diff mbox series

[bug#72452,v5] gnu: Add guile-swayer.

Message ID 0f466c25269fce18ccca13660014a710e475e2b9.1726093663.git.mrh57@posteo.net
State New
Headers show
Series [bug#72452,v5] gnu: Add guile-swayer. | expand

Commit Message

Alec Barreto Sept. 11, 2024, 10:27 p.m. UTC
* gnu/packages/guile-xyz.scm (guile-swayer): New variable.

Change-Id: Ibd3817842e36fa35a3f1ecc09288549c10fd0d12
---
 gnu/packages/guile-xyz.scm | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)


base-commit: 056910ec864cb7cf3225a0c27679d94405db7dcd

Comments

Ludovic Courtès Sept. 12, 2024, 5:12 p.m. UTC | #1
Hi,

Alec Barreto <mrh57@posteo.net> skribis:

> * gnu/packages/guile-xyz.scm (guile-swayer): New variable.
>
> Change-Id: Ibd3817842e36fa35a3f1ecc09288549c10fd0d12

I was about to push it but got this error:

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix build guile-swayer

[...]

HEAD is now at 67e3522 revert example.scm
r:sha256 hash mismatch for /gnu/store/akv9bcr9kdilw6nkzsay34vxwyw381vm-guile-swayer-0.2.0-checkout:
  expected hash: 09c0143q9sm75xp1qz7a7ihdqfwqg4w8nlq0mmnivhvamww775ss
  actual hash:   1xid45npr5v379jziidjda8mg34gabbp7kaxil1h37z67sdwky4h
hash mismatch for store item '/gnu/store/akv9bcr9kdilw6nkzsay34vxwyw381vm-guile-swayer-0.2.0-checkout'
build of /gnu/store/bijs0qa7d7b8m80b0n0ivi177ws1f17d-guile-swayer-0.2.0-checkout.drv failed
View build log at '/var/log/guix/drvs/bi/js0qa7d7b8m80b0n0ivi177ws1f17d-guile-swayer-0.2.0-checkout.drv.gz'.
cannot build derivation `/gnu/store/xl9lmk79p14karjglkxgnlpmp3805pdg-guile-swayer-0.2.0.drv': 1 dependencies couldn't be built
guix build: error: build of `/gnu/store/xl9lmk79p14karjglkxgnlpmp3805pdg-guile-swayer-0.2.0.drv' failed
--8<---------------cut here---------------end--------------->8---

Could it be that the v0.2.0 tag was modified in place?

Could you send an updated patch with the updated hash once you’ve
confirmed it’s all right?

Thanks in advance!

Ludo’.
Alec Barreto Sept. 13, 2024, 12:03 p.m. UTC | #2
Hello!

Ludovic Courtès <ludo@gnu.org> writes:

> Hi,
>
> Alec Barreto <mrh57@posteo.net> skribis:
>
>> * gnu/packages/guile-xyz.scm (guile-swayer): New variable.
>>
>> Change-Id: Ibd3817842e36fa35a3f1ecc09288549c10fd0d12
>
> I was about to push it but got this error:
>
> --8<---------------cut here---------------start------------->8---
> $ ./pre-inst-env guix build guile-swayer
>
> [...]
>
> HEAD is now at 67e3522 revert example.scm
> r:sha256 hash mismatch for /gnu/store/akv9bcr9kdilw6nkzsay34vxwyw381vm-guile-swayer-0.2.0-checkout:
>   expected hash: 09c0143q9sm75xp1qz7a7ihdqfwqg4w8nlq0mmnivhvamww775ss
>   actual hash:   1xid45npr5v379jziidjda8mg34gabbp7kaxil1h37z67sdwky4h
> hash mismatch for store item '/gnu/store/akv9bcr9kdilw6nkzsay34vxwyw381vm-guile-swayer-0.2.0-checkout'
> build of /gnu/store/bijs0qa7d7b8m80b0n0ivi177ws1f17d-guile-swayer-0.2.0-checkout.drv failed
> View build log at '/var/log/guix/drvs/bi/js0qa7d7b8m80b0n0ivi177ws1f17d-guile-swayer-0.2.0-checkout.drv.gz'.
> cannot build derivation `/gnu/store/xl9lmk79p14karjglkxgnlpmp3805pdg-guile-swayer-0.2.0.drv': 1 dependencies couldn't be built
> guix build: error: build of `/gnu/store/xl9lmk79p14karjglkxgnlpmp3805pdg-guile-swayer-0.2.0.drv' failed
> --8<---------------cut here---------------end--------------->8---
>
> Could it be that the v0.2.0 tag was modified in place?
>
> Could you send an updated patch with the updated hash once you’ve
> confirmed it’s all right?
>
> Thanks in advance!
>
> Ludo’.

Hm sorry I'm not sure what's going on here.
The package builds fine for me as is in the patch.
However if I switch the hash in the package definition anyways I get:

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix build guile-swayer

[...]

HEAD is now at 67e3522 revert example.scm
r:sha256 hash mismatch for /gnu/store/3ckiq7q6faq0q5z1iyw34iyx2wdpy8iq-guile-swayer-0.2.0-checkout:
  expected hash: 1x1d45npr5v379jziidjda8mg34gabbp7kaxil1h37z67sdwky4h
  actual hash:   1xid45npr5v379jziidjda8mg34gabbp7kaxil1h37z67sdwky4h
hash mismatch for store item '/gnu/store/3ckiq7q6faq0q5z1iyw34iyx2wdpy8iq-guile-swayer-0.2.0-checkout'
build of /gnu/store/fkwqcknwkh78ryhrxwqb0fs4ncncpa76-guile-swayer-0.2.0-checkout.drv failed
Could not find build log for '/gnu/store/fkwqcknwkh78ryhrxwqb0fs4ncncpa76-guile-swayer-0.2.0-checkout.drv'.
cannot build derivation `/gnu/store/7fwvwc4z45g8ilk9dvrdm0pf86s8bjvq-guile-swayer-0.2.0.drv': 1 dependencies couldn't be built
guix build: error: build of `/gnu/store/7fwvwc4z45g8ilk9dvrdm0pf86s8bjvq-guile-swayer-0.2.0.drv' failed
--8<---------------cut here---------------end--------------->8---

My internet is a bit spotty today and tomorrow, so ending this
while I can, but I can investigate soon.

Best,
Alec
Alec Barreto Sept. 14, 2024, 2:18 p.m. UTC | #3
Besides the typo in my last message, I found the mistake I made.
The original patch had (commit <commit-hash>), which contained a fix to
the guix package build process which is not in the latest release
v0.2.0.
The old 0.2.0 version won't build for bug-reasons in the code.

Should I switch the commit field back, or wait for the next version bump
which includes the fix?

Best,
Alec
Nicolas Graves Sept. 14, 2024, 3:52 p.m. UTC | #4
On 2024-09-14 14:18, Alec Barreto wrote:

> Besides the typo in my last message, I found the mistake I made.
> The original patch had (commit <commit-hash>), which contained a fix to
> the guix package build process which is not in the latest release
> v0.2.0.
> The old 0.2.0 version won't build for bug-reasons in the code.
>
> Should I switch the commit field back, or wait for the next version bump
> which includes the fix?

If you want to pick a specific commit, you can do something like this

  (let ((commit [commit])
        (version "0.2.0")
        (revision "0"))
    (package
      (name [name])
      (version (git-version version revision commit))
      (source (origin
                (method git-fetch)
                (uri (git-reference
                       (url [url])
                       (commit commit)))
                (file-name (git-file-name name version))
                (sha256
                 (base32
                  ""))))


This makes it easier to upgrade to another given commit if necessary.
Alec Barreto Sept. 14, 2024, 6:23 p.m. UTC | #5
Nicolas Graves <ngraves@ngraves.fr> writes:

> If you want to pick a specific commit, you can do something like this
>
>   (let ((commit [commit])
>         (version "0.2.0")
>         (revision "0"))
>     (package
>       (name [name])
>       (version (git-version version revision commit))
>       (source (origin
>                 (method git-fetch)
>                 (uri (git-reference
>                        (url [url])
>                        (commit commit)))
>                 (file-name (git-file-name name version))
>                 (sha256
>                  (base32
>                   ""))))
>
>
> This makes it easier to upgrade to another given commit if necessary.

Thanks!
Funnily v0.3.0 was just released right after your message.
However it introduces a new (minor) issue.

There is a =manifest.scm= file in the project root which was for
building the program with guix since it wasn't (isn't) yet upstream. 
But now with the new 0.3.0 version the =guile-build-system= tries to
compile the =manifest.scm= as part of the program, causing build
failure.

The project itself could create a =make= file and the package definiton
could be switched to =gnu-build-system=.

Alternatively, since the manifest is arguably obsolete if this package
becomes upstreamed, the manifest can simply be removed.

We can wait for one of those situations, or just package it now in the
manner you suggested and pin the commit to where the package builds
(but still updating to  v0.3.0?)

Best,
Alec
Nicolas Graves Sept. 16, 2024, 7:49 p.m. UTC | #6
On 2024-09-14 18:23, Alec Barreto wrote:

> Thanks!
> Funnily v0.3.0 was just released right after your message.

I've seen that indeed ;)

> Alternatively, since the manifest is arguably obsolete if this package
> becomes upstreamed, the manifest can simply be removed.
>
> We can wait for one of those situations, or just package it now in the
> manner you suggested and pin the commit to where the package builds
> (but still updating to  v0.3.0?)

You could add a snippet in the origin to remove the manifest.scm file,
something like that should be enough :

(snippet '(delete-file "manifest.scm"))

>
> Best,
> Alec
>
>
>
Alec Barreto Sept. 17, 2024, 12:51 a.m. UTC | #7
Nicolas Graves <ngraves@ngraves.fr> writes:

> You could add a snippet in the origin to remove the manifest.scm file,
> something like that should be enough :
>
> (snippet '(delete-file "manifest.scm"))
>
Good call!
Change made, linter happy and package building successfully.
Sending v6.
diff mbox series

Patch

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 3bcb0e82bb..17e5a03d17 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -50,6 +50,7 @@ 
 ;;; Copyright © 2024 Ilya Chernyshov <ichernyshovvv@gmail.com>
 ;;; Copyright © 2024 Artyom Bologov <mail@aartaka.me>
 ;;; Copyright © 2024 Felix Lechner <felix.lechner@lease-up.com>
+;;; Copyright © 2024 Alec Barreto <mrh57@posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1027,6 +1028,29 @@  (define-public guile2.2-filesystem
     (name "guile2.2-filesystem")
     (inputs (list guile-2.2))))
 
+(define-public guile-swayer
+  (package
+    (name "guile-swayer")
+    (version "0.2.0")
+    (home-page "https://github.com/ebeem/guile-swayer")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/ebeem/guile-swayer")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "09c0143q9sm75xp1qz7a7ihdqfwqg4w8nlq0mmnivhvamww775ss"))))
+    (native-inputs (list guile-3.0))
+    (build-system guile-build-system)
+    (synopsis "Extensible Guile bindings for SwayWM")
+    (description
+     "This package provides extensible Guile bindings for the Sway window
+manager.  It can be used to query Sway, assign keybindings and listen to
+events in Guile.")
+    (license license:expat)))
+
 (define-public guile-syntax-highlight
   (package
     (name "guile-syntax-highlight")