summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2023-05-17 12:21:56 +0300
committerEfraim Flashner <efraim@flashner.co.il>2023-08-14 19:37:44 +0300
commitac2da48841fba2ca17ab566a3ab47c20aa117af5 (patch)
treedc7123d9ffc589d023e45f0d54808e227b8f34fb /gnu
parent14d7ef79a757454c06dae87909b700f1ad9abe13 (diff)
downloadguix-ac2da48841fba2ca17ab566a3ab47c20aa117af5.tar.gz
gnu: rust-sleef-sys-0.1: Don't skip build.
* gnu/packages/crates-io.scm (rust-sleef-sys-0.1)[source]: Add snippet
to fix code error.
[arguments]: Add a phase to enable unstable features.
[inputs]: Add clang.
[native-inputs]: Add cmake-minimal.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/crates-io.scm24
1 files changed, 20 insertions, 4 deletions
diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 2a7ca4fe6c..dd459d15d0 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -59305,16 +59305,32 @@ implementations.")
         (string-append name "-" version ".tar.gz"))
        (sha256
         (base32
-         "1881q2yc17j2m1yvh01447c93ws1mspnrj3k2nbvwbvcm8z81kkv"))))
+         "1881q2yc17j2m1yvh01447c93ws1mspnrj3k2nbvwbvcm8z81kkv"))
+       (modules '((guix build utils)))
+       (snippet
+        '(begin
+           (substitute* "src/lib.rs"
+             ;; __m64 is x86 only, not x86 or x86_64 as in the code.
+             ;; See: https://github.com/gnzlbg/sleef-sys/issues/27
+             (("__m64") "// __m64"))))))
     (build-system cargo-build-system)
     (arguments
-     `(#:skip-build? #t
-       #:cargo-inputs
+     `(#:cargo-inputs
        (("rust-cfg-if" ,rust-cfg-if-0.1)
         ("rust-libc" ,rust-libc-0.2)
         ("rust-bindgen" ,rust-bindgen-0.46)
         ("rust-cmake" ,rust-cmake-0.1)
-        ("rust-env-logger" ,rust-env-logger-0.6))))
+        ("rust-env-logger" ,rust-env-logger-0.6))
+       #:phases
+       (modify-phases %standard-phases
+         ;; This makes it easier to test the package.
+         (add-after 'unpack 'enable-unstable-features
+           (lambda _
+             (setenv "RUSTC_BOOTSTRAP" "1"))))))
+    (inputs
+     (list clang))
+    (native-inputs
+     (list cmake-minimal))
     (home-page "https://github.com/gnzlbg/sleef-sys")
     (synopsis
      "Rust FFI bindings to the SLEEF Vectorized Math Library")