summary refs log tree commit diff
path: root/pkgs/development/tools/ocaml/opam
diff options
context:
space:
mode:
authorJesse Haber-Kucharsky <hakuch@users.noreply.github.com>2016-09-12 04:44:50 -0400
committervbgl <vbgl@users.noreply.github.com>2016-09-12 10:44:50 +0200
commit99e06fe771c76b88c3bd0b179297da906867b7d1 (patch)
tree906bcef54612f7b7719dd1aa2e2423725a5923af /pkgs/development/tools/ocaml/opam
parent8d8f57d4aa8bf0aa3b7301a751b5240646981e42 (diff)
downloadnixpkgs-99e06fe771c76b88c3bd0b179297da906867b7d1.tar
nixpkgs-99e06fe771c76b88c3bd0b179297da906867b7d1.tar.gz
nixpkgs-99e06fe771c76b88c3bd0b179297da906867b7d1.tar.bz2
nixpkgs-99e06fe771c76b88c3bd0b179297da906867b7d1.tar.lz
nixpkgs-99e06fe771c76b88c3bd0b179297da906867b7d1.tar.xz
nixpkgs-99e06fe771c76b88c3bd0b179297da906867b7d1.tar.zst
nixpkgs-99e06fe771c76b88c3bd0b179297da906867b7d1.zip
opam, aspcud: init packages for external solver (#16938)
The opam package manager relies on external solvers to determine package
management decisions it makes related to upgrades, new installations,
etc.

While, strictly speaking, an external solver is optional, aspcud is
highly recommended in documentation. Furthermore, even having a
relatively small number of packages installed quickly causes the limits
of the interal solver to be reached (before it times out).

Aspcud itself depends on two programs from the same suite: gringo, and
clasp.

On Darwin, Boost 1.55 (and thus Gringo) do not build, so we only support
Aspcud on non-Darwin platforms.
Diffstat (limited to 'pkgs/development/tools/ocaml/opam')
-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 0d765ec93bb..afa480296f6 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; {