From patchwork Tue Jul 18 14:40:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Janneke Nieuwenhuizen X-Patchwork-Id: 51824 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 ACA6F27BBE9; Tue, 18 Jul 2023 15:44:24 +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 1316F27BBEA for ; Tue, 18 Jul 2023 15:44:23 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qLlvo-0001gR-2P; Tue, 18 Jul 2023 10:44:04 -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 1qLlut-0000kt-SO 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 1qLlur-00017I-1n 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 1qLluq-0006kw-UY for guix-patches@gnu.org; Tue, 18 Jul 2023 10:43:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#64711] [PATCH 34/43] gnu: doxygen: 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:04 +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.168969135125761 (code B ref 64711); Tue, 18 Jul 2023 14:43:04 +0000 Received: (at 64711) by debbugs.gnu.org; 18 Jul 2023 14:42:31 +0000 Received: from localhost ([127.0.0.1]:53884 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qLluI-0006hP-TP for submit@debbugs.gnu.org; Tue, 18 Jul 2023 10:42:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54162) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qLlu8-0006fo-TE for 64711@debbugs.gnu.org; Tue, 18 Jul 2023 10:42:21 -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 1qLlu3-0000z2-ME; Tue, 18 Jul 2023 10:42:15 -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=sExXzDzp6AwskeNFE+VvafZfzxae7/agxlwF08QHRIU=; b=jZr+PEVtgkUBNnvJPCXq agPJY6KZMU4+FzUbGafw8PkWO+6d6l+2NDeNsYiAA55Mh/XCZ/U+jubfmYnnlA/BS5+QU9NEM8VeO JFRjVqlraRJGlzc29BXBJH2MUYf4iCJBVrZfO8BxDGrMeDIYzQXGGjoD6ZUj28IsQo4jceI+OsvpY wy578wgxFFTsqjnxX3RMbqdB3Dqypg0w157J53v2vFyf9+JiaccWs1/pCmCJ/CVbKFO/Cm+Wigeq0 Wgl8C3OZjJ1oFbgYUigl4SyXsZ5W/WyJpUAWN8AP79XjA38oxJTFe3cLSKNiuCiYLX8jvE51dK6a0 VP/ho2SH1VaDCA==; 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 1qLlu2-0004hp-Pf; Tue, 18 Jul 2023 10:42:14 -0400 From: Janneke Nieuwenhuizen Date: Tue, 18 Jul 2023 16:40:27 +0200 Message-Id: <4afd686f160440b3af9d16481c9a7e3d3e3a241f.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/doxygen-hurd.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/documentation.scm (doxygen)[arguments]: When building for the Hurd, add new phase 'apply-patch' and use it. --- gnu/local.mk | 1 + gnu/packages/documentation.scm | 12 +++++++++- gnu/packages/patches/doxygen-hurd.patch | 30 +++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/doxygen-hurd.patch diff --git a/gnu/local.mk b/gnu/local.mk index 0d0f8c1937..84c4167723 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1066,6 +1066,7 @@ dist_patch_DATA = \ %D%/packages/patches/doc++-segfault-fix.patch \ %D%/packages/patches/dovecot-opensslv3.patch \ %D%/packages/patches/dovecot-trees-support-dovecot-2.3.patch \ + %D%/packages/patches/doxygen-hurd.patch \ %D%/packages/patches/dstat-fix-crash-when-specifying-delay.patch \ %D%/packages/patches/dstat-skip-devices-without-io.patch \ %D%/packages/patches/dune-common-skip-failing-tests.patch \ diff --git a/gnu/packages/documentation.scm b/gnu/packages/documentation.scm index ec70ca4d8f..5d455431d3 100644 --- a/gnu/packages/documentation.scm +++ b/gnu/packages/documentation.scm @@ -12,6 +12,7 @@ ;;; Copyright © 2020, 2021 Michael Rohleder ;;; Copyright © 2021, 2022 Marius Bakke ;;; Copyright © 2022 Maxim Cournoyer +;;; Copyright © 2023 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -40,6 +41,7 @@ (define-module (gnu packages documentation) #:use-module (guix build-system python) #:use-module (guix build-system qt) #:use-module (guix deprecation) + #:use-module (guix utils) #:use-module (gnu packages) #:use-module (gnu packages autotools) #:use-module (gnu packages backup) @@ -224,7 +226,15 @@ (define-public doxygen (let ((/bin/sh (search-input-file inputs "/bin/sh"))) (substitute* "src/portable.cpp" (("/bin/sh") - /bin/sh)))))))) + /bin/sh))))) + #$@(if (target-hurd?) + #~((add-after 'unpack 'apply-patch + (lambda _ + (let ((patch-file + #$(local-file + (search-patch "doxygen-hurd.patch")))) + (invoke "patch" "--force" "-p1" "-i" patch-file))))) + #~())))) (synopsis "Generate documentation from annotated sources") (description "Doxygen is the de facto standard tool for generating documentation from annotated C++ sources, but it also supports other popular diff --git a/gnu/packages/patches/doxygen-hurd.patch b/gnu/packages/patches/doxygen-hurd.patch new file mode 100644 index 0000000000..a40923184b --- /dev/null +++ b/gnu/packages/patches/doxygen-hurd.patch @@ -0,0 +1,30 @@ +Upstream status: Adapted from upstream. + +From d3d968e5835f449d7ea715f45160db81ea906303 Mon Sep 17 00:00:00 2001 +From: Samuel Thibault +Date: Tue, 16 Aug 2022 20:29:54 +0200 +Subject: [PATCH] Fix build on GNU/Hurd + +There is no path length limitation there, even via pathconf. But glibc +provides a getcwd function that allocates the buffer dynamically so we can +just leverage that. +--- + include/ghc/filesystem.hpp | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/filesystem/filesystem.hpp.orig 2022-08-11 22:14:32.000000000 +0200 ++++ b/filesystem/filesystem.hpp 2023-06-13 07:26:25.310000000 +0200 +@@ -4081,6 +4081,13 @@ + return path(); + } + return path(std::wstring(buffer.get()), path::native_format); ++#elif defined(__GLIBC__) ++ std::unique_ptr buffer { ::getcwd(NULL, 0), std::free }; ++ if (buffer == nullptr) { ++ ec = detail::make_system_error(); ++ return path(); ++ } ++ return path(buffer.get()); + #else + size_t pathlen = static_cast(std::max(int(::pathconf(".", _PC_PATH_MAX)), int(PATH_MAX))); + std::unique_ptr buffer(new char[pathlen + 1]);