(define-module (libsodium) #:use-module (gnu packages crypto) #:use-module (guix build utils) #:use-module (guix build-system cmake) #:use-module (guix git-download) #:use-module (guix packages) #:use-module (komodo-vcpkg-ports)) ;; DATA LAYER (define hash (base32 "0yk9pyj7bl421hb20lg9yaysqvcgrk7860613674la0gk5glq34d")) (define inputs (list komodo-vcpkg-ports)) (define name "libsodium-komodo") (define tests? #f) (define url "https://github.com/jedisct1/libsodium") (define version "1.0.19") ;; ABSTRACTION LAYER -4 (define komodo-vcpkg-ports-store '(assoc-ref inputs "komodo-vcpkg-ports")) ;; ABSTRACTION LAYER -3 (define copy-cmakelists `(lambda* (#:key inputs #:allow-other-keys) (let ((destination ".") (source (string-append ,komodo-vcpkg-ports-store "/ports/libsodium/"))) (copy-recursively source destination)))) ;; ABSTRACTION LAYER -2 (define create-cmakelists `(add-after 'unpack 'create-cmakelists ,copy-cmakelists)) ;; ABSTRACTION LAYER -1 (define uri (git-reference (url url) (commit version))) (define phases `(modify-phases %standard-phases ,create-cmakelists)) ;; ABSTRACTION LAYER -0 (define arguments (list #:phases phases #:tests? tests?)) (define source (origin (uri uri) (method git-fetch) (sha256 hash))) ;; SURFACE LAYER (define-public libsodium-komodo (package (inherit libsodium) (name name) (source source) (build-system cmake-build-system) (arguments arguments) (inputs inputs)))