Hi, finally I found some time to write a working patch.


> I am ready to write such a C patch. Is that okay with you ?

Depends on messy it is, I guess ? The problem is that once packages start to use that patch, I cannot just drop
the patch if it fails to apply to a new upstream version.


I try to make it not Debian specific (ie, it is applicable to upstream version 
in its main part),
minimal, and clean (not messy).

Note the the patch apply to the Debian source gap-4.140-3, namely the one 
currently in Sid.
Second, after applying the patch, the `configure' and `src/config.h.in' files 
must be regenerated.
This can be done by launching `autogen.sh'.

Please let me know if the patch is fine, and, if not, what can be improved.

Cheers,
Jerome


--
Jerome BENOIT | calculus+at-rezozer^dot*net
https://qa.debian.org/developer.php?login=calcu...@rezozer.net
AE28 AE15 710D FF1D 87E5  A762 3F92 19A6 7F36 C68B
This patch requires to regenerate `configure' and `src/config.h.in' (for example, by running `autogen.sh')

diff -Nur '--exclude=configure' gap-4.14.0/debian/patches/multiarch-tuple gap-4.14.0-multiarchtuple/debian/patches/multiarch-tuple
--- gap-4.14.0/debian/patches/multiarch-tuple	1970-01-01 01:00:00.000000000 +0100
+++ gap-4.14.0-multiarchtuple/debian/patches/multiarch-tuple	2025-06-03 19:04:22.025630436 +0200
@@ -0,0 +1,79 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -955,6 +955,9 @@
+     ;;
+ esac
+ 
++dnl Allow user to specify a multi-arch tuple
++AS_IF([test "x$MULTIARCHTUPLE" != "x"],
++  [AC_DEFINE_UNQUOTED([MULTIARCHTUPLE], ["$MULTIARCHTUPLE"], [GAP multi-arch support, for GAP packages])])
+ 
+ dnl
+ dnl check for the existence of various header files
+--- a/src/gap.c
++++ b/src/gap.c
+@@ -1068,6 +1068,9 @@
+     AssPRec(res, RNamName("RELEASEDAY"), MakeImmString(SyReleaseDay));
+     AssPRec(res, RNamName("GAP_ROOT_PATHS"), SyGetGapRootPaths());
+     AssPRec(res, RNamName("DOT_GAP_PATH"), MakeImmString(SyDotGapPath()));
++#ifdef MULTIARCHTUPLE
++    AssPRec(res, RNamName("HOST_MULTIARCHTUPLE"), MakeImmString(MULTIARCHTUPLE));
++#endif
+ 
+     // Get OS Kernel Release info
+     AssPRec(res, RNamName("uname"), SyGetOsRelease());
+--- a/lib/system.g
++++ b/lib/system.g
+@@ -293,6 +293,10 @@
+     GAPInfo.BuildDateTime := GAPInfo.KernelInfo.BUILD_DATETIME;
+     GAPInfo.Architecture:= GAPInfo.KernelInfo.GAP_ARCHITECTURE;
+ 
++    if  IsBound(GAPInfo.KernelInfo.HOST_MULTIARCHTUPLE) then
++      GAPInfo.HostMultiArchTuple := GAPInfo.KernelInfo.HOST_MULTIARCHTUPLE;
++    fi;
++
+     # The exact command line which called GAP as list of strings;
+     # first entry is the executable followed by the options.
+     GAPInfo.SystemCommandLine:= GAPInfo.KernelInfo.COMMAND_LINE;
+--- a/lib/init.g
++++ b/lib/init.g
+@@ -460,6 +460,10 @@
+          sysdate, "\n",
+          " ",vert,"  GAP  ",vert,"   https://www.gap-system.org\n";,
+          " ",bbot,"   Architecture: ", GAPInfo.Architecture, "\n" );
++  if IsBound( GAPInfo.HostMultiArchTuple ) then
++    Print( "             HostMultiArchTuple: ",
++       GAPInfo.HostMultiArchTuple, "\n");
++  fi;
+   if IsHPCGAP then
+     Print( "             Maximum concurrent threads: ",
+        GAPInfo.KernelInfo.NUM_CPUS, "\n");
+--- a/lib/package.gi
++++ b/lib/package.gi
+@@ -1308,7 +1308,7 @@
+ #F  DirectoriesPackagePrograms( <name> )
+ ##
+ InstallGlobalFunction( DirectoriesPackagePrograms, function( name )
+-    local info, installationpath;
++    local info, installationpath, dirlist;
+ 
+     # We are not allowed to call
+     # `InstalledPackageVersion', `TestPackageAvailability' etc.
+@@ -1329,10 +1329,16 @@
+       # This package is not known.
+       return [];
+     fi;
+-    return [
++    dirlist:= [
+       Directory( Concatenation( installationpath, "/bin/") ),
+       Directory( Concatenation( installationpath, "/bin/",
+                             GAPInfo.Architecture, "/" ) ) ];
++    if IsBound( GAPInfo.HostMultiArchTuple ) then
++      Add( dirlist,
++        Directory( Concatenation( installationpath, "/bin/",
++                            GAPInfo.HostMultiArchTuple, "/" ) ) );
++    fi;
++    return dirlist;
+ end );
+ 
+ 
diff -Nur '--exclude=configure' gap-4.14.0/debian/patches/series gap-4.14.0-multiarchtuple/debian/patches/series
--- gap-4.14.0/debian/patches/series	2024-12-07 23:09:25.000000000 +0100
+++ gap-4.14.0-multiarchtuple/debian/patches/series	2025-06-03 19:31:05.644973500 +0200
@@ -15,3 +15,4 @@
 version-date-SDE
 fix--help
 fix-version-stdin
+multiarch-tuple
diff -Nur '--exclude=configure' gap-4.14.0/debian/rules gap-4.14.0-multiarchtuple/debian/rules
--- gap-4.14.0/debian/rules	2024-12-05 23:20:20.000000000 +0100
+++ gap-4.14.0-multiarchtuple/debian/rules	2025-05-25 23:49:24.832130047 +0200
@@ -40,7 +40,7 @@
 
 config.status: configure
 	dh_testdir
-	GAPHOST=$(DEB_HOST_MULTIARCH) LDFLAGS=$(LDFLAGS) ./configure \
+	MULTIARCHTUPLE=$(DEB_HOST_MULTIARCH) LDFLAGS=$(LDFLAGS) ./configure \
           --host=$(DEB_HOST_GNU_TYPE) --target=$(DEB_HOST_GNU_TYPE)  --build=$(DEB_BUILD_GNU_TYPE) \
           --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --libdir=/$(libtriplet) \
           SHELL=/bin/sh GREP=/bin/grep SED=/bin/sed DD=/bin/dd STRIP=/bin/true \

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to