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
926stdenv . 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