2021-01-11 13:49:15 +01:00
|
|
|
{ stdenv, lib, fetchurl, fetchpatch, ocaml, findlib, ocamlbuild, camlp4 }:
|
2014-05-17 12:51:18 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2015-06-04 19:22:36 +02:00
|
|
|
name = "ocaml-optcomp-1.6";
|
2014-05-17 12:51:18 +02:00
|
|
|
src = fetchurl {
|
2020-04-01 03:11:51 +02:00
|
|
|
url = "https://github.com/diml/optcomp/archive/1.6.tar.gz";
|
2017-01-24 17:01:04 +01:00
|
|
|
sha256 = "0hhhb2gisah1h22zlg5iszbgqxdd7x85cwd57bd4mfkx9l7dh8jh";
|
|
|
|
};
|
2018-04-04 17:09:04 +02:00
|
|
|
|
|
|
|
patches =
|
2021-01-11 13:49:15 +01:00
|
|
|
let inherit (lib) optional versionAtLeast; in
|
2018-04-04 17:09:04 +02:00
|
|
|
optional (versionAtLeast ocaml.version "4.02") (fetchpatch {
|
|
|
|
url = "https://github.com/diml/optcomp/commit/b7f809360c9794b383a4bc0492f6df381276b429.patch";
|
|
|
|
sha256 = "1n095lk94jq1rwi0l24g2wbgms7249wdd31n0ji895dr6755s93y";
|
|
|
|
})
|
|
|
|
;
|
2021-01-19 22:20:11 +01:00
|
|
|
|
2014-05-17 12:51:18 +02:00
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
2016-10-08 08:44:25 +02:00
|
|
|
buildInputs = [ ocaml findlib ocamlbuild camlp4 ];
|
2014-05-17 12:51:18 +02:00
|
|
|
|
2018-04-04 17:09:04 +02:00
|
|
|
configurePhase = ''
|
|
|
|
cp ${./META} META
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
ocamlbuild src/optcomp.cmxs src/optcomp.cma src/optcomp_o.native src/optcomp_r.native
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp _build/src/optcomp_o.native $out/bin/optcomp-o
|
|
|
|
cp _build/src/optcomp_r.native $out/bin/optcomp-r
|
|
|
|
ocamlfind install optcomp META _build/src/optcomp.{a,cma,cmxa,cmxs} _build/src/pa_optcomp.{cmi,cmx,mli}
|
|
|
|
'';
|
2014-05-17 12:51:18 +02:00
|
|
|
|
|
|
|
meta = {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://github.com/diml/optcomp";
|
2014-05-17 12:51:18 +02:00
|
|
|
description = "Optional compilation for OCaml with cpp-like directives";
|
2021-01-11 13:49:15 +01:00
|
|
|
license = lib.licenses.bsd3;
|
2015-12-24 18:49:07 +01:00
|
|
|
platforms = ocaml.meta.platforms or [];
|
2014-05-17 12:51:18 +02:00
|
|
|
maintainers = [
|
2021-01-11 13:49:15 +01:00
|
|
|
lib.maintainers.gal_bolle
|
2014-05-17 12:51:18 +02:00
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|