GNU bug report logs - #41078
[PATCH v2 2/3] gnu: Add rust-nettle-sys-2.

Previous Next

Package: guix-patches;

Reported by: Hartmut Goebel <h.goebel <at> crazy-compilers.com>

Date: Mon, 4 May 2020 15:13:02 UTC

Severity: normal

Tags: patch

Done: Jakub Kądziołka <kuba <at> kadziolka.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 41078 in the body.
You can then email your comments to 41078 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#41078; Package guix-patches. (Mon, 04 May 2020 15:13:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Hartmut Goebel <h.goebel <at> crazy-compilers.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 04 May 2020 15:13:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: guix-patches <at> gnu.org,
	40874 <at> debbugs.gnu.org
Cc: Hartmut Goebel <h.goebel <at> crazy-compilers.com>,
 Efraim Flashner <efraim <at> flashner.co.il>
Subject: [PATCH v2 2/3] gnu: Add rust-nettle-sys-2.
Date: Mon,  4 May 2020 17:11:18 +0200
* gnu/packages/crates-io.scm (rust-nettle-sys-2): New variable.
* gnu/packages/patches/rust-nettle-sys-disable-vendor.patch: New file.
* gnu/local.mk: Add it.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/crates-io.scm                    | 31 ++++++++++++
 .../rust-nettle-sys-disable-vendor.patch      | 48 +++++++++++++++++++
 3 files changed, 80 insertions(+)
 create mode 100644 gnu/packages/patches/rust-nettle-sys-disable-vendor.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 9f212434a9..f7ffe75eb3 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-sys-disable-vendor.patch	 \
   %D%/packages/patches/rust-reproducible-builds.patch		 \
   %D%/packages/patches/rust-openssl-sys-no-vendor.patch	\
   %D%/packages/patches/rxvt-unicode-escape-sequences.patch	\
diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index a6dd9a4ef1..16855a8bff 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 nettle)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
@@ -11942,6 +11943,36 @@ types as proposed in RFC 1158.")
     (license (list license:asl2.0
                    license:expat))))
 
+(define-public rust-nettle-sys-2
+  (package
+    (name "rust-nettle-sys")
+    (version "2.0.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "nettle-sys" version))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "1yq1w6dlcmg89x529i7s20j29afdhgim7qnsa7978fszzwrr6qmq"))
+       (patches (search-patches "rust-nettle-sys-disable-vendor.patch"))))
+    (build-system cargo-build-system)
+    (native-inputs
+     `(("clang" ,clang)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("nettle", nettle)))
+    (arguments
+     `(#:skip-build? #t
+       #:cargo-development-inputs
+       (("rust-bindgen" ,rust-bindgen-0.51)
+        ("rust-pkg-config" ,rust-pkg-config-0.3))))
+    (home-page "https://gitlab.com/sequoia-pgp/nettle-sys")
+    (synopsis "Low-level Rust bindings for the Nettle cryptographic library")
+    (description "This package provides low-level Rust bindings for the Nettle
+cryptographic library.")
+    (license ;; licensed under either of these, at your option
+     (list license:lgpl3 license:gpl2 license:gpl3))))
+
 (define-public rust-new-debug-unreachable-1.0
   (package
     (name "rust-new-debug-unreachable")
diff --git a/gnu/packages/patches/rust-nettle-sys-disable-vendor.patch b/gnu/packages/patches/rust-nettle-sys-disable-vendor.patch
new file mode 100644
index 0000000000..ae5ef5ebe0
--- /dev/null
+++ b/gnu/packages/patches/rust-nettle-sys-disable-vendor.patch
@@ -0,0 +1,48 @@
+Subject: nettle-sys: clear out "vendored" feature cruft from build.rs
+From: Daniel Kahn Gillmor's avatarDaniel Kahn Gillmor <dkg <at> fifthhorseman.net>
+
+https://salsa.debian.org/rust-team/debcargo-conf/-/commit/0c71150ad26bb66a8396dcdab055181af232ddc5
+https://sources.debian.org/src/rust-nettle-sys/2.0.4-3/debian/patches/disable-vendor.diff/
+--- a/Cargo.toml	2019-10-23 13:08:07.000000000 -0400
++++ b/Cargo.toml	2019-10-23 14:08:46.644064014 -0400
+@@ -29,12 +29,9 @@
+ version = "0.51.1"
+ default-features = false
+ 
+-[build-dependencies.nettle-src]
+-version = "3.5.1-0"
+-optional = true
+-
+ [build-dependencies.pkg-config]
+ version = "0.3"
+ 
+ [features]
+ vendored = ["nettle-src"]
++nettle-src = []
+diff --git a/build.rs b/build.rs
+index 44f7af3..ede4b2f 100644
+--- a/build.rs
++++ b/build.rs
+@@ -1,7 +1,5 @@
+ extern crate bindgen;
+ extern crate pkg_config;
+-#[cfg(feature = "vendored")]
+-extern crate nettle_src;
+ 
+ use std::env;
+ use std::fs;
+@@ -36,14 +34,6 @@ fn main() {
+     println!("cargo:rerun-if-env-changed=NETTLE_STATIC");
+     println!("cargo:rerun-if-env-changed={}", NETTLE_PREGENERATED_BINDINGS);
+ 
+-    #[cfg(feature = "vendored")]
+-    {
+-        let artifacts = nettle_src::Build::new().build();
+-        println!("cargo:vendored=1");
+-        env::set_var("PKG_CONFIG_PATH",
+-                     artifacts.lib_dir().join("pkgconfig"));
+-    }
+-
+     let nettle = pkg_config::probe_library("nettle hogweed").unwrap();
+ 
+     let mode = match env::var_os("NETTLE_STATIC") {
-- 
2.21.3





bug closed, send any further explanations to 41078 <at> debbugs.gnu.org and Hartmut Goebel <h.goebel <at> crazy-compilers.com> Request was from Jakub Kądziołka <kuba <at> kadziolka.net> to control <at> debbugs.gnu.org. (Fri, 10 Jul 2020 21:17:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 08 Aug 2020 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 255 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.