sharlatan pushed a commit to branch go-team
in repository guix.

commit 8b17b0400ba027db44ca2525083cc7db9f570fb3
Author: Sharlatan Hellseher <sharlata...@gmail.com>
AuthorDate: Mon Feb 24 17:41:06 2025 +0000

    gnu: Add go-github-com-miekg-pkcs11.
    
    * gnu/packages/golang-crypto.scm: Add (gnu packages security-token).
    (go-github-com-miekg-pkcs11): New variable.
    
    Change-Id: I4319b03008e145f0a4a0a175df14d10f9cb56879
---
 gnu/packages/golang-crypto.scm | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/gnu/packages/golang-crypto.scm b/gnu/packages/golang-crypto.scm
index 8daa82517a..8539992da0 100644
--- a/gnu/packages/golang-crypto.scm
+++ b/gnu/packages/golang-crypto.scm
@@ -60,6 +60,7 @@
   #:use-module (gnu packages golang-web)
   #:use-module (gnu packages golang-xyz)
   #:use-module (gnu packages password-utils)
+  #:use-module (gnu packages security-token)
   #:use-module (gnu packages specifications))
 
 ;;; Commentary:
@@ -1565,6 +1566,40 @@ library's internal ChaCha20 package.")
 the Go standard library's TLS 1.3 implementation.")
     (license license:bsd-3)))
 
+(define-public go-github-com-miekg-pkcs11
+  (package
+    (name "go-github-com-miekg-pkcs11")
+    (version "1.1.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/miekg/pkcs11";)
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1w403kmqxf8w25aap4901nrm7wj0wf95lrwwv1nvdjnwi8jjgapz"))))
+    (build-system go-build-system)
+    (arguments
+     (list
+      #:import-path "github.com/miekg/pkcs11"
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-before 'check 'pre-check
+            (lambda _
+              (setenv "SOFTHSM_LIB" (format #f "~a/lib/softhsm/libsofthsm2.so"
+                                            #$(this-package-native-input 
"softhsm"))))))))
+    (native-inputs
+     (list softhsm))
+    (home-page "https://github.com/miekg/pkcs11";)
+    (synopsis "PKCS #11 wrapper for Golang")
+    (description
+     "This package provides an implementation of the
+@url{https://en.wikipedia.org/wiki/PKCS_11, PKCS#11} API.  It wraps the
+library closely, but uses Go idiom where it makes sense.  It has been tested
+with SoftHSM.")
+    (license license:bsd-3)))
+
 (define-public go-github-com-minio-blake2b-simd
   (let ((commit "3f5f724cb5b182a5c278d6d3d55b40e7f8c2efb4")
         (revision "0"))

Reply via email to