Merge pull request #60227 from Atidot/master
swi-prolog: updated version + packs support
This commit is contained in:
commit
02c823a541
1 changed files with 30 additions and 9 deletions
|
@ -1,22 +1,30 @@
|
|||
{ stdenv, fetchurl, jdk, gmp, readline, openssl, libjpeg, unixODBC, zlib
|
||||
{ stdenv, fetchgit, jdk, gmp, readline, openssl, libjpeg, unixODBC, zlib
|
||||
, libXinerama, libarchive, db, pcre, libedit, libossp_uuid, libXft, libXpm
|
||||
, libSM, libXt, freetype, pkgconfig, fontconfig, makeWrapper ? stdenv.isDarwin
|
||||
, git, cacert, cmake, libyaml
|
||||
, extraLibraries ? [ jdk unixODBC libXpm libSM libXt freetype fontconfig ]
|
||||
, extraPacks ? []
|
||||
}:
|
||||
|
||||
let
|
||||
version = "7.6.4";
|
||||
version = "8.1.4";
|
||||
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 {
|
||||
name = "swi-prolog-${version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://www.swi-prolog.org/download/stable/src/swipl-${version}.tar.gz";
|
||||
sha256 = "14bq4sqs61maqpnmgy6687jjj0shwc27cpfsqbf056nrssmplg9d";
|
||||
src = fetchgit {
|
||||
url = "https://github.com/SWI-Prolog/swipl-devel";
|
||||
rev = "V${version}";
|
||||
sha256 = "0qxa6f5dypwczxajlf0l736adbjb17cbak3qsh5g04hpv2bxm6dh";
|
||||
};
|
||||
|
||||
buildInputs = [ jdk gmp readline openssl libjpeg unixODBC libXinerama
|
||||
libarchive db pcre libedit libossp_uuid libXft libXpm libSM libXt
|
||||
zlib freetype pkgconfig fontconfig ]
|
||||
buildInputs = [ cacert git cmake gmp readline openssl
|
||||
libarchive libyaml db pcre libedit libossp_uuid
|
||||
zlib pkgconfig ]
|
||||
++ extraLibraries
|
||||
++ stdenv.lib.optional stdenv.isDarwin makeWrapper;
|
||||
|
||||
hardeningDisable = [ "format" ];
|
||||
|
@ -27,7 +35,20 @@ stdenv.mkDerivation {
|
|||
"--enable-shared"
|
||||
];
|
||||
|
||||
buildFlags = "world";
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
mkdir build
|
||||
cd build
|
||||
${cmake}/bin/cmake -DCMAKE_INSTALL_PREFIX=$out ..
|
||||
cd ../
|
||||
make
|
||||
make install
|
||||
make clean
|
||||
mkdir -p $out/lib/swipl/pack
|
||||
''
|
||||
+ builtins.concatStringsSep "\n"
|
||||
( builtins.map (packInstall "$out") extraPacks
|
||||
);
|
||||
|
||||
# For macOS: still not fixed in upstream: "abort trap 6" when called
|
||||
# through symlink, so wrap binary.
|
||||
|
|
Loading…
Reference in a new issue