nixpkgs/pkgs/development/ocaml-modules/topkg/default.nix
Vincent Laporte 0a309311dd ocamlPackages.topkg: make the installPhase independent of the package name
It can then be reused as-is in other derivations (e.g., uucd).
2016-11-23 10:01:30 +01:00

28 lines
948 B
Nix

{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, result, opam }:
stdenv.mkDerivation rec {
name = "ocaml${ocaml.version}-topkg-${version}";
version = "0.7.8";
src = fetchurl {
url = "http://erratique.ch/software/topkg/releases/topkg-${version}.tbz";
sha256 = "029lbmabczpmcgkj53mc20vmpcn3f7rf7xms4xf0nywswfzsash6";
};
nativeBuildInputs = [ opam ];
buildInputs = [ ocaml findlib ocamlbuild ];
propagatedBuildInputs = [ result ];
unpackCmd = "tar xjf ${src}";
buildPhase = "ocaml -I ${findlib}/lib/ocaml/${ocaml.version}/site-lib/ pkg/pkg.ml build";
createFindlibDestdir = true;
installPhase = "opam-installer -i --prefix=$out --libdir=$OCAMLFIND_DESTDIR";
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;
};
}