Merge pull request #221876 from wegank/glucose-refactor

glucose: refactor

authored by

Weijia Wang and committed by
GitHub
2956bcc4 50c517b0

+23 -32
+20 -7
pkgs/applications/science/logic/glucose/default.nix
··· 1 - { lib, stdenv, fetchurl, zlib }: 1 + { lib 2 + , stdenv 3 + , fetchurl 4 + , zlib 5 + , enableUnfree ? false 6 + }: 7 + 2 8 stdenv.mkDerivation rec { 3 - pname = "glucose"; 9 + pname = "glucose" + lib.optionalString enableUnfree "-syrup"; 4 10 version = "4.1"; 5 11 6 12 src = fetchurl { 7 13 url = "http://www.labri.fr/perso/lsimon/downloads/softwares/glucose-syrup-${version}.tgz"; 8 - sha256 = "0aahrkaq7n0z986fpqz66yz946nxardfi6dh8calzcfjpvqiraji"; 14 + hash = "sha256-Uaoc8b7SsU8VQ7CZ6FpW3RqSvjfm4+sMSh/Yg9XMUCk="; 9 15 }; 16 + 17 + sourceRoot = "glucose-syrup-${version}/${if enableUnfree then "parallel" else "simp"}"; 10 18 11 19 postPatch = '' 12 20 substituteInPlace Main.cc \ ··· 15 23 16 24 buildInputs = [ zlib ]; 17 25 18 - sourceRoot = "glucose-syrup-${version}/simp"; 19 26 makeFlags = [ "r" ]; 27 + 20 28 installPhase = '' 21 - install -Dm0755 glucose_release $out/bin/glucose 29 + runHook preInstall 30 + 31 + install -Dm0755 ${pname}_release $out/bin/${pname} 22 32 mkdir -p "$out/share/doc/${pname}-${version}/" 23 33 install -Dm0755 ../{LICEN?E,README*,Changelog*} "$out/share/doc/${pname}-${version}/" 34 + 35 + runHook postInstall 24 36 ''; 25 37 26 38 meta = with lib; { 27 - description = "Modern, parallel SAT solver (sequential version)"; 28 - license = licenses.mit; 39 + description = "Modern, parallel SAT solver (${if enableUnfree then "parallel" else "sequential"} version)"; 40 + homepage = "https://www.labri.fr/perso/lsimon/research/glucose/"; 41 + license = if enableUnfree then licenses.unfreeRedistributable else licenses.mit; 29 42 platforms = platforms.unix; 30 43 maintainers = with maintainers; [ gebner ]; 31 44 };
-24
pkgs/applications/science/logic/glucose/syrup.nix
··· 1 - { lib, stdenv, zlib, glucose }: 2 - stdenv.mkDerivation rec { 3 - pname = "glucose-syrup"; 4 - version = glucose.version; 5 - 6 - src = glucose.src; 7 - 8 - buildInputs = [ zlib ]; 9 - 10 - sourceRoot = "glucose-syrup-${version}/parallel"; 11 - makeFlags = [ "r" ]; 12 - installPhase = '' 13 - install -Dm0755 glucose-syrup_release $out/bin/glucose-syrup 14 - mkdir -p "$out/share/doc/${pname}-${version}/" 15 - install -Dm0755 ../{LICEN?E,README*,Changelog*} "$out/share/doc/${pname}-${version}/" 16 - ''; 17 - 18 - meta = with lib; { 19 - description = "Modern, parallel SAT solver (parallel version)"; 20 - license = licenses.unfreeRedistributable; 21 - platforms = platforms.unix; 22 - maintainers = with maintainers; [ gebner ]; 23 - }; 24 - }
+3 -1
pkgs/top-level/all-packages.nix
··· 37279 37279 glom = callPackage ../applications/misc/glom { }; 37280 37280 37281 37281 glucose = callPackage ../applications/science/logic/glucose { }; 37282 - glucose-syrup = callPackage ../applications/science/logic/glucose/syrup.nix { }; 37282 + glucose-syrup = callPackage ../applications/science/logic/glucose { 37283 + enableUnfree = true; 37284 + }; 37283 37285 37284 37286 hol = callPackage ../applications/science/logic/hol { }; 37285 37287