about summary refs log tree commit diff
path: root/pkgs/development/tools/ocaml/opam/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/tools/ocaml/opam/default.nix')
-rw-r--r--pkgs/development/tools/ocaml/opam/default.nix14
1 files changed, 12 insertions, 2 deletions
diff --git a/pkgs/development/tools/ocaml/opam/default.nix b/pkgs/development/tools/ocaml/opam/default.nix
index 0d765ec93bbb..afa480296f6f 100644
--- a/pkgs/development/tools/ocaml/opam/default.nix
+++ b/pkgs/development/tools/ocaml/opam/default.nix
@@ -1,4 +1,7 @@
-{ stdenv, fetchgit, fetchurl, ocaml, unzip, ncurses, curl }:
+{ stdenv, fetchgit, fetchurl, makeWrapper,
+  ocaml, unzip, ncurses, curl,
+  aspcudSupport ? !stdenv.isDarwin, aspcud
+}:
 
 assert stdenv.lib.versionAtLeast (stdenv.lib.getVersion ocaml) "3.12.1";
 
@@ -45,7 +48,7 @@ in stdenv.mkDerivation rec {
   name = "opam-${version}";
   version = "1.2.2";
 
-  buildInputs = [ unzip curl ncurses ocaml ];
+  buildInputs = [ unzip curl ncurses ocaml makeWrapper];
 
   src = srcs.opam;
 
@@ -69,6 +72,13 @@ in stdenv.mkDerivation rec {
   # Dirty, but apparently ocp-build requires a TERM
   makeFlags = ["TERM=screen"];
 
+  postInstall =
+    if aspcudSupport then ''
+      wrapProgram $out/bin/opam \
+        --suffix PATH : ${aspcud}/bin
+    ''
+    else "";
+
   doCheck = false;
 
   meta = with stdenv.lib; {