[bug#38546,10/11] gnu: Add julia-mbedtls.
diff mbox series

Message ID 87d0bgvqe9.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me
State Accepted
Headers show
Series
  • Julia: fix package build and add julia-xyz
Related show

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job

Commit Message

Nicolò Balzarotti Jan. 18, 2020, 1:11 p.m. UTC
* gnu/packages/julia-xyz.scm (julia-mbedtls): New variable.
---
 gnu/packages/julia-xyz.scm | 49 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 48 insertions(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/gnu/packages/julia-xyz.scm b/gnu/packages/julia-xyz.scm
index 0f8e04b4d1..3e9f532697 100644
--- a/gnu/packages/julia-xyz.scm
+++ b/gnu/packages/julia-xyz.scm
@@ -2,7 +2,8 @@ 
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix git-download)
-  #:use-module (guix build-system julia))
+  #:use-module (guix build-system julia)
+  #:use-module (gnu packages tls))
 
 (define-public julia-compat
   (package
@@ -101,3 +102,49 @@  function takes in either an @code{Array{UInt8}}, a @code{ByteString} or an
     (description "@code{BinaryProvider.jl} simplifies the installation of
 binaries required by julia packages.")
     (license license:expat)))
+
+(define-public julia-mbedtls
+  (package
+    (name "julia-mbedtls")
+    (version "0.7.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/JuliaLang/MbedTLS.jl")
+             (commit (string-append "v" version))))
+       (file-name "MbedTLS")
+       (sha256
+        (base32 "1a8snw9gi21lm6r3kh6ly7ngi99s9k5shqkfiizj3g9li20q23h2"))))
+    (propagated-inputs
+     `(("julia-binaryprovider" ,julia-binaryprovider)
+       ("mbedtls-apache" ,mbedtls-apache)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'precompile 'build-deps
+           (lambda* (#:key outputs source inputs #:allow-other-keys)
+             (let ((f (open-file
+                       (string-append
+                        (assoc-ref outputs "out")
+                        "/share/julia/packages/"
+                        (string-append
+                         (strip-store-file-name source) "/deps/deps.jl"))
+                       "w")))
+               (display (string-append "const libmbedcrypto = \""
+                                       (assoc-ref inputs "mbedtls-apache")
+                                       "/lib/libmbedcrypto.so\"\n") f)
+               (display (string-append "const libmbedtls = \""
+                                       (assoc-ref inputs "mbedtls-apache")
+                                       "/lib/libmbedtls.so\"\n") f)
+               (display (string-append "const libmbedx509 = \""
+                                       (assoc-ref inputs "mbedtls-apache")
+                                       "/lib/libmbedx509.so\"\n") f)
+               (close-port f))
+             #t)))))
+    (build-system julia-build-system)
+    (home-page "https://github.com/JuliaLang/MbedTLS.jl")
+    (synopsis "Apache's mbed TLS library wrapper")
+    (description "@code{MbedTLS.jl} provides a wrapper around the mbed TLS and
+cryptography C libary for Julia.")
+    (license license:expat)))