[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
78/84: gnu: fontforge: Support build for the Hurd.
From: |
guix-commits |
Subject: |
78/84: gnu: fontforge: Support build for the Hurd. |
Date: |
Wed, 14 Jun 2023 06:24:02 -0400 (EDT) |
janneke pushed a commit to branch wip-hurd
in repository guix.
commit 70e7b24de49e836df82b60332ff3de62cd89563c
Author: Janneke Nieuwenhuizen <janneke@gnu.org>
AuthorDate: Tue Jun 13 14:49:10 2023 +0200
gnu: fontforge: Support build for the Hurd.
* gnu/packages/patches/fontforge-hurd.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/fontutils.scm (fontforge)[arguments]: When building for 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 | 86 ++++++++++++++++++++-----------
gnu/packages/patches/fontforge-hurd.patch | 82 +++++++++++++++++++++++++++++
3 files changed, 139 insertions(+), 30 deletions(-)
diff --git a/gnu/local.mk b/gnu/local.mk
index 13f665607b..8ae800b942 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1143,6 +1143,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 13117d2491..bbd6592475 100644
--- a/gnu/packages/fontutils.scm
+++ b/gnu/packages/fontutils.scm
@@ -1522,37 +1522,63 @@ definitions.")
("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))))
+ (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
+
- 24/84: gnu: gnumach: Support "noide" argument., (continued)
- 24/84: gnu: gnumach: Support "noide" argument., guix-commits, 2023/06/14
- 12/84: gnu: hurd: Update to v0.9.git20230216., guix-commits, 2023/06/14
- 28/84: services: static-networking: Support netdde for the Hurd., guix-commits, 2023/06/14
- 09/84: gnu: Add libc-locales-for-target and glibc-locales/hurd., guix-commits, 2023/06/14
- 19/84: gnu: hurd: Add rumpkernel., guix-commits, 2023/06/14
- 34/84: gnu: commencement: hurd-headers-boot0: Update to 0.9.git20230216., guix-commits, 2023/06/14
- 30/84: gnu: commencement: Add autoconf-boot0., guix-commits, 2023/06/14
- 32/84: gnu: commencement: gnumach-headers-boot0: Update to 1.8+git20221224., guix-commits, 2023/06/14
- 40/84: Revert "gnu: sed: Skip failing test on GNU/Hurd.", guix-commits, 2023/06/14
- 57/84: gnu: git: Skip failing test for the Hurd., guix-commits, 2023/06/14
- 78/84: gnu: fontforge: Support build for the Hurd.,
guix-commits <=
- 79/84: gnu: po4a: Skip failing test for the Hurd., guix-commits, 2023/06/14
- 15/84: gnu: hurd: Update libpciaccess to 0.17., guix-commits, 2023/06/14
- 04/84: gnu: hurd: Update supported systems., guix-commits, 2023/06/14
- 29/84: gnu: gnumach: Disable builtin networking., guix-commits, 2023/06/14
- 25/84: gnu: netdde: Resurrect and update to 2.6.32.65-2-e67c284ac1., guix-commits, 2023/06/14
- 27/84: system: hurd: Add netdde to %base-packages/hurd., guix-commits, 2023/06/14
- 42/84: gnu: diffutils: Remove test-perror2 from XFAIL_TESTS for the Hurd., guix-commits, 2023/06/14
- 58/84: gnu: emacs: Depend on libc-for-target., guix-commits, 2023/06/14
- 51/84: gnu: libbsd: Skip failing test for the Hurd., guix-commits, 2023/06/14
- 45/84: hurd: Support system init in /libexec/runsystem., guix-commits, 2023/06/14