Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f4e3ceed7fda
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 02c823a54178
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Apr 25, 2019

  1. swi-prolog: updated version + packs support

    Using "extraPacks" and "extraLibraries" arguments
    it is possible to create fully functional virtual-envs
    for SWI-Prolog projects.
    (In a way similar to what "ghcWithPackages" does for Haskell)
    barakber committed Apr 25, 2019
    Copy the full SHA
    990acf7 View commit details

Commits on Apr 28, 2019

  1. Merge pull request #60227 from Atidot/master

    swi-prolog: updated version + packs support
    joachifm authored Apr 28, 2019
    Copy the full SHA
    02c823a View commit details
Showing with 30 additions and 9 deletions.
  1. +30 −9 pkgs/development/compilers/swi-prolog/default.nix
39 changes: 30 additions & 9 deletions pkgs/development/compilers/swi-prolog/default.nix
Original file line number Diff line number Diff line change
@@ -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.