Subject: [bug#57625] [PATCH 1/3] gnu: Add libgc-private-headers-for-pnet.

From: Adam Faiz <[email-masked]>
Date: Tue, 6 Sep 2022 23:34:19 +0800

From feec1f999877de9ae411653c76bbf144cc6c7b2d Mon Sep 17 00:00:00 2001
From: AwesomeAdam54321 <[email-masked]>
Date: Tue, 6 Sep 2022 14:08:33 +0800
Subject: [PATCH 1/3] gnu: Add libgc-private-headers-for-pnet.

* gnu/packages/bdw-gc.scm (libgc-private-headers-for-pnet): New private 
variable.
---
  gnu/packages/bdw-gc.scm | 36 ++++++++++++++++++++++++++++++++++++
  1 file changed, 36 insertions(+)

diff --git a/gnu/packages/bdw-gc.scm b/gnu/packages/bdw-gc.scm
index 268f0703b8..3bf2a8f2f6 100644
--- a/gnu/packages/bdw-gc.scm
+++ b/gnu/packages/bdw-gc.scm
@@ -26,6 +26,7 @@ (define-module (gnu packages bdw-gc)
    #:use-module (guix packages)
    #:use-module (guix download)
    #:use-module (guix utils)
+  #:use-module (guix build-system copy)
    #:use-module (guix build-system gnu)
    #:use-module (gnu packages pkg-config)
    #:use-module (gnu packages hurd))
@@ -122,6 +123,41 @@ (define-public libgc/back-pointers
         ,@(package-arguments libgc)))
      (synopsis "The BDW garbage collector, with back-pointer tracking")))

+(define-public libgc-private-headers-for-pnet
+  (hidden-package
+   (package
+     (name "libgc-private-headers")
+     (version (package-version libgc))
+     (source (origin
+               (method url-fetch)
+               (uri (string-append 
"https://github.com/ivmai/bdwgc/releases"
+                                   "/download/v" version "/gc-" version 
".tar.gz"))
+               (sha256
+                (base32
+                 "1798rp3mcfkgs38ynkbg2p47bq59pisrc6mn0l20pb5iczf0ssj3"))))
+     (build-system copy-build-system)
+     (arguments
+      '(#: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-after 'unpack 'fix-includes
+            (lambda _
+              (substitute* "include/private/gc_priv.h"
+                (("#include .*/gc_tiny_fl.h") "#include <gc_tiny_fl.h>")
+                (("#include .*/gc_mark.h") "#include <gc_mark.h>")))))))
+     (synopsis "Private headers of libgc for pnet")
+     (description "Private headers in libgc that are used in pnet.")
+     (home-page "https://www.hboehm.info/gc/")
+     (license (x11-style (string-append home-page "license.txt"))))))
+
  (define-public libatomic-ops
    (package
      (name "libatomic-ops")

base-commit: 9fa3e90789203109f6f86ab41b48c65f15451d4e
-- 
2.37.2