From patchwork Tue Jul 18 14:40:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janneke Nieuwenhuizen X-Patchwork-Id: 51833 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 7C8EE27BBEE; Tue, 18 Jul 2023 15:45:25 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8D27227BBE2 for ; Tue, 18 Jul 2023 15:45:22 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qLlvm-0001W9-8k; Tue, 18 Jul 2023 10:44:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qLluw-0000l8-DM for guix-patches@gnu.org; Tue, 18 Jul 2023 10:43:13 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qLlut-00019b-SB for guix-patches@gnu.org; Tue, 18 Jul 2023 10:43:09 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qLlut-0006lo-OU for guix-patches@gnu.org; Tue, 18 Jul 2023 10:43:07 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#64711] [PATCH 41/43] gnu: fontforge: Support build on the Hurd. Resent-From: Janneke Nieuwenhuizen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 18 Jul 2023 14:43:07 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64711 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 64711@debbugs.gnu.org Received: via spool by 64711-submit@debbugs.gnu.org id=B64711.168969136525869 (code B ref 64711); Tue, 18 Jul 2023 14:43:07 +0000 Received: (at 64711) by debbugs.gnu.org; 18 Jul 2023 14:42:45 +0000 Received: from localhost ([127.0.0.1]:53913 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qLluX-0006j5-4x for submit@debbugs.gnu.org; Tue, 18 Jul 2023 10:42:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47948) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qLluS-0006hl-Uy for 64711@debbugs.gnu.org; Tue, 18 Jul 2023 10:42:41 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qLluN-00012K-Nt; Tue, 18 Jul 2023 10:42:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=3q+qw8HK2VZ08Rxf5BxSv9HnQIW+HwJFY3cV1FMqi9A=; b=nfWhxK5bO/RK1bCYmhWI jhlPshtlnOsGarymawXAVL1BMfijaHSsP9c/Se/tjFmWXVKWamEmprHhFWUN+kKgAdiSS81Wedela kTFO3zxJMVrbRNnDWfs7bF95NcNYKUmZ+5VfpTFzvhrd6O0tPt9NNTFTl9p7iEjkN9weHZK7UsR/s HAn8OigVA2FA7aDUG6IyVhBl9BISCmWF98AF5re2yigsrWRrg4v+6azzXcz5rdFqzwBe4Ix6MEiu7 KsdN0VyBzCLCy2zUvPFcKA1Y1XBYp/NSQvFr4PjaoamGv5OvlLx3TQYXhW7366gQl9b2Ba+JQcL9S X/UVzy9v9CjmrA==; Received: from 2a02-a462-da03-1-aeb0-2f5e-e96a-dccb.fixed6.kpn.net ([2a02:a462:da03:1:aeb0:2f5e:e96a:dccb] helo=drakenpad.fritz.box) by fencepost.gnu.org with esmtpa (Exim 4.90_1) (envelope-from ) id 1qLluN-0004hp-Bc; Tue, 18 Jul 2023 10:42:35 -0400 From: Janneke Nieuwenhuizen Date: Tue, 18 Jul 2023 16:40:34 +0200 Message-Id: <9e077daf4be3ff7e412008ab06ae801bbd4c030c.1689690897.git.janneke@gnu.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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 +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 +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 `` 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 + #include + #include + #include + ++#ifdef __GNU__ ++# define extended double ++#endif ++ + #undef GList + #undef GMenuItem + #undef GTimer +-- +2.40.1 +