From d3a1684c8a092bb729d68a840abea28092dfc587 Mon Sep 17 00:00:00 2001 From: Janneke Nieuwenhuizen Date: Tue, 13 Jun 2023 07:18:26 +0200 Subject: gnu: doxygen: Fix build for the Hurd. * 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/packages/documentation.scm | 12 +++++++++++- gnu/packages/patches/doxygen-hurd.patch | 30 ++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/doxygen-hurd.patch (limited to 'gnu/packages') 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 @@ #: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 @@ markup) can be customized and extended by the user.") (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]); -- cgit v1.2.3