ocamlPackages.topkg: make the installPhase independent of the package name
It can then be reused as-is in other derivations (e.g., uucd).
This commit is contained in:
parent
97a496a472
commit
0a309311dd
@ -1,9 +1,7 @@
|
|||||||
{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, result, opam }:
|
{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, result, opam }:
|
||||||
|
|
||||||
let ocaml-version = stdenv.lib.getVersion ocaml; in
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "ocaml${ocaml-version}-topkg-${version}";
|
name = "ocaml${ocaml.version}-topkg-${version}";
|
||||||
version = "0.7.8";
|
version = "0.7.8";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
@ -16,12 +14,9 @@ stdenv.mkDerivation rec {
|
|||||||
propagatedBuildInputs = [ result ];
|
propagatedBuildInputs = [ result ];
|
||||||
|
|
||||||
unpackCmd = "tar xjf ${src}";
|
unpackCmd = "tar xjf ${src}";
|
||||||
buildPhase = "ocaml -I ${findlib}/lib/ocaml/${ocaml-version}/site-lib/ pkg/pkg.ml build";
|
buildPhase = "ocaml -I ${findlib}/lib/ocaml/${ocaml.version}/site-lib/ pkg/pkg.ml build";
|
||||||
createFindlibDestdir = true;
|
createFindlibDestdir = true;
|
||||||
installPhase = ''
|
installPhase = "opam-installer -i --prefix=$out --libdir=$OCAMLFIND_DESTDIR";
|
||||||
opam-installer --script --prefix=$out topkg.install | sh
|
|
||||||
mv $out/lib/topkg $out/lib/ocaml/${ocaml-version}/site-lib/
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = http://erratique.ch/software/topkg;
|
homepage = http://erratique.ch/software/topkg;
|
||||||
|
@ -19,13 +19,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
unpackCmd = "tar xjf $src";
|
unpackCmd = "tar xjf $src";
|
||||||
|
|
||||||
inherit (topkg) buildPhase;
|
inherit (topkg) buildPhase installPhase;
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
opam-installer --script --prefix=$out ${pname}.install > install.sh
|
|
||||||
sh install.sh
|
|
||||||
ln -s $out/lib/${pname} $out/lib/ocaml/${ocaml.version}/site-lib/
|
|
||||||
'';
|
|
||||||
|
|
||||||
propagatedBuildInputs = [ xmlm ];
|
propagatedBuildInputs = [ xmlm ];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user