From 832ce14a2103077ce137b2b6808636a656d7777c Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Mon, 20 Mar 2023 06:40:21 +0100 Subject: [PATCH] =?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 12c0dfa160e..05d9a440f9c 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 d4c3d72a6d8..7510dcede3a 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 c90dc019b9d..8e91decfd65 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; }