ocamlPackages.ocamlgraph: make GTK support optional
When `gtkSupport` is true, additional components are built: - a module to render a graph on a GTK2 canvas - two GTK-based programs: a graph viewer and a graph editor. The default is to have `gtkSupport` as it is used in e.g., Frama-C.
This commit is contained in:
committed by
Vincent Laporte
parent
5be356a9cc
commit
e3c2934213
@@ -1,4 +1,7 @@
|
|||||||
{stdenv, fetchurl, ocaml, findlib, lablgtk ? null}:
|
{ stdenv, fetchurl, ocaml, findlib
|
||||||
|
, gtkSupport ? true
|
||||||
|
, lablgtk
|
||||||
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "ocamlgraph";
|
pname = "ocamlgraph";
|
||||||
@@ -9,22 +12,19 @@ stdenv.mkDerivation rec {
|
|||||||
sha256 = "0m9g16wrrr86gw4fz2fazrh8nkqms0n863w7ndcvrmyafgxvxsnr";
|
sha256 = "0m9g16wrrr86gw4fz2fazrh8nkqms0n863w7ndcvrmyafgxvxsnr";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ ocaml findlib lablgtk ];
|
buildInputs = [ ocaml findlib ]
|
||||||
|
++ stdenv.lib.optional gtkSupport lablgtk
|
||||||
patches = ./destdir.patch;
|
;
|
||||||
|
|
||||||
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
|
|
||||||
${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;
|
createFindlibDestdir = true;
|
||||||
|
|
||||||
buildPhase = ''
|
buildFlags = [ "all" ];
|
||||||
make all
|
installTargets = [ "install-findlib" ];
|
||||||
make install-findlib
|
|
||||||
|
postInstall = stdenv.lib.optionalString gtkSupport ''
|
||||||
|
mkdir -p $out/bin
|
||||||
|
cp dgraph/dgraph.opt $out/bin/graph-viewer
|
||||||
|
cp editor/editor.opt $out/bin/graph-editor
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
diff -Naur -x '*~' ocamlgraph-1.8.1/Makefile.in ocamlgraph-1.8.1-new//Makefile.in
|
|
||||||
--- ocamlgraph-1.8.1/Makefile.in 2011-10-17 09:57:03.000000000 -0430
|
|
||||||
+++ ocamlgraph-1.8.1-new//Makefile.in 2011-11-24 13:01:22.626004819 -0430
|
|
||||||
@@ -16,8 +16,8 @@
|
|
||||||
##########################################################################
|
|
||||||
|
|
||||||
# Where to install the binaries
|
|
||||||
-DESTDIR =
|
|
||||||
prefix =@prefix@
|
|
||||||
+DESTDIR=$(prefix)
|
|
||||||
exec_prefix=@exec_prefix@
|
|
||||||
datarootdir=@datarootdir@
|
|
||||||
BINDIR =$(DESTDIR)@bindir@
|
|
||||||
Reference in New Issue
Block a user