3
0
Fork 0
forked from mirrors/nixpkgs

ocamlPackages.ocamlgraph: allow building without lablgtk

This commit is contained in:
Yorick van Pelt 2019-10-31 17:24:23 +07:00 committed by Alexander Bantyev
parent 4550405ac9
commit 2693fa4cea
No known key found for this signature in database
GPG key ID: E081FF12ADCB4AD5

View file

@ -1,4 +1,4 @@
{stdenv, fetchurl, ocaml, findlib, lablgtk}:
{stdenv, fetchurl, ocaml, findlib, lablgtk ? null}:
stdenv.mkDerivation rec {
pname = "ocamlgraph";
@ -16,7 +16,8 @@ stdenv.mkDerivation rec {
postPatch = ''
sed -i 's@$(DESTDIR)$(OCAMLLIB)/ocamlgraph@$(DESTDIR)/lib/ocaml/${ocaml.version}/site-lib/ocamlgraph@' Makefile.in
sed -i 's@OCAMLFINDDEST := -destdir $(DESTDIR)@@' Makefile.in
sed -i 's@+lablgtk2@${lablgtk}/lib/ocaml/${ocaml.version}/site-lib/lablgtk2 -I ${lablgtk}/lib/ocaml/${ocaml.version}/site-lib/stublibs@' configure Makefile.in editor/Makefile
${stdenv.lib.optionalString (lablgtk != null)
"sed -i 's@+lablgtk2@${lablgtk}/lib/ocaml/${ocaml.version}/site-lib/lablgtk2 -I ${lablgtk}/lib/ocaml/${ocaml.version}/site-lib/stublibs@' configure Makefile.in editor/Makefile"}
'';
createFindlibDestdir = true;