tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
libhydrogen: init at 2024-04-06 (bbca575b)
Tanya
10 months ago
14552c1b
d1d6ccb6
+66
1 changed file
expand all
collapse all
unified
split
pkgs
by-name
li
libhydrogen
package.nix
+66
pkgs/by-name/li/libhydrogen/package.nix
···
1
1
+
{
2
2
+
lib,
3
3
+
stdenv,
4
4
+
fetchFromGitHub,
5
5
+
testers,
6
6
+
pkg-config,
7
7
+
}:
8
8
+
9
9
+
stdenv.mkDerivation (finalAttrs: {
10
10
+
pname = "libhydrogen";
11
11
+
version = "0-unstable-2025-04-06";
12
12
+
13
13
+
src = fetchFromGitHub {
14
14
+
owner = "jedisct1";
15
15
+
repo = "libhydrogen";
16
16
+
rev = "bbca575b62510bfdc6dd927a4bfa7df4a51cb846";
17
17
+
hash = "sha256-sLOE3oR53hmvRqIPD5PU9Q04TFqw2KuWT1OQBA/KdRc=";
18
18
+
};
19
19
+
20
20
+
outputs = [
21
21
+
"out"
22
22
+
"dev"
23
23
+
];
24
24
+
25
25
+
nativeBuildInputs = [ pkg-config ];
26
26
+
enableParallelBuilding = true;
27
27
+
28
28
+
makeFlags = [
29
29
+
"PREFIX=${placeholder "out"}"
30
30
+
"INCLUDE_INSTALL_DIR=${placeholder "dev"}/include"
31
31
+
"LIBRARY_INSTALL_DIR=${placeholder "out"}/lib"
32
32
+
"PKGCONFIG_INSTALL_DIR=${placeholder "dev"}/lib/pkgconfig"
33
33
+
];
34
34
+
35
35
+
postInstall = ''
36
36
+
mkdir -p "$dev/lib/pkgconfig"
37
37
+
cat > "$dev/lib/pkgconfig/libhydrogen.pc" <<EOF
38
38
+
Name: libhydrogen
39
39
+
Description: Lightweight cryptographic library
40
40
+
Version: ${finalAttrs.version}
41
41
+
Libs: -L$out/lib -lhydrogen
42
42
+
Cflags: -I$dev/include
43
43
+
EOF
44
44
+
'';
45
45
+
46
46
+
doCheck = true;
47
47
+
48
48
+
preCheck = ''
49
49
+
export LD_LIBRARY_PATH=$PWD:$LD_LIBRARY_PATH
50
50
+
'';
51
51
+
52
52
+
checkPhase = ''
53
53
+
tests/tests
54
54
+
'';
55
55
+
56
56
+
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
57
57
+
58
58
+
meta = {
59
59
+
description = "Lightweight, secure, easy-to-use crypto library suitable for constrained environments";
60
60
+
homepage = "https://github.com/jedisct1/libhydrogen";
61
61
+
license = lib.licenses.isc;
62
62
+
maintainers = [ lib.maintainers.tanya1866 ];
63
63
+
pkgConfigModules = [ "libhydrogen" ];
64
64
+
platforms = lib.platforms.all;
65
65
+
};
66
66
+
})