Unverified Commit 9cb45d89 authored by 7c6f434c's avatar 7c6f434c Committed by GitHub
Browse files

Merge pull request #202726 from mmarx/fix-trivial-package-manager

lispPackages_new.sbclPackages.cl-sat: fix build failure
parents b58dc22e 084857b8
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ let
    removeSuffix
    hasInfix
    optionalString
    makeBinPath
    makeLibraryPath
    makeSearchPath
    recurseIntoAttrs
@@ -249,6 +250,12 @@ let
            then pkgs.applyPatches { inherit (args) src patches; }
            else args.src;
      patches = [];

      # make sure that propagated build-inputs from lispLibs are propagated
      propagatedBuildInputs = lib.unique
        (builtins.concatLists
          (lib.catAttrs "propagatedBuildInputs"
            (builtins.concatLists [[args] lispLibs nativeLibs javaLibs])));
    })));

  # Build the set of lisp packages using `lisp`
@@ -353,7 +360,9 @@ let
          --prefix LD_LIBRARY_PATH : "${o.LD_LIBRARY_PATH}" \
          --prefix LD_LIBRARY_PATH : "${makeLibraryPath o.nativeLibs}" \
          --prefix CLASSPATH : "${o.CLASSPATH}" \
          --prefix CLASSPATH : "${makeSearchPath "share/java/*" o.javaLibs}"
          --prefix CLASSPATH : "${makeSearchPath "share/java/*" o.javaLibs}" \
          --prefix PATH : "${makeBinPath (o.buildInputs or [])}" \
          --prefix PATH : "${makeBinPath (o.propagatedBuildInputs or [])}"
      '';
    });

+27 −0
Original line number Diff line number Diff line
From 2040fcab5a7be2f28add46a1412bef62ac5ccf11 Mon Sep 17 00:00:00 2001
From: Maximilian Marx <mmarx@wh2.tu-dresden.de>
Date: Thu, 24 Nov 2022 20:00:33 +0100
Subject: [PATCH] Use glucose binary from PATH if present

---
 src/package.lisp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/package.lisp b/src/package.lisp
index b6e26ac..bdb2581 100644
--- a/src/package.lisp
+++ b/src/package.lisp
@@ -13,7 +13,9 @@
 (defvar *glucose-home* (asdf:system-relative-pathname :cl-sat.glucose "glucose-syrup/"))
 
 (defun glucose-binary (&optional (*glucose-home* *glucose-home*))
-  (merge-pathnames "simp/glucose_static" *glucose-home*))
+  (if (trivial-package-manager:which "glucose")
+      "glucose"
+      (merge-pathnames "simp/glucose_static" *glucose-home*)))
 
 (defmethod solve ((input pathname) (solver (eql :glucose)) &rest options &key debug &allow-other-keys)
   (remf options :debug)
-- 
2.36.2
+11 −0
Original line number Diff line number Diff line
@@ -190,6 +190,17 @@ let
      nativeBuildInputs = [ pkgs.zeromq ];
      nativeLibs = [ pkgs.zeromq ];
    };
    trivial-package-manager = pkg: {
      propagatedBuildInputs = [ pkgs.which ];
    };
    "cl-sat.glucose" = pkg: {
      propagatedBuildInputs = [ pkgs.glucose ];
      patches = [ ./patches/cl-sat.glucose-binary-from-PATH-if-present.patch ];

    };
    "cl-sat.minisat" = pkg: {
      propagatedBuildInputs = [ pkgs.minisat ];
    };
  };

  qlpkgs =