2021-01-21 08:25:33 +01:00
|
|
|
{ lib, stdenv, fetchFromGitHub, buildDunePackage, ocaml, findlib, cppo }:
|
2015-10-04 10:43:34 +02:00
|
|
|
|
2020-07-05 13:38:34 +02:00
|
|
|
let param =
|
2021-08-05 00:15:12 +02:00
|
|
|
let v6_4 = {
|
|
|
|
version = "6.4";
|
|
|
|
sha256 = "15v7yfv6gyp8lzlgwi9garz10wpg34dk4072jdv19n6v20zfg7n1";
|
2021-01-31 14:16:01 +01:00
|
|
|
useDune2 = true;
|
2021-01-21 08:25:33 +01:00
|
|
|
buildInputs = [cppo];
|
2020-07-05 13:38:34 +02:00
|
|
|
}; in
|
|
|
|
{
|
2017-02-27 19:57:26 +01:00
|
|
|
"4.02" = {
|
2016-11-26 10:13:02 +01:00
|
|
|
version = "5.0+4.02.0";
|
|
|
|
sha256 = "16drjk0qafjls8blng69qiv35a84wlafpk16grrg2i3x19p8dlj8"; };
|
2017-02-27 19:57:26 +01:00
|
|
|
"4.03" = {
|
2016-11-26 10:13:02 +01:00
|
|
|
version = "5.0+4.03.0";
|
|
|
|
sha256 = "061v1fl5z7z3ywi4ppryrlcywnvnqbsw83ppq72qmkc7ma4603jg"; };
|
2017-02-27 19:57:26 +01:00
|
|
|
"4.04" = {
|
2017-02-02 21:16:07 +01:00
|
|
|
version = "unstable-20161114";
|
|
|
|
rev = "49c08e2e4ea8fef88692cd1dcc1b38a9133f17ac";
|
|
|
|
sha256 = "0ywzfkf5brj33nwh49k9if8x8v433ral25f3nbklfc9vqr06zrfl"; };
|
2017-02-27 19:57:26 +01:00
|
|
|
"4.05" = {
|
|
|
|
version = "5.0+4.05.0";
|
|
|
|
sha256 = "1jvvhk6wnkvm7b9zph309ihsc0hyxfpahmxxrq19vx8c674jsdm4"; };
|
2017-10-26 00:35:19 +02:00
|
|
|
"4.06" = {
|
|
|
|
version = "5.1+4.06.0";
|
|
|
|
sha256 = "1ww4cspdpgjjsgiv71s0im5yjkr3544x96wsq1vpdacq7dr7zwiw"; };
|
2018-07-14 10:27:00 +02:00
|
|
|
"4.07" = {
|
|
|
|
version = "5.1+4.06.0";
|
|
|
|
sha256 = "1ww4cspdpgjjsgiv71s0im5yjkr3544x96wsq1vpdacq7dr7zwiw"; };
|
2021-08-05 00:15:12 +02:00
|
|
|
"4.08" = v6_4;
|
|
|
|
"4.09" = v6_4;
|
|
|
|
"4.10" = v6_4;
|
|
|
|
"4.11" = v6_4;
|
|
|
|
"4.12" = v6_4;
|
|
|
|
"4.13" = v6_4;
|
2019-09-09 01:38:31 +02:00
|
|
|
}.${ocaml.meta.branch};
|
2016-07-20 14:51:20 +02:00
|
|
|
in
|
2020-02-16 15:24:43 +01:00
|
|
|
|
|
|
|
let src = fetchFromGitHub {
|
2016-07-20 14:51:20 +02:00
|
|
|
owner = "alainfrisch";
|
2020-02-16 15:24:43 +01:00
|
|
|
repo = pname;
|
|
|
|
rev = param.rev or param.version;
|
2016-11-26 10:13:02 +01:00
|
|
|
inherit (param) sha256;
|
2016-07-20 14:51:20 +02:00
|
|
|
};
|
2020-02-16 15:24:43 +01:00
|
|
|
pname = "ppx_tools";
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-02-16 15:24:43 +01:00
|
|
|
description = "Tools for authors of ppx rewriters";
|
2020-03-28 00:05:50 +01:00
|
|
|
homepage = "https://www.lexifi.com/ppx_tools";
|
2020-02-16 15:24:43 +01:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ vbgl ];
|
|
|
|
};
|
|
|
|
in
|
2021-01-11 13:49:15 +01:00
|
|
|
if lib.versionAtLeast param.version "6.0"
|
2020-02-16 15:24:43 +01:00
|
|
|
then
|
|
|
|
buildDunePackage {
|
|
|
|
inherit pname src meta;
|
2021-01-21 08:25:33 +01:00
|
|
|
inherit (param) version useDune2 buildInputs;
|
2020-02-16 15:24:43 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "ocaml${ocaml.version}-${pname}-${param.version}";
|
|
|
|
|
|
|
|
inherit src;
|
2015-10-04 10:43:34 +02:00
|
|
|
|
2019-10-31 11:16:15 +01:00
|
|
|
nativeBuildInputs = [ ocaml findlib ];
|
2019-11-20 12:32:19 +01:00
|
|
|
buildInputs = [ ocaml findlib ];
|
2015-10-04 10:43:34 +02:00
|
|
|
|
2016-07-20 14:51:20 +02:00
|
|
|
createFindlibDestdir = true;
|
2015-10-04 10:43:34 +02:00
|
|
|
|
2017-02-26 21:18:02 +01:00
|
|
|
dontStrip = true;
|
|
|
|
|
2020-02-16 15:24:43 +01:00
|
|
|
meta = meta // { inherit (ocaml.meta) platforms; };
|
2016-07-20 14:51:20 +02:00
|
|
|
}
|