unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: phodina via Guix-patches via <guix-patches@gnu.org>
To: Maxime Devos <maximedevos@telenet.be>
Cc: 53815@debbugs.gnu.org
Subject: [bug#53815] [PATCH v2 1/3] gnu: Add libnitrokey
Date: Wed, 09 Feb 2022 09:53:24 +0000	[thread overview]
Message-ID: <nXtj4DXcwJB4Dkbq96hfhz4kNRmdwMlmKFEK6umdxgD6IrTTdPtC-ZaPbr-T9GjZTPkxbjC0X11p6PY49TtJPxMQ68YHQL1hlHgCuXj1gdc=@protonmail.com> (raw)
In-Reply-To: <O8g3D7YkTUCb-cDXBL5FknF3N8cAgooY1_nOIZU_TWlgqPhHroI23xt4r0EK2thB4RukL1WQiSKzpBewkMOdMexMa2qbqI1JUVmdUk7Wk64=@protonmail.com>

[-- Attachment #1: Type: text/plain, Size: 2138 bytes --]

Hi Maxime,

> phodina via Guix-patches via schreef op zo 06-02-2022 om 07:46 [+0000]:
>
> > +    (license license:lgpl3)))
>
> Looking at
>
> https://github.com/Nitrokey/libnitrokey/blob/master/NK_C_API.cc, the
>
> license appears to be LGPL3+, even though the README just says LGPL3.
>
> Possibly that's only for NK_C_API.cc though (unverified).
>

I've checked the code and there is only one change in the license recently but the commit itself is little bit misleading as it has different versions in LICENSE and README.md. There is now a ticket with this question. In the meantime I followed the LICENSE file.

https://github.com/Nitrokey/libnitrokey/issues/211

> +              (snippet '(begin
> +                          (delete-file-recursively "hidapi")))

> Does this have any effect? Looking at
> <https://github.com/Nitrokey/libnitrokey>, it looks like 'hidapi' is a
> git submodule, which would normally not be included in the checkout
> because 'recursive?' has not been found.

> If it does have any effect, then wouldn't "tests/catch" in cppcodec
> need to be removed as well?

You are right, I thought to unbundle just in case all the code but here it's just submodule and it's not cloned.

-- Found PkgConfig: /gnu/store/2b3blhwbag1ial0dhxw7wh4zjxl0cqpk-pkg-config-0.29.2/bin/pkg-config (found version "0.29.2")
-- Found system Catch2, not using bundled version

The Guix libraries are used correctly without any need for manual intervention.

> I'm seeing a lot of tests at <https://github.com/Nitrokey/libnitrokey/tree/master/unittest>.

You're right. This is my mistake as I only saw the tests that require HW token. Now I've enabled the offline tests.


> While the information about being header-only is useful for people
> looking to bundle a dependency in their source code, it seems
> irrelevant to people using cppcodec via Guix.

I've removed this information (FIY I'm C++ programmer so I thought it might be useful :-)
Also the tests for ccpcodec are now enabled.

The patches in the attachment have been rebase to latest master.


----
Petr





[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: v2-0001-gnu-Add-libnitrokey.patch --]
[-- Type: text/x-patch; name=v2-0001-gnu-Add-libnitrokey.patch, Size: 1945 bytes --]

From 5f01b5d21f688d9725532f35067e92c49ab423b4 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Sat, 5 Feb 2022 23:25:44 +0100
Subject: [PATCH v2 1/3] gnu: Add libnitrokey.

* gnu/packages/security-token.scm (libnitrokey): New variable.

diff --git a/gnu/packages/security-token.scm b/gnu/packages/security-token.scm
index 8190e1e1e2..7ea19b13a2 100644
--- a/gnu/packages/security-token.scm
+++ b/gnu/packages/security-token.scm
@@ -15,6 +15,7 @@
 ;;; Copyright © 2021 Dhruvin Gandhi <contact@dhruvin.dev>
 ;;; Copyright © 2021 Ahmad Jarara <git@ajarara.io>
 ;;; Copyright © 2022 John Kehayias <john.kehayias@protonmail.com>
+;;; Copyright © 2022 Petr Hodina <phodina@protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -723,6 +724,30 @@ (define-public python-yubikey-manager
 an unprivileged user.")
     (license license:bsd-2)))
 
+(define-public libnitrokey
+  (package
+    (name "libnitrokey")
+    (version "3.6")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/Nitrokey/libnitrokey")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0ngrvv61d36vvfwrfg0qxmp2wg18v4aaldwvwzgxvwaysjswhn9r"))))
+    (build-system cmake-build-system)
+    (arguments
+	  ;; These tests do not require any device to be connected
+     '(#:configure-flags (list "-DCOMPILE_OFFLINE_TESTS=ON")))
+    (native-inputs (list catch-framework2 doxygen graphviz pkg-config))
+    (inputs (list hidapi libusb))
+    (home-page "https://github.com/Nitrokey/libnitrokey")
+    (synopsis "Communication library for Nitrokey")
+    (description "This packate provides communication library for Nitrokey.")
+    (license license:lgpl3+)))
+
 (define-public nitrocli
   (package
     (name "nitrocli")
-- 
2.34.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: v2-0003-gnu-Add-nitrokey-app.patch --]
[-- Type: text/x-patch; name=v2-0003-gnu-Add-nitrokey-app.patch, Size: 1710 bytes --]

From e340d972a40667e693302ddc63354d1ed8b36e6e Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Sat, 5 Feb 2022 23:27:06 +0100
Subject: [PATCH v2 3/3] gnu: Add nitrokey-app.

* gnu/packages/crates-io.scm (nitrokey-app): New variable.

diff --git a/gnu/packages/security-token.scm b/gnu/packages/security-token.scm
index 998b9ae36e..14085c0bc7 100644
--- a/gnu/packages/security-token.scm
+++ b/gnu/packages/security-token.scm
@@ -772,6 +772,36 @@ (define-public cppcodec
 base64url, base32, base32hex and hex.")
     (license license:expat)))
 
+(define-public nitrokey-app
+  (package
+    (name "nitrokey-app")
+    (version "1.4.2")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/Nitrokey/nitrokey-app")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1imbvaf0yncz36ckjr99x94jwg2hnid49hsiqlxsv7ccxgk058bk"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f)) ;no test suite
+    (native-inputs (list pkg-config qttools))
+    (inputs (list cppcodec
+                  hidapi
+                  libnitrokey
+                  libusb
+                  qtbase-5
+                  qtsvg))
+    (home-page "https://github.com/Nitrokey/nitrokey-app")
+    (synopsis "GUI tool for Nitrokey devices")
+    (description
+     "This package provides GUI tool that interfaces with Nitrokey Pro
+v0.7/v0.8 and Nitrokey Storage devices.")
+    (license license:gpl3+)))
+
 (define-public nitrocli
   (package
     (name "nitrocli")
-- 
2.34.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: v2-0002-gnu-Add-cppcodec.patch --]
[-- Type: text/x-patch; name=v2-0002-gnu-Add-cppcodec.patch, Size: 1619 bytes --]

From d44b13f8c44491a521bfaa73a414586f6f59ca37 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Sat, 5 Feb 2022 23:26:36 +0100
Subject: [PATCH v2 2/3] gnu: Add cppcodec.

* gnu/packages/crates-io.scm (cppcodec): New variable.

diff --git a/gnu/packages/security-token.scm b/gnu/packages/security-token.scm
index 7ea19b13a2..998b9ae36e 100644
--- a/gnu/packages/security-token.scm
+++ b/gnu/packages/security-token.scm
@@ -748,6 +748,30 @@ (define-public libnitrokey
     (description "This packate provides communication library for Nitrokey.")
     (license license:lgpl3+)))
 
+(define-public cppcodec
+  (package
+    (name "cppcodec")
+    (version "0.2")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/tplgy/cppcodec")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0z39f8w0zvra874az0f67ck1al9kbpaidpilggbl8jnfs05010ck"))))
+    (build-system cmake-build-system)
+    (arguments
+     '(#:configure-flags (list "-DBUILD_TESTING=on")))
+    (native-inputs (list pkg-config qttools))
+    (inputs (list catch-framework2))
+    (home-page "https://github.com/tplgy/cppcodec")
+    (synopsis "Header library to encode/decode base64, base64url, etc.")
+    (description "This package provides library to encode/decode base64,
+base64url, base32, base32hex and hex.")
+    (license license:expat)))
+
 (define-public nitrocli
   (package
     (name "nitrocli")
-- 
2.34.0


  parent reply	other threads:[~2022-02-09  9:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-06  7:46 [bug#53815] [PATCH 1/3] gnu: Add libnitrokey phodina via Guix-patches via
2022-02-06  9:33 ` Maxime Devos
2022-02-06  9:34 ` Maxime Devos
2022-02-06  9:36 ` Maxime Devos
2022-02-06  9:38 ` Maxime Devos
2022-02-09  9:53 ` phodina via Guix-patches via [this message]
2022-02-14 14:52   ` bug#53815: " Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='nXtj4DXcwJB4Dkbq96hfhz4kNRmdwMlmKFEK6umdxgD6IrTTdPtC-ZaPbr-T9GjZTPkxbjC0X11p6PY49TtJPxMQ68YHQL1hlHgCuXj1gdc=@protonmail.com' \
    --to=guix-patches@gnu.org \
    --cc=53815@debbugs.gnu.org \
    --cc=maximedevos@telenet.be \
    --cc=phodina@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).