···
1
-
{ stdenv, fetchurl, swiProlog, haskellPackages
2
-
, glibcLocales, makeWrapper, rlwrap, tk, which }:
1
+
{ stdenv, fetchurl, makeWrapper
2
+
, haskellPackages, haskell
3
+
, which, swiProlog, rlwrap, tk
4
+
, curl, git, unzip, gnutar, coreutils, sqlite }:
5
-
fname = "pakcs-1.14.0";
7
+
name = "pakcs-2.0.2";
8
-
url = "https://www.informatik.uni-kiel.de/~pakcs/download/${fname}-src.tar.gz";
9
-
sha256 = "1651ssh4ql79x8asd7kp4yis2n5rhn3lml4s26y03b0cgbfhs78s";
10
+
url = "https://www.informatik.uni-kiel.de/~pakcs/download/${name}-src.tar.gz";
11
+
sha256 = "0fdzw2zz5vs6z20jn6a8jfvpr6dp7fs1rr01cy0xjnzg2mgmn42a";
12
-
swiPrologLocked = stdenv.lib.overrideDerivation swiProlog (oldAttrs: rec {
14
-
name = "swi-prolog-${version}";
16
-
url = "http://www.swi-prolog.org/download/stable/src/pl-${version}.tar.gz";
17
-
sha256 = "0vcrfskm2hyhv30lxr6v261myb815jc3bgmcn1lgsc9g9qkvp04z";
14
+
curry-frontend = (haskellPackages.override {
15
+
overrides = self: super: {
16
+
curry-base = haskell.lib.overrideCabal (super.callPackage ./curry-base.nix {}) (drv: {
18
+
postUnpack = "sourceRoot+=/frontend/curry-base";
20
+
curry-frontend = haskell.lib.overrideCabal (super.callPackage ./curry-frontend.nix {}) (drv: {
22
+
postUnpack = "sourceRoot+=/frontend/curry-frontend";
22
-
stdenv.mkDerivation rec {
26
-
curryBase = haskellPackages.callPackage (
27
-
{ mkDerivation, base, Cabal, containers, directory, either
28
-
, filepath, mtl, pretty, syb, time
31
-
pname = "curry-base";
34
-
libraryHaskellDepends = [
35
-
base containers directory either filepath mtl pretty syb time
37
-
testHaskellDepends = [ base Cabal filepath mtl ];
38
-
homepage = http://curry-language.org;
39
-
description = "Functions for manipulating Curry programs";
40
-
license = "unknown";
26
+
in stdenv.mkDerivation {
43
-
mv ${name} ${name}.orig
44
-
ln -s ${name}.orig/frontend/curry-base ${name}
29
+
buildInputs = [ swiProlog ];
30
+
nativeBuildInputs = [ which makeWrapper ];
50
-
curryFront = haskellPackages.callPackage (
51
-
{ mkDerivation, base, Cabal, containers, directory
52
-
, filepath, mtl, network-uri, process, syb, transformers
55
-
pname = "curry-frontend";
59
-
isExecutable = true;
60
-
libraryHaskellDepends = [
61
-
base containers curryBase directory filepath mtl network-uri
62
-
process syb transformers
64
-
executableHaskellDepends = [
65
-
base containers curryBase directory filepath mtl network-uri
66
-
process syb transformers
68
-
testHaskellDepends = [ base Cabal curryBase filepath ];
69
-
homepage = http://curry-language.org;
70
-
description = "Compile the functional logic language Curry to several intermediate formats";
71
-
license = "unknown";
74
-
mv ${name} ${name}.orig
75
-
ln -s ${name}.orig/frontend/curry-frontend ${name}
83
-
buildInputs = [ swiPrologLocked makeWrapper glibcLocales rlwrap tk which ];
86
-
./adjust-buildsystem.patch
87
-
./case-insensitive.patch
33
+
"CURRYFRONTEND=${curry-frontend}/bin/curry-frontend"
34
+
"DISTPKGINSTALL=yes"
35
+
# Not needed, just to make script pass
93
-
export HOME=$(pwd)/phony-home
41
+
# Since we can't expand $out in `makeFlags`
42
+
#makeFlags="$makeFlags PAKCSINSTALLDIR=$out/pakcs"
96
-
sed -i 's@SWIPROLOG=@SWIPROLOG='${swiPrologLocked}/bin/swipl'@' scripts/pakcsinitrc.sh
44
+
substituteInPlace currytools/cpm/src/CPM/Repository.curry \
45
+
--replace "/bin/rm" "rm"
48
+
# cypm new: EXISTENCE ERROR: source_sink
49
+
# "/tmp/nix-build-pakcs-2.0.2.drv-0/pakcs-2.0.2/currytools/cpm/templates/LICENSE"
100
-
# Some comments in files are in UTF-8, so include the locale needed by GHC runtime.
101
-
export LC_ALL=en_US.UTF-8
103
-
# PAKCS must be build in place due to embedded filesystem references placed by swi.
105
-
# Prepare PAKCSHOME directory.
106
-
mkdir -p $out/pakcs/bin
108
-
# Set up link to cymake, which has been built already.
109
-
ln -s ${curryFront}/bin/cymake $out/pakcs/bin/
112
-
# Prevent embedding the derivation build directory as temp.
115
-
# Copy to in place build location and run the build.
117
-
(cd $out/pakcs ; make)
54
+
(cd $out/pakcs ; make -j$NIX_BUILD_CORES $makeFlags)
123
-
for b in $(ls $out/pakcs/bin) ; do
124
-
ln -s $out/pakcs/bin/$b $out/bin/ ;
58
+
ln -s $out/pakcs/bin $out
127
-
# Place emacs lisp files in expected locations.
128
-
mkdir -p $out/share/emacs/site-lisp/curry-pakcs
129
-
for e in "$out/pakcs/tools/emacs/"*.el ; do
130
-
cp $e $out/share/emacs/site-lisp/curry-pakcs/ ;
60
+
mkdir -p $out/share/emacs/site-lisp
61
+
ln -s $out/pakcs/tools/emacs $out/share/emacs/site-lisp/curry-pakcs
133
-
# Wrap for rlwrap and tk support.
wrapProgram $out/pakcs/bin/pakcs \
--prefix PATH ":" "${rlwrap}/bin" \
136
-
--prefix PATH ":" "${tk}/bin" \
65
+
--prefix PATH ":" "${tk}/bin"
67
+
# List of dependencies from currytools/cpm/src/CPM/Main.curry
68
+
wrapProgram $out/pakcs/bin/cypm \
69
+
--prefix PATH ":" "${stdenv.lib.makeBinPath [ curl git unzip gnutar coreutils sqlite ]}"
meta = with stdenv.lib; {
···
maintainers = with maintainers; [ kkallio gnidorah ];
157
-
platforms = platforms.unix;
90
+
platforms = platforms.linux;