1 { lib, stdenv, fetchFromGitHub, copyPkgconfigItems, makePkgconfigItem }:
3 stdenv.mkDerivation rec {
7 src = fetchFromGitHub {
10 rev = "rel-${version}";
11 sha256 = "sha256-sSvJgHxsRaJ/xHEK32fox0MFI7u+pj5ERLfNn2s8kC8=";
14 outputs = [ "out" "dev" "lib" ];
17 nativeBuildInputs = [ copyPkgconfigItems ];
23 cflags = [ "-I\${includedir}" ];
24 libs = [ "-L\${libdir}" "-lcadical" ];
26 includedir = "@includedir@";
29 inherit (meta) description;
34 # copyPkgconfigItems will substitute these in the pkg-config file
35 includedir = "${placeholder "dev"}/include";
36 libdir = "${placeholder "lib"}/lib";
39 enableParallelBuilding = true;
43 substituteInPlace makefile.in --replace-fail "ar rc" '$(AR) rc'
46 # the configure script is not generated by autotools and does not accept the
47 # arguments that the default configurePhase passes like --prefix and --libdir
59 install -Dm0755 build/cadical "$out/bin/cadical"
60 install -Dm0755 build/mobical "$out/bin/mobical"
61 install -Dm0644 src/ccadical.h "$dev/include/ccadical.h"
62 install -Dm0644 src/cadical.hpp "$dev/include/cadical.hpp"
63 install -Dm0644 build/libcadical.a "$lib/lib/libcadical.a"
64 mkdir -p "$out/share/doc/${pname}/"
65 install -Dm0755 {LICEN?E,README*,VERSION} "$out/share/doc/${pname}/"
71 description = "Simplified Satisfiability Solver";
72 maintainers = with maintainers; [ shnarazk ];
73 platforms = platforms.unix;
74 license = licenses.mit;
75 homepage = "https://fmv.jku.at/cadical/";