2019-10-15 04:30:00 +01:00
|
|
|
{ stdenv, fetchFromGitHub, jdk, gmp, readline, openssl, unixODBC, zlib
|
2019-06-16 20:59:06 +01:00
|
|
|
, libarchive, db, pcre, libedit, libossp_uuid, libXpm
|
2019-10-15 04:30:00 +01:00
|
|
|
, libSM, libXt, freetype, pkgconfig, fontconfig
|
|
|
|
, cmake, libyaml, Security
|
2019-10-08 07:59:12 +01:00
|
|
|
, libjpeg, libX11, libXext, libXft, libXinerama
|
2019-04-25 15:25:19 +01:00
|
|
|
, extraLibraries ? [ jdk unixODBC libXpm libSM libXt freetype fontconfig ]
|
|
|
|
, extraPacks ? []
|
2019-10-08 07:59:12 +01:00
|
|
|
, withGui ? false
|
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
|
2020-10-15 16:25:55 +01:00
|
|
|
version = "8.3.9";
|
2019-04-25 15:25:19 +01:00
|
|
|
packInstall = swiplPath: pack:
|
|
|
|
''${swiplPath}/bin/swipl -g "pack_install(${pack}, [package_directory(\"${swiplPath}/lib/swipl/pack\"), silent(true), interactive(false)])." -t "halt."
|
|
|
|
'';
|
2011-09-19 17:38:16 +01:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
2019-08-13 22:52:01 +01:00
|
|
|
pname = "swi-prolog";
|
|
|
|
inherit version;
|
2008-03-06 21:53:54 +00:00
|
|
|
|
2019-10-15 04:30:00 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "SWI-Prolog";
|
|
|
|
repo = "swipl-devel";
|
2019-04-25 15:25:19 +01:00
|
|
|
rev = "V${version}";
|
2020-10-15 16:25:55 +01:00
|
|
|
sha256 = "0ixb8pc5s7q8q0njs8is1clpvik6jhhdcwnys7m9rpwdzgi10sjz";
|
2019-10-15 04:30:00 +01:00
|
|
|
fetchSubmodules = true;
|
2008-03-06 21:53:54 +00:00
|
|
|
};
|
|
|
|
|
2019-10-15 04:30:00 +01:00
|
|
|
nativeBuildInputs = [ cmake pkgconfig ];
|
|
|
|
|
|
|
|
buildInputs = [ gmp readline openssl
|
2019-04-25 15:25:19 +01:00
|
|
|
libarchive libyaml db pcre libedit libossp_uuid
|
2019-10-15 04:30:00 +01:00
|
|
|
zlib ]
|
2019-10-08 07:59:12 +01:00
|
|
|
++ stdenv.lib.optionals (withGui && !stdenv.isDarwin) [ libXpm libX11 libXext libXft libXinerama libjpeg ]
|
2019-04-25 15:25:19 +01:00
|
|
|
++ extraLibraries
|
2019-10-15 04:30:00 +01:00
|
|
|
++ stdenv.lib.optional stdenv.isDarwin Security;
|
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
|
|
|
|
2019-10-15 04:30:00 +01:00
|
|
|
cmakeFlags = [ "-DSWIPL_INSTALL_IN_LIB=ON" ];
|
2014-01-13 16:10:11 +00:00
|
|
|
|
2019-10-15 04:30:00 +01:00
|
|
|
postInstall = builtins.concatStringsSep "\n"
|
2019-04-25 15:25:19 +01:00
|
|
|
( builtins.map (packInstall "$out") extraPacks
|
|
|
|
);
|
2009-12-09 14:07:09 +00:00
|
|
|
|
2008-03-06 21:53:54 +00:00
|
|
|
meta = {
|
2019-10-15 04:30:00 +01:00
|
|
|
homepage = "https://www.swi-prolog.org";
|
2009-11-18 09:39:59 +00:00
|
|
|
description = "A Prolog compiler and interpreter";
|
2019-10-15 04:30:00 +01:00
|
|
|
license = stdenv.lib.licenses.bsd2;
|
2011-09-19 17:38:16 +01:00
|
|
|
|
2019-10-08 07:59:12 +01:00
|
|
|
platforms = stdenv.lib.platforms.linux ++ stdenv.lib.optionals (!withGui) stdenv.lib.platforms.darwin;
|
2019-03-05 11:30:59 +00:00
|
|
|
maintainers = [ stdenv.lib.maintainers.meditans ];
|
2008-03-06 21:53:54 +00:00
|
|
|
};
|
|
|
|
}
|