commit
a7bfe3c5f5
@ -1,21 +0,0 @@
|
|||||||
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
|
|
||||||
if tty -s ; then
|
|
||||||
- RLWRAP=`which rlwrap`
|
|
||||||
+ RLWRAP=`type -P rlwrap`
|
|
||||||
if [ -x "$RLWRAP" ] ; then
|
|
||||||
USERLWRAP=yes
|
|
||||||
fi
|
|
||||||
@@ -29,7 +29,7 @@
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ $USERLWRAP = yes ] ; then
|
|
||||||
- exec rlwrap -c -f "$PAKCSHOME/tools/rlwrap" "$REPL" ${1+"$@"}
|
|
||||||
+ exec rlwrap -a -c -f "$PAKCSHOME/tools/rlwrap" "$REPL" ${1+"$@"}
|
|
||||||
else
|
|
||||||
exec "$REPL" ${1+"$@"}
|
|
||||||
fi
|
|
@ -1,19 +0,0 @@
|
|||||||
--- www/Makefile.orig 2016-10-10 21:04:36.000000000 +0300
|
|
||||||
+++ pakcs-1.14.0/www/Makefile 2016-10-10 21:07:56.000000000 +0300
|
|
||||||
@@ -6,7 +6,7 @@ all: submitform Registry
|
|
||||||
submitform: SubmitForm.curry $(LIBDIR)/HtmlCgi.curry \
|
|
||||||
$(LIBDIR)/NamedSocket.curry $(LIBDIR)/CPNS.curry
|
|
||||||
$(REPL) $(REPL_OPTS) :load SubmitForm :save :q
|
|
||||||
- mv SubmitForm submitform
|
|
||||||
+ mv SubmitForm submitform.orig && mv submitform.orig submitform
|
|
||||||
|
|
||||||
Registry: Registry.curry $(LIBDIR)/HtmlCgi.curry
|
|
||||||
$(REPL) $(REPL_OPTS) :load Registry :save :q
|
|
||||||
--- currytools/erd2curry/Makefile.orig 2016-10-10 21:13:49.000000000 +0300
|
|
||||||
+++ pakcs-1.14.0/currytools/erd2curry/Makefile 2016-10-10 21:21:14.000000000 +0300
|
|
||||||
@@ -32,4 +32,4 @@ uninstall: clean
|
|
||||||
erd2curry: $(DEPS)
|
|
||||||
# create saved state for top-level function "main":
|
|
||||||
$(REPL) $(REPL_OPTS) :load ERD2Curry :save "main \"$(CURDIR)\"" :q
|
|
||||||
- mv ERD2Curry $@
|
|
||||||
+ mv ERD2Curry $@.orig && mv $@.orig $@
|
|
16
pkgs/development/compilers/pakcs/curry-base.nix
Normal file
16
pkgs/development/compilers/pakcs/curry-base.nix
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{ mkDerivation, base, Cabal, containers, directory, extra, filepath
|
||||||
|
, mtl, parsec, pretty, stdenv, time, transformers
|
||||||
|
}:
|
||||||
|
mkDerivation {
|
||||||
|
pname = "curry-base";
|
||||||
|
version = "1.0.0";
|
||||||
|
src = ./.;
|
||||||
|
libraryHaskellDepends = [
|
||||||
|
base containers directory extra filepath mtl parsec pretty time
|
||||||
|
transformers
|
||||||
|
];
|
||||||
|
testHaskellDepends = [ base Cabal filepath mtl ];
|
||||||
|
homepage = "http://curry-language.org";
|
||||||
|
description = "Functions for manipulating Curry programs";
|
||||||
|
license = stdenv.lib.licenses.bsd3;
|
||||||
|
}
|
24
pkgs/development/compilers/pakcs/curry-frontend.nix
Normal file
24
pkgs/development/compilers/pakcs/curry-frontend.nix
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
{ mkDerivation, base, Cabal, containers, curry-base, directory
|
||||||
|
, extra, filepath, mtl, network-uri, pretty, process, set-extra
|
||||||
|
, stdenv, transformers
|
||||||
|
}:
|
||||||
|
mkDerivation {
|
||||||
|
pname = "curry-frontend";
|
||||||
|
version = "1.0.2";
|
||||||
|
src = ./.;
|
||||||
|
isLibrary = true;
|
||||||
|
isExecutable = true;
|
||||||
|
enableSeparateDataOutput = true;
|
||||||
|
libraryHaskellDepends = [
|
||||||
|
base containers curry-base directory extra filepath mtl network-uri
|
||||||
|
pretty process set-extra transformers
|
||||||
|
];
|
||||||
|
executableHaskellDepends = [
|
||||||
|
base containers curry-base directory extra filepath mtl network-uri
|
||||||
|
pretty process set-extra transformers
|
||||||
|
];
|
||||||
|
testHaskellDepends = [ base Cabal curry-base filepath ];
|
||||||
|
homepage = "http://curry-language.org";
|
||||||
|
description = "Compile the functional logic language Curry to several intermediate formats";
|
||||||
|
license = stdenv.lib.licenses.bsd3;
|
||||||
|
}
|
@ -1,139 +1,72 @@
|
|||||||
{ stdenv, fetchurl, swiProlog, haskellPackages
|
{ stdenv, fetchurl, makeWrapper
|
||||||
, glibcLocales, makeWrapper, rlwrap, tk, which }:
|
, haskellPackages, haskell
|
||||||
|
, which, swiProlog, rlwrap, tk
|
||||||
|
, curl, git, unzip, gnutar, coreutils, sqlite }:
|
||||||
|
|
||||||
let
|
let
|
||||||
fname = "pakcs-1.14.0";
|
name = "pakcs-2.0.2";
|
||||||
|
|
||||||
fsrc = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://www.informatik.uni-kiel.de/~pakcs/download/${fname}-src.tar.gz";
|
url = "https://www.informatik.uni-kiel.de/~pakcs/download/${name}-src.tar.gz";
|
||||||
sha256 = "1651ssh4ql79x8asd7kp4yis2n5rhn3lml4s26y03b0cgbfhs78s";
|
sha256 = "0fdzw2zz5vs6z20jn6a8jfvpr6dp7fs1rr01cy0xjnzg2mgmn42a";
|
||||||
};
|
};
|
||||||
|
|
||||||
swiPrologLocked = stdenv.lib.overrideDerivation swiProlog (oldAttrs: rec {
|
curry-frontend = (haskellPackages.override {
|
||||||
version = "6.6.6";
|
overrides = self: super: {
|
||||||
name = "swi-prolog-${version}";
|
curry-base = haskell.lib.overrideCabal (super.callPackage ./curry-base.nix {}) (drv: {
|
||||||
src = fetchurl {
|
inherit src;
|
||||||
url = "http://www.swi-prolog.org/download/stable/src/pl-${version}.tar.gz";
|
postUnpack = "sourceRoot+=/frontend/curry-base";
|
||||||
sha256 = "0vcrfskm2hyhv30lxr6v261myb815jc3bgmcn1lgsc9g9qkvp04z";
|
});
|
||||||
|
curry-frontend = haskell.lib.overrideCabal (super.callPackage ./curry-frontend.nix {}) (drv: {
|
||||||
|
inherit src;
|
||||||
|
postUnpack = "sourceRoot+=/frontend/curry-frontend";
|
||||||
|
});
|
||||||
};
|
};
|
||||||
});
|
}).curry-frontend;
|
||||||
|
in stdenv.mkDerivation {
|
||||||
|
inherit name src;
|
||||||
|
|
||||||
in
|
buildInputs = [ swiProlog ];
|
||||||
stdenv.mkDerivation rec {
|
nativeBuildInputs = [ which makeWrapper ];
|
||||||
|
|
||||||
name = fname;
|
makeFlags = [
|
||||||
|
"CURRYFRONTEND=${curry-frontend}/bin/curry-frontend"
|
||||||
curryBase = haskellPackages.callPackage (
|
"DISTPKGINSTALL=yes"
|
||||||
{ mkDerivation, base, Cabal, containers, directory, either
|
# Not needed, just to make script pass
|
||||||
, filepath, mtl, pretty, syb, time
|
"CURRYTOOLSDIR=0"
|
||||||
}:
|
"CURRYLIBSDIR=0"
|
||||||
mkDerivation {
|
|
||||||
pname = "curry-base";
|
|
||||||
version = "0.4.1";
|
|
||||||
src = fsrc;
|
|
||||||
libraryHaskellDepends = [
|
|
||||||
base containers directory either filepath mtl pretty syb time
|
|
||||||
];
|
|
||||||
testHaskellDepends = [ base Cabal filepath mtl ];
|
|
||||||
homepage = http://curry-language.org;
|
|
||||||
description = "Functions for manipulating Curry programs";
|
|
||||||
license = "unknown";
|
|
||||||
|
|
||||||
postUnpack = ''
|
|
||||||
mv ${name} ${name}.orig
|
|
||||||
ln -s ${name}.orig/frontend/curry-base ${name}
|
|
||||||
'';
|
|
||||||
doCheck = false;
|
|
||||||
}
|
|
||||||
) {};
|
|
||||||
|
|
||||||
curryFront = haskellPackages.callPackage (
|
|
||||||
{ mkDerivation, base, Cabal, containers, directory
|
|
||||||
, filepath, mtl, network-uri, process, syb, transformers
|
|
||||||
}:
|
|
||||||
mkDerivation {
|
|
||||||
pname = "curry-frontend";
|
|
||||||
version = "0.4.1";
|
|
||||||
src = fsrc;
|
|
||||||
isLibrary = true;
|
|
||||||
isExecutable = true;
|
|
||||||
libraryHaskellDepends = [
|
|
||||||
base containers curryBase directory filepath mtl network-uri
|
|
||||||
process syb transformers
|
|
||||||
];
|
|
||||||
executableHaskellDepends = [
|
|
||||||
base containers curryBase directory filepath mtl network-uri
|
|
||||||
process syb transformers
|
|
||||||
];
|
|
||||||
testHaskellDepends = [ base Cabal curryBase filepath ];
|
|
||||||
homepage = http://curry-language.org;
|
|
||||||
description = "Compile the functional logic language Curry to several intermediate formats";
|
|
||||||
license = "unknown";
|
|
||||||
|
|
||||||
postUnpack = ''
|
|
||||||
mv ${name} ${name}.orig
|
|
||||||
ln -s ${name}.orig/frontend/curry-frontend ${name}
|
|
||||||
'';
|
|
||||||
doCheck = false;
|
|
||||||
}
|
|
||||||
) {};
|
|
||||||
|
|
||||||
src = fsrc;
|
|
||||||
|
|
||||||
buildInputs = [ swiPrologLocked makeWrapper glibcLocales rlwrap tk which ];
|
|
||||||
|
|
||||||
patches = [
|
|
||||||
./adjust-buildsystem.patch
|
|
||||||
./case-insensitive.patch
|
|
||||||
];
|
];
|
||||||
|
|
||||||
configurePhase = ''
|
preConfigure = ''
|
||||||
# Phony HOME.
|
# Since we can't expand $out in `makeFlags`
|
||||||
mkdir phony-home
|
#makeFlags="$makeFlags PAKCSINSTALLDIR=$out/pakcs"
|
||||||
export HOME=$(pwd)/phony-home
|
|
||||||
|
|
||||||
# SWI Prolog
|
substituteInPlace currytools/cpm/src/CPM/Repository.curry \
|
||||||
sed -i 's@SWIPROLOG=@SWIPROLOG='${swiPrologLocked}/bin/swipl'@' scripts/pakcsinitrc.sh
|
--replace "/bin/rm" "rm"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
# 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
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
# Some comments in files are in UTF-8, so include the locale needed by GHC runtime.
|
mkdir -p $out/pakcs
|
||||||
export LC_ALL=en_US.UTF-8
|
|
||||||
|
|
||||||
# PAKCS must be build in place due to embedded filesystem references placed by swi.
|
|
||||||
|
|
||||||
# Prepare PAKCSHOME directory.
|
|
||||||
mkdir -p $out/pakcs/bin
|
|
||||||
|
|
||||||
# Set up link to cymake, which has been built already.
|
|
||||||
ln -s ${curryFront}/bin/cymake $out/pakcs/bin/
|
|
||||||
rm -r frontend
|
|
||||||
|
|
||||||
# Prevent embedding the derivation build directory as temp.
|
|
||||||
export TEMP=/tmp
|
|
||||||
|
|
||||||
# Copy to in place build location and run the build.
|
|
||||||
cp -r * $out/pakcs
|
cp -r * $out/pakcs
|
||||||
(cd $out/pakcs ; make)
|
(cd $out/pakcs ; make -j$NIX_BUILD_CORES $makeFlags)
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
# Install bin.
|
ln -s $out/pakcs/bin $out
|
||||||
mkdir -p $out/bin
|
|
||||||
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
|
||||||
mkdir -p $out/share/emacs/site-lisp/curry-pakcs
|
ln -s $out/pakcs/tools/emacs $out/share/emacs/site-lisp/curry-pakcs
|
||||||
for e in "$out/pakcs/tools/emacs/"*.el ; do
|
|
||||||
cp $e $out/share/emacs/site-lisp/curry-pakcs/ ;
|
|
||||||
done
|
|
||||||
|
|
||||||
# Wrap for rlwrap and tk support.
|
|
||||||
wrapProgram $out/pakcs/bin/pakcs \
|
wrapProgram $out/pakcs/bin/pakcs \
|
||||||
--prefix PATH ":" "${rlwrap}/bin" \
|
--prefix PATH ":" "${rlwrap}/bin" \
|
||||||
--prefix PATH ":" "${tk}/bin" \
|
--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 ]}"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
@ -154,6 +87,6 @@ stdenv.mkDerivation rec {
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
maintainers = with maintainers; [ kkallio gnidorah ];
|
maintainers = with maintainers; [ kkallio gnidorah ];
|
||||||
platforms = platforms.unix;
|
platforms = platforms.linux;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user