Skip to content

Commit 6a545b1

Browse files
committed
Add new required dependencies for cardano-node 10.7
Add the following new dependencies: * snappy (cardano-rpc) * protobuf (cardano-rpc) * liburing (lmdb)
1 parent a621faa commit 6a545b1

File tree

2 files changed

+39
-5
lines changed

2 files changed

+39
-5
lines changed

flake.nix

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
static-openssl = (final.openssl.override { static = true; });
2626
static-zlib = final.zlib.override { shared = false; };
2727
static-pcre = final.pcre.override { shared = false; };
28+
static-snappy = final.snappy.override { static = true; };
2829
static-libblst = final.libblst.overrideDerivation (old: {
2930
configureFlags = old.configureFlags ++ [ "--enable-static" "--disable-shared" ];
3031
buildPhase = ''
@@ -41,6 +42,36 @@
4142
sed 's/^ILIBS\>.*/ILIBS = liblmdb.a/' -i Makefile
4243
'';
4344
});
45+
# liburing always builds both static and dynamic libraries, so we remove the .so
46+
# target the same way nixpkgs does for isStatic platforms.
47+
static-liburing = final.liburing.overrideAttrs (old: {
48+
dontdisableStatic = true;
49+
# There are several files in man/ that have the same filename but with
50+
# different case. When building on macOS, Nix renames these files with a
51+
# "~nix~case~hack~" suffix, and then the Makefile won't be able to find them
52+
# during the installPhase. Copy these back over the original. This should not
53+
# cause any case conflicts, because it will be built in a Linux VM.
54+
preInstall = ''
55+
# Rename any case-hacked files back to their original names
56+
for f in man/*~nix~case~hack~*; do
57+
if [ -f "$f" ]; then
58+
mv "$f" "''${f%~nix~case~hack~*}"
59+
fi
60+
done
61+
'';
62+
63+
postInstall = ''
64+
# Always builds both static and dynamic libraries, so we need to remove the
65+
# dynamic libraries.
66+
rm $out/lib/liburing*.so*
67+
68+
# Copy the examples into $bin. Most reverse dependency of
69+
# this package should reference only the $out output
70+
for file in $(find ./examples -executable -type f); do
71+
install -Dm555 -t "$bin/bin" "$file"
72+
done
73+
'';
74+
});
4475
});
4576

4677
# nixpkgs defines happy = justStaticExecutables haskellPackages.happy

iog-libs.nix

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,16 @@ in {
2222
# Present in ALL shell types (dynamic, static, cross-js, cross-windows).
2323
crypto = map resolve [ "libblst" "libsodium-vrf" "secp256k1" ];
2424

25-
# Data-storage libraries (ouroboros-consensus / cardano-lmdb).
25+
# Data-storage libraries (ouroboros-consensus / cardano-lmdb / cardano-rpc).
2626
# Dynamic and static shells only — not meaningful for JS/Windows cross.
27-
data = map resolve [ "lmdb" ];
27+
data =
28+
map resolve ([ "lmdb" "snappy" ]
29+
# liburing is Linux-only (io_uring is a Linux kernel feature).
30+
++ pkgs.lib.optionals pkgs.stdenv.isLinux [ "liburing" ]);
2831

2932
# Development/CI tools (not linked into builds). Dynamic and static only.
30-
tools = with pkgs; [ cbor-diag cddl gh icu jq yq-go ];
33+
tools = with pkgs; [ cbor-diag cddl gh icu jq protobuf yq-go ];
3134

32-
# Minimal tool set for cross-compilation targets (CDDL/CBOR validation).
33-
cross-tools = with pkgs; [ cbor-diag cddl ];
35+
# Build tools for cross-compilation targets (validation / code generation).
36+
cross-tools = with pkgs; [ cbor-diag cddl protobuf ];
3437
}

0 commit comments

Comments
 (0)