2015-06-14 20:55:08 +00:00
|
|
|
{ stdenv, fetchurl }:
|
2011-10-17 22:18:21 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2015-06-14 20:55:08 +00:00
|
|
|
name = "picosat-${version}";
|
2016-04-02 16:43:32 +00:00
|
|
|
version = "965";
|
2011-10-17 22:18:21 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://fmv.jku.at/picosat/${name}.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
|
|
|
|
2018-03-24 01:10:54 +00:00
|
|
|
makeFlags = stdenv.lib.optional stdenv.isDarwin
|
|
|
|
"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";
|
2015-06-14 20:55:08 +00:00
|
|
|
homepage = http://fmv.jku.at/picosat/;
|
|
|
|
license = stdenv.lib.licenses.mit;
|
|
|
|
platforms = stdenv.lib.platforms.unix;
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ roconnor thoughtpolice ];
|
2011-10-17 22:18:21 +00:00
|
|
|
};
|
|
|
|
}
|