From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id wGSWDTSltmRXFgAASxT56A (envelope-from ) for ; Tue, 18 Jul 2023 16:44:04 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id IAKPDTSltmTp0wAA9RJhRA (envelope-from ) for ; Tue, 18 Jul 2023 16:44:04 +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 D541266BAC for ; Tue, 18 Jul 2023 16:44:03 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=J0lmIAqm; 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=1689691444; 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=xSbhGfeiuIsXF71SnK7iGthnenLuvYaM6OEwt+lOzfw=; b=J6kcu+G+pPMMf+fdXP5RJEQUAoT2Qtq+7z6XS1xW4BMtVZSVVeq2OrjpQTpSd3hK5S4ukJ eGlj3gKPQWZ/MTCaqMccGjkD+/q7C6FhOyqDbaGk1MWIQosKc9hs/bQDy9JvoPEwMQFv12 YIOSSMZyiZ7m1kaxEZWgQldH4K1M6JOWTxGDFL5p0Lkwg7mMGFIdXeHO03rbYhBy/s4xJA iCpg2G6ycx4VsT5qYxed1gMOlnyfS+Tp+Lcv+0hfUa35YZ8mXAIZ0Cst6P27qObwpejxGe GIKlcsYuWDHaS6Zec8mzEgI+Fy9EutzbRkiuy2q0Fl0AjmOvw+SNCN2O9GXpeg== 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=J0lmIAqm; 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-Seal: i=1; s=key1; d=yhetil.org; t=1689691444; a=rsa-sha256; cv=none; b=kPWrEDrB8VNYYsX4kpMEIJ4aKawYV7FRPpBMCyzVe2B5lCS54q9oEHbeGAZXPRRoYX7F67 CoWWuRxUzwFx0ezmizjgYfazN/enNaT5FaZmBPvd3GwxQGBCmz15DhkPVkwjrkm49HauQW 5a4eGhwDLUNB/ay4PwWu3JAbULjoaGotPoOo8up06F3Bo65WhqbPi+Tnd3ZGP2N5k34JcJ dQLx+Mqy8nSPwfAb2bad7Ju5MTKHsg6fBih5gNeBhxau6HuWa79GRapdHE6638fr48EPes VobQaetm8rYNLcEIVoqLPlLy8QboyoNvNNzHd+EY2iHEkuXhKKKC01/Keb97LQ== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qLlvg-00019L-6W; Tue, 18 Jul 2023 10:43:56 -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 1qLluv-0000l0-HI for guix-patches@gnu.org; Tue, 18 Jul 2023 10:43:11 -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 1qLlus-00017u-L0 for guix-patches@gnu.org; Tue, 18 Jul 2023 10:43:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qLlus-0006lQ-II for guix-patches@gnu.org; Tue, 18 Jul 2023 10:43:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#64711] [PATCH 38/43] gnu: ghostscript: Fix build for the Hurd. Resent-From: Janneke Nieuwenhuizen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 18 Jul 2023 14:43:06 +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.168969136425848 (code B ref 64711); Tue, 18 Jul 2023 14:43:06 +0000 Received: (at 64711) by debbugs.gnu.org; 18 Jul 2023 14:42:44 +0000 Received: from localhost ([127.0.0.1]:53907 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qLluV-0006io-TO for submit@debbugs.gnu.org; Tue, 18 Jul 2023 10:42:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47916) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qLluQ-0006hb-H5 for 64711@debbugs.gnu.org; Tue, 18 Jul 2023 10:42:39 -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 1qLluL-00011A-5Z; Tue, 18 Jul 2023 10:42:33 -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=xSbhGfeiuIsXF71SnK7iGthnenLuvYaM6OEwt+lOzfw=; b=J0lmIAqmhPtP+JOdkMNG OcwTvNlTCYDbo+CQrBeD/CXl1Vk+hCASFEHKXhE0zYw+zxiSOr2sGjYfatxucsTuPn+xwCJjAdM8q TBKlXU3iOa5gAo7T7w4oI1/hoszSMxQWhMCSQaXsQCFZWgd0BHmZOuLS3JI+KBX/W6F8MrLeRBFmm XPuOcCMofjjOHLxDAb0t5mxE0l+K/6GleMsIkUCxx4nE6OIxhWD5ZSBE8oAHsJ3xLQr/yIb25Hr6f ltYDkNzk2zDLwmsZjhB4aWtWweQa0Nb9YBws+tO10YOvE1YuSq22Drzh6l7URLhnTJc7lX2muJNXy PF/6i0O3damYww==; 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 1qLluK-0004hp-D7; Tue, 18 Jul 2023 10:42:32 -0400 From: Janneke Nieuwenhuizen Date: Tue, 18 Jul 2023 16:40:31 +0200 Message-Id: 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-Spam-Score: -3.84 X-Migadu-Queue-Id: D541266BAC X-Migadu-Spam-Score: -3.84 X-Migadu-Scanner: mx0.migadu.com X-TUID: C9slAt3DuK+T * gnu/packages/patches/ghostscript-leptonica-hurd.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/ghostscript.scm (ghostscript)[arguments]: When building for the Hurd, add phase 'patch-leptonica' and use it. --- gnu/local.mk | 3 +- gnu/packages/ghostscript.scm | 10 +++ .../patches/ghostscript-leptonica-hurd.patch | 78 +++++++++++++++++++ 3 files changed, 89 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/ghostscript-leptonica-hurd.patch diff --git a/gnu/local.mk b/gnu/local.mk index 84c4167723..45b1c1356b 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1238,8 +1238,7 @@ dist_patch_DATA = \ %D%/packages/patches/ghc-bloomfilter-ghc9.2.patch \ %D%/packages/patches/ghc-bytestring-handle-ghc9.patch \ %D%/packages/patches/ghc-language-haskell-extract-ghc-8.10.patch \ - %D%/packages/patches/ghostscript-CVE-2023-36664.patch \ - %D%/packages/patches/ghostscript-CVE-2023-36664-fixup.patch \ + %D%/packages/patches/ghostscript-leptonica-hurd.patch \ %D%/packages/patches/ghostscript-no-header-id.patch \ %D%/packages/patches/ghostscript-no-header-uuid.patch \ %D%/packages/patches/ghostscript-no-header-creationdate.patch \ diff --git a/gnu/packages/ghostscript.scm b/gnu/packages/ghostscript.scm index 94807fdd94..2d7f07fb40 100644 --- a/gnu/packages/ghostscript.scm +++ b/gnu/packages/ghostscript.scm @@ -201,6 +201,16 @@ (define-public ghostscript '())) #:phases #~(modify-phases %standard-phases + #$@(if (target-hurd?) + #~((add-after 'unpack 'patch-leptonica + (lambda _ + (let ((patch-file + #$(local-file + (search-patch + "ghostscript-leptonica-hurd.patch")))) + (with-directory-excursion "leptonica" + (invoke "patch" "--force" "-p1" "-i" patch-file)))))) + #~()) (add-before 'configure 'create-output-directory (lambda _ ;; The configure script refuses to function if the directory diff --git a/gnu/packages/patches/ghostscript-leptonica-hurd.patch b/gnu/packages/patches/ghostscript-leptonica-hurd.patch new file mode 100644 index 0000000000..124365b3e6 --- /dev/null +++ b/gnu/packages/patches/ghostscript-leptonica-hurd.patch @@ -0,0 +1,78 @@ +Upstream status: This patch was taken from leptonica upstream. + +Backported to ghostscripts bundled leptonica. + +From f04da7c816feb1d5f689c34f3d0e7e3621edf1f5 Mon Sep 17 00:00:00 2001 +From: Samuel Thibault +Date: Wed, 1 Feb 2023 19:35:43 +0100 +Subject: [PATCH] Fix GNU/Hurd build + +There is no PATH_MAX limitation on GNU/Hurd, and realpath() can be +safely be used with its second parameter set to NULL (as required by +posix since its version 2001). +--- + src/sarray1.c | 29 +++++++++++++++++++++++------ + 1 file changed, 23 insertions(+), 6 deletions(-) + +--- a/src/sarray1.c 2023-06-13 12:31:13.393672916 +0200 ++++ a/src/sarray1.c 2023-06-13 12:34:13.574237149 +0200 +@@ -1953,7 +1953,11 @@ + SARRAY * + getFilenamesInDirectory(const char *dirname) + { ++#if _POSIX_VERSION >= 200112 || defined(__GLIBC__) ++char *dir; ++#else + char dir[PATH_MAX + 1]; ++#endif + char *realdir, *stat_path, *ignore; + size_t size; + SARRAY *safiles; +@@ -1976,17 +1980,28 @@ + * If the file or directory exists, realpath returns its path; + else it returns NULL. + * If the second arg to realpath is passed in, the canonical path +- is returned there. Use a buffer of sufficient size. If the +- second arg is NULL, the path is malloc'd and returned if the +- file or directory exists. +- We pass in a buffer for the second arg, and check that the canonical +- directory path was made. The existence of the directory is checked +- later, after its actual path is returned by genPathname(). */ ++ is returned there. Use a buffer of sufficient size. ++ We pass in a buffer for the second arg, and check that the ++ canonical directory path was made. The existence of the ++ directory is checked later, after its actual path is returned by ++ genPathname(). ++ With GNU libc or Posix 2001, if the second arg is NULL, the path ++ is malloc'd and returned if the file or directory exists. ++ */ ++#if _POSIX_VERSION >= 200112 || defined(__GLIBC__) ++ dir = realpath(dirname, NULL); ++ if (dir == NULL) ++ return (SARRAY *)ERROR_PTR("dir not made", __func__, NULL); ++#else + dir[0] = '\0'; /* init empty in case realpath() fails to write it */ + ignore = realpath(dirname, dir); + if (dir[0] == '\0') + return (SARRAY *)ERROR_PTR("dir not made", procName, NULL); ++#endif + realdir = genPathname(dir, NULL); ++#if _POSIX_VERSION >= 200112 || defined(__GLIBC__) ++ LEPT_FREE(dir); ++#endif + if ((pdir = opendir(realdir)) == NULL) { + LEPT_FREE(realdir); + return (SARRAY *)ERROR_PTR("pdir not opened", procName, NULL); +@@ -1998,10 +2013,12 @@ + stat_ret = fstatat(dfd, pdirentry->d_name, &st, 0); + #else + size = strlen(realdir) + strlen(pdirentry->d_name) + 2; ++#if _POSIX_VERSION < 200112 && !defined(__GLIBC__) + if (size > PATH_MAX) { + L_ERROR("size = %zu too large; skipping\n", procName, size); + continue; + } ++#endif + stat_path = (char *)LEPT_CALLOC(size, 1); + snprintf(stat_path, size, "%s/%s", realdir, pdirentry->d_name); + stat_ret = stat(stat_path, &st); -- 2.40.1