Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
static-openssl = (final.openssl.override { static = true; });
static-zlib = final.zlib.override { shared = false; };
static-pcre = final.pcre.override { shared = false; };
static-snappy = final.snappy.override { static = true; };
static-libblst = final.libblst.overrideDerivation (old: {
configureFlags = old.configureFlags ++ [ "--enable-static" "--disable-shared" ];
buildPhase = ''
Expand All @@ -41,6 +42,36 @@
sed 's/^ILIBS\>.*/ILIBS = liblmdb.a/' -i Makefile
'';
});
# liburing always builds both static and dynamic libraries, so we remove the .so
# target the same way nixpkgs does for isStatic platforms.
static-liburing = final.liburing.overrideAttrs (old: {
dontdisableStatic = true;
# There are several files in man/ that have the same filename but with
# different case. When building on macOS, Nix renames these files with a
# "~nix~case~hack~" suffix, and then the Makefile won't be able to find them
# during the installPhase. Copy these back over the original. This should not
# cause any case conflicts, because it will be built in a Linux VM.
preInstall = ''
# Rename any case-hacked files back to their original names
for f in man/*~nix~case~hack~*; do
if [ -f "$f" ]; then
mv "$f" "''${f%~nix~case~hack~*}"
fi
done
'';

postInstall = ''
# Always builds both static and dynamic libraries, so we need to remove the
# dynamic libraries.
rm $out/lib/liburing*.so*

# Copy the examples into $bin. Most reverse dependency of
# this package should reference only the $out output
for file in $(find ./examples -executable -type f); do
install -Dm555 -t "$bin/bin" "$file"
done
'';
});
});

# nixpkgs defines happy = justStaticExecutables haskellPackages.happy
Expand Down
13 changes: 8 additions & 5 deletions iog-libs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@ in {
# Present in ALL shell types (dynamic, static, cross-js, cross-windows).
crypto = map resolve [ "libblst" "libsodium-vrf" "secp256k1" ];

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

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

# Minimal tool set for cross-compilation targets (CDDL/CBOR validation).
cross-tools = with pkgs; [ cbor-diag cddl ];
# Build tools for cross-compilation targets (validation / code generation).
cross-tools = with pkgs; [ cbor-diag cddl protobuf ];
}
2 changes: 1 addition & 1 deletion tool-map.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
--sha256: sha256-P0hOiQyh54Y5Pyl9rjpEE5Er/u83aeXIKBygzniRZtk=
--sha256: sha256-7jhEysaHgczdNolOCuE9K6ZpLD3KJzsGSlgPHlZOvlg=

if impl(ghc < 9.13)
active-repositories: hackage.haskell.org
Expand Down
Loading