2023-03-24 00:07:29 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
2023-03-30 22:05:00 +00:00
|
|
|
, unzip
|
2023-03-24 00:07:29 +00:00
|
|
|
, zlib
|
|
|
|
, enableUnfree ? false
|
|
|
|
}:
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2023-03-24 00:07:29 +00:00
|
|
|
pname = "glucose" + lib.optionalString enableUnfree "-syrup";
|
2023-03-30 22:05:00 +00:00
|
|
|
version = "4.2.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2023-03-30 22:05:00 +00:00
|
|
|
url = "https://www.labri.fr/perso/lsimon/downloads/softwares/glucose-${version}.zip";
|
|
|
|
hash = "sha256-J0J9EKC/4cCiZr/y4lz+Hm7OcmJmMIIWzQ+4c+KhqXg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-03-30 22:05:00 +00:00
|
|
|
sourceRoot = "glucose-${version}/sources/${if enableUnfree then "parallel" else "simp"}";
|
2023-03-24 00:07:29 +00:00
|
|
|
|
2022-11-27 09:42:12 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace Main.cc \
|
|
|
|
--replace "defined(__linux__)" "defined(__linux__) && defined(__x86_64__)"
|
|
|
|
'';
|
|
|
|
|
2023-03-30 22:05:00 +00:00
|
|
|
nativeBuildInputs = [ unzip ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ zlib ];
|
|
|
|
|
|
|
|
makeFlags = [ "r" ];
|
2023-03-24 00:07:29 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
installPhase = ''
|
2023-03-24 00:07:29 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
install -Dm0755 ${pname}_release $out/bin/${pname}
|
2020-04-24 23:36:52 +00:00
|
|
|
mkdir -p "$out/share/doc/${pname}-${version}/"
|
|
|
|
install -Dm0755 ../{LICEN?E,README*,Changelog*} "$out/share/doc/${pname}-${version}/"
|
2023-03-24 00:07:29 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2023-03-24 00:07:29 +00:00
|
|
|
description = "Modern, parallel SAT solver (${if enableUnfree then "parallel" else "sequential"} version)";
|
|
|
|
homepage = "https://www.labri.fr/perso/lsimon/research/glucose/";
|
|
|
|
license = if enableUnfree then licenses.unfreeRedistributable else licenses.mit;
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ gebner ];
|
|
|
|
};
|
|
|
|
}
|