diff --git a/assembly/nix/linux-arm64-static.nix b/assembly/nix/linux-arm64-static.nix index a69df6abc..c2919a279 100644 --- a/assembly/nix/linux-arm64-static.nix +++ b/assembly/nix/linux-arm64-static.nix @@ -27,7 +27,7 @@ stdenv.mkDerivation { pkgsStatic.openssl microhttpdmy pkgsStatic.zlib pkgsStatic.libsodium.dev pkgsStatic.secp256k1 glibc.static staticLibs.staticBoost staticLibs.staticLibrdkafka - pkgsStatic.lz4 + staticLibs.staticLZ4 ]; makeStatic = true; diff --git a/assembly/nix/linux-x86-64-static.nix b/assembly/nix/linux-x86-64-static.nix index 74543fe55..6780705ba 100644 --- a/assembly/nix/linux-x86-64-static.nix +++ b/assembly/nix/linux-x86-64-static.nix @@ -27,7 +27,7 @@ stdenv.mkDerivation { pkgsStatic.openssl microhttpdmy pkgsStatic.zlib pkgsStatic.libsodium.dev pkgsStatic.secp256k1 glibc.static staticLibs.staticBoost staticLibs.staticLibrdkafka - pkgsStatic.lz4 + staticLibs.staticLZ4 ]; makeStatic = true; diff --git a/assembly/nix/macos-static.nix b/assembly/nix/macos-static.nix index a630334b1..a744e340f 100644 --- a/assembly/nix/macos-static.nix +++ b/assembly/nix/macos-static.nix @@ -30,7 +30,7 @@ pkgs.llvmPackages_14.stdenv.mkDerivation { (libiconv.override { enableStatic = true; enableShared = false; }) pkgsStatic.boost staticLibs.staticLibrdkafka - pkgsStatic.lz4 + staticLibs.staticLZ4 ]; diff --git a/assembly/nix/static-libs.nix b/assembly/nix/static-libs.nix index fac44de85..c7bf936b5 100644 --- a/assembly/nix/static-libs.nix +++ b/assembly/nix/static-libs.nix @@ -17,7 +17,15 @@ let staticLibrdkafka = pkgs.rdkafka.overrideAttrs (oldAttrs: { configureFlags = (oldAttrs.configureFlags or []) ++ ["--enable-static" "--disable-shared"]; }); + + staticLZ4 = lz4.overrideAttrs (oldAttrs: rec { + # Disable shared library building and ensure a static build + buildInputs = oldAttrs.buildInputs or []; + + # Override the configure flags + configureFlags = [ "-DBUILD_SHARED_LIBS=OFF" "-DBUILD_STATIC_LIBS=ON" ]; + }); in { - inherit staticBoost staticLibrdkafka; + inherit staticBoost staticLibrdkafka staticLZ4; } \ No newline at end of file