2021-01-15 13:21:58 +00:00
|
|
|
{ lib, stdenv, fetchurl }:
|
2011-10-17 22:18:21 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "picosat";
|
2016-04-02 16:43:32 +00:00
|
|
|
version = "965";
|
2011-10-17 22:18:21 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 12:41:18 +00:00
|
|
|
url = "http://fmv.jku.at/picosat/${pname}-${version}.tar.gz";
|
2016-04-02 16:43:32 +00:00
|
|
|
sha256 = "0m578rpa5rdn08d10kr4lbsdwp4402hpavrz6n7n53xs517rn5hm";
|
2011-10-17 22:18:21 +00:00
|
|
|
};
|
|
|
|
|
2017-10-18 01:41:37 +00:00
|
|
|
prePatch = ''
|
|
|
|
substituteInPlace picosat.c --replace "sys/unistd.h" "unistd.h"
|
2018-02-05 19:22:14 +00:00
|
|
|
|
|
|
|
substituteInPlace makefile.in \
|
|
|
|
--replace 'ar rc' '$(AR) rc' \
|
|
|
|
--replace 'ranlib' '$(RANLIB)'
|
2017-10-18 01:41:37 +00:00
|
|
|
'';
|
|
|
|
|
2016-04-02 16:45:47 +00:00
|
|
|
configurePhase = "./configure.sh --shared --trace";
|
2011-10-17 22:18:21 +00:00
|
|
|
|
2021-01-15 13:21:58 +00:00
|
|
|
makeFlags = lib.optional stdenv.isDarwin
|
2018-03-24 01:10:54 +00:00
|
|
|
"SONAME=-Wl,-install_name,$(out)/lib/libpicosat.so";
|
|
|
|
|
2011-10-17 22:18:21 +00:00
|
|
|
installPhase = ''
|
2017-10-16 10:12:18 +00:00
|
|
|
mkdir -p $out/bin $out/lib $out/share $out/include/picosat
|
2016-04-02 16:45:47 +00:00
|
|
|
cp picomus picomcs picosat picogcnf "$out"/bin
|
2015-06-14 20:55:08 +00:00
|
|
|
|
2017-10-16 10:12:18 +00:00
|
|
|
cp VERSION "$out"/share/picosat.version
|
|
|
|
cp picosat.o "$out"/lib
|
2011-10-17 22:18:21 +00:00
|
|
|
cp libpicosat.a "$out"/lib
|
|
|
|
cp libpicosat.so "$out"/lib
|
2015-06-14 20:55:08 +00:00
|
|
|
|
2011-10-17 22:18:21 +00:00
|
|
|
cp picosat.h "$out"/include/picosat
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "SAT solver with proof and core support";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://fmv.jku.at/picosat/";
|
2021-01-15 13:21:58 +00:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
platforms = lib.platforms.unix;
|
|
|
|
maintainers = with lib.maintainers; [ roconnor thoughtpolice ];
|
2011-10-17 22:18:21 +00:00
|
|
|
};
|
|
|
|
}
|