2014-02-04 04:10:23 +01:00
|
|
|
{ stdenv, fetchurl, cabal, swiProlog, either, mtl, syb
|
|
|
|
, glibcLocales, makeWrapper, rlwrap, tk }:
|
2011-03-24 20:22:30 +01:00
|
|
|
|
2013-05-10 14:40:59 +02:00
|
|
|
let
|
2014-02-04 04:10:23 +01:00
|
|
|
fname = "pakcs-1.11.3";
|
2011-03-24 20:22:30 +01:00
|
|
|
|
2013-05-10 14:40:59 +02:00
|
|
|
fsrc = fetchurl {
|
|
|
|
url = "http://www.informatik.uni-kiel.de/~pakcs/download/${fname}-src.tar.gz";
|
2014-04-21 20:07:18 +02:00
|
|
|
sha256 = "0m9s6693svr57in8rhkvq9h2j0hiphki6jn0syzrzzs4ahb7i1gb";
|
2011-03-24 20:22:30 +01:00
|
|
|
};
|
|
|
|
|
2013-05-10 14:40:59 +02:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2011-03-24 20:22:30 +01:00
|
|
|
|
2013-05-10 14:40:59 +02:00
|
|
|
name = fname;
|
2011-03-24 20:22:30 +01:00
|
|
|
|
2013-05-10 14:40:59 +02: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 04:10:23 +01:00
|
|
|
buildDepends = [ either mtl syb curryBase ];
|
2013-05-10 14:40:59 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
src = fsrc;
|
|
|
|
|
2014-02-04 04:10:23 +01:00
|
|
|
buildInputs = [ swiProlog makeWrapper glibcLocales rlwrap tk ];
|
2013-05-10 14:40:59 +02:00
|
|
|
|
|
|
|
patches = [ ./adjust-buildsystem.patch ];
|
2011-03-24 20:22:30 +01:00
|
|
|
|
2013-05-10 14:40:59 +02:00
|
|
|
configurePhase = ''
|
|
|
|
# Phony HOME.
|
|
|
|
mkdir phony-home
|
|
|
|
export HOME=$(pwd)/phony-home
|
2012-06-11 08:05:18 +02:00
|
|
|
|
2013-05-10 14:40:59 +02:00
|
|
|
# SWI Prolog
|
|
|
|
sed -i 's@SWIPROLOG=@SWIPROLOG='${swiProlog}/bin/swipl'@' pakcsinitrc
|
2011-03-24 20:22:30 +01:00
|
|
|
'';
|
|
|
|
|
2013-05-10 14:40:59 +02:00
|
|
|
preBuild = ''
|
2014-02-04 04:10:23 +01:00
|
|
|
# Some comments in files are in UTF-8, so include the locale needed by GHC runtime.
|
|
|
|
export LOCALE_ARCHIVE=${glibcLocales}/lib/locale/locale-archive
|
|
|
|
export LC_ALL=en_US.UTF-8
|
|
|
|
|
2013-05-10 14:40:59 +02:00
|
|
|
# Set up link to cymake, which has been built already.
|
|
|
|
ensureDir bin/.local
|
|
|
|
ln -s ${curryFront}/bin/cymake bin/.local/
|
|
|
|
'';
|
2011-03-24 20:22:30 +01:00
|
|
|
|
2013-05-10 14:40:59 +02:00
|
|
|
installPhase = ''
|
|
|
|
# Prepare PAKCSHOME directory.
|
|
|
|
ensureDir $out/pakcs
|
|
|
|
for d in bin curry2prolog currytools lib tools cpns include www examples docs ; do
|
|
|
|
cp -r $d $out/pakcs ;
|
|
|
|
done
|
|
|
|
cp pakcsrc.default $out/pakcs
|
|
|
|
cp pakcsinitrc $out/pakcs
|
|
|
|
|
|
|
|
# Fixing PAKCSHOME and related paths.
|
|
|
|
sed -i 's@PAKCSHOME=/tmp/.*@PAKCSHOME='$out/pakcs'@' $out/pakcs/bin/{pakcs,makecurrycgi,parsecurry,.makesavedstate}
|
|
|
|
|
|
|
|
# The Prolog sources must be rebuilt in their final directory,
|
|
|
|
# to switch the embedded references to the tmp build directory.
|
|
|
|
export TEMP=/tmp
|
|
|
|
(cd $out/pakcs/curry2prolog/ ; rm c2p.state ; make)
|
|
|
|
cp Makefile $out/pakcs
|
|
|
|
(cd $out/pakcs ; make tools)
|
|
|
|
(cd $out/pakcs/cpns ; make)
|
|
|
|
(cd $out/pakcs/www ; make)
|
|
|
|
|
|
|
|
# Install bin.
|
|
|
|
ensureDir $out/bin
|
|
|
|
for b in makecurrycgi .makesavedstate pakcs parsecurry cleancurry \
|
|
|
|
addtypes cass currybrowse currycreatemake currydoc currytest \
|
|
|
|
dataToXml erd2curry ; do
|
|
|
|
ln -s $out/pakcs/bin/$b $out/bin/ ;
|
|
|
|
done
|
2011-03-24 20:22:30 +01:00
|
|
|
|
2013-05-10 14:40:59 +02:00
|
|
|
# Place emacs lisp files in expected locations.
|
|
|
|
ensureDir $out/share/emacs/site-lisp/curry-pakcs
|
|
|
|
for e in "tools/emacs/"*.el ; do
|
|
|
|
cp $e $out/share/emacs/site-lisp/curry-pakcs/ ;
|
|
|
|
done
|
2011-03-24 20:22:30 +01:00
|
|
|
|
2013-05-10 14:40:59 +02:00
|
|
|
# Wrap for rlwrap and tk support.
|
|
|
|
wrapProgram $out/pakcs/bin/pakcs \
|
2011-03-24 20:22:30 +01:00
|
|
|
--prefix PATH ":" "${rlwrap}/bin" \
|
|
|
|
--prefix PATH ":" "${tk}/bin" \
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2012-03-06 23:27:20 +01:00
|
|
|
homepage = "http://www.informatik.uni-kiel.de/~pakcs/";
|
2013-04-26 11:09:13 +02:00
|
|
|
description = "An implementation of the multi-paradigm declarative language Curry";
|
2012-03-06 23:27:20 +01:00
|
|
|
license = stdenv.lib.licenses.bsd3;
|
|
|
|
|
2011-03-24 20:22:30 +01: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 18:21:54 +02:00
|
|
|
maintainers = [ stdenv.lib.maintainers.kkallio ];
|
2013-05-10 14:40:59 +02:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
2011-03-24 20:22:30 +01:00
|
|
|
};
|
|
|
|
}
|