-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmathsat.nix
32 lines (27 loc) · 1.14 KB
/
mathsat.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{ stdenv, fetchurl, lib, gmp }:
let
version = "5.6.5";
name = "mathsat";
in stdenv.mkDerivation rec {
inherit name version;
src = fetchurl {
url = "https://mathsat.fbk.eu/download.php?file=${name}-${version}-"
+ lib.optionalString stdenv.hostPlatform.isDarwin "darwin-libcxx-x86_64"
+ lib.optionalString stdenv.hostPlatform.isLinux "linux-x86_64"
+ ".tar.gz";
sha256 =
lib.optionalString stdenv.hostPlatform.isDarwin "bf13877df67e1a9529474644de2999ba3b5e314f82a8790138e4ddd5c5cd5bfa"
+ lib.optionalString stdenv.hostPlatform.isLinux "08kr8vv58brpbqhd3rdc44y8sf1s2wpklblc5myync7zq4sgydvf";
};
nativeBuildInputs = [ gmp ];
inherit gmp;
installPhase = ''
mkdir $out
cp -r . $out/
'' + lib.optionalString stdenv.hostPlatform.isDarwin ''
install_name_tool -id $out/lib/libmathsat.dylib $out/lib/libmathsat.dylib
install_name_tool -change /usr/local/lib/libgmp.10.dylib $gmp/lib/libgmp.dylib $out/lib/libmathsat.dylib
install_name_tool -change /usr/local/lib/libgmpxx.4.dylib $gmp/lib/libgmpxx.dylib $out/lib/libmathsat.dylib
'' + lib.optionalString stdenv.hostPlatform.isLinux ''
'';
}