From 6920d8ca42b081c874486ad16fc66f43d8bb8074 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Mon, 25 Apr 2022 13:35:24 -0700 Subject: treewide: Simplify negated uses of versionAtLeast, versionOlder Signed-off-by: Anders Kaseorg --- nixos/modules/services/misc/sourcehut/default.nix | 2 +- pkgs/build-support/ocaml/dune.nix | 4 ++-- pkgs/build-support/ocaml/oasis.nix | 2 +- pkgs/development/compilers/ocaml/generic.nix | 10 +++++----- pkgs/development/interpreters/php/generic.nix | 2 +- pkgs/development/libraries/boost/generic.nix | 4 ++-- pkgs/development/ocaml-modules/bap/default.nix | 2 +- pkgs/development/ocaml-modules/batteries/default.nix | 2 +- pkgs/development/ocaml-modules/bitstring/ppx.nix | 2 +- pkgs/development/ocaml-modules/bitv/default.nix | 2 +- pkgs/development/ocaml-modules/bz2/default.nix | 2 +- pkgs/development/ocaml-modules/camlpdf/default.nix | 2 +- pkgs/development/ocaml-modules/cpdf/default.nix | 2 +- pkgs/development/ocaml-modules/cstruct/lwt.nix | 2 +- pkgs/development/ocaml-modules/cstruct/ppx.nix | 2 +- pkgs/development/ocaml-modules/cstruct/sexp.nix | 2 +- pkgs/development/ocaml-modules/cstruct/unix.nix | 2 +- pkgs/development/ocaml-modules/csv/lwt.nix | 2 +- pkgs/development/ocaml-modules/ctypes/default.nix | 2 +- pkgs/development/ocaml-modules/erm_xml/default.nix | 2 +- pkgs/development/ocaml-modules/expat/default.nix | 2 +- pkgs/development/ocaml-modules/farfadet/default.nix | 2 +- pkgs/development/ocaml-modules/fmt/default.nix | 2 +- pkgs/development/ocaml-modules/fpath/default.nix | 2 +- pkgs/development/ocaml-modules/javalib/default.nix | 2 +- pkgs/development/ocaml-modules/lablgl/default.nix | 2 +- pkgs/development/ocaml-modules/lablgtk-extras/default.nix | 2 +- pkgs/development/ocaml-modules/logs/default.nix | 2 +- pkgs/development/ocaml-modules/lua-ml/default.nix | 2 +- pkgs/development/ocaml-modules/lwt/default.nix | 6 +++--- pkgs/development/ocaml-modules/nocrypto/default.nix | 2 +- pkgs/development/ocaml-modules/notty/default.nix | 2 +- pkgs/development/ocaml-modules/ocp-ocamlres/default.nix | 2 +- pkgs/development/ocaml-modules/ocsigen-deriving/default.nix | 2 +- pkgs/development/ocaml-modules/ppxlib/default.nix | 2 +- pkgs/development/ocaml-modules/reactivedata/default.nix | 2 +- pkgs/development/ocaml-modules/sawja/default.nix | 2 +- pkgs/development/ocaml-modules/sedlex/default.nix | 2 +- pkgs/development/ocaml-modules/sosa/default.nix | 2 +- pkgs/development/ocaml-modules/tsdl/default.nix | 2 +- pkgs/development/ocaml-modules/uri/sexp.nix | 2 +- pkgs/development/ocaml-modules/uucp/default.nix | 2 +- pkgs/development/ocaml-modules/uunf/default.nix | 2 +- pkgs/development/ocaml-modules/vg/default.nix | 4 ++-- pkgs/development/ocaml-modules/wasm/default.nix | 2 +- pkgs/development/ocaml-modules/xmlm/default.nix | 2 +- pkgs/development/ocaml-modules/z3/default.nix | 2 +- pkgs/development/ocaml-modules/zarith/default.nix | 2 +- pkgs/development/tools/electron/generic.nix | 10 +++++----- pkgs/development/tools/ocaml/cppo/ocamlbuild.nix | 2 +- pkgs/development/tools/ocaml/dune/1.nix | 2 +- pkgs/development/tools/ocaml/merlin/4.x.nix | 2 +- pkgs/os-specific/linux/nvidia-x11/default.nix | 4 ++-- pkgs/os-specific/linux/nvidia-x11/generic.nix | 2 +- pkgs/os-specific/linux/rtl8723bs/default.nix | 2 +- pkgs/os-specific/linux/sch_cake/default.nix | 2 +- pkgs/servers/foundationdb/vsmake.nix | 4 ++-- pkgs/top-level/php-packages.nix | 4 ++-- 58 files changed, 74 insertions(+), 74 deletions(-) diff --git a/nixos/modules/services/misc/sourcehut/default.nix b/nixos/modules/services/misc/sourcehut/default.nix index 21551d7d5f0..5a6d011a729 100644 --- a/nixos/modules/services/misc/sourcehut/default.nix +++ b/nixos/modules/services/misc/sourcehut/default.nix @@ -1018,7 +1018,7 @@ in inherit configIniOfService; mainService = mkMerge [ baseService { serviceConfig.StateDirectory = [ "sourcehut/gitsrht" "sourcehut/gitsrht/repos" ]; - preStart = mkIf (!versionAtLeast config.system.stateVersion "22.05") (mkBefore '' + preStart = mkIf (versionOlder config.system.stateVersion "22.05") (mkBefore '' # Fix Git hooks of repositories pre-dating https://github.com/NixOS/nixpkgs/pull/133984 ( set +f diff --git a/pkgs/build-support/ocaml/dune.nix b/pkgs/build-support/ocaml/dune.nix index f82bac7d199..2ded76d3cd4 100644 --- a/pkgs/build-support/ocaml/dune.nix +++ b/pkgs/build-support/ocaml/dune.nix @@ -7,8 +7,8 @@ let Dune = { "1" = dune_1; "2" = dune_2; "3" = dune_3; }."${dune-version}" ; in -if (args ? minimumOCamlVersion && ! lib.versionAtLeast ocaml.version args.minimumOCamlVersion) || - (args ? minimalOCamlVersion && ! lib.versionAtLeast ocaml.version args.minimalOCamlVersion) +if (args ? minimumOCamlVersion && lib.versionOlder ocaml.version args.minimumOCamlVersion) || + (args ? minimalOCamlVersion && lib.versionOlder ocaml.version args.minimalOCamlVersion) then throw "${pname}-${version} is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/build-support/ocaml/oasis.nix b/pkgs/build-support/ocaml/oasis.nix index 8f81344daf0..91daad59050 100644 --- a/pkgs/build-support/ocaml/oasis.nix +++ b/pkgs/build-support/ocaml/oasis.nix @@ -8,7 +8,7 @@ }@args: if args ? minimumOCamlVersion && - ! lib.versionAtLeast ocaml.version args.minimumOCamlVersion + lib.versionOlder ocaml.version args.minimumOCamlVersion then throw "${pname}-${version} is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/development/compilers/ocaml/generic.nix b/pkgs/development/compilers/ocaml/generic.nix index 0573b43f5e2..2c6045c13a6 100644 --- a/pkgs/development/compilers/ocaml/generic.nix +++ b/pkgs/development/compilers/ocaml/generic.nix @@ -7,7 +7,7 @@ let in { lib, stdenv, fetchurl, ncurses, buildEnv, libunwind, fetchpatch -, libX11, xorgproto, useX11 ? safeX11 stdenv && !lib.versionAtLeast version "4.09" +, libX11, xorgproto, useX11 ? safeX11 stdenv && lib.versionOlder version "4.09" , aflSupport ? false , flambdaSupport ? false , spaceTimeSupport ? false @@ -87,14 +87,14 @@ stdenv.mkDerivation (args // { buildFlags = if useNativeCompilers then ["nixpkgs_world_bootstrap_world_opt"] else ["nixpkgs_world"]; - buildInputs = optional (!lib.versionAtLeast version "4.07") ncurses + buildInputs = optional (lib.versionOlder version "4.07") ncurses ++ optionals useX11 [ libX11 xorgproto ]; propagatedBuildInputs = optional spaceTimeSupport libunwind; installTargets = [ "install" ] ++ optional useNativeCompilers "installopt"; - preConfigure = optionalString (!lib.versionAtLeast version "4.04") '' + preConfigure = optionalString (lib.versionOlder version "4.04") '' CAT=$(type -tp cat) sed -e "s@/bin/cat@$CAT@" -i config/auto-aux/sharpbang - '' + optionalString (stdenv.isDarwin && !lib.versionAtLeast version "4.13") '' + '' + optionalString (stdenv.isDarwin && lib.versionOlder version "4.13") '' # Do what upstream does by default now: https://github.com/ocaml/ocaml/pull/10176 # This is required for aarch64-darwin, everything else works as is. AS="${stdenv.cc}/bin/cc -c" ASPP="${stdenv.cc}/bin/cc -c" @@ -137,7 +137,7 @@ stdenv.mkDerivation (args // { ''; platforms = with platforms; linux ++ darwin; - broken = stdenv.isAarch64 && !lib.versionAtLeast version "4.06"; + broken = stdenv.isAarch64 && lib.versionOlder version "4.06"; }; }) diff --git a/pkgs/development/interpreters/php/generic.nix b/pkgs/development/interpreters/php/generic.nix index 3debeba329a..7c0994d15b6 100644 --- a/pkgs/development/interpreters/php/generic.nix +++ b/pkgs/development/interpreters/php/generic.nix @@ -272,7 +272,7 @@ let export EXTENSION_DIR=$out/lib/php/extensions '' # PKG_CONFIG need not be a relative path - + lib.optionalString (!lib.versionAtLeast version "7.4") '' + + lib.optionalString (lib.versionOlder version "7.4") '' for i in $(find . -type f -name "*.m4"); do substituteInPlace $i \ --replace 'test -x "$PKG_CONFIG"' 'type -P "$PKG_CONFIG" >/dev/null' diff --git a/pkgs/development/libraries/boost/generic.nix b/pkgs/development/libraries/boost/generic.nix index 1881f06aa4a..34ab5554e74 100644 --- a/pkgs/development/libraries/boost/generic.nix +++ b/pkgs/development/libraries/boost/generic.nix @@ -32,7 +32,7 @@ assert enablePython -> stdenv.hostPlatform == stdenv.buildPlatform; assert enableNumpy -> enablePython; # Boost <1.69 can't be built on linux with clang >8, because pth was removed -assert with lib; ((stdenv.isLinux && toolset == "clang" && !(versionOlder stdenv.cc.version "8.0.0")) -> !(versionOlder version "1.69")); +assert with lib; (stdenv.isLinux && toolset == "clang" && versionAtLeast stdenv.cc.version "8.0.0") -> versionAtLeast version "1.69"; with lib; let @@ -143,7 +143,7 @@ stdenv.mkDerivation { stripLen = 1; extraPrefix = "libs/context/"; }) - ++ optional (and (versionAtLeast version "1.70") (!versionAtLeast version "1.73")) ./cmake-paths.patch + ++ optional (versionAtLeast version "1.70" && versionOlder version "1.73") ./cmake-paths.patch ++ optional (versionAtLeast version "1.73") ./cmake-paths-173.patch ++ optional (version == "1.77.0") (fetchpatch { url = "https://github.com/boostorg/math/commit/7d482f6ebc356e6ec455ccb5f51a23971bf6ce5b.patch"; diff --git a/pkgs/development/ocaml-modules/bap/default.nix b/pkgs/development/ocaml-modules/bap/default.nix index 2bf671c6a09..52287277276 100644 --- a/pkgs/development/ocaml-modules/bap/default.nix +++ b/pkgs/development/ocaml-modules/bap/default.nix @@ -10,7 +10,7 @@ , z3 }: -if !lib.versionAtLeast ocaml.version "4.08" +if lib.versionOlder ocaml.version "4.08" then throw "BAP is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/development/ocaml-modules/batteries/default.nix b/pkgs/development/ocaml-modules/batteries/default.nix index 865518ec29c..731f6e26363 100644 --- a/pkgs/development/ocaml-modules/batteries/default.nix +++ b/pkgs/development/ocaml-modules/batteries/default.nix @@ -2,7 +2,7 @@ , doCheck ? lib.versionAtLeast ocaml.version "4.08" && !stdenv.isAarch64 }: -if !lib.versionAtLeast ocaml.version "4.02" +if lib.versionOlder ocaml.version "4.02" then throw "batteries is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/development/ocaml-modules/bitstring/ppx.nix b/pkgs/development/ocaml-modules/bitstring/ppx.nix index 4d391d3458d..9eb4c74f574 100644 --- a/pkgs/development/ocaml-modules/bitstring/ppx.nix +++ b/pkgs/development/ocaml-modules/bitstring/ppx.nix @@ -3,7 +3,7 @@ , ounit }: -if !lib.versionAtLeast ppxlib.version "0.18.0" +if lib.versionOlder ppxlib.version "0.18.0" then throw "ppx_bitstring is not available with ppxlib-${ppxlib.version}" else diff --git a/pkgs/development/ocaml-modules/bitv/default.nix b/pkgs/development/ocaml-modules/bitv/default.nix index 07649f3655b..a986a46f293 100644 --- a/pkgs/development/ocaml-modules/bitv/default.nix +++ b/pkgs/development/ocaml-modules/bitv/default.nix @@ -1,6 +1,6 @@ { stdenv, lib, fetchFromGitHub, autoreconfHook, which, ocaml, findlib }: -if !lib.versionAtLeast ocaml.version "4.02" +if lib.versionOlder ocaml.version "4.02" then throw "bitv is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/development/ocaml-modules/bz2/default.nix b/pkgs/development/ocaml-modules/bz2/default.nix index 4ac0262e1ee..6d8b56ae232 100644 --- a/pkgs/development/ocaml-modules/bz2/default.nix +++ b/pkgs/development/ocaml-modules/bz2/default.nix @@ -1,6 +1,6 @@ { lib, stdenv, fetchFromGitLab, ocaml, findlib, bzip2, autoreconfHook }: -if !lib.versionAtLeast ocaml.version "4.02" +if lib.versionOlder ocaml.version "4.02" then throw "bz2 is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/development/ocaml-modules/camlpdf/default.nix b/pkgs/development/ocaml-modules/camlpdf/default.nix index 06456b9c930..cbcb67e2d29 100644 --- a/pkgs/development/ocaml-modules/camlpdf/default.nix +++ b/pkgs/development/ocaml-modules/camlpdf/default.nix @@ -1,6 +1,6 @@ { lib, stdenv, fetchFromGitHub, which, ocaml, findlib }: -if !lib.versionAtLeast ocaml.version "4.10" +if lib.versionOlder ocaml.version "4.10" then throw "camlpdf is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/development/ocaml-modules/cpdf/default.nix b/pkgs/development/ocaml-modules/cpdf/default.nix index 3f60263736e..b1694885258 100644 --- a/pkgs/development/ocaml-modules/cpdf/default.nix +++ b/pkgs/development/ocaml-modules/cpdf/default.nix @@ -1,6 +1,6 @@ { lib, stdenv, fetchFromGitHub, ocaml, findlib, camlpdf, ncurses }: -if !lib.versionAtLeast ocaml.version "4.10" +if lib.versionOlder ocaml.version "4.10" then throw "cpdf is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/development/ocaml-modules/cstruct/lwt.nix b/pkgs/development/ocaml-modules/cstruct/lwt.nix index df8941d1260..60e73449264 100644 --- a/pkgs/development/ocaml-modules/cstruct/lwt.nix +++ b/pkgs/development/ocaml-modules/cstruct/lwt.nix @@ -1,6 +1,6 @@ { lib, buildDunePackage, cstruct, lwt }: -if !lib.versionAtLeast (cstruct.version or "1") "3" +if lib.versionOlder (cstruct.version or "1") "3" then cstruct else diff --git a/pkgs/development/ocaml-modules/cstruct/ppx.nix b/pkgs/development/ocaml-modules/cstruct/ppx.nix index 523a2c04f61..6705602ef25 100644 --- a/pkgs/development/ocaml-modules/cstruct/ppx.nix +++ b/pkgs/development/ocaml-modules/cstruct/ppx.nix @@ -2,7 +2,7 @@ , ounit, cppo, ppx_sexp_conv, cstruct-unix, cstruct-sexp }: -if !lib.versionAtLeast (cstruct.version or "1") "3" +if lib.versionOlder (cstruct.version or "1") "3" then cstruct else diff --git a/pkgs/development/ocaml-modules/cstruct/sexp.nix b/pkgs/development/ocaml-modules/cstruct/sexp.nix index b04810e4803..69972ad3403 100644 --- a/pkgs/development/ocaml-modules/cstruct/sexp.nix +++ b/pkgs/development/ocaml-modules/cstruct/sexp.nix @@ -1,6 +1,6 @@ { lib, buildDunePackage, ocaml, alcotest, cstruct, sexplib }: -if !lib.versionAtLeast (cstruct.version or "1") "3" +if lib.versionOlder (cstruct.version or "1") "3" then cstruct else diff --git a/pkgs/development/ocaml-modules/cstruct/unix.nix b/pkgs/development/ocaml-modules/cstruct/unix.nix index 1ea27bb04de..c3d280d785a 100644 --- a/pkgs/development/ocaml-modules/cstruct/unix.nix +++ b/pkgs/development/ocaml-modules/cstruct/unix.nix @@ -1,6 +1,6 @@ { lib, buildDunePackage, cstruct }: -if !lib.versionAtLeast (cstruct.version or "1") "3" +if lib.versionOlder (cstruct.version or "1") "3" then cstruct else diff --git a/pkgs/development/ocaml-modules/csv/lwt.nix b/pkgs/development/ocaml-modules/csv/lwt.nix index b0f771209aa..c90dc019b9d 100644 --- a/pkgs/development/ocaml-modules/csv/lwt.nix +++ b/pkgs/development/ocaml-modules/csv/lwt.nix @@ -1,6 +1,6 @@ { lib, buildDunePackage, ocaml, csv, ocaml_lwt }: -if !lib.versionAtLeast ocaml.version "4.02" +if lib.versionOlder ocaml.version "4.02" then throw "csv-lwt is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/development/ocaml-modules/ctypes/default.nix b/pkgs/development/ocaml-modules/ctypes/default.nix index 0558cf4a163..6e9aa98e1cc 100644 --- a/pkgs/development/ocaml-modules/ctypes/default.nix +++ b/pkgs/development/ocaml-modules/ctypes/default.nix @@ -1,6 +1,6 @@ { lib, stdenv, fetchFromGitHub, ocaml, findlib, libffi, pkg-config, ncurses, integers, bigarray-compat }: -if !lib.versionAtLeast ocaml.version "4.02" +if lib.versionOlder ocaml.version "4.02" then throw "ctypes is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/development/ocaml-modules/erm_xml/default.nix b/pkgs/development/ocaml-modules/erm_xml/default.nix index ebf9cdaad69..d1f93f57264 100644 --- a/pkgs/development/ocaml-modules/erm_xml/default.nix +++ b/pkgs/development/ocaml-modules/erm_xml/default.nix @@ -1,6 +1,6 @@ { stdenv, lib, fetchFromGitHub, ocaml, findlib, ocamlbuild }: -if !lib.versionAtLeast ocaml.version "4.02" +if lib.versionOlder ocaml.version "4.02" then throw "erm_xml is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/development/ocaml-modules/expat/default.nix b/pkgs/development/ocaml-modules/expat/default.nix index 6fb7927073d..0bd6c733e6f 100644 --- a/pkgs/development/ocaml-modules/expat/default.nix +++ b/pkgs/development/ocaml-modules/expat/default.nix @@ -20,7 +20,7 @@ stdenv.mkDerivation rec { strictDeps = true; - doCheck = !lib.versionAtLeast ocaml.version "4.06"; + doCheck = lib.versionOlder ocaml.version "4.06"; checkTarget = "testall"; createFindlibDestdir = true; diff --git a/pkgs/development/ocaml-modules/farfadet/default.nix b/pkgs/development/ocaml-modules/farfadet/default.nix index 1ac5595a015..a02866e3b4f 100644 --- a/pkgs/development/ocaml-modules/farfadet/default.nix +++ b/pkgs/development/ocaml-modules/farfadet/default.nix @@ -2,7 +2,7 @@ , faraday }: -if !lib.versionAtLeast ocaml.version "4.3" +if lib.versionOlder ocaml.version "4.3" then throw "farfadet is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/development/ocaml-modules/fmt/default.nix b/pkgs/development/ocaml-modules/fmt/default.nix index edf8d08eaab..4816cab57cf 100644 --- a/pkgs/development/ocaml-modules/fmt/default.nix +++ b/pkgs/development/ocaml-modules/fmt/default.nix @@ -1,6 +1,6 @@ { lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, cmdliner, seq, stdlib-shims }: -if !lib.versionAtLeast ocaml.version "4.05" +if lib.versionOlder ocaml.version "4.05" then throw "fmt is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/development/ocaml-modules/fpath/default.nix b/pkgs/development/ocaml-modules/fpath/default.nix index 53489f69cc3..84f25fed284 100644 --- a/pkgs/development/ocaml-modules/fpath/default.nix +++ b/pkgs/development/ocaml-modules/fpath/default.nix @@ -1,6 +1,6 @@ { stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg, astring }: -if !lib.versionAtLeast ocaml.version "4.03" +if lib.versionOlder ocaml.version "4.03" then throw "fpath is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/development/ocaml-modules/javalib/default.nix b/pkgs/development/ocaml-modules/javalib/default.nix index ccd3fa19a92..a12ade51c2e 100644 --- a/pkgs/development/ocaml-modules/javalib/default.nix +++ b/pkgs/development/ocaml-modules/javalib/default.nix @@ -8,7 +8,7 @@ , extlib }: -if !lib.versionAtLeast ocaml.version "4.04" +if lib.versionOlder ocaml.version "4.04" then throw "javalib is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/development/ocaml-modules/lablgl/default.nix b/pkgs/development/ocaml-modules/lablgl/default.nix index 85c27f93a09..fa525dbba81 100644 --- a/pkgs/development/ocaml-modules/lablgl/default.nix +++ b/pkgs/development/ocaml-modules/lablgl/default.nix @@ -1,6 +1,6 @@ { lib, stdenv, fetchFromGitHub, ocaml, findlib, libGLU, libGL, freeglut } : -if !lib.versionAtLeast ocaml.version "4.03" +if lib.versionOlder ocaml.version "4.03" then throw "lablgl is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/development/ocaml-modules/lablgtk-extras/default.nix b/pkgs/development/ocaml-modules/lablgtk-extras/default.nix index 736e345dfb3..75b3940a1d5 100644 --- a/pkgs/development/ocaml-modules/lablgtk-extras/default.nix +++ b/pkgs/development/ocaml-modules/lablgtk-extras/default.nix @@ -1,6 +1,6 @@ { stdenv, lib, fetchFromGitLab, ocaml, findlib, camlp4, config-file, lablgtk, xmlm }: -if !lib.versionAtLeast ocaml.version "4.02" +if lib.versionOlder ocaml.version "4.02" || lib.versionAtLeast ocaml.version "4.13" then throw "lablgtk-extras is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/development/ocaml-modules/logs/default.nix b/pkgs/development/ocaml-modules/logs/default.nix index 4359f09ebd3..adc7f255b19 100644 --- a/pkgs/development/ocaml-modules/logs/default.nix +++ b/pkgs/development/ocaml-modules/logs/default.nix @@ -8,7 +8,7 @@ let webpage = "https://erratique.ch/software/${pname}"; in -if !lib.versionAtLeast ocaml.version "4.03" +if lib.versionOlder ocaml.version "4.03" then throw "logs is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/development/ocaml-modules/lua-ml/default.nix b/pkgs/development/ocaml-modules/lua-ml/default.nix index 586fc395064..523e453b7d4 100644 --- a/pkgs/development/ocaml-modules/lua-ml/default.nix +++ b/pkgs/development/ocaml-modules/lua-ml/default.nix @@ -1,6 +1,6 @@ { stdenv, lib, fetchFromGitHub, ocaml, findlib, ocamlbuild, opaline }: -if !lib.versionAtLeast ocaml.version "4.07" +if lib.versionOlder ocaml.version "4.07" then throw "lua-ml is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/development/ocaml-modules/lwt/default.nix b/pkgs/development/ocaml-modules/lwt/default.nix index 96e3abc2674..5f1059395ab 100644 --- a/pkgs/development/ocaml-modules/lwt/default.nix +++ b/pkgs/development/ocaml-modules/lwt/default.nix @@ -4,7 +4,7 @@ , ocaml-syntax-shims }: -let inherit (lib) optional versionAtLeast; in +let inherit (lib) optional versionOlder; in buildDunePackage rec { pname = "lwt"; @@ -22,9 +22,9 @@ buildDunePackage rec { strictDeps = true; nativeBuildInputs = [ pkg-config cppo ] - ++ optional (!versionAtLeast ocaml.version "4.08") ocaml-syntax-shims; + ++ optional (versionOlder ocaml.version "4.08") ocaml-syntax-shims; buildInputs = [ dune-configurator ] - ++ optional (!versionAtLeast ocaml.version "4.07") ncurses; + ++ optional (versionOlder ocaml.version "4.07") ncurses; propagatedBuildInputs = [ libev mmap ocplib-endian seq result ]; meta = { diff --git a/pkgs/development/ocaml-modules/nocrypto/default.nix b/pkgs/development/ocaml-modules/nocrypto/default.nix index d179c8c1c90..e34e3ae0146 100644 --- a/pkgs/development/ocaml-modules/nocrypto/default.nix +++ b/pkgs/development/ocaml-modules/nocrypto/default.nix @@ -15,7 +15,7 @@ let ''; in -if !versionAtLeast ocaml.version "4.08" +if versionOlder ocaml.version "4.08" then throw "nocrypto is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/development/ocaml-modules/notty/default.nix b/pkgs/development/ocaml-modules/notty/default.nix index 1598b2ee5cd..2e53944a306 100644 --- a/pkgs/development/ocaml-modules/notty/default.nix +++ b/pkgs/development/ocaml-modules/notty/default.nix @@ -4,7 +4,7 @@ with lib; -if !versionAtLeast ocaml.version "4.05" +if versionOlder ocaml.version "4.05" then throw "notty is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/development/ocaml-modules/ocp-ocamlres/default.nix b/pkgs/development/ocaml-modules/ocp-ocamlres/default.nix index 763617be132..d084e7f8a62 100644 --- a/pkgs/development/ocaml-modules/ocp-ocamlres/default.nix +++ b/pkgs/development/ocaml-modules/ocp-ocamlres/default.nix @@ -1,6 +1,6 @@ { stdenv, lib, fetchFromGitHub, ocaml, findlib, astring, pprint }: -if !lib.versionAtLeast ocaml.version "4.02" +if lib.versionOlder ocaml.version "4.02" then throw "ocp-ocamlres is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/development/ocaml-modules/ocsigen-deriving/default.nix b/pkgs/development/ocaml-modules/ocsigen-deriving/default.nix index 480ea6daf20..6ffeec98304 100644 --- a/pkgs/development/ocaml-modules/ocsigen-deriving/default.nix +++ b/pkgs/development/ocaml-modules/ocsigen-deriving/default.nix @@ -9,7 +9,7 @@ , num }: -if !lib.versionAtLeast ocaml.version "4.03" +if lib.versionOlder ocaml.version "4.03" then throw "ocsigen-deriving is not available of OCaml ${ocaml.version}" else diff --git a/pkgs/development/ocaml-modules/ppxlib/default.nix b/pkgs/development/ocaml-modules/ppxlib/default.nix index c5b2dd762ce..2b7feddfa89 100644 --- a/pkgs/development/ocaml-modules/ppxlib/default.nix +++ b/pkgs/development/ocaml-modules/ppxlib/default.nix @@ -49,7 +49,7 @@ let param = { }."${version}"; in if param ? max_version && lib.versionAtLeast ocaml.version param.max_version -|| param ? min_version && !lib.versionAtLeast ocaml.version param.min_version +|| param ? min_version && lib.versionOlder ocaml.version param.min_version then throw "ppxlib-${version} is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/development/ocaml-modules/reactivedata/default.nix b/pkgs/development/ocaml-modules/reactivedata/default.nix index 23ebb3144d1..9be32d28bab 100644 --- a/pkgs/development/ocaml-modules/reactivedata/default.nix +++ b/pkgs/development/ocaml-modules/reactivedata/default.nix @@ -1,6 +1,6 @@ { lib, stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild, react, opaline }: -if !lib.versionAtLeast ocaml.version "4.04" +if lib.versionOlder ocaml.version "4.04" then throw "reactiveData is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/development/ocaml-modules/sawja/default.nix b/pkgs/development/ocaml-modules/sawja/default.nix index ec1b59c0407..eaad7e7f1bb 100644 --- a/pkgs/development/ocaml-modules/sawja/default.nix +++ b/pkgs/development/ocaml-modules/sawja/default.nix @@ -5,7 +5,7 @@ let version = "1.5.11"; in -if !lib.versionAtLeast ocaml.version "4.07" +if lib.versionOlder ocaml.version "4.07" then throw "${pname} is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/development/ocaml-modules/sedlex/default.nix b/pkgs/development/ocaml-modules/sedlex/default.nix index b808145bcbb..685d4426cfc 100644 --- a/pkgs/development/ocaml-modules/sedlex/default.nix +++ b/pkgs/development/ocaml-modules/sedlex/default.nix @@ -1,6 +1,6 @@ { stdenv, lib, fetchFromGitHub, ocaml, findlib, gen, ppx_tools_versioned, ocaml-migrate-parsetree }: -if !lib.versionAtLeast ocaml.version "4.02" +if lib.versionOlder ocaml.version "4.02" then throw "sedlex is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/development/ocaml-modules/sosa/default.nix b/pkgs/development/ocaml-modules/sosa/default.nix index 141e2a50193..623f21748a8 100644 --- a/pkgs/development/ocaml-modules/sosa/default.nix +++ b/pkgs/development/ocaml-modules/sosa/default.nix @@ -2,7 +2,7 @@ , findlib, ocaml, ocamlbuild }: -if !lib.versionAtLeast ocaml.version "4.02" +if lib.versionOlder ocaml.version "4.02" then throw "sosa is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/development/ocaml-modules/tsdl/default.nix b/pkgs/development/ocaml-modules/tsdl/default.nix index a56cccbe071..3a1990326df 100644 --- a/pkgs/development/ocaml-modules/tsdl/default.nix +++ b/pkgs/development/ocaml-modules/tsdl/default.nix @@ -1,6 +1,6 @@ { lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, ctypes, result, SDL2, pkg-config, ocb-stubblr }: -if !lib.versionAtLeast ocaml.version "4.03" +if lib.versionOlder ocaml.version "4.03" then throw "tsdl is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/development/ocaml-modules/uri/sexp.nix b/pkgs/development/ocaml-modules/uri/sexp.nix index 83be70c3649..ba970b1d6c5 100644 --- a/pkgs/development/ocaml-modules/uri/sexp.nix +++ b/pkgs/development/ocaml-modules/uri/sexp.nix @@ -1,6 +1,6 @@ { lib, ocaml, buildDunePackage, uri, ounit, ppx_sexp_conv, sexplib0 }: -if !lib.versionAtLeast ocaml.version "4.04" +if lib.versionOlder ocaml.version "4.04" then throw "uri-sexp is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/development/ocaml-modules/uucp/default.nix b/pkgs/development/ocaml-modules/uucp/default.nix index 9031087f505..42705e20d3f 100644 --- a/pkgs/development/ocaml-modules/uucp/default.nix +++ b/pkgs/development/ocaml-modules/uucp/default.nix @@ -8,7 +8,7 @@ let doCheck = true; in -if !(lib.versionAtLeast ocaml.version minimumOCamlVersion) +if lib.versionOlder ocaml.version minimumOCamlVersion then builtins.throw "${pname} needs at least OCaml ${minimumOCamlVersion}" else diff --git a/pkgs/development/ocaml-modules/uunf/default.nix b/pkgs/development/ocaml-modules/uunf/default.nix index 12031c53927..b61a60c2a37 100644 --- a/pkgs/development/ocaml-modules/uunf/default.nix +++ b/pkgs/development/ocaml-modules/uunf/default.nix @@ -5,7 +5,7 @@ let version = "14.0.0"; in -if !lib.versionAtLeast ocaml.version "4.03" +if lib.versionOlder ocaml.version "4.03" then throw "${pname} is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/development/ocaml-modules/vg/default.nix b/pkgs/development/ocaml-modules/vg/default.nix index 9dc7a4eeeef..35a0e51cb09 100644 --- a/pkgs/development/ocaml-modules/vg/default.nix +++ b/pkgs/development/ocaml-modules/vg/default.nix @@ -8,14 +8,14 @@ with lib; let - inherit (lib) optionals versionAtLeast; + inherit (lib) optionals versionOlder; pname = "vg"; version = "0.9.4"; webpage = "https://erratique.ch/software/${pname}"; in -if !versionAtLeast ocaml.version "4.03" +if versionOlder ocaml.version "4.03" then throw "vg is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/development/ocaml-modules/wasm/default.nix b/pkgs/development/ocaml-modules/wasm/default.nix index ffe8479b67e..5d53d6db418 100644 --- a/pkgs/development/ocaml-modules/wasm/default.nix +++ b/pkgs/development/ocaml-modules/wasm/default.nix @@ -1,6 +1,6 @@ { stdenv, lib, fetchFromGitHub, ocaml, findlib, ocamlbuild }: -if !lib.versionAtLeast ocaml.version "4.03" +if lib.versionOlder ocaml.version "4.03" || lib.versionOlder "4.13" ocaml.version then throw "wasm is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/development/ocaml-modules/xmlm/default.nix b/pkgs/development/ocaml-modules/xmlm/default.nix index f7aa1fdf113..d989b281cad 100644 --- a/pkgs/development/ocaml-modules/xmlm/default.nix +++ b/pkgs/development/ocaml-modules/xmlm/default.nix @@ -4,7 +4,7 @@ let webpage = "https://erratique.ch/software/${pname}"; in -if !lib.versionAtLeast ocaml.version "4.02" +if lib.versionOlder ocaml.version "4.02" then throw "xmlm is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/development/ocaml-modules/z3/default.nix b/pkgs/development/ocaml-modules/z3/default.nix index 35709b3105e..f2ece5550d7 100644 --- a/pkgs/development/ocaml-modules/z3/default.nix +++ b/pkgs/development/ocaml-modules/z3/default.nix @@ -1,6 +1,6 @@ { stdenv, lib, ocaml, findlib, zarith, z3 }: -if !lib.versionAtLeast ocaml.version "4.07" +if lib.versionOlder ocaml.version "4.07" then throw "z3 is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/development/ocaml-modules/zarith/default.nix b/pkgs/development/ocaml-modules/zarith/default.nix index 95351caee30..70f0be8c7af 100644 --- a/pkgs/development/ocaml-modules/zarith/default.nix +++ b/pkgs/development/ocaml-modules/zarith/default.nix @@ -3,7 +3,7 @@ , gmp }: -if !lib.versionAtLeast ocaml.version "4.04" +if lib.versionOlder ocaml.version "4.04" then throw "zarith is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/development/tools/electron/generic.nix b/pkgs/development/tools/electron/generic.nix index 7b1de804545..05d9facf60b 100644 --- a/pkgs/development/tools/electron/generic.nix +++ b/pkgs/development/tools/electron/generic.nix @@ -62,10 +62,10 @@ let electronLibPath = with lib; makeLibraryPath ( [ libuuid at-spi2-atk at-spi2-core libappindicator-gtk3 ] - ++ optionals (! versionOlder version "9.0.0") [ libdrm mesa ] - ++ optionals (! versionOlder version "11.0.0") [ libxkbcommon ] - ++ optionals (! versionOlder version "12.0.0") [ libxshmfence ] - ++ optionals (! versionOlder version "17.0.0") [ libglvnd ] + ++ optionals (versionAtLeast version "9.0.0") [ libdrm mesa ] + ++ optionals (versionAtLeast version "11.0.0") [ libxkbcommon ] + ++ optionals (versionAtLeast version "12.0.0") [ libxshmfence ] + ++ optionals (versionAtLeast version "17.0.0") [ libglvnd ] ); linux = { @@ -93,7 +93,7 @@ let --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ --set-rpath "${atomEnv.libPath}:${electronLibPath}:$out/lib/electron" \ $out/lib/electron/electron \ - ${lib.optionalString (! lib.versionOlder version "15.0.0") "$out/lib/electron/chrome_crashpad_handler" } + ${lib.optionalString (lib.versionAtLeast version "15.0.0") "$out/lib/electron/chrome_crashpad_handler" } wrapProgram $out/lib/electron/electron \ --prefix LD_PRELOAD : ${lib.makeLibraryPath [ libXScrnSaver ]}/libXss.so.1 \ diff --git a/pkgs/development/tools/ocaml/cppo/ocamlbuild.nix b/pkgs/development/tools/ocaml/cppo/ocamlbuild.nix index 633dc6bc7bf..d0627480ea1 100644 --- a/pkgs/development/tools/ocaml/cppo/ocamlbuild.nix +++ b/pkgs/development/tools/ocaml/cppo/ocamlbuild.nix @@ -1,6 +1,6 @@ { lib, buildDunePackage, cppo, ocamlbuild }: -if !lib.versionAtLeast (lib.getVersion cppo) "1.6" +if lib.versionOlder (lib.getVersion cppo) "1.6" then cppo else diff --git a/pkgs/development/tools/ocaml/dune/1.nix b/pkgs/development/tools/ocaml/dune/1.nix index 74deb9d2fa5..d6d3863afab 100644 --- a/pkgs/development/tools/ocaml/dune/1.nix +++ b/pkgs/development/tools/ocaml/dune/1.nix @@ -1,6 +1,6 @@ { stdenv, lib, fetchurl, ocaml, findlib, ncurses }: -if !lib.versionAtLeast ocaml.version "4.02" +if lib.versionOlder ocaml.version "4.02" || lib.versionAtLeast ocaml.version "4.12" then throw "dune 1 is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/development/tools/ocaml/merlin/4.x.nix b/pkgs/development/tools/ocaml/merlin/4.x.nix index 2d030b2d156..635273bcfd2 100644 --- a/pkgs/development/tools/ocaml/merlin/4.x.nix +++ b/pkgs/development/tools/ocaml/merlin/4.x.nix @@ -48,7 +48,7 @@ buildDunePackage { dot_merlin_reader = "${dot-merlin-reader}/bin/dot-merlin-reader"; dune = "${dune_2}/bin/dune"; }) - ] ++ lib.optional (!lib.versionAtLeast ocaml.version "4.12") + ] ++ lib.optional (lib.versionOlder ocaml.version "4.12") # This fixes the test-suite on macOS # See https://github.com/ocaml/merlin/pull/1399 # Fixed in 4.4 for OCaml ≥ 4.12 diff --git a/pkgs/os-specific/linux/nvidia-x11/default.nix b/pkgs/os-specific/linux/nvidia-x11/default.nix index 76df6047390..100ca403f62 100644 --- a/pkgs/os-specific/linux/nvidia-x11/default.nix +++ b/pkgs/os-specific/linux/nvidia-x11/default.nix @@ -3,8 +3,8 @@ let generic = args: let imported = import ./generic.nix args; - in if ((!lib.versionOlder args.version "391") - && stdenv.hostPlatform.system != "x86_64-linux") then null + in if lib.versionAtLeast args.version "391" + && stdenv.hostPlatform.system != "x86_64-linux" then null else callPackage imported { lib32 = (pkgsi686Linux.callPackage imported { libsOnly = true; diff --git a/pkgs/os-specific/linux/nvidia-x11/generic.nix b/pkgs/os-specific/linux/nvidia-x11/generic.nix index c7e062534a4..bc867d8b82b 100644 --- a/pkgs/os-specific/linux/nvidia-x11/generic.nix +++ b/pkgs/os-specific/linux/nvidia-x11/generic.nix @@ -33,7 +33,7 @@ with lib; assert !libsOnly -> kernel != null; assert versionOlder version "391" -> sha256_32bit != null; -assert ! versionOlder version "391" -> stdenv.hostPlatform.system == "x86_64-linux"; +assert versionAtLeast version "391" -> stdenv.hostPlatform.system == "x86_64-linux"; let nameSuffix = optionalString (!libsOnly) "-${kernel.version}"; diff --git a/pkgs/os-specific/linux/rtl8723bs/default.nix b/pkgs/os-specific/linux/rtl8723bs/default.nix index a862b351716..b6ab883ca75 100644 --- a/pkgs/os-specific/linux/rtl8723bs/default.nix +++ b/pkgs/os-specific/linux/rtl8723bs/default.nix @@ -35,7 +35,7 @@ stdenv.mkDerivation rec { homepage = "https://github.com/hadess/rtl8723bs"; license = lib.licenses.gpl2; platforms = lib.platforms.linux; - broken = (! versionOlder kernel.version "4.12"); # Now in kernel staging drivers + broken = versionAtLeast kernel.version "4.12"; # Now in kernel staging drivers maintainers = with maintainers; [ elitak ]; }; } diff --git a/pkgs/os-specific/linux/sch_cake/default.nix b/pkgs/os-specific/linux/sch_cake/default.nix index a959fac5dca..f93713344ef 100644 --- a/pkgs/os-specific/linux/sch_cake/default.nix +++ b/pkgs/os-specific/linux/sch_cake/default.nix @@ -29,6 +29,6 @@ stdenv.mkDerivation { license = with licenses; [ bsd3 gpl2 ]; maintainers = with maintainers; [ fpletz ]; platforms = platforms.linux; - broken = !lib.versionOlder kernel.version "4.13"; + broken = lib.versionAtLeast kernel.version "4.13"; }; } diff --git a/pkgs/servers/foundationdb/vsmake.nix b/pkgs/servers/foundationdb/vsmake.nix index 52807fc0620..776e724c9c6 100644 --- a/pkgs/servers/foundationdb/vsmake.nix +++ b/pkgs/servers/foundationdb/vsmake.nix @@ -84,7 +84,7 @@ let makeFlags = [ "all" "fdb_java" "fdb_python" ] # Don't compile FDBLibTLS if we don't need it in 6.0 or later; # it gets statically linked in - ++ lib.optional (!lib.versionAtLeast version "6.0") [ "fdb_c" ] + ++ lib.optional (lib.versionOlder version "6.0") [ "fdb_c" ] # Needed environment overrides ++ [ "KVRELEASE=1" "NOSTRIP=1" @@ -100,7 +100,7 @@ let installPhase = '' mkdir -vp $out/{bin,libexec/plugins} $lib/{lib,share/java} $dev/include/foundationdb - '' + lib.optionalString (!lib.versionAtLeast version "6.0") '' + '' + lib.optionalString (lib.versionOlder version "6.0") '' # we only copy the TLS library on < 6.0, since it's compiled-in otherwise cp -v ./lib/libFDBLibTLS.so $out/libexec/plugins/FDBLibTLS.so '' + '' diff --git a/pkgs/top-level/php-packages.nix b/pkgs/top-level/php-packages.nix index 1cc267de788..a5d553ac629 100644 --- a/pkgs/top-level/php-packages.nix +++ b/pkgs/top-level/php-packages.nix @@ -461,7 +461,7 @@ lib.makeScope pkgs.newScope (self: with self; { '') ]; zendExtension = true; - doCheck = !(lib.versionOlder php.version "7.4"); + doCheck = lib.versionAtLeast php.version "7.4"; # Tests launch the builtin webserver. __darwinAllowLocalNetworking = true; } @@ -525,7 +525,7 @@ lib.makeScope pkgs.newScope (self: with self; { ''; doCheck = false; } - { name = "session"; doCheck = !(lib.versionAtLeast php.version "8.0"); } + { name = "session"; doCheck = lib.versionOlder php.version "8.0"; } { name = "shmop"; } { name = "simplexml"; -- cgit 1.4.1