summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/ocaml-modules')
-rw-r--r--pkgs/development/ocaml-modules/ocamlgraph/default.nix28
-rw-r--r--pkgs/development/ocaml-modules/ocamlgraph/destdir.patch13
-rw-r--r--pkgs/development/ocaml-modules/ocamlnet/default.nix4
3 files changed, 16 insertions, 29 deletions
diff --git a/pkgs/development/ocaml-modules/ocamlgraph/default.nix b/pkgs/development/ocaml-modules/ocamlgraph/default.nix
index d2a94112eb3..df684f166e1 100644
--- a/pkgs/development/ocaml-modules/ocamlgraph/default.nix
+++ b/pkgs/development/ocaml-modules/ocamlgraph/default.nix
@@ -1,4 +1,7 @@
-{stdenv, fetchurl, ocaml, findlib, lablgtk ? null}:
+{ stdenv, fetchurl, ocaml, findlib
+, gtkSupport ? true
+, lablgtk
+}:
 
 stdenv.mkDerivation rec {
   pname = "ocamlgraph";
@@ -9,22 +12,19 @@ stdenv.mkDerivation rec {
     sha256 = "0m9g16wrrr86gw4fz2fazrh8nkqms0n863w7ndcvrmyafgxvxsnr";
   };
 
-  buildInputs = [ ocaml findlib 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"}
-  '';
+  buildInputs = [ ocaml findlib ]
+  ++ stdenv.lib.optional gtkSupport lablgtk
+  ;
 
   createFindlibDestdir = true;
 
-  buildPhase = ''
-    make all
-    make install-findlib
+  buildFlags =  [ "all" ];
+  installTargets = [ "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 = {
diff --git a/pkgs/development/ocaml-modules/ocamlgraph/destdir.patch b/pkgs/development/ocaml-modules/ocamlgraph/destdir.patch
deleted file mode 100644
index 38fca1c491f..00000000000
--- a/pkgs/development/ocaml-modules/ocamlgraph/destdir.patch
+++ /dev/null
@@ -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@
diff --git a/pkgs/development/ocaml-modules/ocamlnet/default.nix b/pkgs/development/ocaml-modules/ocamlnet/default.nix
index 7d9a0573db7..5b6e0dde8b7 100644
--- a/pkgs/development/ocaml-modules/ocamlnet/default.nix
+++ b/pkgs/development/ocaml-modules/ocamlnet/default.nix
@@ -8,11 +8,11 @@ else
 
 stdenv.mkDerivation rec {
   name = "ocaml${ocaml.version}-ocamlnet-${version}";
-  version = "4.1.7";
+  version = "4.1.8";
 
   src = fetchurl {
     url = "http://download.camlcity.org/download/ocamlnet-${version}.tar.gz";
-    sha256 = "0r9gl0lsgxk2achixxqzm8bm5l9jwc4vwihf0rvxxa9v9q9vfdhi";
+    sha256 = "1x703mjqsv9nvffnkj5i36ij2s5zfvxxll2z1qj6a7p428b2yfnm";
   };
 
   nativeBuildInputs = [ pkgconfig ];