diff mbox series

[bug#69637,mesa-updates,5/6] gnu: Add rust-bindgen-cli-0.69.

Message ID b558be5e5c5b9956fbcc2378ffabb51312c4ac68.1709899566.git.aurtzy@gmail.com
State New
Headers show
Series gnu: mesa: Update to 24.0.2. | expand

Commit Message

aurtzy March 8, 2024, 8:27 p.m. UTC
* gnu/packages/crates-io.scm (rust-bindgen-cli-0.69): New variable.

Change-Id: I0841f34d73acf4e161c9f0ba0c6543d7f0d03092
---
 gnu/packages/crates-io.scm | 53 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)

Comments

Efraim Flashner March 12, 2024, 11:54 a.m. UTC | #1
I've applied rust-bindgen-cli to the master branch. I renamed it to
remove the version at the end and I switched to the crate-uri since
there's no tests in the bindgen-cli folder of the bindgen git repo.

I also moved it to the rust-apps module and added the shell completions.
diff mbox series

Patch

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 97dfc03525..150b8884b1 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -6182,6 +6182,59 @@  (define-public rust-bindgen-0.69
 bindings to C and C++ libraries.")
     (license license:bsd-3)))
 
+(define-public rust-bindgen-cli-0.69
+  (package
+    (inherit rust-bindgen-0.69)
+    (name "rust-bindgen-cli")
+    (version "0.69.4")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/rust-lang/rust-bindgen.git")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "0mksvspqymdypgflgx6xqfxdr9a5wwx534imgcnn3mk7ffz0sqlm"))))
+    (arguments
+     (cons*
+      ;; 1 test case fails (header_ptr32_has_different_size_h); related issue:
+      ;; https://github.com/rust-lang/rust-bindgen/issues/2638
+      #:tests? #f
+      #:phases
+      #~(modify-phases %standard-phases
+          (replace 'install
+            (lambda* (#:key outputs inputs #:allow-other-keys)
+              (let* ((out (assoc-ref outputs "out"))
+                     (bin (string-append out "/bin"))
+                     (bindgen (string-append bin "/bindgen"))
+                     (llvm-dir (string-append
+                                (assoc-ref inputs "clang")
+                                "/lib")))
+                (mkdir-p bin)
+                (copy-file "target/release/bindgen" bindgen)
+                (wrap-program bindgen
+                  `("LIBCLANG_PATH" = (,llvm-dir)))))))
+      (substitute-keyword-arguments (package-arguments rust-bindgen-0.69)
+        ((#:skip-build? _)
+         #f)
+        ((#:cargo-inputs original-inputs)
+         `(("rust-bindgen" ,rust-bindgen-0.69)
+           ("rust-block" ,rust-block-0.1)
+           ("rust-clap" ,rust-clap-complete-4)
+           ("rust-env-logger" ,rust-env-logger-0.10)
+           ("rust-libloading" ,rust-libloading-0.7)
+           ("rust-objc" ,rust-objc-0.2)
+           ("rust-owo-colors" ,rust-owo-colors-3)
+           ("rust-prettyplease" ,rust-prettyplease-0.2)
+           ("rust-quickcheck" ,rust-quickcheck-0.4)
+           ("rust-similar" ,rust-similar-2)
+           ,@original-inputs)))))
+    (native-inputs
+     (modify-inputs (package-native-inputs rust-bindgen-0.69)
+       (prepend clang)))))
+
 (define-public rust-bindgen-0.66
   (package
     (inherit rust-bindgen-0.69)