From edf81049b1e89ed31f17722429e77fcba87f31c3 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Mon, 20 Mar 2023 06:40:08 +0100 Subject: [PATCH 1/2] ocaml-ng.ocamlPackages_4_01_0.csv: remove at 1.5 --- pkgs/development/ocaml-modules/csv/1.5.nix | 38 ---------------------- pkgs/top-level/ocaml-packages.nix | 5 +-- 2 files changed, 1 insertion(+), 42 deletions(-) delete mode 100644 pkgs/development/ocaml-modules/csv/1.5.nix 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/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 28e3db6d64c9..32b96e2dbcc3 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -265,10 +265,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 { }; From 832ce14a2103077ce137b2b6808636a656d7777c Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Mon, 20 Mar 2023 06:40:21 +0100 Subject: [PATCH 2/2] =?UTF-8?q?ocamlPackages.csv:=20fix=20for=20OCaml=20?= =?UTF-8?q?=E2=89=A5=205.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/development/ocaml-modules/csv/csvtool.nix | 4 +++- pkgs/development/ocaml-modules/csv/default.nix | 6 +++++- pkgs/development/ocaml-modules/csv/lwt.nix | 18 ++++++++++-------- 3 files changed, 18 insertions(+), 10 deletions(-) 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; }