guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

48/62: gnu: gnutls-3.6.13: Cross-build fix.


From: guix-commits
Subject: 48/62: gnu: gnutls-3.6.13: Cross-build fix.
Date: Sat, 11 Apr 2020 11:35:55 -0400 (EDT)

janneke pushed a commit to branch wip-hurd-vm
in repository guix.

commit ea4af9130be815d19fa8ddfd3043edfdf1291621
Author: Jan (janneke) Nieuwenhuizen <address@hidden>
AuthorDate: Fri Apr 10 07:34:03 2020 +0200

    gnu: gnutls-3.6.13: Cross-build fix.
    
    * gnu/packages/patches/gnutls-cross.patch: New file.
    * gnu/packages/tls.scm (gnutls-3.6.13)[source]: Use it.
    [native-inputs]: If cross-compiling, add native guile-3.0.  This
    actually cross compiles .go modules.
---
 gnu/local.mk                            |  1 +
 gnu/packages/patches/gnutls-cross.patch | 82 +++++++++++++++++++++++++++++++++
 gnu/packages/tls.scm                    | 10 +++-
 3 files changed, 91 insertions(+), 2 deletions(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index 1cecfa7..14cfc83 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1003,6 +1003,7 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/gnome-tweaks-search-paths.patch         \
   %D%/packages/patches/gnupg-default-pinentry.patch            \
   %D%/packages/patches/gnutls-skip-trust-store-test.patch      \
+  %D%/packages/patches/gnutls-cross.patch.patch                        \
   %D%/packages/patches/gobject-introspection-absolute-shlib-path.patch \
   %D%/packages/patches/gobject-introspection-cc.patch          \
   %D%/packages/patches/gobject-introspection-girepository.patch        \
diff --git a/gnu/packages/patches/gnutls-cross.patch 
b/gnu/packages/patches/gnutls-cross.patch
new file mode 100644
index 0000000..82d08da
--- /dev/null
+++ b/gnu/packages/patches/gnutls-cross.patch
@@ -0,0 +1,82 @@
+Not sent upstream.
+
+From e23de62e28f64599148ff06e439fac116a391299 Mon Sep 17 00:00:00 2001
+From: "Jan (janneke) Nieuwenhuizen" <address@hidden>
+Date: Fri, 10 Apr 2020 07:24:48 +0200
+Subject: [PATCH] guile: Cross build fix.
+
+To cross-build, both the host guile and the native guile-for-build
+must be available.  If the native guile is not available, no snarfing
+is done and the guile cross build is skipped.
+
+During the cross-build gnutls.scm does not load when compliling
+extra.scm, becase of missing definitions from guile-gnutls-v-2.
+
+* guile/modules/gnutls.in (protocol/ssl-3 protocol/tls-1.0,
+protocol/tls-1.1, credentials/anonymous, cipher/rijndael-256-cbc,
+cipher/rijndael-128-cbc, cipher/rijndael-cbc, cipher/arcfour-128,
+certificate-verify/allow-any-x509-v1-ca-certificate,
+certificate-verify/allow-x509-v1-ca-certificate): Define to #f
+initially.  When "GNUTLS_GUILE_CROSS_COMPILING" not set, set! to value
+from "guile-gnutls-v-2" load-extension C module.
+---
+ guile/modules/gnutls.in | 40 +++++++++++++++++++++++++++-------------
+ 1 file changed, 27 insertions(+), 13 deletions(-)
+
+diff --git a/guile/modules/gnutls.in b/guile/modules/gnutls.in
+index 6461c404a..954e315de 100644
+--- a/guile/modules/gnutls.in
++++ b/guile/modules/gnutls.in
+@@ -564,22 +564,36 @@ This defines 'variable' as an alias for 'alias', and 
emits a warning when
+                    (identifier? #'id)
+                    #'alias))))))))))
+ 
+-
+ ;; Renaming.
+-(define protocol/ssl-3 protocol/ssl3)
+-(define protocol/tls-1.0 protocol/tls1-0)
+-(define protocol/tls-1.1 protocol/tls1-1)
++(define protocol/ssl-3 #f)
++(define protocol/tls-1.0 #f)
++(define protocol/tls-1.1 #f)
+ 
+ ;; Aliases.
+-(define credentials/anonymous   credentials/anon)
+-(define cipher/rijndael-256-cbc cipher/aes-256-cbc)
+-(define cipher/rijndael-128-cbc cipher/aes-128-cbc)
+-(define cipher/rijndael-cbc     cipher/aes-128-cbc)
+-(define cipher/arcfour-128      cipher/arcfour)
+-(define certificate-verify/allow-any-x509-v1-ca-certificate
+-  certificate-verify/allow-any-x509-v1-ca-crt)
+-(define certificate-verify/allow-x509-v1-ca-certificate
+-  certificate-verify/allow-x509-v1-ca-crt)
++(define credentials/anonymous   #f)
++(define cipher/rijndael-256-cbc #f)
++(define cipher/rijndael-128-cbc #f)
++(define cipher/rijndael-cbc     #f)
++(define cipher/arcfour-128      #f)
++(define certificate-verify/allow-any-x509-v1-ca-certificate #f)
++(define certificate-verify/allow-x509-v1-ca-certificate #f)
++
++(unless (getenv "GNUTLS_GUILE_CROSS_COMPILING")
++  ;; Renaming.
++  (set! protocol/ssl-3 protocol/ssl3)
++  (set! protocol/tls-1.0 protocol/tls1-0)
++  (set! protocol/tls-1.1 protocol/tls1-1)
++
++  ;; Aliases.
++  (set! credentials/anonymous   credentials/anon)
++  (set! cipher/rijndael-256-cbc cipher/aes-256-cbc)
++  (set! cipher/rijndael-128-cbc cipher/aes-128-cbc)
++  (set! cipher/rijndael-cbc     cipher/aes-128-cbc)
++  (set! cipher/arcfour-128      cipher/arcfour)
++  (set! certificate-verify/allow-any-x509-v1-ca-certificate
++    certificate-verify/allow-any-x509-v1-ca-crt)
++  (set! certificate-verify/allow-x509-v1-ca-certificate
++    certificate-verify/allow-x509-v1-ca-crt))
+ 
+ ;; Deprecated OpenPGP bindings.
+ (define-deprecated certificate-type/openpgp)
+-- 
+2.26.0
+
diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm
index 614c50f..0eab6a1 100644
--- a/gnu/packages/tls.scm
+++ b/gnu/packages/tls.scm
@@ -260,10 +260,16 @@ required structures.")
               (uri (string-append "mirror://gnupg/gnutls/v"
                                   (version-major+minor version)
                                   "/gnutls-3.6.13.tar.xz"))
-              (patches (search-patches "gnutls-skip-trust-store-test.patch"))
+              (patches (search-patches "gnutls-skip-trust-store-test.patch"
+                                       "gnutls-cross.patch"))
               (sha256
                (base32
-                "0f1gnm0756qms5cpx6yn6xb8d3imc2gkqmygf12n9x6r8zs1s11j"))))))
+                "0f1gnm0756qms5cpx6yn6xb8d3imc2gkqmygf12n9x6r8zs1s11j"))))
+    (native-inputs
+     `(,@(if (%current-target-system)             ;for cross-build
+             `(("guile" ,guile-3.0))              ;to create .go files
+             '())
+       ,@(package-native-inputs gnutls)))))
 
 (define-public gnutls/guile-2.0
   ;; GnuTLS for Guile 2.0.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]