mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-17 01:24:47 +00: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.
This commit is contained in:
parent
8d8f57d4aa
commit
99e06fe771
@ -168,6 +168,7 @@
|
||||
grahamc = "Graham Christensen <graham@grahamc.com>";
|
||||
gridaphobe = "Eric Seidel <eric@seidel.io>";
|
||||
guibert = "David Guibert <david.guibert@gmail.com>";
|
||||
hakuch = "Jesse Haber-Kucharsky <hakuch@gmail.com>";
|
||||
havvy = "Ryan Scheel <ryan.havvy@gmail.com>";
|
||||
hbunke = "Hendrik Bunke <bunke.hendrik@gmail.com>";
|
||||
hce = "Hans-Christian Esperer <hc@hcesperer.org>";
|
||||
|
@ -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; {
|
||||
|
44
pkgs/tools/misc/aspcud/default.nix
Normal file
44
pkgs/tools/misc/aspcud/default.nix
Normal file
@ -0,0 +1,44 @@
|
||||
{ stdenv, fetchurl,
|
||||
boost, clasp, cmake, gringo, re2c
|
||||
}:
|
||||
|
||||
let
|
||||
version = "1.9.0";
|
||||
in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "aspcud-${version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/project/potassco/aspcud/${version}/aspcud-${version}-source.tar.gz";
|
||||
sha256 = "029035vcdk527ssf126i8ipi5zs73gqpbrg019pvm9r24rf0m373";
|
||||
};
|
||||
|
||||
buildInputs = [ boost clasp cmake gringo re2c ];
|
||||
|
||||
buildPhase = ''
|
||||
cmake -DCMAKE_BUILD_TYPE=Release \
|
||||
-DGRINGO_LOC=${gringo}/bin/gringo \
|
||||
-DCLASP_LOC=${clasp}/bin/clasp \
|
||||
-DENCODING_LOC=$out/share/aspcud/specification.lp \
|
||||
.
|
||||
|
||||
make
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp bin/{aspcud,cudf2lp,lemon} $out/bin
|
||||
|
||||
mkdir -p $out/share/aspcud
|
||||
cp ../share/aspcud/specification.lp $out/share/aspcud
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "Solver for package problems in CUDF format using ASP";
|
||||
homepage = http://potasssco.sourceforge.net/;
|
||||
platforms = platforms.linux;
|
||||
maintainers = [ maintainers.hakuch ];
|
||||
license = licenses.gpl3Plus;
|
||||
};
|
||||
}
|
32
pkgs/tools/misc/clasp/default.nix
Normal file
32
pkgs/tools/misc/clasp/default.nix
Normal file
@ -0,0 +1,32 @@
|
||||
{ stdenv, fetchurl }:
|
||||
|
||||
let
|
||||
version = "3.1.4";
|
||||
in
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "clasp-${version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/project/potassco/clasp/${version}/clasp-${version}-source.tar.gz";
|
||||
sha256 = "1zkjqc4gp4n9p2kf3k3z8x82g42any4p3shhhivny89z1jlxi9zn";
|
||||
};
|
||||
|
||||
preConfigure = "patchShebangs ./configure.sh";
|
||||
configureScript = "./configure.sh";
|
||||
|
||||
preBuild = "cd build/release";
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp bin/clasp $out/bin/clasp
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "Answer set solver for (extended) normal and disjunctive logic programs";
|
||||
homepage = http://potassco.sourceforge.net/;
|
||||
platforms = platforms.all;
|
||||
maintainers = [ maintainers.hakuch ];
|
||||
license = licenses.gpl2Plus;
|
||||
};
|
||||
}
|
39
pkgs/tools/misc/gringo/default.nix
Normal file
39
pkgs/tools/misc/gringo/default.nix
Normal file
@ -0,0 +1,39 @@
|
||||
{ stdenv, fetchurl,
|
||||
bison, re2c, scons
|
||||
}:
|
||||
|
||||
let
|
||||
version = "4.5.4";
|
||||
in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "gringo-${version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/project/potassco/gringo/${version}/gringo-${version}-source.tar.gz";
|
||||
sha256 = "16k4pkwyr2mh5w8j91vhxh9aff7f4y31npwf09w6f8q63fxvpy41";
|
||||
};
|
||||
|
||||
buildInputs = [ bison re2c scons ];
|
||||
|
||||
patches = [
|
||||
./gringo-4.5.4-cmath.patch
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
scons --build-dir=release
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp build/release/gringo $out/bin/gringo
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "Converts input programs with first-order variables to equivalent ground programs";
|
||||
homepage = http://potassco.sourceforge.net/;
|
||||
platforms = platforms.linux;
|
||||
maintainers = [ maintainers.hakuch ];
|
||||
license = licenses.gpl3Plus;
|
||||
};
|
||||
}
|
11
pkgs/tools/misc/gringo/gringo-4.5.4-cmath.patch
Normal file
11
pkgs/tools/misc/gringo/gringo-4.5.4-cmath.patch
Normal file
@ -0,0 +1,11 @@
|
||||
--- gringo/libgringo/src/term.cc~ 2016-07-12 23:56:10.593577749 -0400
|
||||
+++ gringo/libgringo/src/term.cc 2016-07-12 23:52:35.169968338 -0400
|
||||
@@ -22,6 +22,8 @@
|
||||
#include "gringo/logger.hh"
|
||||
#include "gringo/graph.hh"
|
||||
|
||||
+#include <cmath>
|
||||
+
|
||||
namespace Gringo {
|
||||
|
||||
// {{{ definition of Defines
|
@ -536,6 +536,10 @@ in
|
||||
};
|
||||
aria = self.aria2;
|
||||
|
||||
aspcud = callPackage ../tools/misc/aspcud {
|
||||
boost = boost155;
|
||||
};
|
||||
|
||||
at = callPackage ../tools/system/at { };
|
||||
|
||||
atftp = callPackage ../tools/networking/atftp { };
|
||||
@ -710,6 +714,8 @@ in
|
||||
|
||||
ckbcomp = callPackage ../tools/X11/ckbcomp { };
|
||||
|
||||
clasp = callPackage ../tools/misc/clasp { };
|
||||
|
||||
cli53 = callPackage ../tools/admin/cli53 { };
|
||||
|
||||
cli-visualizer = callPackage ../applications/misc/cli-visualizer { };
|
||||
@ -843,6 +849,8 @@ in
|
||||
|
||||
gmic = callPackage ../tools/graphics/gmic { };
|
||||
|
||||
gringo = callPackage ../tools/misc/gringo { };
|
||||
|
||||
gti = callPackage ../tools/misc/gti { };
|
||||
|
||||
heatseeker = callPackage ../tools/misc/heatseeker { };
|
||||
|
Loading…
Reference in New Issue
Block a user