Skip to content

Commit a942595

Browse files
authored
Make libsodium-vrf and secp256k1 .version match .pc file (#604)
Haskell.nix expects the derivations `.version` and the version in the `.pc` file to match. This is a follow up to #603
1 parent bfdd1c3 commit a942595

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

overlays/crypto/libsecp256k1.nix

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
stdenv.mkDerivation rec {
55
pname = "secp256k1";
6-
version = src.shortRev;
6+
version = "0.3.2";
77

88
inherit src;
99

@@ -18,6 +18,20 @@ stdenv.mkDerivation rec {
1818

1919
doCheck = true;
2020

21+
# Verify .pc version matches derivation version
22+
preCheck = ''
23+
pc_file="libsecp256k1.pc"
24+
if [ ! -f "$pc_file" ]; then
25+
echo "ERROR: pkg-config file not found: $pc_file"
26+
exit 1
27+
fi
28+
pc_version=$(sed -n 's/^Version: *//p' "$pc_file")
29+
if [ "$pc_version" != "${version}" ]; then
30+
echo "ERROR: Version mismatch: derivation has ${version}, but .pc file has $pc_version"
31+
exit 1
32+
fi
33+
'';
34+
2135
meta = with lib; {
2236
description = "Optimized C library for EC operations on curve secp256k1";
2337
longDescription = ''

overlays/crypto/libsodium.nix

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
stdenv.mkDerivation rec {
44
pname = "libsodium-vrf";
5-
version = src.shortRev;
5+
version = "1.0.18";
66

77
inherit src;
88

@@ -21,6 +21,20 @@ stdenv.mkDerivation rec {
2121

2222
doCheck = true;
2323

24+
# Verify .pc version matches derivation version
25+
preCheck = ''
26+
pc_file="libsodium.pc"
27+
if [ ! -f "$pc_file" ]; then
28+
echo "ERROR: pkg-config file not found: $pc_file"
29+
exit 1
30+
fi
31+
pc_version=$(sed -n 's/^Version: *//p' "$pc_file")
32+
if [ "$pc_version" != "${version}" ]; then
33+
echo "ERROR: Version mismatch: derivation has ${version}, but .pc file has $pc_version"
34+
exit 1
35+
fi
36+
'';
37+
2438
meta = with lib; {
2539
description = "A modern and easy-to-use crypto library - VRF fork";
2640
homepage = "http://doc.libsodium.org/";

0 commit comments

Comments
 (0)