nixpkgs/pkgs/development/compilers/pakcs/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

96 lines
3.0 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, makeWrapper
2018-07-22 18:07:29 +03:00
, haskellPackages, haskell
, which, swiProlog, rlwrap, tk
, curl, git, unzip, gnutar, coreutils, sqlite }:
2016-10-04 22:49:07 +03:00
let
2020-10-27 14:02:44 +03:00
pname = "pakcs";
2023-12-26 16:36:14 +03:00
version = "3.6.0";
2016-10-04 22:49:07 +03:00
2020-10-27 14:02:44 +03:00
# Don't switch to "Current release" without a reason, because its
# source updates without version bump. Prefer last from "Older releases" instead.
2018-07-22 18:07:29 +03:00
src = fetchurl {
2020-10-27 14:02:44 +03:00
url = "https://www.informatik.uni-kiel.de/~pakcs/download/pakcs-${version}-src.tar.gz";
2023-12-26 16:36:14 +03:00
hash = "sha256-1r6jEY3eEGESKcAepiziVbxpIvQLtCS6l0trBU3SGGo=";
2016-10-04 22:49:07 +03:00
};
2018-07-22 18:07:29 +03:00
curry-frontend = (haskellPackages.override {
overrides = self: super: {
curry-frontend = haskell.lib.compose.overrideCabal (drv: {
2018-07-22 18:07:29 +03:00
inherit src;
2023-12-26 16:36:14 +03:00
postUnpack = "sourceRoot+=/frontend";
}) (super.callPackage ./curry-frontend.nix { });
2016-10-05 21:20:58 +03:00
};
2018-07-22 18:07:29 +03:00
}).curry-frontend;
2023-12-26 16:36:14 +03:00
2018-07-22 18:07:29 +03:00
in stdenv.mkDerivation {
2020-10-27 14:02:44 +03:00
inherit pname version src;
2018-07-22 18:07:29 +03:00
buildInputs = [ swiProlog ];
nativeBuildInputs = [ which makeWrapper ];
makeFlags = [
"CURRYFRONTEND=${curry-frontend}/bin/curry-frontend"
"DISTPKGINSTALL=yes"
# Not needed, just to make script pass
"CURRYTOOLSDIR=0"
"CURRYLIBSDIR=0"
2016-10-10 21:50:05 +03:00
];
2016-10-04 22:49:07 +03:00
2018-07-22 18:07:29 +03:00
preConfigure = ''
2023-12-26 16:36:14 +03:00
for file in examples/test.sh \
currytools/optimize/Makefile \
testsuite/test.sh \
scripts/cleancurry.sh \
scripts/compile-all-libs.sh; do
substituteInPlace $file --replace "/bin/rm" "rm"
done
'' ;
2016-10-04 22:49:07 +03:00
2023-12-26 16:36:14 +03:00
preBuild = ''
2018-07-22 18:07:29 +03:00
mkdir -p $out/pakcs
2016-10-04 22:49:07 +03:00
cp -r * $out/pakcs
2023-12-26 16:36:14 +03:00
cd $out/pakcs
2016-10-04 22:49:07 +03:00
'';
installPhase = ''
2023-12-26 16:36:14 +03:00
runHook preInstall
2018-07-22 18:07:29 +03:00
ln -s $out/pakcs/bin $out
2016-10-04 22:49:07 +03:00
2018-07-22 18:07:29 +03:00
mkdir -p $out/share/emacs/site-lisp
ln -s $out/pakcs/tools/emacs $out/share/emacs/site-lisp/curry-pakcs
2016-10-04 22:49:07 +03:00
wrapProgram $out/pakcs/bin/pakcs \
--prefix PATH ":" "${rlwrap}/bin" \
2018-07-22 18:07:29 +03:00
--prefix PATH ":" "${tk}/bin"
# List of dependencies from currytools/cpm/src/CPM/Main.curry
wrapProgram $out/pakcs/bin/cypm \
--prefix PATH ":" "${lib.makeBinPath [ curl git unzip gnutar coreutils sqlite ]}"
2023-12-26 16:36:14 +03:00
runHook postInstall
2016-10-04 22:49:07 +03:00
'';
meta = with lib; {
homepage = "http://www.informatik.uni-kiel.de/~pakcs/";
2016-10-04 22:49:07 +03:00
description = "Implementation of the multi-paradigm declarative language Curry";
2016-10-15 05:24:42 +03:00
license = licenses.bsd3;
2016-10-04 22:49:07 +03: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).
'';
2023-12-26 16:36:14 +03:00
maintainers = with maintainers; [ t4ccer ];
2018-07-22 18:07:29 +03:00
platforms = platforms.linux;
2016-10-04 22:49:07 +03:00
};
}