Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4b5e5fce5a0f
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: bdaa8402302a
Choose a head ref
  • 3 commits
  • 1 file changed
  • 2 contributors

Commits on Mar 3, 2020

  1. python3Packages.monosat: Fix Python 3.8 build

    (cherry picked from commit 2148a15)
    acairncross committed Mar 3, 2020

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    grahamc Graham Christensen
    Copy the full SHA
    04379d0 View commit details
  2. python3Packages.monosat: Fix hash

    (cherry picked from commit 3db82f6)
    acairncross committed Mar 3, 2020

    Verified

    This commit was signed with the committer’s verified signature.
    vcunat Vladimír Čunát
    Copy the full SHA
    6c3ab02 View commit details

Commits on Mar 30, 2020

  1. Merge pull request #81647 from acairncross/monosat-py38-backport

    [20.03] python3Packages.monosat: Fix Python 3.8 build
    bhipple authored Mar 30, 2020

    Verified

    This commit was signed with the committer’s verified signature.
    vcunat Vladimír Čunát
    Copy the full SHA
    bdaa840 View commit details
Showing with 17 additions and 7 deletions.
  1. +17 −7 pkgs/applications/science/logic/monosat/default.nix
24 changes: 17 additions & 7 deletions pkgs/applications/science/logic/monosat/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, cmake, zlib, gmp, jdk8,
{ stdenv, fetchpatch, fetchFromGitHub, cmake, zlib, gmp, jdk8,
# The JDK we use on Darwin currenly makes extensive use of rpaths which are
# annoying and break the python library, so let's not bother for now
includeJava ? !stdenv.hostPlatform.isDarwin, includeGplCode ? true }:
@@ -20,9 +20,17 @@ let
inherit rev sha256;
};

patches = [
# Python 3.8 compatibility
(fetchpatch {
url = https://github.com/sambayless/monosat/commit/a5079711d0df0451f9840f3a41248e56dbb03967.patch;
sha256 = "1p2y0jw8hb9c90nbffhn86k1dxd6f6hk5v70dfmpzka3y6g1ksal";
})
];

core = stdenv.mkDerivation {
name = "${pname}-${version}";
inherit src;
inherit src patches;
buildInputs = [ cmake zlib gmp jdk8 ];

cmakeFlags = [
@@ -48,20 +56,22 @@ let
};

python = { buildPythonPackage, cython }: buildPythonPackage {
inherit pname version src;

# The top-level "source" is what fetchFromGitHub gives us. The rest is inside the repo
sourceRoot = "source/src/monosat/api/python/";
inherit pname version src patches;

propagatedBuildInputs = [ core cython ];

# This tells setup.py to use cython, which should produce faster bindings
MONOSAT_CYTHON = true;

# After patching src, move to where the actually relevant source is. This could just be made
# the sourceRoot if it weren't for the patch.
postPatch = ''
cd src/monosat/api/python
'' +
# The relative paths here don't make sense for our Nix build
# TODO: do we want to just reference the core monosat library rather than copying the
# shared lib? The current setup.py copies the .dylib/.so...
postPatch = ''
''
substituteInPlace setup.py \
--replace 'library_dir = "../../../../"' 'library_dir = "${core}/lib/"'
'';