diff mbox series

[bug#41079,v2,3/3] gnu: Add rust-nettle-7.

Message ID d691b0f6a3ca099441ae2fb7763fdd706c086458.1588604978.git.h.goebel@crazy-compilers.com
State Accepted
Headers show
Series None | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job

Commit Message

Hartmut Goebel May 4, 2020, 3:11 p.m. UTC
* gnu/packages/crates-io.scm (rust-nettle-7): New variable.
* gnu/packages/patches/rust-nettle-disable-vendor.patch: New file.
* gnu/local.mk: Add it.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/crates-io.scm                    | 44 +++++++++++++++++++
 .../patches/rust-nettle-disable-vendor.patch  | 13 ++++++
 3 files changed, 58 insertions(+)
 create mode 100644 gnu/packages/patches/rust-nettle-disable-vendor.patch

Comments

Efraim Flashner May 4, 2020, 4:10 p.m. UTC | #1
I would personally do this one with a snippet since its one line but
looks good.

On Mon, May 04, 2020 at 05:11:19PM +0200, Hartmut Goebel wrote:
> * gnu/packages/crates-io.scm (rust-nettle-7): New variable.
> * gnu/packages/patches/rust-nettle-disable-vendor.patch: New file.
> * gnu/local.mk: Add it.
> ---
>  gnu/local.mk                                  |  1 +
>  gnu/packages/crates-io.scm                    | 44 +++++++++++++++++++
>  .../patches/rust-nettle-disable-vendor.patch  | 13 ++++++
>  3 files changed, 58 insertions(+)
>  create mode 100644 gnu/packages/patches/rust-nettle-disable-vendor.patch
> 
> diff --git a/gnu/local.mk b/gnu/local.mk
> index f7ffe75eb3..383f867426 100644
> --- a/gnu/local.mk
> +++ b/gnu/local.mk
> @@ -1425,6 +1425,7 @@ dist_patch_DATA =						\
>    %D%/packages/patches/rust-1.25-accept-more-detailed-gdb-lines.patch \
>    %D%/packages/patches/rust-bootstrap-stage0-test.patch		\
>    %D%/packages/patches/rust-coresimd-doctest.patch		\
> +  %D%/packages/patches/rust-nettle-disable-vendor.patch		 \
>    %D%/packages/patches/rust-nettle-sys-disable-vendor.patch	 \
>    %D%/packages/patches/rust-reproducible-builds.patch		 \
>    %D%/packages/patches/rust-openssl-sys-no-vendor.patch	\
> diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
> index 16855a8bff..e1c971e76e 100644
> --- a/gnu/packages/crates-io.scm
> +++ b/gnu/packages/crates-io.scm
> @@ -37,6 +37,7 @@
>    #:use-module (gnu packages gtk)
>    #:use-module (gnu packages jemalloc)
>    #:use-module (gnu packages llvm)
> +  #:use-module (gnu packages multiprecision)
>    #:use-module (gnu packages nettle)
>    #:use-module (gnu packages pcre)
>    #:use-module (gnu packages pkg-config)
> @@ -11943,6 +11944,49 @@ types as proposed in RFC 1158.")
>      (license (list license:asl2.0
>                     license:expat))))
>  
> +(define-public rust-nettle-7
> +  (package
> +    (name "rust-nettle")
> +    (version "7.0.0")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (crate-uri "nettle" version))
> +       (file-name (string-append name "-" version ".tar.gz"))
> +       (sha256
> +        (base32 "1n6dwy9zba8853bmxzhwaashd3np0wxpx0pj43brm0hb8n2sxbxi"))
> +       (patches (search-patches "rust-nettle-disable-vendor.patch"))))
> +    (build-system cargo-build-system)
> +    (native-inputs
> +     `(("pkg-config" ,pkg-config)))
> +    (inputs
> +     `(("clang" ,clang)
> +       ("gmp" ,gmp)
> +       ("nettle" ,nettle)))
> +    (arguments
> +     `(#:skip-build? #t ;; provides nothing, has no tests
> +       #:cargo-inputs
> +       (("rust-getrandom" ,rust-getrandom-0.1)
> +        ("rust-libc" ,rust-libc-0.2)
> +        ("rust-nettle-sys" ,rust-nettle-sys-2)
> +        ("rust-thiserror" ,rust-thiserror-1.0))
> +       #:cargo-development-inputs
> +       (("rust-bindgen" ,rust-bindgen-0.51)
> +        ("rust-pkg-config" ,rust-pkg-config-0.3))
> +       #:phases
> +       (modify-phases %standard-phases
> +         (add-after 'unpack 'set-missing-env-vars
> +           (lambda* (#:key inputs #:allow-other-keys)
> +             ;; FIXME: why do we need to set this?
> +             (setenv "LIBCLANG_PATH"
> +                     (string-append (assoc-ref inputs "clang") "/lib"))
> +             #t)))))
> +    (home-page "https://gitlab.com/sequoia-pgp/nettle-rs")
> +  (synopsis "Rust bindings for the Nettle cryptographic library")
> +  (description "This package provides Rust bindings for the Nettle
> +cryptographic library.")
> +  (license (list license:lgpl3 license:gpl2 license:gpl3))))
> +
>  (define-public rust-nettle-sys-2
>    (package
>      (name "rust-nettle-sys")
> diff --git a/gnu/packages/patches/rust-nettle-disable-vendor.patch b/gnu/packages/patches/rust-nettle-disable-vendor.patch
> new file mode 100644
> index 0000000000..5b52821cdb
> --- /dev/null
> +++ b/gnu/packages/patches/rust-nettle-disable-vendor.patch
> @@ -0,0 +1,13 @@
> +Subject: nettle: clear out "vendored" feature cruft from build.rs
> +From: Daniel Kahn Gillmor's avatarDaniel Kahn Gillmor <dkg@fifthhorseman.net>
> +
> +https://salsa.debian.org/rust-team/debcargo-conf/-/commit/b608e6beaa1d38c14fc16ad53780d94954a91900
> +https://sources.debian.org/src/rust-nettle/7.0.0-1/debian/patches/disable-vendor.diff/
> +--- a/Cargo.toml	1969-12-31 19:00:00.000000000 -0500
> ++++ b/Cargo.toml	2019-10-23 19:12:01.076181971 -0400
> +@@ -35,4 +35,4 @@
> + version = "1"
> + 
> + [features]
> +-vendored = ["nettle-sys/vendored"]
> ++vendored = []
> -- 
> 2.21.3
>
Hartmut Goebel May 5, 2020, 11:57 a.m. UTC | #2
Am 04.05.20 um 18:10 schrieb Efraim Flashner:
> I would personally do this one with a snippet since its one line but
> looks good.
Using the existing patch was much easier than writing a snippet :-)

Thanks for the review. Merged as 31def9a9df583dd27f8604302700ff48368c43f3
diff mbox series

Patch

diff --git a/gnu/local.mk b/gnu/local.mk
index f7ffe75eb3..383f867426 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1425,6 +1425,7 @@  dist_patch_DATA =						\
   %D%/packages/patches/rust-1.25-accept-more-detailed-gdb-lines.patch \
   %D%/packages/patches/rust-bootstrap-stage0-test.patch		\
   %D%/packages/patches/rust-coresimd-doctest.patch		\
+  %D%/packages/patches/rust-nettle-disable-vendor.patch		 \
   %D%/packages/patches/rust-nettle-sys-disable-vendor.patch	 \
   %D%/packages/patches/rust-reproducible-builds.patch		 \
   %D%/packages/patches/rust-openssl-sys-no-vendor.patch	\
diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 16855a8bff..e1c971e76e 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -37,6 +37,7 @@ 
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages jemalloc)
   #:use-module (gnu packages llvm)
+  #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages nettle)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages pkg-config)
@@ -11943,6 +11944,49 @@  types as proposed in RFC 1158.")
     (license (list license:asl2.0
                    license:expat))))
 
+(define-public rust-nettle-7
+  (package
+    (name "rust-nettle")
+    (version "7.0.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "nettle" version))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "1n6dwy9zba8853bmxzhwaashd3np0wxpx0pj43brm0hb8n2sxbxi"))
+       (patches (search-patches "rust-nettle-disable-vendor.patch"))))
+    (build-system cargo-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (inputs
+     `(("clang" ,clang)
+       ("gmp" ,gmp)
+       ("nettle" ,nettle)))
+    (arguments
+     `(#:skip-build? #t ;; provides nothing, has no tests
+       #:cargo-inputs
+       (("rust-getrandom" ,rust-getrandom-0.1)
+        ("rust-libc" ,rust-libc-0.2)
+        ("rust-nettle-sys" ,rust-nettle-sys-2)
+        ("rust-thiserror" ,rust-thiserror-1.0))
+       #:cargo-development-inputs
+       (("rust-bindgen" ,rust-bindgen-0.51)
+        ("rust-pkg-config" ,rust-pkg-config-0.3))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'set-missing-env-vars
+           (lambda* (#:key inputs #:allow-other-keys)
+             ;; FIXME: why do we need to set this?
+             (setenv "LIBCLANG_PATH"
+                     (string-append (assoc-ref inputs "clang") "/lib"))
+             #t)))))
+    (home-page "https://gitlab.com/sequoia-pgp/nettle-rs")
+  (synopsis "Rust bindings for the Nettle cryptographic library")
+  (description "This package provides Rust bindings for the Nettle
+cryptographic library.")
+  (license (list license:lgpl3 license:gpl2 license:gpl3))))
+
 (define-public rust-nettle-sys-2
   (package
     (name "rust-nettle-sys")
diff --git a/gnu/packages/patches/rust-nettle-disable-vendor.patch b/gnu/packages/patches/rust-nettle-disable-vendor.patch
new file mode 100644
index 0000000000..5b52821cdb
--- /dev/null
+++ b/gnu/packages/patches/rust-nettle-disable-vendor.patch
@@ -0,0 +1,13 @@ 
+Subject: nettle: clear out "vendored" feature cruft from build.rs
+From: Daniel Kahn Gillmor's avatarDaniel Kahn Gillmor <dkg@fifthhorseman.net>
+
+https://salsa.debian.org/rust-team/debcargo-conf/-/commit/b608e6beaa1d38c14fc16ad53780d94954a91900
+https://sources.debian.org/src/rust-nettle/7.0.0-1/debian/patches/disable-vendor.diff/
+--- a/Cargo.toml	1969-12-31 19:00:00.000000000 -0500
++++ b/Cargo.toml	2019-10-23 19:12:01.076181971 -0400
+@@ -35,4 +35,4 @@
+ version = "1"
+ 
+ [features]
+-vendored = ["nettle-sys/vendored"]
++vendored = []