From patchwork Wed May 26 03:57:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Antero Mejr X-Patchwork-Id: 29608 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 51B4427BC81; Wed, 26 May 2021 18:43:43 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 5F56227BC78 for ; Wed, 26 May 2021 18:43:42 +0100 (BST) Received: from localhost ([::1]:60556 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llxZE-0000Rd-Br for patchwork@mira.cbaines.net; Wed, 26 May 2021 13:43:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44124) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llujS-0000Bc-W9 for guix-patches@gnu.org; Wed, 26 May 2021 10:42:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:38161) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llujS-0000EP-MA for guix-patches@gnu.org; Wed, 26 May 2021 10:42:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1llujS-0000FF-Jx for guix-patches@gnu.org; Wed, 26 May 2021 10:42:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48671] [PATCH] Add nitrocli Resent-From: Antero Mejr Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 26 May 2021 14:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 48671 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48671@debbugs.gnu.org Cc: Antero Mejr X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.1622040073832 (code B ref -1); Wed, 26 May 2021 14:42:02 +0000 Received: (at submit) by debbugs.gnu.org; 26 May 2021 14:41:13 +0000 Received: from localhost ([127.0.0.1]:49695 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lluic-0000DE-FC for submit@debbugs.gnu.org; Wed, 26 May 2021 10:41:12 -0400 Received: from lists.gnu.org ([209.51.188.17]:42342) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1llkgt-00047b-8G for submit@debbugs.gnu.org; Tue, 25 May 2021 23:58:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59588) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llkgs-00067t-Is for guix-patches@gnu.org; Tue, 25 May 2021 23:58:42 -0400 Received: from mout-p-201.mailbox.org ([80.241.56.171]:61310) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1llkgn-0005Zf-Vs for guix-patches@gnu.org; Tue, 25 May 2021 23:58:41 -0400 Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4Fqccm5YztzQk36; Wed, 26 May 2021 05:58:32 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kodmin.com; s=MBO0001; t=1622001508; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AHUIAXFhleyMbljUbVsXkdK4KJkS52BmUtUtu01Vj6M=; b=v6o/2KAYVn5dO+wZQKHBwICyH+fYPkfyggylZmNsxyh3nYLAjnFvjbI6rU7gxp/GPCLdde jVORo/ofOA6FvnCxYGWJM6K51rRmeLCI+mpg0aV3SZcQEvW48gETXzFW9ZX9N62uF4uq7r nMytr7l1Q8Ib8bfeAvrCKvZWzIXQDlVrQO+als60wv6HgD6wKMtqkUifCVzvzgH7EQykdQ KIi2N65mFaxqwWAhbQG1PZgr0wwleWDp5uYBI9PTjjiMMmdUxlDYPRNFlUv42mjHl6dhZ6 TFQLgWU3d24xGPkTGFXs5igjtdDSPOIe3oah/9CFb3Dj/8MOURhirk5GhgLDzA== Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter03.heinlein-hosting.de (spamfilter03.heinlein-hosting.de [80.241.56.117]) (amavisd-new, port 10030) with ESMTP id LAiw1z-ltqsE; Wed, 26 May 2021 05:58:26 +0200 (CEST) From: Antero Mejr Date: Tue, 25 May 2021 23:57:55 -0400 Message-Id: <20210526035755.79632-1-antero@kodmin.com> MIME-Version: 1.0 X-MBO-SPAM-Probability: X-Rspamd-Score: -5.77 / 15.00 / 15.00 X-Rspamd-Queue-Id: CFF0117E8 X-Rspamd-UID: c673be Received-SPF: pass client-ip=80.241.56.171; envelope-from=antero@kodmin.com; helo=mout-p-201.mailbox.org X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 26 May 2021 10:41:08 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Wed, 26 May 2021 13:35:08 -0400 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches --- Tested using a Purism Key. Has new package definitions for some updated crate dependencies like rust-structopt-0.3.21, I can update the main definition if that is preferred. gnu/packages/crates-io.scm | 247 ++++++++++++++++++++++++++++++++ gnu/packages/security-token.scm | 46 ++++++ 2 files changed, 293 insertions(+) diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm index 318b2c695b..5440c5cd79 100644 --- a/gnu/packages/crates-io.scm +++ b/gnu/packages/crates-io.scm @@ -15,6 +15,7 @@ ;;; Copyright © 2021 aecepoglu ;;; Copyright © 2021 Zheng Junjie <873216071@qq.com> ;;; Copyright © 2021 Alexandru-Sergiu Marton +;;; Copyright © 2021 Antero Mejr ;;; ;;; This file is part of GNU Guix. ;;; @@ -3702,6 +3703,24 @@ trace (backtrace) at runtime in a Rust program.") (license (list license:asl2.0 license:expat)))) +(define-public rust-base32-0.4 + (package + (name "rust-base32") + (version "0.4.0") + (source + (origin + (method url-fetch) + (uri (crate-uri "base32" version)) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "1ykwx8jhksqxghfgyw2pzikzjf4n9wqm1x2ww5wqyn68ssf6dki3")))) + (build-system cargo-build-system) + (home-page "https://github.com/andreasots/base32") + (synopsis "Base32 encoder/decoder for Rust") + (description "Base32 encoder/decoder for Rust") + (license (list license:asl2.0 license:expat)))) + (define-public rust-base58-0.1 (package (name "rust-base58") @@ -13308,6 +13327,29 @@ variables.") "Environment variables utility functions.") (license license:asl2.0))) +(define-public rust-envy-0.4 + (package + (name "rust-envy") + (version "0.4.2") + (source + (origin + (method url-fetch) + (uri (crate-uri "envy" version)) + (file-name + (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "0rar459p7pl19v6pbx98q3hi2hxfl8q1ndxxw5d4zd9cgway0irz")))) + (build-system cargo-build-system) + (arguments + `(#:cargo-inputs + (("rust-serde" ,rust-serde-1)))) + (home-page "https://github.com/softprops/envy") + (synopsis "deserialize env vars into typesafe structs") + (description + "deserialize env vars into typesafe structs") + (license license:expat))) + (define-public rust-erased-serde-0.3 (package (name "rust-erased-serde") @@ -23390,6 +23432,47 @@ for Rust structs.") (sha256 (base32 "13ir50j549gdz94pds1i7ljnk14d66q5x91s11hncm1pih7jif8c")))))) +(define-public rust-merge-0.1 + (package + (name "rust-merge") + (version "0.1.0") + (source + (origin + (method url-fetch) + (uri (crate-uri "merge" version)) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "1sck0vhi9lk8a6mgky0rgn842fj7yspywidwbd963nmimf9yzfqh")))) + (build-system cargo-build-system) + (arguments + `(#:cargo-inputs + (("rust-merge-derive" ,rust-merge-derive-0.1) + ("rust-num-traits" ,rust-num-traits-0.2)))) + (home-page "https://git.sr.ht/~ireas/merge-rs") + (synopsis "Merge multiple values into one") + (description "Merge multiple values into one") + (license (list license:asl2.0 license:expat)))) + +(define-public rust-merge-derive-0.1 + (package + (name "rust-merge-derive") + (version "0.1.0") + (source + (origin + (method url-fetch) + (uri (crate-uri "merge_derive" version)) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 "01wxhi7mqmp34l540wcfb24hb13vcbps4wlynas66bnsfra0g790")))) + (build-system cargo-build-system) + (home-page + "https://git.sr.ht/~ireas/merge-rs/tree/master/merge_derive") + (synopsis "Derive macro for merge crate") + (description "This crate provides a derive macro for the +merge::Merge crate. See the merge crate for more information.") + (license (list license:asl2.0 license:expat)))) + (define-public rust-merlin-2 (package (name "rust-merlin") @@ -25107,6 +25190,94 @@ selectors. You can use the jQuery-like syntax to query and manipulate an HTML document quickly.") (license (list license:expat license:asl2.0)))) +(define-public rust-nitrokey-0.9 + (package + (name "rust-nitrokey") + (version "0.9.0") + (source + (origin + (method url-fetch) + (uri (crate-uri "nitrokey" version)) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "0c8mj52ckvy1311vwxs6jpw16b2bihp5cc811isb96j9slcjvsyx")))) + (build-system cargo-build-system) + (arguments + `(#:cargo-inputs + (("rust-lazy_static" ,rust-lazy-static-1) + ("rust-libc" ,rust-libc-0.2) + ("rust-nitrokey-sys" ,rust-nitrokey-sys-3) + ("rust-rand_core" ,rust-rand-core-0.5)))) + (home-page "https://git.sr.ht/~ireas/nitrokey-rs") + (synopsis "Rust bindings to libnitrokey") + (description + "Bindings to libnitrokey for communication with Nitrokey devices") + (license license:expat))) + +(define-public rust-nitrokey-sys-3 + (package + (name "rust-nitrokey-sys") + (version "3.6.0") + (source + (origin + (method url-fetch) + (uri (crate-uri "nitrokey-sys" version)) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "08c3lnb8iqx000jd5rzvrdvv4ihjyw3x3s8q11dw56is0nmjyvws")))) + (build-system cargo-build-system) + (home-page "https://git.sr.ht/~ireas/nitrokey-sys-rs") + (synopsis "Low-level Rust bindings for libnitrokey") + (description + "Low-level bindings to libnitrokey for communication with +Nitrokey devices") + (license license:lgpl3))) + +(define-public rust-nitrokey-test-0.5 + (package + (name "rust-nitrokey-test") + (version "0.5.0") + (source + (origin + (method url-fetch) + (uri (crate-uri "nitrokey-test" version)) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "197j9r2s4ydzbqfydza6v31mgcsgd29jpidz4psqawjdm49f8lg6")))) + (build-system cargo-build-system) + (arguments + `(#:cargo-inputs + (("rust-proc-macro2" ,rust-proc-macro2-1) + ("quote" ,rust-quote-1) + ("syn" ,rust-syn-1)))) + (home-page "https://github.com/d-e-s-o/nitrokey-test") + (synopsis "Supporting test infrastructure for the nitrokey crate") + (description + "Supporting test infrastructure for the nitrokey crate and others +using it.") + (license license:gpl3+))) + +(define-public rust-nitrokey-test-state-0.1 + (package + (name "rust-nitrokey-test-state") + (version "0.1.0") + (source + (origin + (method url-fetch) + (uri (crate-uri "nitrokey-test-state" version)) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "00w817kl8q3sna924pzl72ybqljny14rdv1ixlj288fmsqp776x5")))) + (build-system cargo-build-system) + (home-page "https://github.com/d-e-s-o/nitrokey-test") + (synopsis "State required and used by the nitrokey-test crate") + (description "State required and used by the nitrokey-test crate.") + (license license:gpl3+))) + (define-public rust-nix-0.20 (package (name "rust-nix") @@ -30203,6 +30374,28 @@ macro use case.") @code{proc_macro_derive} pretend to be @code{proc_macro}.") (license (list license:expat license:asl2.0)))) +(define-public rust-progressing-3 + (package + (name "rust-progressing") + (version "3.0.2") + (source + (origin + (method url-fetch) + (uri (crate-uri "progressing" version)) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "06sb1cxpkc8lx56s76c95cfljs0513nsnn35wd6w79sblwcxpdwp")))) + (build-system cargo-build-system) + (arguments + `(#:cargo-inputs + (("log" ,rust-log-0.4)))) + (home-page "https://github.com/dominicparga/progressing") + (synopsis "A counting progress-bar for Rust") + (description + "A lightweight, text-based, counting progress-bar for Rust") + (license license:asl2.0))) + (define-public rust-progrs-0.1 (package (name "rust-progrs") @@ -40394,6 +40587,32 @@ and Jaro-Winkler.") "Parse command line argument by defining a struct.") (license (list license:asl2.0 license:expat)))) +(define-public rust-structopt-0.3.21 + (package + (name "rust-structopt") + (version "0.3.21") + (source + (origin + (method url-fetch) + (uri (crate-uri "structopt" version)) + (file-name + (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "136j0lvjmpv5syi751vxg8vb30gfyv4k81x8d18kxrj6xvbsqxsj")))) + (build-system cargo-build-system) + (arguments + `(#:skip-build? #t + #:cargo-inputs + (("rust-structopt-derive" ,rust-structopt-derive-0.4.14) + ("rust-lazy-static" ,rust-lazy-static-1) + ("rust-clap" ,rust-clap-2)))) + (home-page "https://github.com/TeXitoi/structopt") + (synopsis "Parse command line argument by defining a struct") + (description + "Parse command line argument by defining a struct.") + (license (list license:asl2.0 license:expat)))) + (define-public rust-structopt-0.2 (package (name "rust-structopt") @@ -40446,6 +40665,34 @@ and Jaro-Winkler.") "Parse command line argument by defining a struct, derive crate.") (license (list license:asl2.0 license:expat)))) +(define-public rust-structopt-derive-0.4.14 + (package + (name "rust-structopt-derive") + (version "0.4.14") + (source + (origin + (method url-fetch) + (uri (crate-uri "structopt-derive" version)) + (file-name + (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "143gjwvz3s86hwp070km83y25n8kqp5f01kb1dr19f4ilkywvaav")))) + (build-system cargo-build-system) + (arguments + `(#:skip-build? #t + #:cargo-inputs + (("rust-heck" ,rust-heck-0.3) + ("rust-proc-macro-error" ,rust-proc-macro-error-1) + ("rust-proc-macro2" ,rust-proc-macro2-1) + ("rust-syn" ,rust-syn-1) + ("rust-quote" ,rust-quote-1)))) + (home-page "https://github.com/TeXitoi/structopt") + (synopsis "Parse command line argument by defining a struct, derive crate") + (description + "Parse command line argument by defining a struct, derive crate.") + (license license:asl2.0))) + (define-public rust-structopt-derive-0.2 (package (name "rust-structopt-derive") diff --git a/gnu/packages/security-token.scm b/gnu/packages/security-token.scm index dfa43bb2bf..3a297cda2b 100644 --- a/gnu/packages/security-token.scm +++ b/gnu/packages/security-token.scm @@ -9,6 +9,7 @@ ;;; Copyright © 2018, 2019 Chris Marusich ;;; Copyright © 2018 Arun Isaac ;;; Copyright © 2020 Raphaël Mélotte +;;; Copyright © 2021 Antero Mejr ;;; ;;; This file is part of GNU Guix. ;;; @@ -32,6 +33,7 @@ #:use-module (guix download) #:use-module (guix gexp) #:use-module (guix git-download) + #:use-module (guix build-system cargo) #:use-module (guix build-system gnu) #:use-module (guix build-system glib-or-gtk) #:use-module (guix build-system python) @@ -39,6 +41,7 @@ #:use-module (gnu packages base) #:use-module (gnu packages curl) #:use-module (gnu packages check) + #:use-module (gnu packages crates-io) #:use-module (gnu packages docbook) #:use-module (gnu packages documentation) #:use-module (gnu packages dns) @@ -674,3 +677,46 @@ that after installing this package, you might still need to add appropriate udev rules to your system configuration to be able to configure the YubiKey as an unprivileged user.") (license license:bsd-2))) + +(define-public nitrocli + (package + (name "nitrocli") + (version "0.4.1") + (source (origin + (method url-fetch) + (uri (crate-uri "nitrocli" version)) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "1djspfvcqjipg17v8hkph8xrhkdg1xqjhq5jk1sr8vr750yavidy")))) + (build-system cargo-build-system) + (arguments + `(#:tests? #f ;; 2/164 tests fail, nitrocli-ext tests failing + #:cargo-inputs + (("rust-anyhow" ,rust-anyhow-1) + ("rust-base32" ,rust-base32-0.4) + ("rust-directories" ,rust-directories-3) + ("rust-envy" ,rust-envy-0.4) + ("rust-libc-0.2" ,rust-libc-0.2) + ("rust-merge" ,rust-merge-0.1) + ("rust-nitrokey" ,rust-nitrokey-0.9) + ("rust-progressing" ,rust-progressing-3) + ("rust-serde" ,rust-serde-1) + ("rust-structopt" ,rust-structopt-0.3.21) + ("rust-termion" ,rust-termion-1) + ("rust-toml" ,rust-toml-0.5)) + #:cargo-development-inputs + (("rust-nitrokey-test" ,rust-nitrokey-test-0.5) + ("rust-nitrokey-test-state" ,rust-nitrokey-test-state-0.1) + ("rust-regex" ,rust-regex-1) + ("rust-tempfile" ,rust-tempfile-3)))) + (inputs + `(("hidapi" ,hidapi) + ("gnupg" ,gnupg))) + (home-page "https://github.com/d-e-s-o/nitrocli") + (synopsis "Command line tool for Nitrokey devices") + (description + "nitrocli is a program that provides a command line interface +for interaction with Nitrokey Pro, Nitrokey Storage, and Librem Key +devices.") + (license license:gpl3+)))