Subject: Re: rust-zstd-sys bundles zstd

From: Maxime Devos <[email-masked]>
Date: Fri, 16 Sep 2022 18:47:22 +0200

Solved as follows in antioxidant (i.e., enable the 'pkg-config' feature 
and remove the local copy in a snippet).

diff --git a/antioxidant-packages.scm b/antioxidant-packages.scm
index e851bc9..b0296e7 100644
--- a/antioxidant-packages.scm
+++ b/antioxidant-packages.scm
@@ -4708,6 +4708,7 @@ RFC-compliant `EmailAddress` newtype. ")
      ;; rust-num-bigint-dig's zeroize feature requires the "derive"
      ;; feature of rust-zeroize
      ("rust-zeroize" ,#~'("default" "derive"))
+    ("rust-zstd-sys" ,#~'("default" "pkg-config" "non-cargo"))
      ("rust-zip" ,#~'("bzip2" "deflate" "time" "zstd")))) ; avoid 
default "aes-crypto" feature, which requiers an ol

  (define %replacements
@@ -5748,6 +5749,8 @@ RFC-compliant `EmailAddress` newtype. ")
       (("rust-parking-lot" ,(p rust-parking-lot-0.11)))) ; test input
      ("rust-zip" ; new inputs for new version
       (("rust-zstd" ,(p rust-zstd-0.9))))
+    ("rust-zstd-sys"
+     (("zstd:lib" ,(@ (gnu packages compression) zstd) "lib")))
      ("sniffglue" (("rust-bstr" ,(@ (gnu packages crates-io) 
rust-bstr-0.2))))))

  (define %no-parallel-tests?
@@ -6628,6 +6631,14 @@ RFC-compliant `EmailAddress` newtype. ")
                (inherit (package-source pack))
                (modules '((guix build utils)))
                (snippet #~(delete-file-recursively "source"))))
+            ("rust-zstd-sys"
+             ;; Unbundle zstd
+             (origin
+              (inherit (package-source pack))
+              (modules '((guix build utils)))
+              (snippet #~(begin
+                           (delete-file-recursively "zstd")
+                           (delete-file "zstd.h")))))
              ("rust-itoa"
               (origin
                (inherit (package-source pack))