2016-10-08 06:44:25 +00:00
|
|
|
{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, result, opam }:
|
2016-07-17 15:26:22 +00:00
|
|
|
|
2017-07-10 18:15:42 +00:00
|
|
|
if !stdenv.lib.versionAtLeast ocaml.version "4.01"
|
|
|
|
then throw "topkg is not available for OCaml ${ocaml.version}"
|
|
|
|
else
|
|
|
|
|
2017-12-14 07:36:29 +00:00
|
|
|
let
|
|
|
|
run = "ocaml -I ${findlib}/lib/ocaml/${ocaml.version}/site-lib/ pkg/pkg.ml";
|
|
|
|
in
|
|
|
|
|
2016-07-17 15:26:22 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2016-11-23 03:20:51 +00:00
|
|
|
name = "ocaml${ocaml.version}-topkg-${version}";
|
2017-10-27 07:36:40 +00:00
|
|
|
version = "0.9.1";
|
2016-07-17 15:26:22 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://erratique.ch/software/topkg/releases/topkg-${version}.tbz";
|
2017-10-27 07:36:40 +00:00
|
|
|
sha256 = "1slrzbmyp81xhgsfwwqs2d6gxzvqx0gcp34rq00h5iblhcq7myx6";
|
2016-07-17 15:26:22 +00:00
|
|
|
};
|
|
|
|
|
2016-10-08 06:44:25 +00:00
|
|
|
buildInputs = [ ocaml findlib ocamlbuild ];
|
2016-07-17 15:26:22 +00:00
|
|
|
propagatedBuildInputs = [ result ];
|
|
|
|
|
|
|
|
unpackCmd = "tar xjf ${src}";
|
2017-12-14 07:36:29 +00:00
|
|
|
buildPhase = "${run} build";
|
2016-07-17 15:26:22 +00:00
|
|
|
createFindlibDestdir = true;
|
2017-12-14 07:36:29 +00:00
|
|
|
installPhase = "${opam}/bin/opam-installer -i --prefix=$out --libdir=$OCAMLFIND_DESTDIR";
|
|
|
|
|
|
|
|
passthru = { inherit run; };
|
2016-07-17 15:26:22 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = http://erratique.ch/software/topkg;
|
|
|
|
license = stdenv.lib.licenses.isc;
|
|
|
|
maintainers = [ stdenv.lib.maintainers.vbgl ];
|
|
|
|
description = "A packager for distributing OCaml software";
|
|
|
|
inherit (ocaml.meta) platforms;
|
|
|
|
};
|
|
|
|
}
|