From e09db29aa47a0dfa386b262352391c2496e56676 Mon Sep 17 00:00:00 2001 From: Alain Date: Mon, 29 Nov 2021 11:24:03 +0100 Subject: [PATCH] add a check to whenever menhirLib exists If it does, it add menhirLib as a dependency. Else, ignore it. --- default.nix | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/default.nix b/default.nix index f6450c4f..fef100e2 100644 --- a/default.nix +++ b/default.nix @@ -1,6 +1,25 @@ -{ lib, fetchFromGitHub, buildDunePackage, ansiterminal, sedlex_2, menhir -, menhirLib, unionfind, bindlib, cmdliner, re, zarith, zarith_stubs_js, ocamlgraph -, calendar, visitors, benchmark, js_of_ocaml, js_of_ocaml-ppx, camomile, cppo }: +{ lib +, fetchFromGitHub +, buildDunePackage +, ansiterminal +, sedlex_2 +, menhir +, unionfind +, bindlib +, cmdliner +, re +, zarith +, zarith_stubs_js +, ocamlgraph +, calendar +, visitors +, benchmark +, js_of_ocaml +, js_of_ocaml-ppx +, camomile +, cppo +, menhirLib ? null #for nixos-unstable compatibility. +}: buildDunePackage rec { pname = "catala"; @@ -32,7 +51,7 @@ buildDunePackage rec { unionfind bindlib - ]; + ] ++ (if isNull menhirLib then [ ] else [ menhirLib ]); doCheck = true; patches = [ ./.nix/no-web.patch ]; @@ -44,4 +63,4 @@ buildDunePackage rec { license = licenses.asl20; maintainers = with maintainers; [ ]; }; -} +} \ No newline at end of file