summary refs log tree commit diff
path: root/pkgs/applications/science/logic/kissat/default.nix
blob: 5f982508c8c616db99b92878c95b30d4fae3ca09 (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
51
52
53
{ lib, stdenv, fetchFromGitHub
, drat-trim, p7zip
}:

stdenv.mkDerivation rec {
  pname = "kissat";
  version = "3.1.0";

  src = fetchFromGitHub {
    owner = "arminbiere";
    repo = "kissat";
    rev = "rel-${version}";
    sha256 = "sha256-AFUVkkD+toOfVEvIKfz3ncEdABLRxs9yQ8aJx6Q0ETM=";
  };

  outputs = [ "out" "dev" "lib" ];

  nativeCheckInputs = [ drat-trim p7zip ];
  doCheck = true;

  # 'make test' assumes that /etc/passwd is not writable.
  patches = [ ./writable-passwd-is-ok.patch ];

  # the configure script is not generated by autotools and does not accept the
  # arguments that the default configurePhase passes like --prefix and --libdir
  dontAddPrefix = true;
  setOutputFlags = false;

  installPhase = ''
    runHook preInstall

    install -Dm0755 build/kissat "$out/bin/kissat"
    install -Dm0644 src/kissat.h "$dev/include/kissat.h"
    install -Dm0644 build/libkissat.a "$lib/lib/libkissat.a"
    mkdir -p "$out/share/doc/kissat/"
    install -Dm0644 {LICEN?E,README*,VERSION} "$out/share/doc/kissat/"

    runHook postInstall
  '';

  meta = with lib; {
    description = "A 'keep it simple and clean bare metal SAT solver' written in C";
    longDescription = ''
      Kissat is a "keep it simple and clean bare metal SAT solver" written in C.
      It is a port of CaDiCaL back to C with improved data structures,
      better scheduling of inprocessing and optimized algorithms and implementation.
    '';
    maintainers = with maintainers; [ shnarazk ];
    platforms = platforms.unix;
    license = licenses.mit;
    homepage = "http://fmv.jku.at/kissat";
  };
}