From 43453d562a909eb251fb8d1c02c1340737f973c1 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 23 Mar 2022 07:12:22 +0000 Subject: [PATCH 1/6] nodejs-17_x: 17.7.2 -> 17.8.0 --- pkgs/development/web/nodejs/v17.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/web/nodejs/v17.nix b/pkgs/development/web/nodejs/v17.nix index 20d76246020e..1c4dcc02a971 100644 --- a/pkgs/development/web/nodejs/v17.nix +++ b/pkgs/development/web/nodejs/v17.nix @@ -7,8 +7,8 @@ let in buildNodejs { inherit enableNpm; - version = "17.7.2"; - sha256 = "sha256-OuXnTgsWIoz37faIU1mp0uAZrIQ5BsXgGUjXRvq6Sq8="; + version = "17.8.0"; + sha256 = "0jsf6sv42rzpizvil7g1gf9bskh8lx0gcxg0yzpr4hk7mx7i90br"; patches = [ ./disable-darwin-v8-system-instrumentation.patch ]; From 1eae4d84686f2cf687c154605479f259e6c8faeb Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 25 Mar 2022 04:58:49 +0000 Subject: [PATCH 2/6] flexget: 3.3.3 -> 3.3.4 --- pkgs/applications/networking/flexget/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/flexget/default.nix b/pkgs/applications/networking/flexget/default.nix index f4a2306017a9..96d3e773c88c 100644 --- a/pkgs/applications/networking/flexget/default.nix +++ b/pkgs/applications/networking/flexget/default.nix @@ -5,14 +5,14 @@ python3Packages.buildPythonApplication rec { pname = "flexget"; - version = "3.3.3"; + version = "3.3.4"; # Fetch from GitHub in order to use `requirements.in` src = fetchFromGitHub { owner = "flexget"; repo = "flexget"; rev = "v${version}"; - hash = "sha256-a76x4Klad3lct2M9RxSroUYKmEX7lPqDN+dFvfjavo8="; + hash = "sha256-/nuY8+/RMM7ASke+NXb95yu+FeQHawCdgqVsBrk/KZ8="; }; postPatch = '' From 7d0e21c77e3c8b1d6dcd26a3710922087fe99df2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20He=C3=9F?= Date: Fri, 25 Mar 2022 11:36:29 +0100 Subject: [PATCH 3/6] nixos/test-runner: Allow writing to qemu stdin --- .../writing-nixos-tests.section.md | 13 ++++++++ .../writing-nixos-tests.section.xml | 28 +++++++++++++++++ nixos/lib/test-driver/test_driver/machine.py | 30 ++++++++++++++++++- 3 files changed, 70 insertions(+), 1 deletion(-) diff --git a/nixos/doc/manual/development/writing-nixos-tests.section.md b/nixos/doc/manual/development/writing-nixos-tests.section.md index 7de57d0d2a37..433e1906f775 100644 --- a/nixos/doc/manual/development/writing-nixos-tests.section.md +++ b/nixos/doc/manual/development/writing-nixos-tests.section.md @@ -158,6 +158,12 @@ The following methods are available on machine objects: e.g., `send_chars("foobar\n")` will type the string `foobar` followed by the Enter key. +`send_console` + +: Send keys to the kernel console. This allows interaction with the systemd + emergency mode, for example. Takes a string that is sent, e.g., + `send_console("\n\nsystemctl default\n")`. + `execute` : Execute a shell command, returning a list `(status, stdout)`. @@ -272,6 +278,13 @@ The following methods are available on machine objects: Killing the interactive session with `Ctrl-d` or `Ctrl-c` also ends the guest session. +`console_interact` + +: Allows you to directly interact with QEMU's stdin. This should + only be used during test development, not in production tests. + Output from QEMU is only read line-wise. `Ctrl-c` kills QEMU and + `Ctrl-d` closes console and returns to the test runner. + To test user units declared by `systemd.user.services` the optional `user` argument can be used: diff --git a/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml b/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml index 45c9c40c6095..4f856f98f2a2 100644 --- a/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml +++ b/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml @@ -261,6 +261,19 @@ start_all() + + + send_console + + + + Send keys to the kernel console. This allows interaction + with the systemd emergency mode, for example. Takes a string + that is sent, e.g., + send_console("\n\nsystemctl default\n"). + + + execute @@ -502,6 +515,21 @@ machine.systemctl("list-jobs --no-pager", "any-user") # spaw + + + console_interact + + + + Allows you to directly interact with QEMU’s stdin. This + should only be used during test development, not in + production tests. Output from QEMU is only read line-wise. + Ctrl-c kills QEMU and + Ctrl-d closes console and returns to the + test runner. + + + To test user units declared by diff --git a/nixos/lib/test-driver/test_driver/machine.py b/nixos/lib/test-driver/test_driver/machine.py index 569a0f3c61e4..f3e615fe5bf9 100644 --- a/nixos/lib/test-driver/test_driver/machine.py +++ b/nixos/lib/test-driver/test_driver/machine.py @@ -198,7 +198,7 @@ class StartCommand: ) -> subprocess.Popen: return subprocess.Popen( self.cmd(monitor_socket_path, shell_socket_path), - stdin=subprocess.DEVNULL, + stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True, @@ -558,6 +558,28 @@ class Machine: pass_fds=[self.shell.fileno()], ) + def console_interact(self) -> None: + """Allows you to interact with QEMU's stdin + + The shell can be exited with Ctrl+D. Note that Ctrl+C is not allowed to be used. + QEMU's stdout is read line-wise. + + Should only be used during test development, not in the production test.""" + self.log("Terminal is ready (there is no prompt):") + + assert self.process + assert self.process.stdin + + while True: + try: + char = sys.stdin.buffer.read(1) + except KeyboardInterrupt: + break + if char == b"": # ctrl+d + self.log("Closing connection to the console") + break + self.send_console(char.decode()) + def succeed(self, *commands: str, timeout: Optional[int] = None) -> str: """Execute each command and check that it succeeds.""" output = "" @@ -834,6 +856,12 @@ class Machine: self.send_monitor_command("sendkey {}".format(key)) time.sleep(0.01) + def send_console(self, chars: str) -> None: + assert self.process + assert self.process.stdin + self.process.stdin.write(chars.encode()) + self.process.stdin.flush() + def start(self) -> None: if self.booted: return From e440c8b3c3d55570d46f54a7382b304f31fdb7f8 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 25 Mar 2022 11:19:56 +0000 Subject: [PATCH 4/6] python310Packages.asyncsleepiq: 1.2.0 -> 1.2.1 --- pkgs/development/python-modules/asyncsleepiq/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/asyncsleepiq/default.nix b/pkgs/development/python-modules/asyncsleepiq/default.nix index 93b4aca2aa71..7eaac6490644 100644 --- a/pkgs/development/python-modules/asyncsleepiq/default.nix +++ b/pkgs/development/python-modules/asyncsleepiq/default.nix @@ -7,14 +7,14 @@ buildPythonPackage rec { pname = "asyncsleepiq"; - version = "1.2.0"; + version = "1.2.1"; format = "setuptools"; disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - sha256 = "sha256-bE9eOjOLERnioOunIBN7Hc/Nvs1zDXMSMzqZsVRg6Jo="; + sha256 = "sha256-pIfEdNmtnwA+PE3lXVd7Qd8Igj+/aqZmuDqFs60PxgY="; }; propagatedBuildInputs = [ From 661ee6b46824286320843905569061c4a5a2594b Mon Sep 17 00:00:00 2001 From: Ulrik Strid Date: Fri, 4 Mar 2022 11:30:58 +0100 Subject: [PATCH 5/6] ocamlPackages treewide: Add missing inputs --- pkgs/development/ocaml-modules/batteries/default.nix | 4 ++-- pkgs/development/ocaml-modules/conduit/default.nix | 3 +-- pkgs/development/ocaml-modules/elina/default.nix | 4 ++-- pkgs/development/ocaml-modules/gmetadom/default.nix | 4 ++-- pkgs/development/ocaml-modules/hack_parallel/default.nix | 2 +- pkgs/development/ocaml-modules/mccs/default.nix | 2 +- pkgs/development/ocaml-modules/mirage-logs/default.nix | 4 ++-- pkgs/development/ocaml-modules/mirage-profile/default.nix | 4 ++-- pkgs/development/ocaml-modules/mlgmpidl/default.nix | 5 ++--- pkgs/development/ocaml-modules/odoc-parser/default.nix | 2 +- pkgs/development/ocaml-modules/opium_kernel/default.nix | 3 ++- pkgs/development/ocaml-modules/pcap-format/default.nix | 3 ++- pkgs/development/ocaml-modules/pipebang/default.nix | 2 +- pkgs/development/ocaml-modules/piqi-ocaml/default.nix | 4 +++- pkgs/development/ocaml-modules/ppx_cstubs/default.nix | 8 +++++--- .../ocaml-modules/ppx_deriving_protobuf/default.nix | 6 ++++-- .../ocaml-modules/shared-memory-ring/default.nix | 2 ++ pkgs/development/ocaml-modules/ulex/default.nix | 1 + 18 files changed, 36 insertions(+), 27 deletions(-) diff --git a/pkgs/development/ocaml-modules/batteries/default.nix b/pkgs/development/ocaml-modules/batteries/default.nix index 184f10a52be4..865518ec29c7 100644 --- a/pkgs/development/ocaml-modules/batteries/default.nix +++ b/pkgs/development/ocaml-modules/batteries/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchFromGitHub, ocaml, findlib, ocamlbuild, qtest, num, ounit +{ stdenv, lib, fetchFromGitHub, ocaml, findlib, ocamlbuild, qtest, qcheck, num, ounit , doCheck ? lib.versionAtLeast ocaml.version "4.08" && !stdenv.isAarch64 }: @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ ocaml findlib ocamlbuild ]; - checkInputs = [ qtest ounit ]; + checkInputs = [ qtest ounit qcheck ]; propagatedBuildInputs = [ num ]; strictDeps = !doCheck; diff --git a/pkgs/development/ocaml-modules/conduit/default.nix b/pkgs/development/ocaml-modules/conduit/default.nix index 1dc28b2b5f79..6261ba2801b0 100644 --- a/pkgs/development/ocaml-modules/conduit/default.nix +++ b/pkgs/development/ocaml-modules/conduit/default.nix @@ -15,8 +15,7 @@ buildDunePackage rec { sha256 = "2a37ffaa352a1e145ef3d80ac28661213c69a741b238623e59f29e3d5a12c537"; }; - buildInputs = [ ppx_sexp_conv ]; - propagatedBuildInputs = [ astring ipaddr ipaddr-sexp sexplib uri logs ]; + propagatedBuildInputs = [ astring ipaddr ipaddr-sexp sexplib uri logs ppx_sexp_conv ]; meta = { description = "A network connection establishment library"; diff --git a/pkgs/development/ocaml-modules/elina/default.nix b/pkgs/development/ocaml-modules/elina/default.nix index df7f140e5458..ec4199cc06eb 100644 --- a/pkgs/development/ocaml-modules/elina/default.nix +++ b/pkgs/development/ocaml-modules/elina/default.nix @@ -8,9 +8,9 @@ stdenv.mkDerivation rec { sha256 = "1nymykskq1yx87y4xl6hl9i4q6kv0qaq25rniqgl1bfn883p1ysc"; }; - nativeBuildInputs = [ perl ocaml findlib ]; + nativeBuildInputs = [ perl ocaml findlib camlidl ]; - propagatedBuildInputs = [ apron camlidl gmp mpfr ]; + propagatedBuildInputs = [ apron gmp mpfr ]; strictDeps = true; diff --git a/pkgs/development/ocaml-modules/gmetadom/default.nix b/pkgs/development/ocaml-modules/gmetadom/default.nix index 50be2adcb384..fe4f85a0024f 100644 --- a/pkgs/development/ocaml-modules/gmetadom/default.nix +++ b/pkgs/development/ocaml-modules/gmetadom/default.nix @@ -22,8 +22,8 @@ stdenv.mkDerivation rec { ''; nativeBuildInputs = [ pkg-config ocaml findlib ]; - buildInputs = [ gdome2 libxslt]; - propagatedBuildInputs = [gdome2]; + buildInputs = [ libxslt ]; + propagatedBuildInputs = [ gdome2 ]; strictDeps = true; diff --git a/pkgs/development/ocaml-modules/hack_parallel/default.nix b/pkgs/development/ocaml-modules/hack_parallel/default.nix index f9bc67772125..122ee2149f3a 100644 --- a/pkgs/development/ocaml-modules/hack_parallel/default.nix +++ b/pkgs/development/ocaml-modules/hack_parallel/default.nix @@ -15,7 +15,7 @@ buildDunePackage rec { nativeBuildInputs = [ pkg-config ]; - buildInputs = [ core core_kernel sqlite ]; + propagatedBuildInputs = [ core core_kernel sqlite ]; meta = { description = diff --git a/pkgs/development/ocaml-modules/mccs/default.nix b/pkgs/development/ocaml-modules/mccs/default.nix index beadceff02b0..50abdf631db8 100644 --- a/pkgs/development/ocaml-modules/mccs/default.nix +++ b/pkgs/development/ocaml-modules/mccs/default.nix @@ -13,7 +13,7 @@ buildDunePackage rec { useDune2 = true; - buildInputs = [ + propagatedBuildInputs = [ cudf ]; diff --git a/pkgs/development/ocaml-modules/mirage-logs/default.nix b/pkgs/development/ocaml-modules/mirage-logs/default.nix index 2a7670ce3722..7aabd51b819a 100644 --- a/pkgs/development/ocaml-modules/mirage-logs/default.nix +++ b/pkgs/development/ocaml-modules/mirage-logs/default.nix @@ -1,6 +1,6 @@ { lib, fetchurl, buildDunePackage , logs, lwt, mirage-clock, mirage-profile, ptime -, alcotest +, alcotest, stdlib-shims }: buildDunePackage rec { @@ -14,7 +14,7 @@ buildDunePackage rec { sha256 = "0h0amzjxy067jljscib7fvw5q8k0adqa8m86affha9hq5jsh07a1"; }; - propagatedBuildInputs = [ logs lwt mirage-clock mirage-profile ptime ]; + propagatedBuildInputs = [ logs lwt mirage-clock mirage-profile ptime stdlib-shims ]; doCheck = true; checkInputs = [ alcotest ]; diff --git a/pkgs/development/ocaml-modules/mirage-profile/default.nix b/pkgs/development/ocaml-modules/mirage-profile/default.nix index c6ca730bf3c5..ef856e021273 100644 --- a/pkgs/development/ocaml-modules/mirage-profile/default.nix +++ b/pkgs/development/ocaml-modules/mirage-profile/default.nix @@ -1,5 +1,5 @@ { lib, fetchurl, buildDunePackage -, ppx_cstruct +, ppx_cstruct, stdlib-shims , cstruct, lwt }: @@ -15,7 +15,7 @@ buildDunePackage rec { }; buildInputs = [ ppx_cstruct ]; - propagatedBuildInputs = [ cstruct lwt ]; + propagatedBuildInputs = [ cstruct lwt stdlib-shims ]; meta = with lib; { description = "Collect runtime profiling information in CTF format"; diff --git a/pkgs/development/ocaml-modules/mlgmpidl/default.nix b/pkgs/development/ocaml-modules/mlgmpidl/default.nix index d12329b811e6..33f9f2d8e6b0 100644 --- a/pkgs/development/ocaml-modules/mlgmpidl/default.nix +++ b/pkgs/development/ocaml-modules/mlgmpidl/default.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { sha256 = "17xqiclaqs4hmnb92p9z6z9a1xfr31vcn8nlnj8ykk57by31vfza"; }; - nativeBuildInputs = [ perl ocaml findlib mpfr camlidl ]; + nativeBuildInputs = [ perl ocaml findlib camlidl ]; buildInputs = [ gmp mpfr ]; strictDeps = true; @@ -22,8 +22,7 @@ stdenv.mkDerivation rec { ]; postConfigure = '' - sed -i Makefile \ - -e 's|/bin/rm|rm|' + substituteInPlace Makefile --replace "/bin/rm" "rm" mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/stublibs ''; diff --git a/pkgs/development/ocaml-modules/odoc-parser/default.nix b/pkgs/development/ocaml-modules/odoc-parser/default.nix index 7a2b5abd974b..9e4e4bc8d1de 100644 --- a/pkgs/development/ocaml-modules/odoc-parser/default.nix +++ b/pkgs/development/ocaml-modules/odoc-parser/default.nix @@ -23,7 +23,7 @@ buildDunePackage rec { useDune2 = true; - buildInputs = [ astring result ]; + propagatedBuildInputs = [ astring result ]; meta = { description = "Parser for Ocaml documentation comments"; diff --git a/pkgs/development/ocaml-modules/opium_kernel/default.nix b/pkgs/development/ocaml-modules/opium_kernel/default.nix index c7bfe1e7306a..6b51443df232 100644 --- a/pkgs/development/ocaml-modules/opium_kernel/default.nix +++ b/pkgs/development/ocaml-modules/opium_kernel/default.nix @@ -9,6 +9,7 @@ , ezjsonm , hmap , sexplib +, fieldslib }: buildDunePackage rec { @@ -31,7 +32,7 @@ buildDunePackage rec { ]; propagatedBuildInputs = [ - hmap cohttp-lwt ezjsonm sexplib + hmap cohttp-lwt ezjsonm sexplib fieldslib ]; meta = { diff --git a/pkgs/development/ocaml-modules/pcap-format/default.nix b/pkgs/development/ocaml-modules/pcap-format/default.nix index f8bb6f4f6b2d..ae093cc7817e 100644 --- a/pkgs/development/ocaml-modules/pcap-format/default.nix +++ b/pkgs/development/ocaml-modules/pcap-format/default.nix @@ -1,6 +1,6 @@ { lib, buildDunePackage, fetchurl , ppx_cstruct, ppx_tools -, cstruct, ounit, mmap +, cstruct, ounit, mmap, stdlib-shims }: buildDunePackage rec { @@ -24,6 +24,7 @@ buildDunePackage rec { propagatedBuildInputs = [ cstruct + stdlib-shims ]; doCheck = true; diff --git a/pkgs/development/ocaml-modules/pipebang/default.nix b/pkgs/development/ocaml-modules/pipebang/default.nix index 251aeb8de8ec..e2bd4d3ec5c8 100644 --- a/pkgs/development/ocaml-modules/pipebang/default.nix +++ b/pkgs/development/ocaml-modules/pipebang/default.nix @@ -15,7 +15,7 @@ buildOcaml rec { strictDeps = true; - buildInputs = [ camlp4 ]; + propagatedBuildInputs = [ camlp4 ]; meta = with lib; { homepage = "https://github.com/janestreet/pipebang"; diff --git a/pkgs/development/ocaml-modules/piqi-ocaml/default.nix b/pkgs/development/ocaml-modules/piqi-ocaml/default.nix index 4f2e4693357f..8c0276bc9a7a 100644 --- a/pkgs/development/ocaml-modules/piqi-ocaml/default.nix +++ b/pkgs/development/ocaml-modules/piqi-ocaml/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, fetchpatch, ocaml, findlib, piqi, stdlib-shims }: +{ lib, stdenv, fetchFromGitHub, fetchpatch, ocaml, findlib, piqi, stdlib-shims, num }: stdenv.mkDerivation rec { version = "0.7.7"; @@ -15,6 +15,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ ocaml findlib ]; buildInputs = [ piqi stdlib-shims ]; + checkInputs = [ num ]; + strictDeps = true; createFindlibDestdir = true; diff --git a/pkgs/development/ocaml-modules/ppx_cstubs/default.nix b/pkgs/development/ocaml-modules/ppx_cstubs/default.nix index f4794eea76ed..f2c844ea0482 100644 --- a/pkgs/development/ocaml-modules/ppx_cstubs/default.nix +++ b/pkgs/development/ocaml-modules/ppx_cstubs/default.nix @@ -27,17 +27,19 @@ buildDunePackage rec { sha256 = "15cjb9ygnvp2kv85rrb7ncz7yalifyl7wd2hp2cl8r1qrpgi1d0w"; }; - nativeBuildInputs = [ cppo ]; + nativeBuildInputs = [ cppo findlib ]; buildInputs = [ bigarray-compat containers - ctypes integers num ppxlib re - findlib + ]; + + propagatedBuildInputs = [ + ctypes ]; strictDeps = true; diff --git a/pkgs/development/ocaml-modules/ppx_deriving_protobuf/default.nix b/pkgs/development/ocaml-modules/ppx_deriving_protobuf/default.nix index 6f23af44b949..43cc2992c2a0 100644 --- a/pkgs/development/ocaml-modules/ppx_deriving_protobuf/default.nix +++ b/pkgs/development/ocaml-modules/ppx_deriving_protobuf/default.nix @@ -1,5 +1,5 @@ { lib, fetchurl, buildDunePackage, cppo, ppx_deriving -, ppxlib +, ppxlib, dune-configurator }: buildDunePackage rec { @@ -13,7 +13,9 @@ buildDunePackage rec { sha256 = "1dc1vxnkd0cnrgac5v3zbaj2lq1d2w8118mp1cmsdxylp06yz1sj"; }; - buildInputs = [ cppo ppxlib ppx_deriving ]; + nativeBuildInputs = [ cppo ]; + buildInputs = [ ppxlib dune-configurator ]; + propagatedBuildInputs = [ ppx_deriving ]; meta = with lib; { homepage = "https://github.com/ocaml-ppx/ppx_deriving_protobuf"; diff --git a/pkgs/development/ocaml-modules/shared-memory-ring/default.nix b/pkgs/development/ocaml-modules/shared-memory-ring/default.nix index 3a96d4adee4c..17dd6183c0da 100644 --- a/pkgs/development/ocaml-modules/shared-memory-ring/default.nix +++ b/pkgs/development/ocaml-modules/shared-memory-ring/default.nix @@ -5,6 +5,7 @@ , mirage-profile , cstruct , ounit +, stdlib-shims }: buildDunePackage rec { @@ -25,6 +26,7 @@ buildDunePackage rec { propagatedBuildInputs = [ mirage-profile cstruct + stdlib-shims ]; doCheck = true; diff --git a/pkgs/development/ocaml-modules/ulex/default.nix b/pkgs/development/ocaml-modules/ulex/default.nix index 9a5848db3f7b..d08f2c4c0ae3 100644 --- a/pkgs/development/ocaml-modules/ulex/default.nix +++ b/pkgs/development/ocaml-modules/ulex/default.nix @@ -26,6 +26,7 @@ stdenv.mkDerivation rec { createFindlibDestdir = true; nativeBuildInputs = [ ocaml findlib ocamlbuild camlp4 ]; + propagatedBuildInputs = [ camlp4 ]; strictDeps = true; From d6e2e39a6e5998e4ad4cbd9d422835b365dfa763 Mon Sep 17 00:00:00 2001 From: Ulrik Strid Date: Fri, 4 Mar 2022 11:34:13 +0100 Subject: [PATCH 6/6] ocamlPackages.nonstd,facile: run `dune upgrade` for newer ocaml versions This allows us to build the packages on OCaml >=4.12 Co-authored-by: Sandro --- pkgs/development/ocaml-modules/facile/default.nix | 7 ++++--- pkgs/development/ocaml-modules/nonstd/default.nix | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pkgs/development/ocaml-modules/facile/default.nix b/pkgs/development/ocaml-modules/facile/default.nix index df228603e9f4..3eab7d3417fc 100644 --- a/pkgs/development/ocaml-modules/facile/default.nix +++ b/pkgs/development/ocaml-modules/facile/default.nix @@ -1,11 +1,9 @@ -{ lib, fetchurl, buildDunePackage }: +{ lib, fetchurl, buildDunePackage, ocaml }: buildDunePackage rec { pname = "facile"; version = "1.1.4"; - useDune2 = false; - src = fetchurl { url = "https://github.com/Emmanuel-PLF/facile/releases/download/${version}/facile-${version}.tbz"; sha256 = "0jqrwmn6fr2vj2rrbllwxq4cmxykv7zh0y4vnngx29f5084a04jp"; @@ -13,6 +11,9 @@ buildDunePackage rec { doCheck = true; + useDune2 = lib.versionAtLeast ocaml.version "4.12"; + postPatch = lib.optionalString useDune2 "dune upgrade"; + meta = { homepage = "http://opti.recherche.enac.fr/facile/"; license = lib.licenses.lgpl21Plus; diff --git a/pkgs/development/ocaml-modules/nonstd/default.nix b/pkgs/development/ocaml-modules/nonstd/default.nix index 82b1feed540b..696cdff52196 100644 --- a/pkgs/development/ocaml-modules/nonstd/default.nix +++ b/pkgs/development/ocaml-modules/nonstd/default.nix @@ -1,11 +1,9 @@ -{ lib, fetchzip, buildDunePackage }: +{ lib, fetchzip, buildDunePackage, ocaml }: buildDunePackage rec { pname = "nonstd"; version = "0.0.3"; - useDune2 = false; - minimalOCamlVersion = "4.02"; src = fetchzip { @@ -13,6 +11,8 @@ buildDunePackage rec { sha256 = "0ccjwcriwm8fv29ij1cnbc9win054kb6pfga3ygzdbjpjb778j46"; }; + useDune2 = lib.versionAtLeast ocaml.version "4.12"; + postPatch = lib.optionalString useDune2 "dune upgrade"; doCheck = true; meta = with lib; {