summaryrefslogtreecommitdiff
path: root/packages/komodo/libsodium.scm
blob: 34766263ae92291b627078a36f654d4396c45687 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
(define-module (packages komodo 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 (packages komodo 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)))