diff mbox

[4/6] gnu: Add gpgscm.

Message ID 87lh0z97jm.fsf@we.make.ritual.n0.is
State New
Headers show

Commit Message

non such July 17, 2016, 11:19 p.m. UTC
Whoever wants to fix how this looks in code can change it before
commit, like it is now it works and serves its purpose (run the
gnupg tests).
Commented parts included for people who want to make it smaller,
if you make it smaller in size the code size on our side will
grow.

From 6babb18479de83bd19c44412c7957918d2c917b2 Mon Sep 17 00:00:00 2001
From: ng0 <ng0@we.make.ritual.n0.is>
Date: Sun, 17 Jul 2016 22:11:41 +0000
Subject: [PATCH 4/6] gnu: Add gpgscm.

* gnu/packages/gnupg.scm (gpgscm): New variable.
---
 gnu/packages/gnupg.scm | 107 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 107 insertions(+)

--
2.9.1


--
♥Ⓐ  ng0
For non-prism friendly talk find me on http://www.psyced.org
SecuShare – http://secushare.org

Comments

Ludovic Courtès July 18, 2016, 12:35 p.m. UTC | #1
Hello!

ng0 <ng0@we.make.ritual.n0.is> skribis:

> From 6babb18479de83bd19c44412c7957918d2c917b2 Mon Sep 17 00:00:00 2001
> From: ng0 <ng0@we.make.ritual.n0.is>
> Date: Sun, 17 Jul 2016 22:11:41 +0000
> Subject: [PATCH 4/6] gnu: Add gpgscm.
>
> * gnu/packages/gnupg.scm (gpgscm): New variable.

[...]

> +    (home-page "https://gnupg.org/")
> +    (synopsis "tinyscheme implementation used by The GNU Privacy Guard")

I’ve seen some of the discussions on IRC about gpgscm.  However, it’s
not clear to me why we should make it a separate package.  AIUI, it’s
meant as a purely GnuPG-internal tool, and as such it may evolve in
lockstep with the rest of the GnuPG code base.

So I’d be tempted to keep it internal to GnuPG, unless upstream decides
to make it a separate package (which seems unlikely; it may be come part
of libgpg-error, though.)

WDYT?

Thanks,
Ludo’.
non such July 18, 2016, 2:10 p.m. UTC | #2
Hi,

Ludovic Courtès writes:

> Hello!
>
> ng0 <ng0@we.make.ritual.n0.is> skribis:
>
>> From 6babb18479de83bd19c44412c7957918d2c917b2 Mon Sep 17 00:00:00 2001
>> From: ng0 <ng0@we.make.ritual.n0.is>
>> Date: Sun, 17 Jul 2016 22:11:41 +0000
>> Subject: [PATCH 4/6] gnu: Add gpgscm.
>>
>> * gnu/packages/gnupg.scm (gpgscm): New variable.
>
> [...]
>
>> +    (home-page "https://gnupg.org/")
>> +    (synopsis "tinyscheme implementation used by The GNU Privacy Guard")
>
> I’ve seen some of the discussions on IRC about gpgscm.  However, it’s
> not clear to me why we should make it a separate package.  AIUI, it’s
> meant as a purely GnuPG-internal tool, and as such it may evolve in
> lockstep with the rest of the GnuPG code base.
>
> So I’d be tempted to keep it internal to GnuPG, unless upstream decides
> to make it a separate package (which seems unlikely; it may be come part
> of libgpg-error, though.)
>
> WDYT?
>
> Thanks,
> Ludo’.

I'm not familiar with all the short words being used all the
time. What is AIUI? "As I understand it"?


I think I forgot to add more descriptions above this patch and
the gnupg one.

It should've read:

This is a not very pleasant, but working hack
to enable building >=gnupg-2.1.14 without wasting much time on
having to built gpgscm in the gnupg package.  Whoever wants to
fix this may step forward and do it, I am done with this as I
need to focus on something else.
This is left intentionally with comments for other people to
improve in case we even use this. Else, someone can improve my
gnupg-2.1.14 patch and make the gpgscm patc obsolete.
non such July 18, 2016, 2:13 p.m. UTC | #3
Upstream discussion thread / statement on gpgscm:
https://lists.gnupg.org/pipermail/gnupg-users/2016-July/056303.html
Leo Famulari July 18, 2016, 5:44 p.m. UTC | #4
On Sun, Jul 17, 2016 at 11:19:41PM +0000, ng0 wrote:
> Whoever wants to fix how this looks in code can change it before
> commit, like it is now it works and serves its purpose (run the
> gnupg tests).
> Commented parts included for people who want to make it smaller,
> if you make it smaller in size the code size on our side will
> grow.

Thank you for beginning this!

It looks as if the gpgscm executable is built in our build phase, and
then used in our check phase. So, I will try patching the shebangs of
the tests in between the build and check phases.
Ludovic Courtès July 19, 2016, 12:53 p.m. UTC | #5
Hello,

ng0 <ng0@we.make.ritual.n0.is> skribis:

> Ludovic Courtès writes:
>
>> Hello!
>>
>> ng0 <ng0@we.make.ritual.n0.is> skribis:
>>
>>> From 6babb18479de83bd19c44412c7957918d2c917b2 Mon Sep 17 00:00:00 2001
>>> From: ng0 <ng0@we.make.ritual.n0.is>
>>> Date: Sun, 17 Jul 2016 22:11:41 +0000
>>> Subject: [PATCH 4/6] gnu: Add gpgscm.
>>>
>>> * gnu/packages/gnupg.scm (gpgscm): New variable.
>>
>> [...]
>>
>>> +    (home-page "https://gnupg.org/")
>>> +    (synopsis "tinyscheme implementation used by The GNU Privacy Guard")
>>
>> I’ve seen some of the discussions on IRC about gpgscm.  However, it’s
>> not clear to me why we should make it a separate package.  AIUI, it’s
>> meant as a purely GnuPG-internal tool, and as such it may evolve in
>> lockstep with the rest of the GnuPG code base.
>>
>> So I’d be tempted to keep it internal to GnuPG, unless upstream decides
>> to make it a separate package (which seems unlikely; it may be come part
>> of libgpg-error, though.)
>>
>> WDYT?
>>
>> Thanks,
>> Ludo’.
>
> I'm not familiar with all the short words being used all the
> time. What is AIUI? "As I understand it"?

Yes; apologies for being cryptic without even noticing!

> I think I forgot to add more descriptions above this patch and
> the gnupg one.
>
> It should've read:
>
> This is a not very pleasant, but working hack
> to enable building >=gnupg-2.1.14 without wasting much time on
> having to built gpgscm in the gnupg package.  Whoever wants to
> fix this may step forward and do it, I am done with this as I
> need to focus on something else.
> This is left intentionally with comments for other people to
> improve in case we even use this. Else, someone can improve my
> gnupg-2.1.14 patch and make the gpgscm patc obsolete.

OK, but what do you think of the comments I made above?

Thanks,
Ludo’.
diff mbox

Patch

diff --git a/gnu/packages/gnupg.scm b/gnu/packages/gnupg.scm
index 444c60a..84bf19c 100644
--- a/gnu/packages/gnupg.scm
+++ b/gnu/packages/gnupg.scm
@@ -205,6 +205,113 @@  implementation.  This allows the use of libraries which are not
 compatible to GNU Pth.")
     (license (list license:lgpl3+ license:gpl2+)))) ; dual license

+;; This is used by >=gnupg-2.1.14 for the test suite.
+;; This package becomes obsolete once they will move gpgscm
+;; outside of GnuPG source.
+(define-public gpgscm
+  (package
+    (name "gpgscm")
+    (version "2.1.14")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://gnupg/gnupg/gnupg-" version
+                           ".tar.bz2"))
+       (file-name (string-append name "-" version ".tar.bz2"))
+       (sha256
+        (base32
+         "0hmsiscpdpdqd8kcjpzkz2gzcc3cnrvswk9p1jzi4sivd7lxwl4l"))))
+       ;; (modules '((guix build utils)))
+       ;; (snippet
+       ;;  '(begin
+       ;;     ;; Strip gnupg down to gpgscm + shared libs.
+       ;;     (for-each delete-file-recursively
+       ;;               '(;;"agent" "dirmngr" ;;"kbx"
+       ;;                 ;;"scd" "doc" ;;"sm"
+       ;;                 "tests/openpgp"
+       ;;                 "tests/pkits"
+       ;;                 "tests/migrations"
+       ;;                 "tests/samplekeys"))))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (inputs
+     `(("adns" ,adns)
+       ("bzip2" ,bzip2)
+       ("curl" ,curl)
+       ("gnutls" ,gnutls)
+       ("libassuan" ,libassuan)
+       ("libgcrypt" ,libgcrypt)
+       ("libgpg-error" ,libgpg-error)
+       ("libksba" ,libksba)
+       ("npth" ,npth)
+       ("openldap" ,openldap)
+       ("readline" ,readline)
+       ("sqlite" ,sqlite)
+       ("zlib" ,zlib)))
+   (arguments
+    `(#:phases
+      (modify-phases %standard-phases
+        (add-before 'configure 'patch-tests-makefile
+          (lambda _
+            (substitute* "tests/Makefile.am"
+              (("/bin/pwd") (which "pwd")))))
+        ;; (add-before 'configure 'delete-excluded-Makefiles
+        ;;   (lambda _
+        ;;     (substitute* "configure.ac"
+        ;;       ;;(("kbx/Makefile") "")
+        ;;       ;;(("sm/Makefile") "")
+        ;;       ;; (("agent/Makefile") "")
+        ;;       ;; (("scd/Makefile") "")
+        ;;       ;; (("dirmngr/Makefile") "")
+        ;;       ;; (("doc/Makefile") "")
+        ;;       (("tests/opengpg/Makefile") "")
+        ;;       (("tests/pkits") "")
+        ;;       (("tests/migrations") "")
+        ;;       (("tests/samplekeys") ""))))
+        (replace 'install
+          (lambda* (#:key outputs #:allow-other-keys)
+            (let* ((out (assoc-ref outputs "out"))
+                   (bin (string-append out "/bin"))
+                   (inc (string-append out "/include"))
+                   (doc (string-append out "/share/doc/gpgscm")))
+              (install-file "tests/gpgscm/gpgscm" bin)
+              (install-file "common/util.h" inc)
+              (install-file "common/exechelp.h" inc)
+              (install-file "common/sysutils.h" inc)
+              (install-file "tests/gpgscm/private.h" inc)
+              (install-file "tests/gpgscm/ffi.h" inc)
+              (install-file "tests/gpgscm/ffi-private.h" inc)
+              (install-file "tests/gpgscm/scheme.h" inc)
+              (install-file "common/i18n.h" inc)
+              (install-file "common/argparse.h" inc)
+              (install-file "common/init.h" inc)
+              (install-file "common/logging.h" inc)
+              (install-file "common/strlist.h" inc)
+              (install-file "tests/gpgscm/scheme-private.h" inc)
+              (install-file "common/dynload.h" inc)
+              (install-file "NEWS" doc)
+              (install-file "AUTHORS" doc)
+              (install-file "ChangeLog" doc)
+              (install-file "THANKS" doc)
+              (install-file "README" doc)
+              (install-file "tests/gpgscm/Manual.txt" doc))
+            #t)))
+      #:tests? #f ;; no tests for gpgscm
+      ))
+    (home-page "https://gnupg.org/")
+    (synopsis "tinyscheme implementation used by The GNU Privacy Guard")
+    (description
+     "The GNU Privacy Guard is a complete implementation of the OpenPGP
+standard.  It is used to encrypt and sign data and communication.  It
+features powerful key management and the ability to access public key
+servers.  It includes several libraries: libassuan (IPC between GnuPG
+components), libgpg-error (centralized GnuPG error values), and
+libskba (working with X.509 certificates and CMS data).")
+    (license license:gpl3+)
+    (properties '((ftp-server . "ftp.gnupg.org")
+                  (ftp-directory . "/gcrypt/gnupg")))))
+
 (define-public gnupg
   (package
     (name "gnupg")