nixpkgs-suyu/pkgs/development/compilers/swi-prolog/default.nix

55 lines
1.7 KiB
Nix
Raw Normal View History

2019-10-15 05:30:00 +02:00
{ stdenv, fetchFromGitHub, jdk, gmp, readline, openssl, unixODBC, zlib
, libarchive, db, pcre, libedit, libossp_uuid, libXpm
2019-10-15 05:30:00 +02:00
, libSM, libXt, freetype, pkgconfig, fontconfig
, cmake, libyaml, Security
, libjpeg, libX11, libXext, libXft, libXinerama
, extraLibraries ? [ jdk unixODBC libXpm libSM libXt freetype fontconfig ]
, extraPacks ? []
, withGui ? false
2014-01-13 17:10:11 +01:00
}:
let
version = "8.1.15";
packInstall = swiplPath: pack:
''${swiplPath}/bin/swipl -g "pack_install(${pack}, [package_directory(\"${swiplPath}/lib/swipl/pack\"), silent(true), interactive(false)])." -t "halt."
'';
in
stdenv.mkDerivation {
2019-08-13 23:52:01 +02:00
pname = "swi-prolog";
inherit version;
2019-10-15 05:30:00 +02:00
src = fetchFromGitHub {
owner = "SWI-Prolog";
repo = "swipl-devel";
rev = "V${version}";
sha256 = "0czbrscx2s4079nmwvipp9cnwfny16m3fpnp823llm7wyljchgvq";
2019-10-15 05:30:00 +02:00
fetchSubmodules = true;
};
2019-10-15 05:30:00 +02:00
nativeBuildInputs = [ cmake pkgconfig ];
buildInputs = [ gmp readline openssl
libarchive libyaml db pcre libedit libossp_uuid
2019-10-15 05:30:00 +02:00
zlib ]
++ stdenv.lib.optionals (withGui && !stdenv.isDarwin) [ libXpm libX11 libXext libXft libXinerama libjpeg ]
++ extraLibraries
2019-10-15 05:30:00 +02:00
++ stdenv.lib.optional stdenv.isDarwin Security;
2014-01-13 17:10:11 +01:00
hardeningDisable = [ "format" ];
2016-02-24 18:10:58 +01:00
2019-10-15 05:30:00 +02:00
cmakeFlags = [ "-DSWIPL_INSTALL_IN_LIB=ON" ];
2014-01-13 17:10:11 +01:00
2019-10-15 05:30:00 +02:00
postInstall = builtins.concatStringsSep "\n"
( builtins.map (packInstall "$out") extraPacks
);
meta = {
2019-10-15 05:30:00 +02:00
homepage = "https://www.swi-prolog.org";
description = "A Prolog compiler and interpreter";
2019-10-15 05:30:00 +02:00
license = stdenv.lib.licenses.bsd2;
platforms = stdenv.lib.platforms.linux ++ stdenv.lib.optionals (!withGui) stdenv.lib.platforms.darwin;
maintainers = [ stdenv.lib.maintainers.meditans ];
};
}