From 8aa0198147db0dac7bb166740c00c8311e1c75ae Mon Sep 17 00:00:00 2001 From: Ulrik Strid Date: Tue, 11 Oct 2022 11:15:32 +0200 Subject: [PATCH] We don't have to build library of tunac --- nix/tuna.nix | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/nix/tuna.nix b/nix/tuna.nix index 15baf51..d6e458a 100644 --- a/nix/tuna.nix +++ b/nix/tuna.nix @@ -1,7 +1,9 @@ { nix-filter, lib, - buildDunePackage, + stdenv, + dune, + ocaml, zarith, ppx_deriving, ppx_yojson_conv, @@ -14,8 +16,9 @@ ppx_jane, alcotest, }: -buildDunePackage rec { - pname = "tunac"; + +stdenv.mkDerivation rec { + name = "tunac"; version = "1.0.0"; src = with nix-filter.lib; filter { @@ -29,6 +32,11 @@ buildDunePackage rec { ]; }; + nativeBuildInputs = [ + dune + ocaml + ]; + propagatedBuildInputs = [ zarith ppx_deriving @@ -40,9 +48,9 @@ buildDunePackage rec { buildInputs = [ yojson - core - core_unix - ppx_jane + core + core_unix + ppx_jane ]; checkInputs = [ @@ -51,5 +59,16 @@ buildDunePackage rec { doCheck = true; - meta.mainProgram = "tunacc_test_operation"; + buildPhase = '' + runHook preBuild + dune build --profile=release ./packages/tunac/bin/tunacc_test_operation.exe + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + mkdir -p $out/lib $out/bin + cp _build/default/packages/tunac/bin/tunacc_test_operation.exe $out/bin/tunac + runHook postInstall + ''; }