From 9de077115473b21ac6a8ace3b9d76871b28c0430 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Fri, 12 May 2023 05:50:33 +0200 Subject: [PATCH 1/2] ocamlPackages.ringo: disable for OCaml < 4.08 --- pkgs/development/ocaml-modules/ringo/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/ocaml-modules/ringo/default.nix b/pkgs/development/ocaml-modules/ringo/default.nix index f826b03f6aa1..4920a2910b8f 100644 --- a/pkgs/development/ocaml-modules/ringo/default.nix +++ b/pkgs/development/ocaml-modules/ringo/default.nix @@ -10,7 +10,7 @@ buildDunePackage rec { sha256 = "sha256-9HW3M27BxrEPbF8cMHwzP8FmJduUInpQQAE2672LOuU="; }; - minimalOCamlVersion = "4.05"; + minimalOCamlVersion = "4.08"; doCheck = true; From e7b211e3d26aba0b370e17c32e0c1ae36f73e508 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Fri, 12 May 2023 05:50:40 +0200 Subject: [PATCH 2/2] ocamlPackages: default to version 3 of Dune --- pkgs/build-support/ocaml/dune.nix | 2 +- .../ocaml-modules/dune-build-info/default.nix | 8 +++----- .../ocaml-modules/dune-configurator/default.nix | 13 ++++++++----- pkgs/development/ocaml-modules/lame/default.nix | 2 +- pkgs/development/ocaml-modules/lo/default.nix | 2 ++ .../ocaml-modules/ocaml-gettext/stub.nix | 2 ++ pkgs/development/ocaml-modules/ounit2/default.nix | 8 ++++---- pkgs/development/ocaml-modules/shine/default.nix | 2 -- .../tools/ocaml/js_of_ocaml/ocamlbuild.nix | 2 +- 9 files changed, 22 insertions(+), 19 deletions(-) diff --git a/pkgs/build-support/ocaml/dune.nix b/pkgs/build-support/ocaml/dune.nix index 2dfba9e74050..972244f80b0a 100644 --- a/pkgs/build-support/ocaml/dune.nix +++ b/pkgs/build-support/ocaml/dune.nix @@ -3,7 +3,7 @@ { pname, version, nativeBuildInputs ? [], enableParallelBuilding ? true, ... }@args: let Dune = - let dune-version = args.duneVersion or "2"; in + let dune-version = args.duneVersion or "3"; in { "1" = dune_1; "2" = dune_2; "3" = dune_3; }."${dune-version}" ; in diff --git a/pkgs/development/ocaml-modules/dune-build-info/default.nix b/pkgs/development/ocaml-modules/dune-build-info/default.nix index 9eb7afa2c408..ac9b127cac38 100644 --- a/pkgs/development/ocaml-modules/dune-build-info/default.nix +++ b/pkgs/development/ocaml-modules/dune-build-info/default.nix @@ -1,17 +1,15 @@ -{ lib, buildDunePackage, dune_2, dune-action-plugin }: +{ lib, buildDunePackage, dune-action-plugin }: buildDunePackage rec { pname = "dune-build-info"; - inherit (dune_2) src version patches; - - useDune2 = true; + inherit (dune-action-plugin) src version preBuild; dontAddPrefix = true; buildInputs = [ dune-action-plugin ]; meta = with lib; { - inherit (dune_2.meta) homepage; + inherit (dune-action-plugin.meta) homepage; description = "Embed build information inside executables"; maintainers = [ maintainers.bcdarwin ]; license = licenses.mit; diff --git a/pkgs/development/ocaml-modules/dune-configurator/default.nix b/pkgs/development/ocaml-modules/dune-configurator/default.nix index cdb1e3fc2005..3eae198d8242 100644 --- a/pkgs/development/ocaml-modules/dune-configurator/default.nix +++ b/pkgs/development/ocaml-modules/dune-configurator/default.nix @@ -1,17 +1,20 @@ -{ lib, buildDunePackage, dune_2, csexp, result }: +{ lib, buildDunePackage, dune_3, csexp }: buildDunePackage rec { pname = "dune-configurator"; - inherit (dune_2) src version patches; + inherit (dune_3) src version patches; - duneVersion = "2"; + # This fixes finding csexp + postPatch = '' + rm -rf vendor/pp vendor/csexp + ''; - minimalOCamlVersion = "4.03"; + minimalOCamlVersion = "4.05"; dontAddPrefix = true; - propagatedBuildInputs = [ csexp result ]; + propagatedBuildInputs = [ csexp ]; meta = with lib; { description = "Helper library for gathering system configuration"; diff --git a/pkgs/development/ocaml-modules/lame/default.nix b/pkgs/development/ocaml-modules/lame/default.nix index 85d02538ab0b..5d65bb95101c 100644 --- a/pkgs/development/ocaml-modules/lame/default.nix +++ b/pkgs/development/ocaml-modules/lame/default.nix @@ -4,7 +4,7 @@ buildDunePackage rec { pname = "lame"; version = "0.3.6"; - minimalOCamlVersion = "4.03"; + minimalOCamlVersion = "4.06"; src = fetchFromGitHub { owner = "savonet"; diff --git a/pkgs/development/ocaml-modules/lo/default.nix b/pkgs/development/ocaml-modules/lo/default.nix index 57e7dea51604..6da5854f9de2 100644 --- a/pkgs/development/ocaml-modules/lo/default.nix +++ b/pkgs/development/ocaml-modules/lo/default.nix @@ -4,6 +4,8 @@ buildDunePackage rec { pname = "lo"; version = "0.2.0"; + minimalOCamlVersion = "4.06"; + src = fetchFromGitHub { owner = "savonet"; repo = "ocaml-lo"; diff --git a/pkgs/development/ocaml-modules/ocaml-gettext/stub.nix b/pkgs/development/ocaml-modules/ocaml-gettext/stub.nix index 75e739959c3c..28ab9450e032 100644 --- a/pkgs/development/ocaml-modules/ocaml-gettext/stub.nix +++ b/pkgs/development/ocaml-modules/ocaml-gettext/stub.nix @@ -6,6 +6,8 @@ buildDunePackage rec { inherit (ocaml_gettext) src version; + minimalOCamlVersion = "4.06"; + buildInputs = [ dune-configurator ]; propagatedBuildInputs = [ ocaml_gettext ]; diff --git a/pkgs/development/ocaml-modules/ounit2/default.nix b/pkgs/development/ocaml-modules/ounit2/default.nix index 3b75428d0efb..e44bd5bb35a9 100644 --- a/pkgs/development/ocaml-modules/ounit2/default.nix +++ b/pkgs/development/ocaml-modules/ounit2/default.nix @@ -1,13 +1,11 @@ { lib, ocaml, buildDunePackage, fetchurl, seq, stdlib-shims, ncurses }: -buildDunePackage rec { +buildDunePackage (rec { minimalOCamlVersion = "4.04"; pname = "ounit2"; version = "2.2.6"; - duneVersion = if lib.versionAtLeast ocaml.version "4.08" then "2" else "1"; - src = fetchurl { url = "https://github.com/gildor478/ounit/releases/download/v${version}/ounit-${version}.tbz"; hash = "sha256-BpD7Hg6QoY7tXDVms8wYJdmLDox9UbtrhGyVxFphWRM="; @@ -24,4 +22,6 @@ buildDunePackage rec { license = licenses.mit; maintainers = with maintainers; [ sternenseemann ]; }; -} +} // lib.optionalAttrs (!lib.versionAtLeast ocaml.version "4.08") { + duneVersion = "1"; +}) diff --git a/pkgs/development/ocaml-modules/shine/default.nix b/pkgs/development/ocaml-modules/shine/default.nix index f6acd6b937b6..13d41e72254b 100644 --- a/pkgs/development/ocaml-modules/shine/default.nix +++ b/pkgs/development/ocaml-modules/shine/default.nix @@ -4,8 +4,6 @@ buildDunePackage rec { pname = "shine"; version = "0.2.3"; - duneVersion = "2"; - src = fetchFromGitHub { owner = "savonet"; repo = "ocaml-shine"; diff --git a/pkgs/development/tools/ocaml/js_of_ocaml/ocamlbuild.nix b/pkgs/development/tools/ocaml/js_of_ocaml/ocamlbuild.nix index 18530f3c6690..861dc22c8038 100644 --- a/pkgs/development/tools/ocaml/js_of_ocaml/ocamlbuild.nix +++ b/pkgs/development/tools/ocaml/js_of_ocaml/ocamlbuild.nix @@ -6,7 +6,7 @@ buildDunePackage rec { pname = "js_of_ocaml-ocamlbuild"; version = "5.0"; - minimalOCamlVersion = "4.02"; + minimalOCamlVersion = "4.03"; src = fetchurl { url = "https://github.com/ocsigen/js_of_ocaml-ocamlbuild/releases/download/${version}/js_of_ocaml-ocamlbuild-${version}.tbz";