Unverified Commit 2956bcc4 authored by Weijia Wang's avatar Weijia Wang Committed by GitHub
Browse files

Merge pull request #221876 from wegank/glucose-refactor

glucose: refactor
parents 50c517b0 0ddc01c5
Loading
Loading
Loading
Loading
+20 −7
Original line number Diff line number Diff line
{ lib, stdenv, fetchurl, zlib }:
{ lib
, stdenv
, fetchurl
, zlib
, enableUnfree ? false
}:

stdenv.mkDerivation rec {
  pname = "glucose";
  pname = "glucose" + lib.optionalString enableUnfree "-syrup";
  version = "4.1";

  src = fetchurl {
    url = "http://www.labri.fr/perso/lsimon/downloads/softwares/glucose-syrup-${version}.tgz";
    sha256 = "0aahrkaq7n0z986fpqz66yz946nxardfi6dh8calzcfjpvqiraji";
    hash = "sha256-Uaoc8b7SsU8VQ7CZ6FpW3RqSvjfm4+sMSh/Yg9XMUCk=";
  };

  sourceRoot = "glucose-syrup-${version}/${if enableUnfree then "parallel" else "simp"}";

  postPatch = ''
    substituteInPlace Main.cc \
      --replace "defined(__linux__)" "defined(__linux__) && defined(__x86_64__)"
@@ -15,17 +23,22 @@ stdenv.mkDerivation rec {

  buildInputs = [ zlib ];

  sourceRoot = "glucose-syrup-${version}/simp";
  makeFlags = [ "r" ];

  installPhase = ''
    install -Dm0755 glucose_release $out/bin/glucose
    runHook preInstall

    install -Dm0755 ${pname}_release $out/bin/${pname}
    mkdir -p "$out/share/doc/${pname}-${version}/"
    install -Dm0755 ../{LICEN?E,README*,Changelog*} "$out/share/doc/${pname}-${version}/"

    runHook postInstall
  '';

  meta = with lib; {
    description = "Modern, parallel SAT solver (sequential version)";
    license = licenses.mit;
    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;
    platforms = platforms.unix;
    maintainers = with maintainers; [ gebner ];
  };
+0 −24
Original line number Diff line number Diff line
{ lib, stdenv, zlib, glucose }:
stdenv.mkDerivation rec {
  pname = "glucose-syrup";
  version = glucose.version;

  src = glucose.src;

  buildInputs = [ zlib ];

  sourceRoot = "glucose-syrup-${version}/parallel";
  makeFlags = [ "r" ];
  installPhase = ''
    install -Dm0755 glucose-syrup_release $out/bin/glucose-syrup
    mkdir -p "$out/share/doc/${pname}-${version}/"
    install -Dm0755 ../{LICEN?E,README*,Changelog*} "$out/share/doc/${pname}-${version}/"
  '';

  meta = with lib; {
    description = "Modern, parallel SAT solver (parallel version)";
    license = licenses.unfreeRedistributable;
    platforms = platforms.unix;
    maintainers = with maintainers; [ gebner ];
  };
}
+3 −1
Original line number Diff line number Diff line
@@ -37279,7 +37279,9 @@ with pkgs;
  glom = callPackage ../applications/misc/glom { };
  glucose = callPackage ../applications/science/logic/glucose { };
  glucose-syrup = callPackage ../applications/science/logic/glucose/syrup.nix { };
  glucose-syrup = callPackage ../applications/science/logic/glucose {
    enableUnfree = true;
  };
  hol = callPackage ../applications/science/logic/hol { };