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