1{ stdenv, fetchurl }:
2
3stdenv.mkDerivation rec {
4 name = "clean-2.4";
5
6 src =
7 if stdenv.system == "i686-linux" then (fetchurl {
8 url = "http://clean.cs.ru.nl/download/Clean24/linux/clean2.4_boot.tar.gz";
9 sha256 = "1w8vvmkwzq8g51639r62apcy75sj69nm08082a34xvqm9ymfgkq5";
10 })
11 else if stdenv.system == "x86_64-linux" then (fetchurl {
12 url = "http://clean.cs.ru.nl/download/Clean24/linux/clean2.4_64_boot.tar.gz";
13 sha256 = "08gsa1pjl5wyzh4ah8ccfx8a7mdcn6ycsn1lzkrr9adygv1gmm7r";
14 })
15 else throw "Architecture not supported";
16
17 # clm uses timestamps of dcl, icl, abc and o files to decide what must be rebuild
18 # and for chroot builds all of the library files will have equal timestamps. This
19 # makes clm try to rebuild the library modules (and fail due to absence of write permission
20 # on the Nix store) every time any file is compiled.
21 patches = [ ./chroot-build-support-do-not-rebuild-equal-timestamps.patch ];
22
23 preBuild = ''
24 substituteInPlace Makefile --replace 'INSTALL_DIR = $(CURRENTDIR)' 'INSTALL_DIR = '$out
25
26 substituteInPlace src/tools/clm/clm.c --replace '/usr/bin/gcc' $(type -p gcc)
27 substituteInPlace src/tools/clm/clm.c --replace '/usr/bin/as' $(type -p as)
28
29 cd src
30 '';
31
32 postBuild = ''
33 cd ..
34 '';
35
36 meta = {
37 description = "General purpose, state-of-the-art, pure and lazy functional programming language";
38 longDescription = ''
39 Clean is a general purpose, state-of-the-art, pure and lazy functional
40 programming language designed for making real-world applications. Some
41 of its most notable language features are uniqueness typing, dynamic typing,
42 and generic functions.
43 '';
44
45 homepage = http://wiki.clean.cs.ru.nl/Clean;
46 license = stdenv.lib.licenses.lgpl21;
47 maintainers = [ stdenv.lib.maintainers.kkallio ];
48 platforms = [ "i686-linux" "x86_64-linux" ];
49 };
50}