2018-07-22 17:07:29 +02:00
|
|
|
{ stdenv, fetchurl, makeWrapper
|
|
|
|
, haskellPackages, haskell
|
|
|
|
, which, swiProlog, rlwrap, tk
|
|
|
|
, curl, git, unzip, gnutar, coreutils, sqlite }:
|
2016-10-04 21:49:07 +02:00
|
|
|
|
|
|
|
let
|
2019-03-16 22:15:35 +01:00
|
|
|
name = "pakcs-2.1.1";
|
2016-10-04 21:49:07 +02:00
|
|
|
|
2018-11-17 03:08:21 +01:00
|
|
|
# Don't switch to development release without a reason, because its
|
|
|
|
# source updates without version bump. Prefer current release instead.
|
2018-07-22 17:07:29 +02:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://www.informatik.uni-kiel.de/~pakcs/download/${name}-src.tar.gz";
|
2019-03-16 22:15:35 +01:00
|
|
|
sha256 = "112v9ynqfbbm4x770mcfrai9v5bh7c3zn7jka80pv6v4y65r778c";
|
2016-10-04 21:49:07 +02:00
|
|
|
};
|
|
|
|
|
2018-07-22 17:07:29 +02:00
|
|
|
curry-frontend = (haskellPackages.override {
|
|
|
|
overrides = self: super: {
|
|
|
|
curry-base = haskell.lib.overrideCabal (super.callPackage ./curry-base.nix {}) (drv: {
|
|
|
|
inherit src;
|
|
|
|
postUnpack = "sourceRoot+=/frontend/curry-base";
|
|
|
|
});
|
|
|
|
curry-frontend = haskell.lib.overrideCabal (super.callPackage ./curry-frontend.nix {}) (drv: {
|
|
|
|
inherit src;
|
|
|
|
postUnpack = "sourceRoot+=/frontend/curry-frontend";
|
|
|
|
});
|
2016-10-05 20:20:58 +02:00
|
|
|
};
|
2018-07-22 17:07:29 +02:00
|
|
|
}).curry-frontend;
|
|
|
|
in stdenv.mkDerivation {
|
|
|
|
inherit name src;
|
|
|
|
|
|
|
|
buildInputs = [ swiProlog ];
|
|
|
|
nativeBuildInputs = [ which makeWrapper ];
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"CURRYFRONTEND=${curry-frontend}/bin/curry-frontend"
|
|
|
|
"DISTPKGINSTALL=yes"
|
|
|
|
# Not needed, just to make script pass
|
|
|
|
"CURRYTOOLSDIR=0"
|
|
|
|
"CURRYLIBSDIR=0"
|
2016-10-10 20:50:05 +02:00
|
|
|
];
|
2016-10-04 21:49:07 +02:00
|
|
|
|
2018-07-22 17:07:29 +02:00
|
|
|
preConfigure = ''
|
|
|
|
# Since we can't expand $out in `makeFlags`
|
|
|
|
#makeFlags="$makeFlags PAKCSINSTALLDIR=$out/pakcs"
|
2016-10-04 21:49:07 +02:00
|
|
|
|
2018-07-22 17:07:29 +02:00
|
|
|
substituteInPlace currytools/cpm/src/CPM/Repository.curry \
|
|
|
|
--replace "/bin/rm" "rm"
|
2016-10-04 21:49:07 +02:00
|
|
|
'';
|
|
|
|
|
2018-07-22 17:07:29 +02:00
|
|
|
# cypm new: EXISTENCE ERROR: source_sink
|
|
|
|
# "/tmp/nix-build-pakcs-2.0.2.drv-0/pakcs-2.0.2/currytools/cpm/templates/LICENSE"
|
|
|
|
# does not exist
|
2016-10-04 21:49:07 +02:00
|
|
|
buildPhase = ''
|
2018-07-22 17:07:29 +02:00
|
|
|
mkdir -p $out/pakcs
|
2016-10-04 21:49:07 +02:00
|
|
|
cp -r * $out/pakcs
|
2018-07-22 17:07:29 +02:00
|
|
|
(cd $out/pakcs ; make -j$NIX_BUILD_CORES $makeFlags)
|
2016-10-04 21:49:07 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2018-07-22 17:07:29 +02:00
|
|
|
ln -s $out/pakcs/bin $out
|
2016-10-04 21:49:07 +02:00
|
|
|
|
2018-07-22 17:07:29 +02:00
|
|
|
mkdir -p $out/share/emacs/site-lisp
|
|
|
|
ln -s $out/pakcs/tools/emacs $out/share/emacs/site-lisp/curry-pakcs
|
2016-10-04 21:49:07 +02:00
|
|
|
|
|
|
|
wrapProgram $out/pakcs/bin/pakcs \
|
|
|
|
--prefix PATH ":" "${rlwrap}/bin" \
|
2018-07-22 17:07:29 +02:00
|
|
|
--prefix PATH ":" "${tk}/bin"
|
|
|
|
|
|
|
|
# List of dependencies from currytools/cpm/src/CPM/Main.curry
|
|
|
|
wrapProgram $out/pakcs/bin/cypm \
|
|
|
|
--prefix PATH ":" "${stdenv.lib.makeBinPath [ curl git unzip gnutar coreutils sqlite ]}"
|
2016-10-04 21:49:07 +02:00
|
|
|
'';
|
|
|
|
|
2016-10-15 04:24:42 +02:00
|
|
|
meta = with stdenv.lib; {
|
2017-08-01 22:03:30 +02:00
|
|
|
homepage = http://www.informatik.uni-kiel.de/~pakcs/;
|
2016-10-04 21:49:07 +02:00
|
|
|
description = "An implementation of the multi-paradigm declarative language Curry";
|
2016-10-15 04:24:42 +02:00
|
|
|
license = licenses.bsd3;
|
2016-10-04 21:49:07 +02:00
|
|
|
|
|
|
|
longDescription = ''
|
|
|
|
PAKCS is an implementation of the multi-paradigm declarative language
|
|
|
|
Curry jointly developed by the Portland State University, the Aachen
|
|
|
|
University of Technology, and the University of Kiel. Although this is
|
|
|
|
not a highly optimized implementation but based on a high-level
|
|
|
|
compilation of Curry programs into Prolog programs, it is not a toy
|
|
|
|
implementation but has been used for a variety of applications (e.g.,
|
|
|
|
graphical programming environments, an object-oriented front-end for
|
|
|
|
Curry, partial evaluators, database applications, HTML programming
|
|
|
|
with dynamic web pages, prototyping embedded systems).
|
|
|
|
'';
|
|
|
|
|
2016-10-15 04:24:42 +02:00
|
|
|
maintainers = with maintainers; [ kkallio gnidorah ];
|
2018-07-22 17:07:29 +02:00
|
|
|
platforms = platforms.linux;
|
2016-10-04 21:49:07 +02:00
|
|
|
};
|
|
|
|
}
|