diff --git a/pkgs/development/ocaml-modules/csv/1.5.nix b/pkgs/development/ocaml-modules/csv/1.5.nix deleted file mode 100644 index ef4ae4484d83..000000000000 --- a/pkgs/development/ocaml-modules/csv/1.5.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ lib, stdenv, fetchzip, ocaml, findlib, ocamlbuild }: - -stdenv.mkDerivation rec { - pname = "ocaml${ocaml.version}-csv"; - version = "1.5"; - - src = fetchzip { - url = "https://github.com/Chris00/ocaml-csv/releases/download/${version}/csv-${version}.tar.gz"; - sha256 = "1ca7jgg58j24pccs5fshis726s06fdcjshnwza5kwxpjgdbvc63g"; - }; - - nativeBuildInputs = [ ocaml findlib ocamlbuild ]; - - strictDeps = true; - - createFindlibDestdir = true; - - configurePhase = "ocaml setup.ml -configure --prefix $out --enable-tests"; - - buildPhase = "ocaml setup.ml -build"; - - doCheck = true; - checkPhase = "ocaml setup.ml -test"; - - installPhase = '' - runHook preInstall - ocaml setup.ml -install - runHook postInstall - ''; - - meta = with lib; { - description = "A pure OCaml library to read and write CSV files"; - homepage = "https://github.com/Chris00/ocaml-csv"; - license = licenses.lgpl21; - maintainers = [ maintainers.vbgl ]; - inherit (ocaml.meta) platforms; - }; -} diff --git a/pkgs/development/ocaml-modules/csv/csvtool.nix b/pkgs/development/ocaml-modules/csv/csvtool.nix index 12c0dfa160e6..05d9a440f9c1 100644 --- a/pkgs/development/ocaml-modules/csv/csvtool.nix +++ b/pkgs/development/ocaml-modules/csv/csvtool.nix @@ -4,7 +4,9 @@ let inherit (ocamlPackages) buildDunePackage csv uutf; in buildDunePackage { pname = "csvtool"; - inherit (csv) src version useDune2; + inherit (csv) src version; + + duneVersion = "3"; buildInputs = [ csv uutf ]; diff --git a/pkgs/development/ocaml-modules/csv/default.nix b/pkgs/development/ocaml-modules/csv/default.nix index d4c3d72a6d80..7510dcede3a9 100644 --- a/pkgs/development/ocaml-modules/csv/default.nix +++ b/pkgs/development/ocaml-modules/csv/default.nix @@ -9,7 +9,11 @@ buildDunePackage rec { sha256 = "13m9n8mdss6jfbiw7d5bybxn4n85vmg4zw7dc968qrgjfy0w9zhk"; }; - useDune2 = true; + preConfigure = '' + substituteInPlace src/dune --replace '(libraries bytes)' "" + ''; + + duneVersion = "3"; meta = { description = "A pure OCaml library to read and write CSV files"; diff --git a/pkgs/development/ocaml-modules/csv/lwt.nix b/pkgs/development/ocaml-modules/csv/lwt.nix index c90dc019b9d4..8e91decfd65f 100644 --- a/pkgs/development/ocaml-modules/csv/lwt.nix +++ b/pkgs/development/ocaml-modules/csv/lwt.nix @@ -1,14 +1,16 @@ -{ lib, buildDunePackage, ocaml, csv, ocaml_lwt }: - -if lib.versionOlder ocaml.version "4.02" -then throw "csv-lwt is not available for OCaml ${ocaml.version}" -else +{ lib, buildDunePackage, csv, lwt }: buildDunePackage { pname = "csv-lwt"; - inherit (csv) src version useDune2 meta; + inherit (csv) src version meta; - propagatedBuildInputs = [ csv ocaml_lwt ]; + preConfigure = '' + substituteInPlace lwt/dune --replace '(libraries bytes' '(libraries ' + ''; - doCheck = lib.versionAtLeast ocaml.version "4.03"; + duneVersion = "3"; + + propagatedBuildInputs = [ csv lwt ]; + + doCheck = true; } diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 617281df58a9..d1e599d8970f 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -263,10 +263,7 @@ let cstruct-unix = callPackage ../development/ocaml-modules/cstruct/unix.nix {}; - csv = - if lib.versionAtLeast ocaml.version "4.2" - then callPackage ../development/ocaml-modules/csv { } - else callPackage ../development/ocaml-modules/csv/1.5.nix { }; + csv = callPackage ../development/ocaml-modules/csv { }; csv-lwt = callPackage ../development/ocaml-modules/csv/lwt.nix { };