guix_mirror_bot pushed a commit to branch core-packages-team
in repository guix.

commit fcea52a397eded8d8061d00a067378ce8d617d3b
Author: Zheng Junjie <[email protected]>
AuthorDate: Sat Apr 25 02:30:52 2026 +0800

    gnu: libgc: Add static output.
    
    * gnu/packages/bdw-gc.scm (libgc)[arguments]<#:configure-flags>: Add
    --enable-static.
    <#:phases>: Add move-static-library phase.
    [outputs]: Add static.
    
    * gnu/packages/bdw-gc.scm (libgc/static-libs): Use 
define-deprecated/public-alias.
    * gnu/packages/make-bootstrap.scm (make-guile-static): Use libgc:static.
    
    Change-Id: If793d090dd34272a489f6175ac34fbc2c033072a
---
 gnu/packages/bdw-gc.scm         | 39 +++++++++++++++++++++++++++------------
 gnu/packages/make-bootstrap.scm |  3 ++-
 2 files changed, 29 insertions(+), 13 deletions(-)

diff --git a/gnu/packages/bdw-gc.scm b/gnu/packages/bdw-gc.scm
index 4f0845f300d..f379bc77dc3 100644
--- a/gnu/packages/bdw-gc.scm
+++ b/gnu/packages/bdw-gc.scm
@@ -6,6 +6,7 @@
 ;;; Copyright © 2019, 2020, 2022 Marius Bakke <[email protected]>
 ;;; Copyright © 2022, 2023 Efraim Flashner <[email protected]>
 ;;; Copyright © 2025 Janneke Nieuwenhuizen <[email protected]>
+;;; Copyright © 2026 Zheng Junjie <[email protected]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -23,6 +24,7 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages bdw-gc)
+  #:use-module (guix deprecation)
   #:use-module (guix licenses)
   #:use-module (guix packages)
   #:use-module (guix download)
@@ -55,6 +57,8 @@
      #~(list
         ;; Install gc_cpp.h et al.
         "--enable-cplusplus"
+        ;; Used by 'guile-static'.
+        "--enable-static"
 
         ;; In GNU/Hurd systems during the 'check' phase,
         ;; there is a deadlock caused by the 'gctest' test.
@@ -68,7 +72,26 @@
                #~())
         #$@(if (target-mingw?)
                #~("--enable-threads=pthreads")
-               #~())))
+               #~()))
+     #:phases
+     #~(modify-phases %standard-phases
+         (add-after 'install 'move-static-library
+           (lambda _
+             (for-each
+              (lambda (a)
+                (install-file a (string-append #$output:static
+                                               "/lib"))
+                (delete-file a))
+              (find-files (string-append #$output "/lib") "\\.a"))
+             (mkdir-p (string-append #$output:static "/lib/pkgconfig/"))
+             (let ((pc "/lib/pkgconfig/bdw-gc.pc"))
+               (copy-recursively (string-append #$output pc)
+                               (string-append #$output:static pc))
+             (substitute* (string-append #$output:static pc)
+               (((string-append "prefix=" #$output))
+                (string-append "prefix=" #$output:static))
+               (("includedir=\\$[{]prefix[}]/include")
+                (string-append "includedir=" #$output "/include"))))))))
      (cond
        ((target-ppc64le?)
         (list #:make-flags
@@ -87,7 +110,7 @@
         ;; cross-compiling, and demands using libatomic-ops instead.
         (list libatomic-ops)
         '()))
-   (outputs '("out" "debug"))
+   (outputs '("out" "debug" "static"))
    (properties
     '((release-monitoring-url . "https://www.hboehm.info/gc/gc_source/";)
       (upstream-name . "gc")))
@@ -112,16 +135,8 @@ C or C++ programs, though that is not its primary goal.")
 
    (license (x11-style (string-append home-page "license.txt")))))
 
-;; TODO: Add a static output in libgc in the next rebuild cycle.
-(define-public libgc/static-libs
-  (package/inherit
-   libgc
-   (arguments
-    (substitute-keyword-arguments arguments
-      ((#:configure-flags flags #~'())
-       #~(cons "--enable-static" #$flags))))
-
-   (properties '((hidden? . #t)))))
+;; XXX: Deprecated on <2026-04-25>.
+(define-deprecated/public-alias libgc/static-libs libgc)
 
 (define-public libgc-7
   (package
diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm
index 904fb5c307d..296d6b8e1e7 100644
--- a/gnu/packages/make-bootstrap.scm
+++ b/gnu/packages/make-bootstrap.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2019, 2020, 2022 Marius Bakke <[email protected]>
 ;;; Copyright © 2020 Mathieu Othacehe <[email protected]>
 ;;; Copyright © 2021 Pierre Langlois <[email protected]>
+;;; Copyright © 2026 Zheng Junjie <[email protected]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -622,7 +623,7 @@ for `sh' in $PATH, and without nscd, and with static NSS 
modules."
 
       (propagated-inputs
        (modify-inputs propagated-inputs
-         (replace "libgc" libgc/static-libs)))
+         (replace "libgc" `(,libgc "static"))))
 
       (arguments
        (substitute-keyword-arguments arguments

Reply via email to