From b600136f59cb143450a419866473015b2633c882 Mon Sep 17 00:00:00 2001 From: Moritz Angermann Date: Fri, 27 Feb 2026 10:31:54 +0900 Subject: [PATCH] Add lmdb to IOG profiles 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 --- dynamic.nix | 1 + flake.nix | 7 +++++++ static.nix | 2 ++ 3 files changed, 10 insertions(+) diff --git a/dynamic.nix b/dynamic.nix index d4e75f9..ee45a67 100644 --- a/dynamic.nix +++ b/dynamic.nix @@ -136,6 +136,7 @@ pkgs.mkShell { jq libblst libsodium-vrf + lmdb # required by ouroboros-consensus (cardano-lmdb) secp256k1 yq-go ] diff --git a/flake.nix b/flake.nix index efdba66..8c68cac 100644 --- a/flake.nix +++ b/flake.nix @@ -34,6 +34,13 @@ ''; postFixup = ""; }); + # lmdb uses a plain Makefile (no autoconf), so we strip the .so + # target the same way nixpkgs does for isStatic platforms. + static-lmdb = final.lmdb.overrideAttrs (old: { + postPatch = (old.postPatch or "") + '' + sed 's/^ILIBS\>.*/ILIBS = liblmdb.a/' -i Makefile + ''; + }); }); # nixpkgs defines happy = justStaticExecutables haskellPackages.happy diff --git a/static.nix b/static.nix index 1084cd7..54b2cc4 100644 --- a/static.nix +++ b/static.nix @@ -50,6 +50,7 @@ let tool-version-map = (import ./tool-map.nix) self; --ghc-option=-L${lib.getLib static-libsodium-vrf}/lib \ --ghc-option=-L${lib.getLib static-secp256k1}/lib \ --ghc-option=-L${lib.getLib static-libblst}/lib \ + --ghc-option=-L${lib.getLib static-lmdb}/lib \ --ghc-option=-L${lib.getLib static-openssl}/lib ;; clean|unpack) @@ -136,6 +137,7 @@ pkgs.mkShell (rec { ] ++ lib.optionals withIOG [ static-libblst static-libsodium-vrf + static-lmdb # required by ouroboros-consensus (cardano-lmdb) static-secp256k1 icu # for cardano-cli gh