Subject: [bug#57625] [PATCH v2 1/3] gnu: Add libgc-all-headers.

From: Adam Faiz <[email-masked]>
Date: Sat, 19 Nov 2022 18:33:28 +0800

From 5ddddd9a24d9b319e722984e19ab26ba02779752 Mon Sep 17 00:00:00 2001
From: AwesomeAdam54321 <[email-masked]>
Date: Fri, 18 Nov 2022 07:39:38 +0800
Subject: [PATCH v2 1/3] gnu: Add libgc-all-headers.

* gnu/packages/bdw-gc.scm (libgc-all-headers): New variable.
---
  gnu/packages/bdw-gc.scm | 29 +++++++++++++++++++++++++++++
  1 file changed, 29 insertions(+)

diff --git a/gnu/packages/bdw-gc.scm b/gnu/packages/bdw-gc.scm
index c812248e86..947a50f738 100644
--- a/gnu/packages/bdw-gc.scm
+++ b/gnu/packages/bdw-gc.scm
@@ -26,7 +26,9 @@ (define-module (gnu packages bdw-gc)
    #:use-module (guix packages)
    #:use-module (guix download)
    #:use-module (guix utils)
+  #:use-module (guix gexp)
    #:use-module (guix build-system gnu)
+  #:use-module (guix build-system copy)
    #:use-module (gnu packages pkg-config)
    #:use-module (gnu packages hurd))

@@ -90,6 +92,33 @@ (define-public libgc

     (license (x11-style (string-append home-page "license.txt")))))

+(define-public libgc-all-headers ; TODO(core-updates) merge into libgc
+  (package
+    (inherit libgc)
+    (name "libgc-all-headers")
+    (outputs '("out"))
+    (build-system copy-build-system)
+    (arguments
+             (list #:install-plan
+                   #~'(("include/config.h.in" "include/private/config.h")
+                     ("include/gc_tiny_fl.h" 
"include/private/gc_tiny_fl.h")
+                     ("include/gc_mark.h" "include/private/gc_mark.h")
+                     ("include/private/gcconfig.h" 
"include/private/gcconfig.h")
+                     ("include/private/gc_hdrs.h" 
"include/private/gc_hdrs.h")
+                     ("include/private/gc_atomic_ops.h" 
"include/private/gc_atomic_ops.h")
+                     ("include/private/gc_locks.h" 
"include/private/gc_locks.h")
+                     ("include/private/gc_priv.h" 
"include/private/gc_priv.h"))
+                   #:phases
+                   #~(modify-phases %standard-phases
+                       (add-before 'install 'fix-headers
+                         (lambda _
+                           (with-directory-excursion "include/private"
+                             (substitute* "gc_priv.h"
+                               (("#include .*/gc_tiny_fl.h.") "#include 
<gc_tiny_fl.h>")
+                               (("#include .*/gc_mark.h.") "#include 
<gc_mark.h>"))))))))
+    (synopsis "Headers of libgc")
+    (description "All headers of libgc.")))
+
  ;; TODO: Add a static output in libgc in the next rebuild cycle.
  (define-public libgc/static-libs
    (package/inherit
-- 
2.38.1