Skip to content

Commit 638bd90

Browse files
authored
Add lmdb to IOG profiles (#238)
ouroboros-consensus depends on cardano-lmdb which requires the lmdb system library (pkg-config: lmdb>=0.9 && <0.10). Since UTxO-HD was integrated in Cardano Node 10.4.1, lmdb is required for all Cardano development. Adds lmdb to dynamic shells and static-lmdb (static-only build via Makefile ILIBS patching, matching nixpkgs isStatic pattern) to static shells. The wrapped-cabal in static.nix gets the corresponding -L flag so GHC finds the static library. Closes #218 Supersedes #221
1 parent ac635ef commit 638bd90

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

dynamic.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ pkgs.mkShell {
136136
jq
137137
libblst
138138
libsodium-vrf
139+
lmdb # required by ouroboros-consensus (cardano-lmdb)
139140
secp256k1
140141
yq-go
141142
]

flake.nix

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@
3434
'';
3535
postFixup = "";
3636
});
37+
# lmdb uses a plain Makefile (no autoconf), so we strip the .so
38+
# target the same way nixpkgs does for isStatic platforms.
39+
static-lmdb = final.lmdb.overrideAttrs (old: {
40+
postPatch = (old.postPatch or "") + ''
41+
sed 's/^ILIBS\>.*/ILIBS = liblmdb.a/' -i Makefile
42+
'';
43+
});
3744
});
3845

3946
# nixpkgs defines happy = justStaticExecutables haskellPackages.happy

static.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ let tool-version-map = (import ./tool-map.nix) self;
5050
--ghc-option=-L${lib.getLib static-libsodium-vrf}/lib \
5151
--ghc-option=-L${lib.getLib static-secp256k1}/lib \
5252
--ghc-option=-L${lib.getLib static-libblst}/lib \
53+
--ghc-option=-L${lib.getLib static-lmdb}/lib \
5354
--ghc-option=-L${lib.getLib static-openssl}/lib
5455
;;
5556
clean|unpack)
@@ -136,6 +137,7 @@ pkgs.mkShell (rec {
136137
] ++ lib.optionals withIOG [
137138
static-libblst
138139
static-libsodium-vrf
140+
static-lmdb # required by ouroboros-consensus (cardano-lmdb)
139141
static-secp256k1
140142
icu # for cardano-cli
141143
gh

0 commit comments

Comments
 (0)