anchor.diff:      inherit src;
       buildInputs = [ cmake zlib gmp jdk8 ];
   
  -    cmakeFlags = [ "-DJAVA=${boolToCmake includeJava}" "-DGPL=${boolToCmake includeGplCode}" ];
  +    cmakeFlags = [
  +      "-DBUILD_STATIC=OFF"
  +      "-DJAVA=${boolToCmake includeJava}"
  +      "-DGPL=${boolToCmake includeGplCode}"
  +    ];
   
       postInstall = optionalString includeJava ''
         mkdir -p $out/share/java
  
positive.code: let
    boolToCmake = x: if x then "ON" else "OFF";
  
    rev    = "2deeadeff214e975c9f7508bc8a24fa05a1a0c32";
    sha256 = "09yhym2lxmn3xbhw5fcxawnmvms5jd9fw9m7x2wzil7yvy4vwdjn";
  
    pname   = "monosat";
    version = substring 0 7 sha256;
  
    src = fetchFromGitHub {
      owner = "sambayless";
  
negative.code: 
      propagatedBuildInputs = [ core cython ];
  
      # This tells setup.py to use cython, which should produce faster bindings
      MONOSAT_CYTHON = true;
  
      # 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/"'
      '';
    };
  in core
  