2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, zlib, unzip }:
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
let
|
|
|
|
|
|
|
|
cxx = "${stdenv.cc.targetPrefix}c++";
|
|
|
|
libName = "libipasirglucose4" + stdenv.targetPlatform.extensions.sharedLibrary;
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
2020-08-20 17:08:02 +00:00
|
|
|
pname = "libipasirglucose4";
|
|
|
|
# This library has no version number AFAICT (beyond generally being based on
|
|
|
|
# Glucose 4.x), but it was submitted to the 2017 SAT competition so let's use
|
|
|
|
# that as the version number, I guess.
|
|
|
|
version = "2017";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://baldur.iti.kit.edu/sat-competition-2017/solvers/incremental/glucose-ipasir.zip";
|
|
|
|
sha256 = "0xchgady9vwdh8frmc8swz6va53igp2wj1y9sshd0g7549n87wdj";
|
|
|
|
};
|
|
|
|
nativeBuildInputs = [ unzip ];
|
|
|
|
|
|
|
|
buildInputs = [ zlib ];
|
|
|
|
|
|
|
|
sourceRoot = "sat/glucose4";
|
|
|
|
patches = [ ./0001-Support-shared-library-build.patch ];
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
makeFlags = [ "CXX=${cxx}" ];
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
postBuild = ''
|
2021-05-20 23:08:51 +00:00
|
|
|
${cxx} -shared -o ${libName} \
|
|
|
|
${if stdenv.cc.isClang then "" else "-Wl,-soname,${libName}"} \
|
2020-08-20 17:08:02 +00:00
|
|
|
ipasirglucoseglue.o libipasirglucose4.a
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2021-05-20 23:08:51 +00:00
|
|
|
install -D ${libName} $out/lib/${libName}
|
2020-08-20 17:08:02 +00:00
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-08-20 17:08:02 +00:00
|
|
|
description = "Shared library providing IPASIR interface to the Glucose SAT solver";
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ kini ];
|
|
|
|
};
|
|
|
|
}
|