From e3624e86aeda7eaf4f16560f50602639ea60fffe Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 4 Dec 2024 23:26:20 -0500 Subject: nix build, dub, take account of nixpkgs build changes --- flake.nix | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index 5ad88af..2d9f360 100644 --- a/flake.nix +++ b/flake.nix @@ -60,17 +60,16 @@ inherit shell; inherit devEnv; buildInputs = [sqlite]; - nativeBuildInputs = [dub ldc gnumake]; # [ dub dmd ]; [ dub ldc ]; [ dub gdc ]; + nativeBuildInputs = [gnumake dub ldc]; + preBuild = '' + export DCn=ldmd2 + export DC=$(type -P $DCn || echo "") + if [ "$DC" == "" ]; then exit "Error: could not find D compiler"; fi + ''; buildPhase = '' runHook preBuild - for DC_ in dmd ldmd2 ldc2 gdc gdmd; do - echo "- check for D compiler $DC_" - DC=$(type -P $DC_ || echo "") - if [ ! "$DC" == "" ]; then break; fi - done - if [ "$DC" == "" ]; then exit "Error: could not find D compiler"; fi - echo "$DC_ used as D compiler to build $pname" - dub build --cache=local --compiler=$DC --build=$DC_ --combined --skip-registry=all + echo "$DCn used as D compiler to build $pname" + dub build --cache=local --compiler=$DC --build=$DCn --combined --skip-registry=all runHook postBuild ''; inherit checkPhase; -- cgit v1.2.3