about summary refs log tree commit diff
path: root/pkgs/development/compilers/clean
diff options
context:
space:
mode:
authorKarn Kallio <tierpluspluslists@gmail.com>2010-12-25 15:13:07 +0000
committerKarn Kallio <tierpluspluslists@gmail.com>2010-12-25 15:13:07 +0000
commit801ce7d5fb724f52e73c0654a312a58f2e92f4ca (patch)
tree98cf07b4692bc0010485ff9890a25a3606769674 /pkgs/development/compilers/clean
parent51d6c8df916ae9fe482655af84562faa0dcd72c6 (diff)
downloadnixlib-801ce7d5fb724f52e73c0654a312a58f2e92f4ca.tar
nixlib-801ce7d5fb724f52e73c0654a312a58f2e92f4ca.tar.gz
nixlib-801ce7d5fb724f52e73c0654a312a58f2e92f4ca.tar.bz2
nixlib-801ce7d5fb724f52e73c0654a312a58f2e92f4ca.tar.lz
nixlib-801ce7d5fb724f52e73c0654a312a58f2e92f4ca.tar.xz
nixlib-801ce7d5fb724f52e73c0654a312a58f2e92f4ca.tar.zst
nixlib-801ce7d5fb724f52e73c0654a312a58f2e92f4ca.zip
Add Concurrent Clean to NixPkgs.
svn path=/nixpkgs/trunk/; revision=25276
Diffstat (limited to 'pkgs/development/compilers/clean')
-rw-r--r--pkgs/development/compilers/clean/chroot-build-support-do-not-rebuild-equal-timestamps.patch17
-rw-r--r--pkgs/development/compilers/clean/default.nix50
2 files changed, 67 insertions, 0 deletions
diff --git a/pkgs/development/compilers/clean/chroot-build-support-do-not-rebuild-equal-timestamps.patch b/pkgs/development/compilers/clean/chroot-build-support-do-not-rebuild-equal-timestamps.patch
new file mode 100644
index 000000000000..3e0fbe6b996d
--- /dev/null
+++ b/pkgs/development/compilers/clean/chroot-build-support-do-not-rebuild-equal-timestamps.patch
@@ -0,0 +1,17 @@
+The clean command line compiler clm checks modules for freshness by comparing timestamps.
+However, in chroot builds all files installed have the same timestamp.  This leads to clm
+trying to rebuild the library modules distributed with the Clean install every time a user
+compiles any file.  This patch changes the freshness check to use less than instead of less
+than or equal to in order to avoid this.
+
+--- clean-upstream/src/tools/clm/clm.c	2010-12-10 06:12:17.000000000 -0430
++++ clean/src/tools/clm/clm.c	2010-12-25 10:29:09.840675925 -0430
+@@ -250,7 +250,7 @@
+ 		|| (t1.dwHighDateTime==t2.dwHighDateTime && (unsigned)(t1.dwLowDateTime)<=(unsigned)(t2.dwLowDateTime)))
+ #else
+ 	typedef unsigned long FileTime;
+-#	define FILE_TIME_LE(t1,t2) (t1<=t2)
++#	define FILE_TIME_LE(t1,t2) (t1<t2)
+ #endif
+ 
+ typedef struct project_node {
diff --git a/pkgs/development/compilers/clean/default.nix b/pkgs/development/compilers/clean/default.nix
new file mode 100644
index 000000000000..fa61f8bfc75a
--- /dev/null
+++ b/pkgs/development/compilers/clean/default.nix
@@ -0,0 +1,50 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "clean-2.3";
+
+  src =
+    if stdenv.system == "i686-linux" then (fetchurl {
+      url = "http://clean.cs.ru.nl/download/Clean23/linux/clean2.3_boot.tar.gz";
+      sha256 = "0rrjpqdbqwbx7n8v35wi3wpm6lpv9zd1n5q50byb2h0ljqw31j9h";
+    })
+    else if stdenv.system == "x86_64-linux" then (fetchurl {
+        url = "http://clean.cs.ru.nl/download/Clean23/linux/clean2.3_64_boot.tar.gz";
+        sha256 = "0bvkaiwcaa1p6h1bl4bgnia1yd0j8nq6sb1yiwar74y2m1wwmjqj";
+    })
+    else throw "Architecture not supported";
+
+  # clm uses timestamps of dcl, icl, abc and o files to decide what must be rebuild
+  # and for chroot builds all of the library files will have equal timestamps.  This
+  # makes clm try to rebuild the library modules (and fail due to absence of write permission
+  # on the Nix store) every time any file is compiled.
+  patches = [ ./chroot-build-support-do-not-rebuild-equal-timestamps.patch ];
+
+  preBuild = ''
+    substituteInPlace Makefile --replace 'INSTALL_DIR = $(CURRENTDIR)' 'INSTALL_DIR = '$out
+
+    substituteInPlace src/tools/clm/clm.c --replace '/usr/bin/gcc' $(type -p gcc)
+    substituteInPlace src/tools/clm/clm.c --replace '/usr/bin/as' $(type -p as)
+
+    cd src
+  '';
+
+  postBuild = ''
+    cd ..
+  '';
+
+  meta = {
+    description = "Clean is a general purpose, state-of-the-art, pure and lazy functional programming language.";
+    longDescription = ''
+      Clean is a general purpose, state-of-the-art, pure and lazy functional
+      programming language designed for making real-world applications. Some
+      of its most notable language features are uniqueness typing, dynamic typing,
+      and generic functions.
+    '';
+
+    homepage = http://wiki.clean.cs.ru.nl/Clean;
+    license = stdenv.lib.licenses.lgpl21;
+    maintainers = [ stdenv.lib.maintainers.kkallio ];
+    platforms = [ "i686-linux" "x86_64-linux" ];
+  };
+}