[bug#76246,2/5] gnu: Add guile-cairo-next.

Message ID 565889c10a90c95361aa0b4a58751b710bda207b.1739749706.git.pelzflorian@pelzflorian.de
State New
Headers
Series [bug#76246,1/5] gnu: guile-cairo: Remove expat from inputs. |

Commit Message

pelzflorian (Florian Pelz) Feb. 16, 2025, 11:52 p.m. UTC
  * gnu/packages/gtk.scm (guile-cairo-next): New variable.

Change-Id: I328afe58d46e60243e075edead12afc0d1c4a98a
---
 gnu/packages/gtk.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
  

Comments

Maxim Cournoyer Feb. 17, 2025, 1:37 a.m. UTC | #1
Hi,

Florian Pelz <pelzflorian@pelzflorian.de> writes:

> * gnu/packages/gtk.scm (guile-cairo-next): New variable.

[...]

> +(define-public guile-cairo-next
> +  ;; A commit with cairo-pointer->context, missing from guile-cairo@1.11.2
> +  ;; and needed by animated-paintable from g-golf-gtk-4-examples.
> +  (let ((commit "30da459d7a4380174ff243b1560d5512a4bca86e")
> +        (revision "0"))
> +    (package
> +      (inherit guile-cairo)
> +      (name "guile-cairo-next")
> +      (version (git-version "1.11.2" revision commit))
> +      (source (origin
> +                (method git-fetch)
> +                (uri (git-reference
> +                      (url "git://git.savannah.nongnu.org/guile-cairo.git")

Prefer https:// to git://, for privacy and the extra authenticity check.

> +                      (commit commit)))
> +                (file-name (git-file-name name version))
> +                (sha256
> +                 (base32
> +                   "0dslfldzgxis8g0g3xaffcqnd1njzz23fjy0v3lc0r2694ra4ny4"))))
> +      ;; To allow running the check phase before install, use a libtool path
> +      ;; similar to David Pirotte's suggested patch
> +      ;; <https://lists.gnu.org/archive/html/guile-user/2023-03/msg00028.html>.

This comment should be nested inside the set-libtool-path phase, which
is the one it relates to.

> +      (arguments
> +       (substitute-keyword-arguments (package-arguments guile-cairo)
> +         ((#:phases phases)
> +          `(modify-phases ,phases
> +             (add-after 'build 'fix-dynamic-link-path
> +               (lambda _
> +                 ;; Make libguile-cairo foreign extension usable in tests.
> +                 (substitute* "cairo/config.scm"
> +                   (("\\(define \\*cairo-lib-path\\* .*")
> +                    "\(define *cairo-lib-path* \"libguile-cairo\")\n"))))
> +             (add-before 'check 'set-libtool-path
> +               (lambda _
> +                 (setenv "LTDL_LIBRARY_PATH" "../../guile-cairo/.libs")))))))
> +      (inputs
> +       (list gettext-minimal guile-3.0 guile-lib))
> +      (native-inputs
> +       (list autoconf automake libtool pkg-config texinfo)))))

Otherwise, it LGTM.

Could you please send a new revision?
  

Patch

diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
index 8e893d66c3..2698fdb1c7 100644
--- a/gnu/packages/gtk.scm
+++ b/gnu/packages/gtk.scm
@@ -37,6 +37,7 @@ 
 ;;; Copyright © 2023, 2024 Zheng Junjie <873216071@qq.com>
 ;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2024 John Kehayias <john.kehayias@protonmail.com>
+;;; Copyright © 2025 Florian Pelz <pelzflorian@pelzflorian.de>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1481,6 +1482,45 @@  (define-public guile2.2-cairo
        ,@(fold alist-delete (package-inputs guile-cairo)
                '("guile" "guile-lib"))))))
 
+(define-public guile-cairo-next
+  ;; A commit with cairo-pointer->context, missing from guile-cairo@1.11.2
+  ;; and needed by animated-paintable from g-golf-gtk-4-examples.
+  (let ((commit "30da459d7a4380174ff243b1560d5512a4bca86e")
+        (revision "0"))
+    (package
+      (inherit guile-cairo)
+      (name "guile-cairo-next")
+      (version (git-version "1.11.2" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "git://git.savannah.nongnu.org/guile-cairo.git")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                   "0dslfldzgxis8g0g3xaffcqnd1njzz23fjy0v3lc0r2694ra4ny4"))))
+      ;; To allow running the check phase before install, use a libtool path
+      ;; similar to David Pirotte's suggested patch
+      ;; <https://lists.gnu.org/archive/html/guile-user/2023-03/msg00028.html>.
+      (arguments
+       (substitute-keyword-arguments (package-arguments guile-cairo)
+         ((#:phases phases)
+          `(modify-phases ,phases
+             (add-after 'build 'fix-dynamic-link-path
+               (lambda _
+                 ;; Make libguile-cairo foreign extension usable in tests.
+                 (substitute* "cairo/config.scm"
+                   (("\\(define \\*cairo-lib-path\\* .*")
+                    "\(define *cairo-lib-path* \"libguile-cairo\")\n"))))
+             (add-before 'check 'set-libtool-path
+               (lambda _
+                 (setenv "LTDL_LIBRARY_PATH" "../../guile-cairo/.libs")))))))
+      (inputs
+       (list gettext-minimal guile-3.0 guile-lib))
+      (native-inputs
+       (list autoconf automake libtool pkg-config texinfo)))))
+
 (define-public guile-rsvg
   ;; Use a recent snapshot that supports Guile 2.2 and beyond.
   (let ((commit "05c6a2fd67e4fea1a7c3ff776729dc931bae6678")