Skip to content

Commit

Permalink
ocamlPackages.csv: fix for OCaml ≥ 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vbgl committed Mar 20, 2023
1 parent edf8104 commit 832ce14
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
4 changes: 3 additions & 1 deletion pkgs/development/ocaml-modules/csv/csvtool.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];

Expand Down
6 changes: 5 additions & 1 deletion pkgs/development/ocaml-modules/csv/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
18 changes: 10 additions & 8 deletions pkgs/development/ocaml-modules/csv/lwt.nix
Original file line number Diff line number Diff line change
@@ -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;

preConfigure = ''
substituteInPlace lwt/dune --replace '(libraries bytes' '(libraries '
'';

duneVersion = "3";

propagatedBuildInputs = [ csv ocaml_lwt ];
propagatedBuildInputs = [ csv lwt ];

doCheck = lib.versionAtLeast ocaml.version "4.03";
doCheck = true;
}

0 comments on commit 832ce14

Please sign in to comment.