2018-09-06 18:18:34 +01:00
|
|
|
{ stdenv, lib, fetchurl, makeWrapper, getconf,
|
|
|
|
ocaml, unzip, ncurses, curl, aspcud, bubblewrap
|
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.
2016-09-12 09:44:50 +01:00
|
|
|
}:
|
2014-11-03 16:55:33 +00:00
|
|
|
|
2018-09-06 18:18:34 +01:00
|
|
|
assert lib.versionAtLeast ocaml.version "4.02.3";
|
2014-11-03 16:55:33 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
srcs = {
|
2018-09-06 18:18:34 +01:00
|
|
|
cmdliner = fetchurl {
|
2019-07-15 10:20:00 +01:00
|
|
|
url = "http://erratique.ch/software/cmdliner/releases/cmdliner-1.0.2.tbz";
|
2018-09-06 18:18:34 +01:00
|
|
|
sha256 = "18jqphjiifljlh9jg8zpl6310p3iwyaqphdkmf89acyaix0s4kj1";
|
|
|
|
};
|
|
|
|
cppo = fetchurl {
|
2021-02-09 04:20:00 +00:00
|
|
|
url = "https://github.com/ocaml-community/cppo/releases/download/v1.6.6/cppo-v1.6.6.tbz";
|
|
|
|
sha256 = "185q0x54id7pfc6rkbjscav8sjkrg78fz65rgfw7b4bqlyb2j9z7";
|
2018-09-06 18:18:34 +01:00
|
|
|
};
|
2014-11-03 16:55:33 +00:00
|
|
|
cudf = fetchurl {
|
2018-09-06 18:18:34 +01:00
|
|
|
url = "https://gforge.inria.fr/frs/download.php/36602/cudf-0.9.tar.gz";
|
|
|
|
sha256 = "0771lwljqwwn3cryl0plny5a5dyyrj4z6bw66ha5n8yfbpcy8clr";
|
|
|
|
};
|
|
|
|
dose3 = fetchurl {
|
|
|
|
url = "https://gforge.inria.fr/frs/download.php/file/36063/dose3-5.0.1.tar.gz";
|
|
|
|
sha256 = "00yvyfm4j423zqndvgc1ycnmiffaa2l9ab40cyg23pf51qmzk2jm";
|
2014-11-03 16:55:33 +00:00
|
|
|
};
|
2019-01-25 04:08:40 +00:00
|
|
|
dune-local = fetchurl {
|
2019-07-15 10:20:00 +01:00
|
|
|
url = "https://github.com/ocaml/dune/releases/download/1.6.3/dune-1.6.3.tbz";
|
|
|
|
sha256 = "0dmf0wbfmgdy5plz1bjiisc2hjgblvxsnrqjmw2c8y45v1h23mdz";
|
2019-01-25 04:08:40 +00:00
|
|
|
};
|
2014-11-03 16:55:33 +00:00
|
|
|
extlib = fetchurl {
|
2021-02-09 04:20:00 +00:00
|
|
|
url = "https://ygrek.org/p/release/ocaml-extlib/extlib-1.7.7.tar.gz";
|
|
|
|
sha256 = "1sxmzc1mx3kg62j8kbk0dxkx8mkf1rn70h542cjzrziflznap0s1";
|
2014-11-03 16:55:33 +00:00
|
|
|
};
|
2018-09-06 18:18:34 +01:00
|
|
|
mccs = fetchurl {
|
2020-01-16 10:30:00 +00:00
|
|
|
url = "https://github.com/AltGr/ocaml-mccs/archive/1.1+11.tar.gz";
|
|
|
|
sha256 = "0mswapf37rav8nvvbjc4c7c7wnl6qwgd3c5v0nfifmr910qygz72";
|
2014-11-03 16:55:33 +00:00
|
|
|
};
|
2018-09-06 18:18:34 +01:00
|
|
|
ocamlgraph = fetchurl {
|
|
|
|
url = "http://ocamlgraph.lri.fr/download/ocamlgraph-1.8.8.tar.gz";
|
|
|
|
sha256 = "0m9g16wrrr86gw4fz2fazrh8nkqms0n863w7ndcvrmyafgxvxsnr";
|
2014-11-03 16:55:33 +00:00
|
|
|
};
|
2018-09-06 18:18:34 +01:00
|
|
|
opam-file-format = fetchurl {
|
2019-01-25 04:08:40 +00:00
|
|
|
url = "https://github.com/ocaml/opam-file-format/archive/2.0.0.tar.gz";
|
|
|
|
sha256 = "0cjw69r7iilidi7b6arr92kjnjspchvwnmwr1b1gyaxqxpr2s98m";
|
2014-11-03 16:55:33 +00:00
|
|
|
};
|
2018-09-06 18:18:34 +01:00
|
|
|
re = fetchurl {
|
2021-02-09 04:20:00 +00:00
|
|
|
url = "https://github.com/ocaml/ocaml-re/releases/download/1.9.0/re-1.9.0.tbz";
|
|
|
|
sha256 = "1gas4ky49zgxph3870nffzkr6y41kkpqp4nj38pz1gh49zcf12aj";
|
2014-11-03 16:55:33 +00:00
|
|
|
};
|
2018-09-06 18:18:34 +01:00
|
|
|
result = fetchurl {
|
2021-02-09 04:20:00 +00:00
|
|
|
url = "https://github.com/janestreet/result/archive/1.4.tar.gz";
|
|
|
|
sha256 = "1cjlncnzkwc6zr4v8dgy8nin490blbyxzwwp0qh0cla7s3q2jw0n";
|
2014-11-03 16:55:33 +00:00
|
|
|
};
|
2019-01-25 04:08:40 +00:00
|
|
|
seq = fetchurl {
|
|
|
|
url = "https://github.com/c-cube/seq/archive/0.1.tar.gz";
|
|
|
|
sha256 = "02lb2d9i12bxrz2ba5wygk2bycan316skqlyri0597q7j9210g8r";
|
|
|
|
};
|
2014-11-03 16:55:33 +00:00
|
|
|
opam = fetchurl {
|
2021-02-09 04:20:00 +00:00
|
|
|
url = "https://github.com/ocaml/opam/archive/2.0.8.zip";
|
|
|
|
sha256 = "1h55jh4nnx1fcn7v7ss3fgxrn6ixkgnq7pvg5njz8c9xq4njwbc1";
|
2014-11-03 16:55:33 +00:00
|
|
|
};
|
|
|
|
};
|
2019-08-13 22:52:01 +01:00
|
|
|
in stdenv.mkDerivation {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "opam";
|
2021-02-09 04:20:00 +00:00
|
|
|
version = "2.0.8";
|
2014-11-03 16:55:33 +00:00
|
|
|
|
2021-02-20 21:01:53 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper unzip ];
|
|
|
|
buildInputs = [ curl ncurses ocaml getconf ] ++ lib.optional stdenv.isLinux bubblewrap;
|
2014-11-03 16:55:33 +00:00
|
|
|
|
|
|
|
src = srcs.opam;
|
|
|
|
|
|
|
|
postUnpack = ''
|
2018-09-06 18:18:34 +01:00
|
|
|
ln -sv ${srcs.cmdliner} $sourceRoot/src_ext/cmdliner.tbz
|
2021-02-09 04:20:00 +00:00
|
|
|
ln -sv ${srcs.cppo} $sourceRoot/src_ext/cppo.tbz
|
2018-09-06 18:18:34 +01:00
|
|
|
ln -sv ${srcs.cudf} $sourceRoot/src_ext/cudf.tar.gz
|
|
|
|
ln -sv ${srcs.dose3} $sourceRoot/src_ext/dose3.tar.gz
|
2019-01-25 04:08:40 +00:00
|
|
|
ln -sv ${srcs.dune-local} $sourceRoot/src_ext/dune-local.tbz
|
2018-09-06 18:18:34 +01:00
|
|
|
ln -sv ${srcs.extlib} $sourceRoot/src_ext/extlib.tar.gz
|
|
|
|
ln -sv ${srcs.mccs} $sourceRoot/src_ext/mccs.tar.gz
|
|
|
|
ln -sv ${srcs.ocamlgraph} $sourceRoot/src_ext/ocamlgraph.tar.gz
|
|
|
|
ln -sv ${srcs.opam-file-format} $sourceRoot/src_ext/opam-file-format.tar.gz
|
|
|
|
ln -sv ${srcs.re} $sourceRoot/src_ext/re.tbz
|
2021-02-09 04:20:00 +00:00
|
|
|
ln -sv ${srcs.result} $sourceRoot/src_ext/result.tar.gz
|
2019-01-25 04:08:40 +00:00
|
|
|
ln -sv ${srcs.seq} $sourceRoot/src_ext/seq.tar.gz
|
2014-11-03 16:55:33 +00:00
|
|
|
'';
|
|
|
|
|
2019-01-25 04:08:40 +00:00
|
|
|
patches = [ ./opam-shebangs.patch ];
|
2018-09-06 18:18:34 +01:00
|
|
|
|
2015-03-22 20:31:25 +00:00
|
|
|
preConfigure = ''
|
|
|
|
substituteInPlace ./src_ext/Makefile --replace "%.stamp: %.download" "%.stamp:"
|
2018-09-06 18:18:34 +01:00
|
|
|
patchShebangs src/state/shellscripts
|
2015-03-22 20:31:25 +00:00
|
|
|
'';
|
2014-11-03 16:55:33 +00:00
|
|
|
|
|
|
|
postConfigure = "make lib-ext";
|
|
|
|
|
|
|
|
# Dirty, but apparently ocp-build requires a TERM
|
|
|
|
makeFlags = ["TERM=screen"];
|
|
|
|
|
2018-09-06 18:18:34 +01:00
|
|
|
outputs = [ "out" "installer" ];
|
|
|
|
setOutputFlags = false;
|
|
|
|
|
2018-06-04 20:22:07 +01:00
|
|
|
# change argv0 to "opam" as a workaround for
|
|
|
|
# https://github.com/ocaml/opam/issues/2142
|
2017-09-12 21:22:39 +01:00
|
|
|
postInstall = ''
|
2018-06-04 20:22:07 +01:00
|
|
|
mv $out/bin/opam $out/bin/.opam-wrapped
|
|
|
|
makeWrapper $out/bin/.opam-wrapped $out/bin/opam \
|
|
|
|
--argv0 "opam" \
|
2019-01-25 04:08:40 +00:00
|
|
|
--suffix PATH : ${aspcud}/bin:${unzip}/bin:${curl}/bin:${lib.optionalString stdenv.isLinux "${bubblewrap}/bin:"}${getconf}/bin \
|
2019-03-09 13:20:58 +00:00
|
|
|
--set OPAM_USER_PATH_RO /run/current-system/sw/bin:/nix/
|
2018-09-06 18:18:34 +01:00
|
|
|
$out/bin/opam-installer --prefix=$installer opam-installer.install
|
2017-09-12 21:22:39 +01:00
|
|
|
'';
|
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.
2016-09-12 09:44:50 +01:00
|
|
|
|
2014-11-03 16:55:33 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
2021-01-23 12:26:19 +00:00
|
|
|
meta = with lib; {
|
2014-11-03 16:55:33 +00:00
|
|
|
description = "A package manager for OCaml";
|
2020-01-16 10:30:00 +00:00
|
|
|
homepage = "https://opam.ocaml.org/";
|
2020-04-21 13:26:00 +01:00
|
|
|
maintainers = [ maintainers.henrytill maintainers.marsam ];
|
2015-03-22 20:31:25 +00:00
|
|
|
platforms = platforms.all;
|
2014-11-03 16:55:33 +00:00
|
|
|
};
|
|
|
|
}
|
2021-02-09 04:20:00 +00:00
|
|
|
# Generated by: ./opam.nix.pl -v 2.0.8 -p opam-shebangs.patch
|