@@ -1,12 +1,12 @@
11{ stdenv, fetchurl, cabal, swiProlog, either, mtl, syb
2−, glibcLocales, makeWrapper, rlwrap, tk }:
2+, glibcLocales, makeWrapper, rlwrap, tk, which }:
33
44let
5− fname = "pakcs-1.11.3";
5+ fname = "pakcs-1.11.4";
66
77 fsrc = fetchurl {
88 url = "http://www.informatik.uni-kiel.de/~pakcs/download/${fname}-src.tar.gz";
9− sha256 = "0f4rhaqss9vfinpdjchxq75g343hz322cv0admjnl4g5g568wk3x";
9+ sha256 = "1xsn8h58pi1jp8wr4abyrqdps840j8limyv5i812z49npf91fy5c";
1010 };
1111
1212in
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
3535
3636 src = fsrc;
3737
38− buildInputs = [ swiProlog makeWrapper glibcLocales rlwrap tk ];
38+ buildInputs = [ swiProlog makeWrapper glibcLocales rlwrap tk which ];
3939
4040 patches = [ ./adjust-buildsystem.patch ];
4141
@@ -48,48 +48,37 @@ stdenv.mkDerivation rec {
4848 sed -i 's@SWIPROLOG=@SWIPROLOG='${swiProlog}/bin/swipl'@' pakcsinitrc
4949 '';
5050
51− preBuild = ''
51+ buildPhase = ''
5252 # Some comments in files are in UTF-8, so include the locale needed by GHC runtime.
5353 export LOCALE_ARCHIVE=${glibcLocales}/lib/locale/locale-archive
5454 export LC_ALL=en_US.UTF-8
5555
56− # Set up link to cymake, which has been built already.
57− mkdir -p bin/.local
58− ln -s ${curryFront}/bin/cymake bin/.local/
59− '';
56+ # PAKCS must be build in place due to embedded filesystem references placed by swi.
6057
61− installPhase = ''
6258 # Prepare PAKCSHOME directory.
63− mkdir -p $out/pakcs
64− for d in bin curry2prolog currytools lib tools cpns include www examples docs ; do
65− cp -r $d $out/pakcs ;
66− done
67− cp pakcsrc.default $out/pakcs
68− cp pakcsinitrc $out/pakcs
59+ mkdir -p $out/pakcs/bin
6960
70− # Fixing PAKCSHOME and related paths.
71− sed -i 's@PAKCSHOME=/tmp/.*@PAKCSHOME='$out/pakcs'@' $out/pakcs/bin/{pakcs,makecurrycgi,parsecurry,.makesavedstate}
61+ # Set up link to cymake, which has been built already.
62+ ln -s ${curryFront}/bin/cymake $out/pakcs/bin/
7263
73− # The Prolog sources must be rebuilt in their final directory,
74− # to switch the embedded references to the tmp build directory.
64+ # Prevent embedding the derivation build directory as temp.
7565 export TEMP=/tmp
76− (cd $out/pakcs/curry2prolog/ ; rm c2p.state ; make)
77− cp Makefile $out/pakcs
78− (cd $out/pakcs ; make tools)
79− (cd $out/pakcs/cpns ; make)
80− (cd $out/pakcs/www ; make)
8166
67+ # Copy to in place build location and run the build.
68+ cp -r * $out/pakcs
69+ (cd $out/pakcs ; make)
70+ '';
71+
72+ installPhase = ''
8273 # Install bin.
8374 mkdir -p $out/bin
84− for b in makecurrycgi .makesavedstate pakcs parsecurry cleancurry \
85− addtypes cass currybrowse currycreatemake currydoc currytest \
86− dataToXml erd2curry ; do
75+ for b in $(ls $out/pakcs/bin) ; do
8776 ln -s $out/pakcs/bin/$b $out/bin/ ;
8877 done
8978
9079 # Place emacs lisp files in expected locations.
9180 mkdir -p $out/share/emacs/site-lisp/curry-pakcs
92− for e in "tools/emacs/"*.el ; do
81+ for e in "$out/tools/emacs/"*.el ; do
9382 cp $e $out/share/emacs/site-lisp/curry-pakcs/ ;
9483 done
9584
@@ -119,6 +108,5 @@ stdenv.mkDerivation rec {
119108 maintainers = [ stdenv.lib.maintainers.kkallio ];
120109 platforms = stdenv.lib.platforms.linux;
121110 hydraPlatforms = stdenv.lib.platforms.none;
122− broken = true;
123111 };
124112}