summary refs log tree commit diff
path: root/pkgs/development/compilers/pakcs
diff options
context:
space:
mode:
authorKarn Kallio <kkallio@skami.org>2015-01-06 04:24:11 -0430
committerDomen Kožar <domen@dev.si>2015-01-06 11:15:48 +0100
commit19cd862a6df19df6105e61bbc193caac0cf7f333 (patch)
tree05408d2b2842df221b7c5540a875ff219efbddb2 /pkgs/development/compilers/pakcs
parent0eccb88a5cc9f6daa68f7d56038ea8c355a5b5e9 (diff)
downloadnixlib-19cd862a6df19df6105e61bbc193caac0cf7f333.tar
nixlib-19cd862a6df19df6105e61bbc193caac0cf7f333.tar.gz
nixlib-19cd862a6df19df6105e61bbc193caac0cf7f333.tar.bz2
nixlib-19cd862a6df19df6105e61bbc193caac0cf7f333.tar.lz
nixlib-19cd862a6df19df6105e61bbc193caac0cf7f333.tar.xz
nixlib-19cd862a6df19df6105e61bbc193caac0cf7f333.tar.zst
nixlib-19cd862a6df19df6105e61bbc193caac0cf7f333.zip
pakcs: advance version 1.11.3 to 1.11.4, also fixing the build.
Diffstat (limited to 'pkgs/development/compilers/pakcs')
-rw-r--r--pkgs/development/compilers/pakcs/adjust-buildsystem.patch22
-rw-r--r--pkgs/development/compilers/pakcs/default.nix48
2 files changed, 29 insertions, 41 deletions
diff --git a/pkgs/development/compilers/pakcs/adjust-buildsystem.patch b/pkgs/development/compilers/pakcs/adjust-buildsystem.patch
index 830fc3fa7f9a..ce0b42c9e344 100644
--- a/pkgs/development/compilers/pakcs/adjust-buildsystem.patch
+++ b/pkgs/development/compilers/pakcs/adjust-buildsystem.patch
@@ -1,15 +1,15 @@
-diff -Naur pakcs-1.11.3-upstream/Makefile pakcs-1.11.3/Makefile
---- pakcs-1.11.3-upstream/Makefile	2014-01-31 09:10:03.000000000 -0430
-+++ pakcs-1.11.3/Makefile	2014-02-03 20:27:41.558334480 -0430
-@@ -66,7 +66,6 @@
- #
- .PHONY: install
- install: installscripts
+diff -Naur pakcs-1.11.4-upstream/Makefile pakcs-1.11.4/Makefile
+--- pakcs-1.11.4-upstream/Makefile	2014-10-24 05:12:37.000000000 -0430
++++ pakcs-1.11.4/Makefile	2015-01-05 16:26:39.256709080 -0430
+@@ -94,7 +94,6 @@
+ install: cleanoldinfos installscripts copylibs
+ 	@echo "PAKCS installation configuration (file pakcsinitrc):"
+ 	@cat pakcsinitrc
 -	$(MAKE) frontend
  	# pre-compile all libraries:
  	@cd lib && $(MAKE) fcy
  	# install the Curry2Prolog compiler as a saved system:
-@@ -105,10 +104,6 @@
+@@ -145,10 +144,6 @@
  # compile the tools:
  .PHONY: tools
  tools:
@@ -20,9 +20,9 @@ diff -Naur pakcs-1.11.3-upstream/Makefile pakcs-1.11.3/Makefile
  	@if [ -r bin/pakcs ] ; then cd currytools && $(MAKE) ; fi
  	@if [ -r bin/pakcs ] ; then cd tools      && $(MAKE) ; fi
  
-diff -Naur pakcs-1.11.3-upstream/scripts/pakcs.sh pakcs-1.11.3/scripts/pakcs.sh
---- pakcs-1.11.3-upstream/scripts/pakcs.sh	2014-01-31 09:04:19.000000000 -0430
-+++ pakcs-1.11.3/scripts/pakcs.sh	2014-02-03 20:20:40.775350116 -0430
+diff -Naur pakcs-1.11.4-upstream/scripts/pakcs.sh pakcs-1.11.4/scripts/pakcs.sh
+--- pakcs-1.11.4-upstream/scripts/pakcs.sh	2014-10-24 05:06:07.000000000 -0430
++++ pakcs-1.11.4/scripts/pakcs.sh	2015-01-05 16:26:15.697982791 -0430
 @@ -16,7 +16,7 @@
  # use readline wrapper rlwrap if it is installed and we have tty as stdin:
  USERLWRAP=no
diff --git a/pkgs/development/compilers/pakcs/default.nix b/pkgs/development/compilers/pakcs/default.nix
index f7c76d74aaeb..433301e7ac0c 100644
--- a/pkgs/development/compilers/pakcs/default.nix
+++ b/pkgs/development/compilers/pakcs/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, cabal, swiProlog, either, mtl, syb
-, glibcLocales, makeWrapper, rlwrap, tk }:
+, glibcLocales, makeWrapper, rlwrap, tk, which }:
 
 let
-  fname = "pakcs-1.11.3";
+  fname = "pakcs-1.11.4";
 
   fsrc = fetchurl {
     url = "http://www.informatik.uni-kiel.de/~pakcs/download/${fname}-src.tar.gz";
-    sha256 = "0f4rhaqss9vfinpdjchxq75g343hz322cv0admjnl4g5g568wk3x";
+    sha256 = "1xsn8h58pi1jp8wr4abyrqdps840j8limyv5i812z49npf91fy5c";
   };
 
 in
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
 
   src = fsrc;
 
-  buildInputs = [ swiProlog makeWrapper glibcLocales rlwrap tk ];
+  buildInputs = [ swiProlog makeWrapper glibcLocales rlwrap tk which ];
 
   patches = [ ./adjust-buildsystem.patch ];
 
@@ -48,48 +48,37 @@ stdenv.mkDerivation rec {
     sed -i 's@SWIPROLOG=@SWIPROLOG='${swiProlog}/bin/swipl'@' pakcsinitrc
   '';
 
-  preBuild = ''
+  buildPhase = ''
     # 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
 
-    # Set up link to cymake, which has been built already.
-    mkdir -p bin/.local
-    ln -s ${curryFront}/bin/cymake bin/.local/
-  '';
+    # PAKCS must be build in place due to embedded filesystem references placed by swi.
 
-  installPhase = ''
     # Prepare PAKCSHOME directory.
-    mkdir -p $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
+    mkdir -p $out/pakcs/bin
 
-    # Fixing PAKCSHOME and related paths.
-    sed -i 's@PAKCSHOME=/tmp/.*@PAKCSHOME='$out/pakcs'@' $out/pakcs/bin/{pakcs,makecurrycgi,parsecurry,.makesavedstate}
+    # Set up link to cymake, which has been built already.
+    ln -s ${curryFront}/bin/cymake $out/pakcs/bin/
 
-    # The Prolog sources must be rebuilt in their final directory,
-    # to switch the embedded references to the tmp build directory.
+    # Prevent embedding the derivation build directory as temp.
     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)
 
+    # Copy to in place build location and run the build.
+    cp -r * $out/pakcs
+    (cd $out/pakcs ; make)
+  '';
+
+  installPhase = ''
     # Install bin.
     mkdir -p $out/bin
-    for b in makecurrycgi .makesavedstate pakcs parsecurry cleancurry \
-             addtypes cass currybrowse currycreatemake currydoc currytest \
-             dataToXml erd2curry ; do
+    for b in $(ls $out/pakcs/bin) ; do
       ln -s $out/pakcs/bin/$b $out/bin/ ;
     done
 
     # Place emacs lisp files in expected locations.
     mkdir -p $out/share/emacs/site-lisp/curry-pakcs
-    for e in "tools/emacs/"*.el ; do
+    for e in "$out/tools/emacs/"*.el ; do
       cp $e $out/share/emacs/site-lisp/curry-pakcs/ ;
     done
 
@@ -119,6 +108,5 @@ stdenv.mkDerivation rec {
     maintainers = [ stdenv.lib.maintainers.kkallio ];
     platforms = stdenv.lib.platforms.linux;
     hydraPlatforms = stdenv.lib.platforms.none;
-    broken = true;
   };
 }