From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id YJ1RBoOltmTFBQEASxT56A (envelope-from ) for ; Tue, 18 Jul 2023 16:45:23 +0200 Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id wPQrBoOltmRqbgAAauVa8A (envelope-from ) for ; Tue, 18 Jul 2023 16:45:23 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A9F8935D9C for ; Tue, 18 Jul 2023 16:45:22 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=nfWhxK5b; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1689691522; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=3q+qw8HK2VZ08Rxf5BxSv9HnQIW+HwJFY3cV1FMqi9A=; b=JsHPhC7okYpZrQOPI6CV/QBXinY0zTP5wQkRCyELI0ZlXa/gR6xbA2g28TqCWDX4nQILkF 85TyOHtMpM+iKkIQ44kodCq7Vu/lSlQoGlYcE5sbB4IPLraJ0hhf9LkTFpl74ezaw20AAG qPsyPznjwZDX94YTP8Y7beQkADlz5BQZnvHXXji/ymqN7OEd7bh4W0WH9HufICJGMg4Ceo 1iWfYsnEaRc52Zd9MD2oWlCzO9mbQXv8NmHwfAt/7wdc0tpapKra1nhxdzLuOsep8HcPKt ePTfLPOSMswnXSbGqrxXCQfk3MX78w5+Ijbx9wNbp232+0MX5H10wQzyfJbCDg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1689691522; a=rsa-sha256; cv=none; b=elrlEhPsCNvGqKLBuCbS6J/gRVM5VbLNRAs2h874X7QbjbF2cuzR5J/TRQOC5sx1FQ8bwf +Kca5HiG+NT4IjK4PW+FOmyjclktYp0seoZNt+RUYvQIdRL5fIiYElmbWk6V2iymcF9v1x kx18X7wKRtzpdUEA8DfGorENcP4MHmVOxFfogmTf8HVz7uYU/p6pgmw5m8pIwk7RTOLAk4 Ou2Z5gpNs+SzBx06Wj0UeatigE6pg5ozqtgztMRmgzm27Eq8mN7ATlvTRuTILjE1QA305f L5ocWuYpvKlkED6i9COFyVFZS4krky5tIpNxrbJImiuZ1KrzUvOJ0CLlw5dffw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=nfWhxK5b; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org 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 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx2.migadu.com X-Migadu-Spam-Score: -3.84 X-Spam-Score: -3.84 X-Migadu-Queue-Id: A9F8935D9C X-TUID: 3hET+sB0PWaW * 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 + -- 2.40.1