]> Nutra Git (v2) - gamesguru/feather.git/commitdiff
guix: remap guix store on mingw
authortobtoht <tob@featherwallet.org>
Sun, 29 Sep 2024 11:39:13 +0000 (13:39 +0200)
committertobtoht <tob@featherwallet.org>
Sun, 29 Sep 2024 11:48:58 +0000 (13:48 +0200)
contrib/guix/manifest.scm
contrib/guix/patches/winpthreads-remap-guix-store.patch [new file with mode: 0644]

index 46508a07559455e2771b479f37a155f19f9725bf..e3b8415f43c867e77c3c37c5ae7e279712e4de84 100644 (file)
@@ -119,10 +119,17 @@ desirable for building Feather Wallet release binaries."
     (search-our-patches "gcc-remap-guix-store.patch"
                         "vmov-alignment.patch")))
 
+(define (winpthreads-patches mingw-w64-x86_64-winpthreads)
+  (package-with-extra-patches mingw-w64-x86_64-winpthreads
+    (search-our-patches "winpthreads-remap-guix-store.patch")))
+
 (define (make-mingw-pthreads-cross-toolchain target)
   "Create a cross-compilation toolchain package for TARGET"
   (let* ((xbinutils (cross-binutils target))
-         (pthreads-xlibc mingw-w64-x86_64-winpthreads)
+         (machine (substring target 0 (string-index target #\-)))
+         (pthreads-xlibc (winpthreads-patches (make-mingw-w64 machine
+                                         #:xgcc (cross-gcc target #:xgcc (gcc-mingw-patches base-gcc))
+                                         #:with-winpthreads? #t)))
          (pthreads-xgcc (cross-gcc target
                                     #:xgcc (gcc-mingw-patches mingw-w64-base-gcc)
                                     #:xbinutils xbinutils
diff --git a/contrib/guix/patches/winpthreads-remap-guix-store.patch b/contrib/guix/patches/winpthreads-remap-guix-store.patch
new file mode 100644 (file)
index 0000000..2c12585
--- /dev/null
@@ -0,0 +1,17 @@
+Without ffile-prefix-map, the debug symbols will contain paths for the
+guix store which will include the hashes of each package. However, the
+hash for the same package will differ when on different architectures.
+In order to be reproducible regardless of the architecture used to build
+the package, map all guix store prefixes to something fixed, e.g. /usr.
+
+--- a/mingw-w64-libraries/winpthreads/Makefile.in
++++ b/mingw-w64-libraries/winpthreads/Makefile.in
+@@ -454,7 +454,7 @@ top_build_prefix = @top_build_prefix@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+ SUBDIRS = . tests
+-AM_CFLAGS = -Wall -DWIN32_LEAN_AND_MEAN
++AM_CFLAGS = -Wall -DWIN32_LEAN_AND_MEAN $(shell find /gnu/store -maxdepth 1 -mindepth 1 -type d -exec echo -n " -ffile-prefix-map={}=/usr" \;)
+ ACLOCAL_AMFLAGS = -I m4
+ lib_LTLIBRARIES = libwinpthread.la
+ include_HEADERS = include/pthread.h include/sched.h include/semaphore.h include/pthread_unistd.h include/pthread_time.h include/pthread_compat.h include/pthread_signal.h