2018-03-14 05:45:55 +00:00
|
|
|
{ stdenv, fetchurl, jdk, gmp, readline, openssl, libjpeg, unixODBC, zlib
|
2014-01-13 16:10:11 +00:00
|
|
|
, libXinerama, libXft, libXpm, libSM, libXt, freetype, pkgconfig
|
2016-10-13 07:36:49 +01:00
|
|
|
, fontconfig, makeWrapper ? stdenv.isDarwin
|
2014-01-13 16:10:11 +00:00
|
|
|
}:
|
2008-03-06 21:53:54 +00:00
|
|
|
|
2011-09-19 17:38:16 +01:00
|
|
|
let
|
2018-03-14 05:46:39 +00:00
|
|
|
version = "7.6.4";
|
2011-09-19 17:38:16 +01:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
2010-12-04 11:16:39 +00:00
|
|
|
name = "swi-prolog-${version}";
|
2008-03-06 21:53:54 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2016-09-15 05:31:23 +01:00
|
|
|
url = "http://www.swi-prolog.org/download/stable/src/swipl-${version}.tar.gz";
|
2018-03-14 05:46:39 +00:00
|
|
|
sha256 = "14bq4sqs61maqpnmgy6687jjj0shwc27cpfsqbf056nrssmplg9d";
|
2008-03-06 21:53:54 +00:00
|
|
|
};
|
|
|
|
|
2018-03-14 05:45:55 +00:00
|
|
|
buildInputs = [ jdk gmp readline openssl libjpeg unixODBC libXinerama
|
2016-10-13 07:36:49 +01:00
|
|
|
libXft libXpm libSM libXt zlib freetype pkgconfig fontconfig ]
|
|
|
|
++ stdenv.lib.optional stdenv.isDarwin makeWrapper;
|
2014-01-13 16:10:11 +00:00
|
|
|
|
2016-02-26 17:38:15 +00:00
|
|
|
hardeningDisable = [ "format" ];
|
2016-02-24 17:10:58 +00:00
|
|
|
|
2009-12-09 14:07:09 +00:00
|
|
|
configureFlags = "--with-world --enable-gmp --enable-shared";
|
2014-01-13 16:10:11 +00:00
|
|
|
|
|
|
|
buildFlags = "world";
|
2009-12-09 14:07:09 +00:00
|
|
|
|
2016-10-13 07:36:49 +01:00
|
|
|
# For macOS: still not fixed in upstream: "abort trap 6" when called
|
|
|
|
# through symlink, so wrap binary.
|
|
|
|
# We reinvent wrapProgram here but omit argv0 pass in order to not
|
|
|
|
# break PAKCS package build. This is also safe for SWI-Prolog, since
|
|
|
|
# there is no wrapping environment and hence no need to spoof $0
|
|
|
|
postInstall = stdenv.lib.optionalString stdenv.isDarwin ''
|
|
|
|
local prog="$out/bin/swipl"
|
|
|
|
local hidden="$(dirname "$prog")/.$(basename "$prog")"-wrapped
|
|
|
|
mv $prog $hidden
|
|
|
|
makeWrapper $hidden $prog
|
|
|
|
'';
|
|
|
|
|
2008-03-06 21:53:54 +00:00
|
|
|
meta = {
|
|
|
|
homepage = http://www.swi-prolog.org/;
|
2009-11-18 09:39:59 +00:00
|
|
|
description = "A Prolog compiler and interpreter";
|
2008-03-06 21:53:54 +00:00
|
|
|
license = "LGPL";
|
2011-09-19 17:38:16 +01:00
|
|
|
|
2016-10-13 07:36:49 +01:00
|
|
|
platforms = stdenv.lib.platforms.unix;
|
2016-05-16 21:30:20 +01:00
|
|
|
maintainers = [ stdenv.lib.maintainers.peti ];
|
2008-03-06 21:53:54 +00:00
|
|
|
};
|
|
|
|
}
|