guix_mirror_bot pushed a commit to branch next-master
in repository guix.

commit 8d00d345e9cfe55bfd1ceea5c349046bc7332e83
Author: Janneke Nieuwenhuizen <[email protected]>
AuthorDate: Tue Jan 6 11:03:59 2026 +0100

    gnu: libunistring: Resurrect cross-build for MinGW.
    
    * gnu/packages/libunistring.scm (libunistring)[arguments]:
    When building for MinGW, add phase `patch-tests/nanosleep.c'.
    
    Change-Id: Ia76c342f2bbe7873367b5e59168f7180b845f4c3
---
 gnu/packages/libunistring.scm | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/libunistring.scm b/gnu/packages/libunistring.scm
index f4d11f9f76..732a624964 100644
--- a/gnu/packages/libunistring.scm
+++ b/gnu/packages/libunistring.scm
@@ -2,7 +2,7 @@
 ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <[email protected]>
 ;;; Copyright © 2015 Mark H Weaver <[email protected]>
 ;;; Copyright © 2016, 2018, 2022 Efraim Flashner <[email protected]>
-;;; Copyright © 2016 Jan Nieuwenhuizen <[email protected]>
+;;; Copyright © 2016, 2026 Janneke Nieuwenhuizen <[email protected]>
 ;;; Copyright © 2017 Mathieu Othacehe <[email protected]>
 ;;; Copyright © 2017 Eric Bavier <[email protected]>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <[email protected]>
@@ -29,6 +29,7 @@
   #:use-module (guix download)
   #:use-module (guix gexp)
   #:use-module (guix build-system gnu)
+  #:use-module (guix utils)
   #:use-module (gnu packages)
   #:use-module (gnu packages base))
 
@@ -60,7 +61,15 @@
               (with-directory-excursion (string-append #$output "/lib")
                 (install-file "libunistring.a"
                               (string-append #$output:static "/lib"))
-                (delete-file "libunistring.a")))))))
+                (delete-file "libunistring.a"))))
+          #$@(if (target-mingw?)
+                 #~((add-after 'unpack 'patch-tests/nanosleep.c
+                      (lambda _
+                        (substitute* "tests/nanosleep.c"
+                          (("# define WIN32_LEAN_AND_MEAN" all)
+                           (string-append "#define nanosleep 
nanosleep_native\n"
+                                          all))))))
+                 #~()))))
    (synopsis "C library for manipulating Unicode strings")
    (description
     "GNU libunistring is a library providing functions to manipulate

Reply via email to