From e956eda65d18451140dce1eba5cadcacc1cde4d7 Mon Sep 17 00:00:00 2001 From: nixo Date: Thu, 10 Oct 2019 20:49:03 +0200 Subject: [PATCH] gnu: Add julia-mbedtls. * gnu/packages/julia-xyz.scm (julia-mbedtls-0.7.0): New variable. --- gnu/packages/julia-xyz.scm | 47 +++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/gnu/packages/julia-xyz.scm b/gnu/packages/julia-xyz.scm index 851e681e7f..156da040e4 100644 --- a/gnu/packages/julia-xyz.scm +++ b/gnu/packages/julia-xyz.scm @@ -20,7 +20,8 @@ #:use-module (guix build-system julia) #:use-module (guix git-download) #:use-module ((guix licenses) #:prefix license:) - #:use-module (guix packages)) + #:use-module (guix packages) + #:use-module (gnu packages tls)) (define-public julia-inifile (package @@ -119,3 +120,47 @@ function takes in either an Array{UInt8}, a ByteString or an IO object.") (synopsis "A reliable binary provider for Julia") (description "Install binary packages with Julia.") (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/JuliaWeb/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/JuliaWeb/MbedTLS.jl") + (synopsis "Wrapper around the mbed TLS and cryptography C libary") + (description "@code{julia-mbedtls} is a julia wrapper around mbed TLS.") + (license license:expat)))