guix_mirror_bot pushed a commit to branch master
in repository guix.
commit 3afbbf8ae30a63e6787b2dda11398ee89cee8782
Author: Yelninei <[email protected]>
AuthorDate: Fri Jan 2 08:43:56 2026 +0000
gnu: opensp: Fix build on the Hurd.
* gnu/packages/patches/opensp-maxpathlen.patch: New patch.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/xml.scm (opensp): Add phase for adding the patch.
Change-Id: I47278396eb5ded8f654708019e51b7d88b13b976
Signed-off-by: Liliana Marie Prikler <[email protected]>
---
gnu/local.mk | 1 +
gnu/packages/patches/opensp-maxpathlen.patch | 41 ++++++++++++++++++++++++++++
gnu/packages/xml.scm | 7 +++++
3 files changed, 49 insertions(+)
diff --git a/gnu/local.mk b/gnu/local.mk
index 696fe73d96..e619ab688c 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -2027,6 +2027,7 @@ dist_patch_DATA =
\
%D%/packages/patches/openrgb-unbundle-hueplusplus.patch \
%D%/packages/patches/openscad-fix-path-in-expected-test-results-to-acommodate-diff.patch
\
%D%/packages/patches/opensles-add-license-file.patch \
+ %D%/packages/patches/opensp-maxpathlen.patch \
%D%/packages/patches/openssl-1.1-c-rehash-in.patch \
%D%/packages/patches/openssl-3.0-c-rehash-in.patch \
%D%/packages/patches/openssl-hurd64.patch \
diff --git a/gnu/packages/patches/opensp-maxpathlen.patch
b/gnu/packages/patches/opensp-maxpathlen.patch
new file mode 100644
index 0000000000..9b141472ed
--- /dev/null
+++ b/gnu/packages/patches/opensp-maxpathlen.patch
@@ -0,0 +1,41 @@
+Adapted from
https://sources.debian.org/src/opensp/1.5.2-15.2/debian/patches/diff-1.0.patch
+
+Index: OpenSP-1.5.2/sx/XmlOutputEventHandler.cxx
+===================================================================
+--- OpenSP-1.5.2.orig/sx/XmlOutputEventHandler.cxx
++++ OpenSP-1.5.2/sx/XmlOutputEventHandler.cxx
+@@ -1199,12 +1199,22 @@ void XmlOutputEventHandler::inputOpened(
+ // Check to make sure we haven't passed outside of the
+ // output directory
+ char *dirs = strdup (filePath);
++#ifdef MAXPATHLEN
+ char realDirs[MAXPATHLEN];
+ char realOutputDir[MAXPATHLEN];
++#else
++ char *realDirs;
++ char *realOutputDir;
++#endif
+ char *outputDir = strdup(outputDir_);
+
++#ifdef MAXPATHLEN
+ realpath((const char *)dirname(dirs), realDirs);
+ realpath((const char *)dirname(outputDir), realOutputDir);
++#else
++ realDirs = realpath((const char *)dirname(dirs), NULL);
++ realOutputDir = realpath((const char *)dirname(outputDir), NULL);
++#endif
+
+ if (strncmp(realDirs, realOutputDir, strlen (realOutputDir)) != 0) {
+ app_->message(XmlOutputMessages::pathOutsideOutputDirectory,
+@@ -1214,6 +1224,11 @@ void XmlOutputEventHandler::inputOpened(
+ }
+ }
+
++#ifndef MAXPATHLEN
++ free(realDirs);
++ free(realOutputDir);
++#endif
++
+ // Make the necessary directories
+ maybeCreateDirectories(dirname(dirs));
+
diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm
index 38606df7a1..1660feb853 100644
--- a/gnu/packages/xml.scm
+++ b/gnu/packages/xml.scm
@@ -1845,6 +1845,13 @@ modular implementation of XML-RPC for C and C++.")
#:make-flags #~(list "TESTS_THAT_FAIL=")
#:phases
#~(modify-phases %standard-phases
+ #$@(if (target-hurd?)
+ #~((add-after 'unpack 'patch-hurd
+ (lambda _
+ (let ((patch #$(local-file
+ (search-patch
"opensp-maxpathlen.patch"))))
+ (invoke "patch" "--force" "-p1" "-i" patch)))))
+ #~())
(add-after 'unpack 'delete-configure
;; The configure script in the release was made with an older
;; Autoconf and lacks support for the `--docdir' option.