Skip to content

Commit 0f88b38

Browse files
authored
bitwuzla: fix kissat not compiled in error (#400299)
2 parents 95987b0 + fbede79 commit 0f88b38

File tree

2 files changed

+50
-13
lines changed

2 files changed

+50
-13
lines changed

pkgs/by-name/bi/bitwuzla/package.nix

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
gmp,
1313
cadical,
1414
cryptominisat,
15+
kissat,
1516
zlib,
1617
pkg-config,
1718
cmake,
@@ -37,20 +38,23 @@ stdenv.mkDerivation (finalAttrs: {
3738
ninja
3839
cmake
3940
];
41+
4042
buildInputs = [
4143
cadical
4244
cryptominisat
4345
btor2tools
4446
symfpu
4547
gmp
4648
zlib
49+
kissat
4750
];
4851

4952
mesonFlags = [
5053
# note: the default value for default_library fails to link dynamic dependencies
5154
# but setting it to shared works even in pkgsStatic
5255
"-Ddefault_library=shared"
5356
"-Dcryptominisat=true"
57+
"-Dkissat=true"
5458

5559
(lib.strings.mesonEnable "testing" finalAttrs.finalPackage.doCheck)
5660
];
@@ -77,6 +81,7 @@ stdenv.mkDerivation (finalAttrs: {
7781
set -euxo pipefail;
7882
$out/bin/bitwuzla -S cms -j 3 -m file.smt2 | tee /dev/stderr | grep $needle;
7983
$out/bin/bitwuzla -S cadical -m file.smt2 | tee /dev/stderr | grep $needle;
84+
$out/bin/bitwuzla -S kissat -m file.smt2 | tee /dev/stderr | grep $needle;
8085
)
8186
8287
runHook postInstallCheck

pkgs/by-name/ki/kissat/package.nix

Lines changed: 45 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,25 @@
44
fetchFromGitHub,
55
drat-trim,
66
p7zip,
7+
pkg-config,
78
}:
89

10+
let
11+
# Early meta to reference in pkgconfig generation
12+
meta = with lib; {
13+
description = "'keep it simple and clean bare metal SAT solver' written in C";
14+
mainProgram = "kissat";
15+
longDescription = ''
16+
Kissat is a "keep it simple and clean bare metal SAT solver" written in C.
17+
It is a port of CaDiCaL back to C with improved data structures,
18+
better scheduling of inprocessing and optimized algorithms and implementation.
19+
'';
20+
maintainers = with maintainers; [ shnarazk ];
21+
platforms = platforms.unix;
22+
license = licenses.mit;
23+
homepage = "https://fmv.jku.at/kissat";
24+
};
25+
in
926
stdenv.mkDerivation rec {
1027
pname = "kissat";
1128
version = "4.0.2";
@@ -23,6 +40,10 @@ stdenv.mkDerivation rec {
2340
"lib"
2441
];
2542

43+
nativeBuildInputs = [
44+
pkg-config
45+
];
46+
2647
nativeCheckInputs = [
2748
drat-trim
2849
p7zip
@@ -37,6 +58,14 @@ stdenv.mkDerivation rec {
3758
dontAddPrefix = true;
3859
setOutputFlags = false;
3960

61+
configurePhase = ''
62+
./configure
63+
'';
64+
65+
buildPhase = ''
66+
make -j$NIX_BUILD_CORES
67+
'';
68+
4069
installPhase = ''
4170
runHook preInstall
4271
@@ -46,20 +75,23 @@ stdenv.mkDerivation rec {
4675
mkdir -p "$out/share/doc/kissat/"
4776
install -Dm0644 {LICEN?E,README*,VERSION} "$out/share/doc/kissat/"
4877
78+
# Create pkgconfig
79+
mkdir -p $dev/lib/pkgconfig
80+
cat > $dev/lib/pkgconfig/kissat.pc <<EOF
81+
prefix=${placeholder "dev"}
82+
exec_prefix=\''${prefix}
83+
libdir=${placeholder "lib"}/lib
84+
includedir=\''${prefix}/include
85+
86+
Name: ${pname}
87+
Description: ${meta.description}
88+
Version: ${version}
89+
Libs: -L\''${libdir} -lkissat
90+
Cflags: -I\''${includedir}
91+
EOF
92+
4993
runHook postInstall
5094
'';
5195

52-
meta = with lib; {
53-
description = "'keep it simple and clean bare metal SAT solver' written in C";
54-
mainProgram = "kissat";
55-
longDescription = ''
56-
Kissat is a "keep it simple and clean bare metal SAT solver" written in C.
57-
It is a port of CaDiCaL back to C with improved data structures,
58-
better scheduling of inprocessing and optimized algorithms and implementation.
59-
'';
60-
maintainers = with maintainers; [ shnarazk ];
61-
platforms = platforms.unix;
62-
license = licenses.mit;
63-
homepage = "https://fmv.jku.at/kissat";
64-
};
96+
inherit meta;
6597
}

0 commit comments

Comments
 (0)