all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Janneke Nieuwenhuizen <janneke@gnu.org>
To: 64711@debbugs.gnu.org
Subject: [bug#64711] [PATCH 41/43] gnu: fontforge: Support build on the Hurd.
Date: Tue, 18 Jul 2023 16:40:34 +0200	[thread overview]
Message-ID: <9e077daf4be3ff7e412008ab06ae801bbd4c030c.1689690897.git.janneke@gnu.org> (raw)
In-Reply-To: <cover.1689690897.git.janneke@gnu.org>

* gnu/packages/patches/fontforge-hurd.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/fontutils.scm (fontforge)[arguments]: When building natively on
the Hurd, add new phase 'apply-hurd-patch' and use it, and replace phase
'check' to skip two tests.
---
 gnu/local.mk                              |  1 +
 gnu/packages/fontutils.scm                | 88 +++++++++++++++--------
 gnu/packages/patches/fontforge-hurd.patch | 82 +++++++++++++++++++++
 3 files changed, 141 insertions(+), 30 deletions(-)
 create mode 100644 gnu/packages/patches/fontforge-hurd.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 45b1c1356b..5befa67e6e 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1147,6 +1147,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/flatpak-unset-gdk-pixbuf-for-sandbox.patch	\
   %D%/packages/patches/fluxbox-1.3.7-no-dynamic-cursor.patch	\
   %D%/packages/patches/fontconfig-cache-ignore-mtime.patch	\
+  %D%/packages/patches/fontforge-hurd.patch			\
   %D%/packages/patches/foobillard++-pkg-config.patch		\
   %D%/packages/patches/foomatic-filters-CVE-2015-8327.patch	\
   %D%/packages/patches/foomatic-filters-CVE-2015-8560.patch	\
diff --git a/gnu/packages/fontutils.scm b/gnu/packages/fontutils.scm
index 64b15fbf05..2cfaa45c37 100644
--- a/gnu/packages/fontutils.scm
+++ b/gnu/packages/fontutils.scm
@@ -1534,37 +1534,65 @@ (define-public fontforge
              ("python"          ,python)
              ("zlib"            ,zlib)))
    (arguments
-    '(#:configure-flags '(;; TODO: Provide GTK+ for the Wayland-friendly GDK
-                          ;; backend, instead of the legacy X11 backend.
-                          ;; Currently it introduces a circular dependency.
-                          "-DENABLE_X11=ON")
+    (list
+     #:configure-flags #~'( ;; TODO: Provide GTK+ for the Wayland-friendly GDK
+                           ;; backend, instead of the legacy X11 backend.
+                           ;; Currently it introduces a circular dependency.
+                           "-DENABLE_X11=ON")
       #:phases
-      (modify-phases %standard-phases
-        (add-after 'unpack 'do-not-override-RPATH
-          (lambda _
-            ;; Do not attempt to set a default RPATH, as our ld-wrapper
-            ;; already does the right thing.
-            (substitute* "CMakeLists.txt"
-              (("^set_default_rpath\\(\\)")
-               ""))
-            #t))
-        (add-after 'install 'set-library-path
-          (lambda* (#:key inputs outputs #:allow-other-keys)
-            (let ((out (assoc-ref outputs "out"))
-                  (potrace (dirname
-                            (search-input-file inputs "bin/potrace"))))
-              (wrap-program (string-append out "/bin/fontforge")
-                ;; Fontforge dynamically opens libraries.
-                `("LD_LIBRARY_PATH" ":" prefix
-                  ,(map (lambda (input)
-                          (string-append (assoc-ref inputs input)
-                                         "/lib"))
-                        '("libtiff" "libjpeg" "libpng" "libungif"
-                          "libxml2" "zlib" "libspiro" "freetype"
-                          "pango" "cairo" "fontconfig")))
-                ;; Checks for potrace program at runtime
-                `("PATH" ":" prefix (,potrace)))
-              #t))))))
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'do-not-override-RPATH
+            (lambda _
+              ;; Do not attempt to set a default RPATH, as our ld-wrapper
+              ;; already does the right thing.
+              (substitute* "CMakeLists.txt"
+                (("^set_default_rpath\\(\\)")
+                 ""))
+              #t))
+          #$@(if (target-hurd?)
+                 #~((add-after 'unpack 'apply-hurd-patch
+                      (lambda _
+                        (let ((patch-file
+                               #$(local-file
+                                  (search-patch "fontforge-hurd.patch"))))
+                          (invoke "patch" "--force" "-p1" "-i" patch-file)))))
+                 #~())
+          #$@(if (system-hurd?)
+                 #~((replace 'check
+                      ;; cmake-build-system ignores #:make-flags for make check
+                      (lambda* (#:key test-target tests? parallel-tests?
+                                #:allow-other-keys)
+                        (let ((skip '("test0001_py" "test0001_pyhook")))
+                          (if tests?
+                              (let ((jobs
+                                     (if parallel-tests?
+                                         (number->string (parallel-job-count))
+                                         "1")))
+                                (invoke "make"
+                                        (string-append "ARGS=-j " jobs
+                                                       " --exclude-regex ^"
+                                                       (string-join skip "\\|")
+                                                       "$")
+                                        test-target))
+                              (format #t "test suite not run~%"))))))
+                 #~())
+          (add-after 'install 'set-library-path
+            (lambda* (#:key inputs outputs #:allow-other-keys)
+              (let ((out (assoc-ref outputs "out"))
+                    (potrace (dirname
+                              (search-input-file inputs "bin/potrace"))))
+                (wrap-program (string-append out "/bin/fontforge")
+                  ;; Fontforge dynamically opens libraries.
+                  `("LD_LIBRARY_PATH" ":" prefix
+                    ,(map (lambda (input)
+                            (string-append (assoc-ref inputs input)
+                                           "/lib"))
+                          '("libtiff" "libjpeg" "libpng" "libungif"
+                            "libxml2" "zlib" "libspiro" "freetype"
+                            "pango" "cairo" "fontconfig")))
+                  ;; Checks for potrace program at runtime
+                  `("PATH" ":" prefix (,potrace)))
+                #t))))))
    (synopsis "Outline font editor")
    (description
     "FontForge allows you to create and modify postscript, truetype and
diff --git a/gnu/packages/patches/fontforge-hurd.patch b/gnu/packages/patches/fontforge-hurd.patch
new file mode 100644
index 0000000000..20d62b8ce2
--- /dev/null
+++ b/gnu/packages/patches/fontforge-hurd.patch
@@ -0,0 +1,82 @@
+Upstream status: Taken from upstream.
+
+From dca87c025665f0f010f906a4eba96da9794a4d04 Mon Sep 17 00:00:00 2001
+From: Anthony Fok <foka@debian.org>
+Date: Thu, 16 Jun 2022 02:40:23 -0600
+Subject: [PATCH] Define PATH_MAX and MAXPATHLEN for GNU/Hurd compatibility
+
+Special thanks to @henrich, @ucko and @kilobyte for reporting the issue
+and offering suggestions on a fix.
+
+See also https://bugs.debian.org/877795
+
+Fixes #3119
+---
+ inc/basics.h | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/inc/basics.h b/inc/basics.h
+index b8d65823b..14590c5b1 100644
+--- a/inc/basics.h
++++ b/inc/basics.h
+@@ -123,5 +123,13 @@ static inline int imax(int a, int b)
+ 			last = newitem;		       \
+ 		    }
+ 
++#ifdef __GNU__
++# ifndef PATH_MAX
++#  define PATH_MAX 4096
++# endif
++# ifndef MAXPATHLEN
++#  define MAXPATHLEN 4096
++# endif
++#endif
+ 
+ #endif /* FONTFORGE_BASICS_H */
+-- 
+2.40.1
+
+From e0480f143f27f8f2686b5b14d7d302fe22f35002 Mon Sep 17 00:00:00 2001
+From: Anthony Fok <foka@debian.org>
+Date: Thu, 16 Jun 2022 03:06:56 -0600
+Subject: [PATCH] Undefine "extended" macro temporarily on GNU Hurd
+
+GNU Mach microkernel header files (gnumach-dev 1.8+git20201129) added to
+struct i386_xfp_save in /usr/include/i386-gnu/include/mach/i386/fp_reg.h
+a new "extended" field which happens to collide with the macro definition
+"#define extended double" in FontForge, leading to FTBFS on GNU Hurd.
+
+This issue may be circumvented by temporarily undefining the "extended"
+macro before loading `<gio/gio.h>` and friends, and redefining the
+"extended" macro right after.
+---
+ inc/ffglib.h | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/inc/ffglib.h b/inc/ffglib.h
+index f3419f0ab..25fe9ebde 100644
+--- a/inc/ffglib.h
++++ b/inc/ffglib.h
+@@ -26,11 +26,19 @@
+ #define GMenuItem GMenuItem_GIO
+ #define GTimer GTimer_GTK
+ 
++#ifdef __GNU__
++# undef extended
++#endif
++
+ #include <gio/gio.h>
+ #include <glib-object.h>
+ #include <glib.h>
+ #include <glib/gstdio.h>
+ 
++#ifdef __GNU__
++# define extended	double
++#endif
++
+ #undef GList
+ #undef GMenuItem
+ #undef GTimer
+-- 
+2.40.1
+
-- 
2.40.1





  parent reply	other threads:[~2023-07-18 14:45 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-18 14:38 [bug#64711] [PATCH 00/45] Fix builds and skip failing tests for the Hurd Janneke Nieuwenhuizen
2023-07-18 14:39 ` [bug#64711] [PATCH 01/43] Revert "gnu: libunistring: Fix make check for the Hurd." Janneke Nieuwenhuizen
2023-07-18 14:39 ` [bug#64711] [PATCH 02/43] gnu: guile: Skip hanging and failing pipe tests on the Hurd Janneke Nieuwenhuizen
2023-07-18 20:18   ` [bug#64711] [PATCH 00/45] Fix builds and skip failing tests for " Ludovic Courtès
2023-07-19  5:23     ` Janneke Nieuwenhuizen
2023-07-19  6:27     ` Janneke Nieuwenhuizen
2023-07-18 14:39 ` [bug#64711] [PATCH 03/43] gnu: coreutils: Skip hanging and failing test on " Janneke Nieuwenhuizen
2023-07-18 20:13   ` [bug#64711] [PATCH 00/45] Fix builds and skip failing tests for " Ludovic Courtès
2023-07-18 20:23     ` Janneke Nieuwenhuizen
2023-07-18 20:23     ` Janneke Nieuwenhuizen
2023-07-18 14:39 ` [bug#64711] [PATCH 04/43] gnu: grep: Update hanging and failing tests on " Janneke Nieuwenhuizen
2023-07-18 20:23   ` [bug#64711] [PATCH 00/45] Fix builds and skip failing tests for " Ludovic Courtès
2023-07-18 14:39 ` [bug#64711] [PATCH 05/43] Revert "gnu: sed: Skip failing test on GNU/Hurd." Janneke Nieuwenhuizen
2023-07-18 14:39 ` [bug#64711] [PATCH 06/43] gnu: findutils: Move test-strerror_r from XFAIL to skip on the Hurd Janneke Nieuwenhuizen
2023-07-18 14:40 ` [bug#64711] [PATCH 07/43] gnu: diffutils: Remove test-perror2 from XFAIL_TESTS " Janneke Nieuwenhuizen
2023-07-18 14:40 ` [bug#64711] [PATCH 08/43] gnu: gettext-minimal: Remove XFAIL_TESTS for " Janneke Nieuwenhuizen
2023-07-18 14:40 ` [bug#64711] [PATCH 09/43] gnu: m4: Skip gnulib stack-overflow tests " Janneke Nieuwenhuizen
2023-07-18 14:40 ` [bug#64711] [PATCH 10/43] gnu: openssl: Build fix " Janneke Nieuwenhuizen
2023-07-18 17:53   ` [bug#64711] [PATCH 00/45] Fix builds and skip failing tests " Ludovic Courtès
2023-07-18 18:04     ` Janneke Nieuwenhuizen
2023-07-18 14:40 ` [bug#64711] [PATCH 11/43] gnu: python: Support native build on " Janneke Nieuwenhuizen
2023-07-18 14:40 ` [bug#64711] [PATCH 12/43] gnu: mpfr: Skip failing test " Janneke Nieuwenhuizen
2023-07-18 17:57   ` [bug#64711] [PATCH 00/45] Fix builds and skip failing tests for " Ludovic Courtès
2023-07-18 14:40 ` [bug#64711] [PATCH 13/43] gnu: elfutils: Skip failing tests on " Janneke Nieuwenhuizen
2023-07-18 14:40 ` [bug#64711] [PATCH 14/43] gnu: libbsd: Skip failing test " Janneke Nieuwenhuizen
2023-07-18 14:40 ` [bug#64711] [PATCH 15/43] gnu: c-ares: Skip failing tests " Janneke Nieuwenhuizen
2023-07-18 14:40 ` [bug#64711] [PATCH 16/43] gnu: libgpg-error: Skip failing test " Janneke Nieuwenhuizen
2023-07-18 14:40 ` [bug#64711] [PATCH 17/43] gnu: libgcrypt: Skip hanging benchmark tests " Janneke Nieuwenhuizen
2023-07-18 14:40 ` [bug#64711] [PATCH 18/43] gnu: tcl: Remove failing " Janneke Nieuwenhuizen
2023-07-18 14:40 ` [bug#64711] [PATCH 19/43] gnu: curl: Skip failing test " Janneke Nieuwenhuizen
2023-07-18 14:40 ` [bug#64711] [PATCH 20/43] gnu: git: " Janneke Nieuwenhuizen
2023-07-18 14:40 ` [bug#64711] [PATCH 21/43] gnu: emacs: Depend on libc-for-target Janneke Nieuwenhuizen
2023-07-18 15:54   ` Liliana Marie Prikler
2023-07-18 16:39     ` Janneke Nieuwenhuizen
2023-07-18 14:40 ` [bug#64711] [PATCH 22/43] gnu: procps: Skip linux-version test for the Hurd Janneke Nieuwenhuizen
2023-07-18 14:40 ` [bug#64711] [PATCH 23/43] gnu: e2fsprogs: Skip failing tests on " Janneke Nieuwenhuizen
2023-07-18 14:40 ` [bug#64711] [PATCH 24/43] gnu: parted: Disable tests for " Janneke Nieuwenhuizen
2023-07-18 14:40 ` [bug#64711] [PATCH 25/43] gnu: libpaper: " Janneke Nieuwenhuizen
2023-07-18 14:40 ` [bug#64711] [PATCH 26/43] gnu: cairo: Support building " Janneke Nieuwenhuizen
2023-07-18 15:57   ` Liliana Marie Prikler
2023-07-18 16:33     ` Janneke Nieuwenhuizen
2023-07-18 20:06       ` Maxim Cournoyer
2023-07-19  9:30         ` Janneke Nieuwenhuizen
2023-07-20  3:14           ` Maxim Cournoyer
2023-07-21 18:27             ` Janneke Nieuwenhuizen
2023-07-18 14:40 ` [bug#64711] [PATCH 27/43] gnu: openssl-1.1: Fix shared build " Janneke Nieuwenhuizen
2023-07-18 14:40 ` [bug#64711] [PATCH 28/43] gnu: ruby-2.6: Skip test on " Janneke Nieuwenhuizen
2023-07-18 14:40 ` [bug#64711] [PATCH 29/43] gnu: tcsh: Skip substitution tests " Janneke Nieuwenhuizen
2023-07-18 14:40 ` [bug#64711] [PATCH 30/43] gnu: swig: Skip tests when building for " Janneke Nieuwenhuizen
2023-07-18 14:40 ` [bug#64711] [PATCH 31/43] gnu: zstd: " Janneke Nieuwenhuizen
2023-07-18 14:40 ` [bug#64711] [PATCH 32/43] gnu: cmake-bootstrap: Fix build " Janneke Nieuwenhuizen
2023-07-18 14:40 ` [bug#64711] [PATCH 33/43] gnu: cmake-minimal: Skip tests on " Janneke Nieuwenhuizen
2023-07-18 14:40 ` [bug#64711] [PATCH 34/43] gnu: doxygen: Fix build for " Janneke Nieuwenhuizen
2023-07-18 14:40 ` [bug#64711] [PATCH 35/43] gnu: graphite2: Skip test on " Janneke Nieuwenhuizen
2023-07-18 14:40 ` [bug#64711] [PATCH 36/43] gnu: guile-git: Skip http proxy " Janneke Nieuwenhuizen
2023-07-18 14:40 ` [bug#64711] [PATCH 37/43] gnu: glib: Disable tests for " Janneke Nieuwenhuizen
2023-07-18 15:56   ` Liliana Marie Prikler
2023-07-18 16:32     ` Janneke Nieuwenhuizen
2023-07-18 20:05       ` Maxim Cournoyer
2023-07-20  8:19         ` Janneke Nieuwenhuizen
2023-07-20 18:08           ` Maxim Cournoyer
2023-07-21 17:22             ` Janneke Nieuwenhuizen
2023-07-18 14:40 ` [bug#64711] [PATCH 38/43] gnu: ghostscript: Fix build " Janneke Nieuwenhuizen
2023-07-18 14:40 ` [bug#64711] [PATCH 39/43] gnu: harfbuzz: Support " Janneke Nieuwenhuizen
2023-07-18 20:13   ` Maxim Cournoyer
2023-07-18 14:40 ` [bug#64711] [PATCH 40/43] gnu: pango: " Janneke Nieuwenhuizen
2023-07-18 20:04   ` Maxim Cournoyer
2023-07-18 20:15     ` Janneke Nieuwenhuizen
2023-07-19  0:56       ` Maxim Cournoyer
2023-07-19  6:14         ` Janneke Nieuwenhuizen
2023-07-19 16:22           ` Maxim Cournoyer
2023-07-19 20:51             ` Janneke Nieuwenhuizen
2023-07-18 14:40 ` Janneke Nieuwenhuizen [this message]
2023-07-18 14:40 ` [bug#64711] [PATCH 42/43] gnu: po4a: Skip failing test on " Janneke Nieuwenhuizen
2023-07-18 14:40 ` [bug#64711] [PATCH 43/43] gnu: guile-2.0: Skip failing tests " Janneke Nieuwenhuizen
2023-07-18 14:48 ` [bug#64711] [PATCH 00/43] Fix builds and skip failing tests for " Janneke Nieuwenhuizen
2023-07-18 20:29 ` [bug#64711] [PATCH 00/45] " Ludovic Courtès
2023-07-20  8:27   ` bug#64711: " Janneke Nieuwenhuizen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9e077daf4be3ff7e412008ab06ae801bbd4c030c.1689690897.git.janneke@gnu.org \
    --to=janneke@gnu.org \
    --cc=64711@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.