diff options
author | Felix Buehler <account@buehler.rocks> | 2023-02-06 21:49:02 +0100 |
---|---|---|
committer | Felix Buehler <account@buehler.rocks> | 2023-02-13 21:52:34 +0100 |
commit | cdb39a86e0dd7cda3a057f4f4795485a5c9b9be5 (patch) | |
tree | 1fef6e55f39dab2289b68b68972ee4c9b89520f7 /pkgs/applications/science/logic/coq | |
parent | 7f610b4d3f6e6f695b1f5521862066c0ece79a5a (diff) |
treewide: use optionalString
Diffstat (limited to 'pkgs/applications/science/logic/coq')
-rw-r--r-- | pkgs/applications/science/logic/coq/default.nix | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pkgs/applications/science/logic/coq/default.nix b/pkgs/applications/science/logic/coq/default.nix index 10d77885b5cb9..49c9fc47fef26 100644 --- a/pkgs/applications/science/logic/coq/default.nix +++ b/pkgs/applications/science/logic/coq/default.nix @@ -66,10 +66,10 @@ let buildIde = args.buildIde or (!coqAtLeast "8.14"); ideFlags = optionalString (buildIde && !coqAtLeast "8.10") "-lablgtkdir ${ocamlPackages.lablgtk}/lib/ocaml/*/site-lib/lablgtk2 -coqide opt"; - csdpPatch = if csdp != null then '' + csdpPatch = lib.optionalString (csdp != null) '' substituteInPlace plugins/micromega/sos.ml --replace "; csdp" "; ${csdp}/bin/csdp" substituteInPlace plugins/micromega/coq_micromega.ml --replace "System.is_in_system_path \"csdp\"" "true" - '' else ""; + ''; ocamlPackages = if !isNull customOCamlPackages then customOCamlPackages else with versions; switch coq-version [ { case = range "8.16" "8.17"; out = ocamlPackages_4_14; } @@ -158,7 +158,7 @@ self = stdenv.mkDerivation { UNAME=$(type -tp uname) RM=$(type -tp rm) substituteInPlace tools/beautify-archive --replace "/bin/rm" "$RM" - ${if !coqAtLeast "8.7" then "substituteInPlace configure.ml --replace \"md5 -q\" \"md5sum\"" else ""} + ${lib.optionalString (!coqAtLeast "8.7") "substituteInPlace configure.ml --replace \"md5 -q\" \"md5sum\""} ${csdpPatch} ''; @@ -196,7 +196,7 @@ self = stdenv.mkDerivation { categories = [ "Development" "Science" "Math" "IDE" "GTK" ]; }); - postInstall = let suffix = if coqAtLeast "8.14" then "-core" else ""; in optionalString (!coqAtLeast "8.17") '' + postInstall = let suffix = optionalString (coqAtLeast "8.14") "-core"; in optionalString (!coqAtLeast "8.17") '' cp bin/votour $out/bin/ '' + '' ln -s $out/lib/coq${suffix} $OCAMLFIND_DESTDIR/coq${suffix} @@ -227,12 +227,12 @@ if coqAtLeast "8.17" then self.overrideAttrs(_: { buildPhase = '' runHook preBuild make dunestrap - dune build -p coq-core,coq-stdlib,coq,coqide-server${if buildIde then ",coqide" else ""} -j $NIX_BUILD_CORES + dune build -p coq-core,coq-stdlib,coq,coqide-server${lib.optionalString buildIde ",coqide"} -j $NIX_BUILD_CORES runHook postBuild ''; installPhase = '' runHook preInstall - dune install --prefix $out coq-core coq-stdlib coq coqide-server${if buildIde then " coqide" else ""} + dune install --prefix $out coq-core coq-stdlib coq coqide-server${lib.optionalString buildIde " coqide"} runHook postInstall ''; }) else self |