summary refs log tree commit diff
path: root/pkgs/applications/science/logic/aspino/default.nix
blob: 82458d7c5663c6ad0c8c56960a252af71eb112d5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{ stdenv, fetchurl, fetchFromGitHub, zlib, boost }:

let
  glucose' = fetchurl {
    url = "http://www.labri.fr/perso/lsimon/downloads/softwares/glucose-syrup.tgz";
    sha256 = "0bq5l2jabhdfhng002qfk0mcj4pfi1v5853x3c7igwfrgx0jmfld";
  };
in

stdenv.mkDerivation {
  name = "aspino-unstable-2017-03-09";

  src = fetchFromGitHub {
    owner = "alviano";
    repo = "aspino";
    rev = "e31c3b4e5791a454e6602439cb26bd98d23c4e78";
    sha256 = "0annsjs2prqmv1lbs0lxr7yclfzh47xg9zyiq6mdxcc02rxsi14f";
  };

  buildInputs = [ zlib boost ];

  postPatch = ''
    substituteInPlace Makefile \
      --replace "GCC = g++" "GCC = c++"

    patchShebangs .
  '';

  preBuild = ''
    cp ${glucose'} patches/glucose-syrup.tgz
    ./bootstrap.sh
  '';

  installPhase = ''
    runHook preInstall
    mkdir -p $out/bin
    install -m0755 build/release/{aspino,fairino-{bs,ls,ps},maxino-2015-{k16,kdyn}} $out/bin
    runHook postInstall
  '';

  meta = with stdenv.lib; {
    description = "SAT/PseudoBoolean/MaxSat/ASP solver using glucose";
    maintainers = with maintainers; [ gebner ];
    platforms = platforms.unix;
    license = licenses.asl20;
    homepage = https://alviano.net/software/maxino/;
    # See pkgs/applications/science/logic/glucose/default.nix
    badPlatforms = [ "aarch64-linux" ];
  };
}