2014-02-04 03:10:23 +00:00
|
|
|
{ stdenv, fetchurl, cabal, swiProlog, either, mtl, syb
|
2015-01-06 08:54:11 +00:00
|
|
|
, glibcLocales, makeWrapper, rlwrap, tk, which }:
|
2011-03-24 19:22:30 +00:00
|
|
|
|
2013-05-10 13:40:59 +01:00
|
|
|
let
|
2015-01-06 08:54:11 +00:00
|
|
|
fname = "pakcs-1.11.4";
|
2011-03-24 19:22:30 +00:00
|
|
|
|
2013-05-10 13:40:59 +01:00
|
|
|
fsrc = fetchurl {
|
|
|
|
url = "http://www.informatik.uni-kiel.de/~pakcs/download/${fname}-src.tar.gz";
|
2015-01-06 08:54:11 +00:00
|
|
|
sha256 = "1xsn8h58pi1jp8wr4abyrqdps840j8limyv5i812z49npf91fy5c";
|
2011-03-24 19:22:30 +00:00
|
|
|
};
|
|
|
|
|
2013-05-10 13:40:59 +01:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2011-03-24 19:22:30 +00:00
|
|
|
|
2013-05-10 13:40:59 +01:00
|
|
|
name = fname;
|
2011-03-24 19:22:30 +00:00
|
|
|
|
2013-05-10 13:40:59 +01:00
|
|
|
curryBase = cabal.mkDerivation(self: {
|
|
|
|
pname = "curryBase";
|
|
|
|
version = "local";
|
|
|
|
src = fsrc;
|
|
|
|
sourceRoot = "${name}/frontend/curry-base";
|
|
|
|
isLibrary = true;
|
|
|
|
buildDepends = [ mtl syb ];
|
|
|
|
});
|
|
|
|
|
|
|
|
curryFront = cabal.mkDerivation(self: {
|
|
|
|
pname = "curryFront";
|
|
|
|
version = "local";
|
|
|
|
src = fsrc;
|
|
|
|
sourceRoot = "${name}/frontend/curry-frontend";
|
|
|
|
isLibrary = true;
|
|
|
|
isExecutable = true;
|
2014-02-04 03:10:23 +00:00
|
|
|
buildDepends = [ either mtl syb curryBase ];
|
2013-05-10 13:40:59 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
src = fsrc;
|
|
|
|
|
2015-01-06 08:54:11 +00:00
|
|
|
buildInputs = [ swiProlog makeWrapper glibcLocales rlwrap tk which ];
|
2013-05-10 13:40:59 +01:00
|
|
|
|
|
|
|
patches = [ ./adjust-buildsystem.patch ];
|
2011-03-24 19:22:30 +00:00
|
|
|
|
2013-05-10 13:40:59 +01:00
|
|
|
configurePhase = ''
|
|
|
|
# Phony HOME.
|
|
|
|
mkdir phony-home
|
|
|
|
export HOME=$(pwd)/phony-home
|
2012-06-11 07:05:18 +01:00
|
|
|
|
2013-05-10 13:40:59 +01:00
|
|
|
# SWI Prolog
|
|
|
|
sed -i 's@SWIPROLOG=@SWIPROLOG='${swiProlog}/bin/swipl'@' pakcsinitrc
|
2011-03-24 19:22:30 +00:00
|
|
|
'';
|
|
|
|
|
2015-01-06 08:54:11 +00:00
|
|
|
buildPhase = ''
|
2014-02-04 03:10:23 +00:00
|
|
|
# Some comments in files are in UTF-8, so include the locale needed by GHC runtime.
|
|
|
|
export LC_ALL=en_US.UTF-8
|
|
|
|
|
2015-01-06 08:54:11 +00:00
|
|
|
# PAKCS must be build in place due to embedded filesystem references placed by swi.
|
2011-03-24 19:22:30 +00:00
|
|
|
|
2013-05-10 13:40:59 +01:00
|
|
|
# Prepare PAKCSHOME directory.
|
2015-01-06 08:54:11 +00:00
|
|
|
mkdir -p $out/pakcs/bin
|
2013-05-10 13:40:59 +01:00
|
|
|
|
2015-01-06 08:54:11 +00:00
|
|
|
# Set up link to cymake, which has been built already.
|
|
|
|
ln -s ${curryFront}/bin/cymake $out/pakcs/bin/
|
2013-05-10 13:40:59 +01:00
|
|
|
|
2015-01-06 08:54:11 +00:00
|
|
|
# Prevent embedding the derivation build directory as temp.
|
2013-05-10 13:40:59 +01:00
|
|
|
export TEMP=/tmp
|
|
|
|
|
2015-01-06 08:54:11 +00:00
|
|
|
# Copy to in place build location and run the build.
|
|
|
|
cp -r * $out/pakcs
|
|
|
|
(cd $out/pakcs ; make)
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2013-05-10 13:40:59 +01:00
|
|
|
# Install bin.
|
2014-06-30 13:56:10 +01:00
|
|
|
mkdir -p $out/bin
|
2015-01-06 08:54:11 +00:00
|
|
|
for b in $(ls $out/pakcs/bin) ; do
|
2013-05-10 13:40:59 +01:00
|
|
|
ln -s $out/pakcs/bin/$b $out/bin/ ;
|
|
|
|
done
|
2011-03-24 19:22:30 +00:00
|
|
|
|
2013-05-10 13:40:59 +01:00
|
|
|
# Place emacs lisp files in expected locations.
|
2014-06-30 13:56:10 +01:00
|
|
|
mkdir -p $out/share/emacs/site-lisp/curry-pakcs
|
2015-01-06 08:54:11 +00:00
|
|
|
for e in "$out/tools/emacs/"*.el ; do
|
2013-05-10 13:40:59 +01:00
|
|
|
cp $e $out/share/emacs/site-lisp/curry-pakcs/ ;
|
|
|
|
done
|
2011-03-24 19:22:30 +00:00
|
|
|
|
2013-05-10 13:40:59 +01:00
|
|
|
# Wrap for rlwrap and tk support.
|
|
|
|
wrapProgram $out/pakcs/bin/pakcs \
|
2011-03-24 19:22:30 +00:00
|
|
|
--prefix PATH ":" "${rlwrap}/bin" \
|
|
|
|
--prefix PATH ":" "${tk}/bin" \
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2012-03-06 22:27:20 +00:00
|
|
|
homepage = "http://www.informatik.uni-kiel.de/~pakcs/";
|
2013-04-26 10:09:13 +01:00
|
|
|
description = "An implementation of the multi-paradigm declarative language Curry";
|
2012-03-06 22:27:20 +00:00
|
|
|
license = stdenv.lib.licenses.bsd3;
|
|
|
|
|
2011-03-24 19:22:30 +00: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).
|
|
|
|
'';
|
|
|
|
|
2012-09-11 17:21:54 +01:00
|
|
|
maintainers = [ stdenv.lib.maintainers.kkallio ];
|
2013-05-10 13:40:59 +01:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
2014-08-12 10:56:50 +01:00
|
|
|
hydraPlatforms = stdenv.lib.platforms.none;
|
2011-03-24 19:22:30 +00:00
|
|
|
};
|
|
|
|
}
|