3
0
Fork 0
forked from mirrors/nixpkgs

ppxlib: default to 0.28.0 for OCaml ≥ 4.11 only

This commit is contained in:
Vincent Laporte 2022-11-09 20:41:22 +01:00
parent 15b6e9efd4
commit d6c30bbf70
No known key found for this signature in database
GPG key ID: EBD582ADDDB1F81F
6 changed files with 30 additions and 10 deletions

View file

@ -11,7 +11,7 @@ buildDunePackage rec {
sha256 = "sha256-pOeeSxzUF1jXQjA71atSZALdgQ2NB9qpKo5iaDnPwhQ=";
};
patches = [
patches = lib.optionals (lib.versionAtLeast ppxlib.version "0.26.0") [
# Ppxlib >= 0.26.0 compatibility
# remove when a new version is released
(fetchpatch {
@ -26,8 +26,7 @@ buildDunePackage rec {
})
];
minimumOCamlVersion = "4.08";
useDune2 = true;
minimalOCamlVersion = "4.08";
buildInputs = [
cmdliner

View file

@ -18,7 +18,7 @@ buildDunePackage rec {
sha256 = "sha256-0FKKYPbSBza/Q6oZniq/UHi5zBjD/i7j5ds3ZDWkBTs=";
};
minimalOCamlVersion = "4.08";
minimalOCamlVersion = "4.11";
propagatedBuildInputs = [ ojs ppxlib ];
checkInputs = [ js_of_ocaml-compiler nodejs ];

View file

@ -12,7 +12,7 @@ buildDunePackage rec {
pname = "ppx_deriving_cmdliner";
version = "0.6.1";
minimalOCamlVersion = "4.08";
minimalOCamlVersion = "4.11";
src = fetchFromGitHub {
owner = "hammerlab";

View file

@ -2,9 +2,19 @@
, ppx_deriving, yojson
}:
let param =
if lib.versionAtLeast ppxlib.version "0.26" then {
version = "3.7.0";
sha256 = "sha256-niKxn1fX0mL1MhlZvbN1wgRed9AHh+z9s6l++k1VX9k=";
} else {
version = "3.6.1";
sha256 = "1icz5h6p3pfj7my5gi7wxpflrb8c902dqa17f9w424njilnpyrbk";
}
; in
buildDunePackage rec {
pname = "ppx_deriving_yojson";
version = "3.7.0";
inherit (param) version;
minimalOCamlVersion = "4.07";
@ -12,7 +22,7 @@ buildDunePackage rec {
owner = "ocaml-ppx";
repo = "ppx_deriving_yojson";
rev = "v${version}";
sha256 = "sha256-niKxn1fX0mL1MhlZvbN1wgRed9AHh+z9s6l++k1VX9k=";
inherit (param) sha256;
};
propagatedBuildInputs = [ ppxlib ppx_deriving yojson ];

View file

@ -2,7 +2,8 @@
, version ?
if lib.versionAtLeast ocaml.version "4.07"
then if lib.versionAtLeast ocaml.version "4.08"
then "0.28.0" else "0.15.0" else "0.13.0"
then if lib.versionAtLeast ocaml.version "4.11"
then "0.28.0" else "0.24.0" else "0.15.0" else "0.13.0"
, ocaml-compiler-libs, ocaml-migrate-parsetree, ppx_derivers, stdio
, stdlib-shims, ocaml-migrate-parsetree-2
}:

View file

@ -8,6 +8,16 @@
, uchar
}:
let param =
if lib.versionAtLeast ppxlib.version "0.26.0" then {
version = "2.6";
sha256 = "sha256-AU+dV+jTG9v3BXzip2Bnv04Ewyo3pyUglDDBFsOsFf0=";
} else {
version = "2.5";
sha256 = "sha256:062a5dvrzvb81l3a9phljrhxfw9nlb61q341q0a6xn65hll3z2wy";
}
; in
let
unicodeVersion = "15.0.0";
baseUrl = "https://www.unicode.org/Public/${unicodeVersion}";
@ -27,7 +37,7 @@ let
in
buildDunePackage rec {
pname = "sedlex";
version = "2.6";
inherit (param) version;
minimalOCamlVersion = "4.08";
@ -35,7 +45,7 @@ buildDunePackage rec {
owner = "ocaml-community";
repo = "sedlex";
rev = "v${version}";
sha256 = "sha256-AU+dV+jTG9v3BXzip2Bnv04Ewyo3pyUglDDBFsOsFf0=";
inherit (param) sha256;
};
propagatedBuildInputs = [