Subject: [PATCH v3 1/4] gnu: Add libgc-all-headers.

From: Adam Faiz <[email-masked]>
Date: Mon, 26 Jun 2023 21:17:14 +0800

>From 94149f940fc7dd3c052cfa9765933303abb7a4ee Mon Sep 17 00:00:00 2001
Message-Id: <9[email-masked]>
From: AwesomeAdam54321 <[email-masked]>
Date: Fri, 18 Nov 2022 07:39:38 +0800
Subject: [PATCH v3 1/4] 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 5ff4649716..a1a046ad9d 100644
--- a/gnu/packages/bdw-gc.scm
+++ b/gnu/packages/bdw-gc.scm
@@ -27,7 +27,9 @@ (define-module (gnu packages bdw-gc)
   #:use-module (guix download)
   #:use-module (guix gexp)
   #: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))
 
@@ -107,6 +109,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

base-commit: f25529b08e356f89ca7cecc44295085531a8faba
-- 
2.40.1