Subject: Re: [bug#76246] [PATCH 1/2] gnu: Add guile-cairo-next.

From: Liliana Marie Prikler <[email-masked]>
Date: Thu, 13 Feb 2025 09:05:24 +0100

Am Donnerstag, dem 13.02.2025 um 03:55 +0100 schrieb Florian Pelz:
> From: "pelzflorian (Florian Pelz)" <[email-masked]>
> 
> * gnu/packages/patches/guile-cairo-fix-make-check.patch: New patch.
> * gnu/local.mk (dist_patch_DATA): Register patch.
> * gnu/packages/gtk.scm (guile-cairo-next): New variable.
> 
> Change-Id: I328afe58d46e60243e075edead12afc0d1c4a98a
> ---
>  gnu/local.mk                                  |   1 +
>  gnu/packages/gtk.scm                          |  23 ++
>  .../patches/guile-cairo-fix-make-check.patch  | 352
> ++++++++++++++++++
>  3 files changed, 376 insertions(+)
>  create mode 100644 gnu/packages/patches/guile-cairo-fix-make-
> check.patch
> 
> diff --git a/gnu/local.mk b/gnu/local.mk
> index 9e192f1e4f..70cc51152f 100644
> --- a/gnu/local.mk
> +++ b/gnu/local.mk
> @@ -1535,6 +1535,7 @@ dist_patch_DATA
> =                                         \
>    %D%/packages/patches/guile-linux-syscalls.patch              \
>    %D%/packages/patches/guile-3.0-linux-syscalls.patch          \
>    %D%/packages/patches/guile-ac-d-bus-fix-tests.patch          \
> +  %D%/packages/patches/guile-cairo-fix-make-check.patch        \
>    %D%/packages/patches/guile-lib-fix-tests-for-
> guile2.2.patch          \
>    %D%/packages/patches/guile-fibers-cross-build-fix.patch      \
>    %D%/packages/patches/guile-fibers-destroy-peer-schedulers.patch \
> diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
> index 7ed7d7b7df..4d2356d8cf 100644
> --- a/gnu/packages/gtk.scm
> +++ b/gnu/packages/gtk.scm
> @@ -37,6 +37,7 @@
>  ;;; Copyright © 2023, 2024 Zheng Junjie <[email-masked]>
>  ;;; Copyright © 2023 Janneke Nieuwenhuizen <[email-masked]>
>  ;;; Copyright © 2024 John Kehayias <[email-masked]>
> +;;; Copyright © 2025 Florian Pelz <[email-masked]>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -1495,6 +1496,28 @@ (define-public guile2.2-cairo
>         ,@(fold alist-delete (package-inputs guile-cairo)
>                 '("guile" "guile-lib"))))))
>  
> +(define-public guile-cairo-next
> +  (package
> +    (inherit guile-cairo)
> +    (name "guile-cairo-next")
> +    ;; A commit with cairo-pointer->context, missing from
> [email-masked]
> +    ;; and needed by animated-paintable from g-golf-gtk-4-examples.
> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url "git://git.savannah.nongnu.org/guile-
> cairo.git")
> +                    (commit
> "30da459d7a4380174ff243b1560d5512a4bca86e")))
> +              (sha256
> +               (base32
> +               
> "0dslfldzgxis8g0g3xaffcqnd1njzz23fjy0v3lc0r2694ra4ny4"))
> +              ;; A patch to allow running the check phase before
> install.
> +              (patches (search-patches "guile-cairo-fix-make-
> check.patch"))
> +              (file-name (string-append "guile-cairo-next"))))
You probably want git-file-name.
> +    (inputs
> +     (list guile-lib guile-3.0 gettext-minimal))
> +    (native-inputs
> +     (list autoconf-2.71 automake libtool pkg-config texinfo))))
Is there a reason for changed inputs?  Does plain autoconf not work?

> +
>  (define-public guile-rsvg
>    ;; Use a recent snapshot that supports Guile 2.2 and beyond.
>    (let ((commit "05c6a2fd67e4fea1a7c3ff776729dc931bae6678")
> diff --git a/gnu/packages/patches/guile-cairo-fix-make-check.patch
> b/gnu/packages/patches/guile-cairo-fix-make-check.patch
> new file mode 100644
> index 0000000000..d14de7717e
> --- /dev/null
> +++ b/gnu/packages/patches/guile-cairo-fix-make-check.patch
> @@ -0,0 +1,352 @@
> +From 1de7b5e994fd99e20849d9372963c2aadf782ed1 Mon Sep 17 00:00:00
> 2001
> +From: David Pirotte <[email-masked]>
> +Date: Tue, 21 Mar 2023 01:54:04 -0300
> +Subject: [PATCH] Fixing make check and make distcheck
> +
> +  Notes: the main goal of this patch is to remove the hard coded
> +  libguile-cairo path, which makes it impossible to run 'make
> check',
> +  unless you actualy first install the version you are working
> +  on/checking [which is 'none sense'].
> +
> +  Also, even with the above problem fixed, there were still a few
> +  nitpick things to solve so that make distcheck pass.
> +
> +  Finally, while workig on this patch, I also made a few cosmetic
> +  changes, mostly adding a space before and after '=' in Makefile.am
> +  targets, as well as having each filename on its own line for
> targets
> +  that requires filenames. Those changes are not commented here
> below.
> +
> +* Makefile.am: (1) removing the env target, as we update env.in
> +  this is not only not necessary anymore, but would actually
> +  raise an error; (2) the CLEANFILES target misses $(GOBJECTS);
> +  (3) using $(AM_V_GEN) in .scm.go target; (4) the EXTRA_DIST
> +  target misses $(SOURCES), and does not need to ship autogen.sh
> +  nor build-aux/git-version-gen.
> +
> +* cairo.scm: Call (dynamic-link "libguile-cairo"),
> +  not (dynamic-link *cairo-lib-path*).
> +
> +* cairo/Makefile.am: (1) using $(AM_V_GEN) in .scm.go target; (2) in
> the
> +  config.scm target, removing the @cairolibpath@ substitution; (3)
> the
> +  EXTRA_DIST target misses vector-types.scm and $(NOCOMP_SOURCES).
> +
> +* cairo/config.scm.in: Removing the *cairo-lib-path* definition.
> +
> +* env.in: (1) define and use abs_top_srcdir and abs_top_builddir;
> (2)
> +  define and export GUILE_LOAD_PATH, GUILE_LOAD_COMPILED_PATH and
> +  LTDL_LIBRARY_PATH.
> +
> +* tests/unit-tests/Makefile.am: (1) add context-pointer.scm to the
> TESTS
> +  target; (2) add a TEST_EXTENSIONS = .scm target; (3) update the
> +  TESTS_ENVIRONMENT to use $(abs_top_builddir); (4) remove the
> %.check
> +  target (unecessary in 'modern' autotools).
> +---
Is this an upstreamed patch?  There are too many cosmetic changes (of
dubious quality) mixed with actual code changes for my personal liking.

Cheers