From mboxrd@z Thu Jan 1 00:00:00 1970 From: taylanbayirli@gmail.com (Taylan Ulrich =?utf-8?Q?Bay=C4=B1rl=C4=B1?= =?utf-8?Q?=2FKammer?=) Subject: [PATCH] gnu: Add CCL. Date: Mon, 16 Feb 2015 00:59:17 +0100 Message-ID: <87vbj2d8ve.fsf@taylan.uni.cx> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45360) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YN95x-00013g-Qu for guix-devel@gnu.org; Sun, 15 Feb 2015 18:59:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YN95v-00056E-Is for guix-devel@gnu.org; Sun, 15 Feb 2015 18:59:25 -0500 Received: from mail-we0-x232.google.com ([2a00:1450:400c:c03::232]:47874) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YN95v-00055x-7i for guix-devel@gnu.org; Sun, 15 Feb 2015 18:59:23 -0500 Received: by mail-we0-f178.google.com with SMTP id w62so26243030wes.9 for ; Sun, 15 Feb 2015 15:59:21 -0800 (PST) Received: from taylan.uni.cx (p200300514A1A69D90213E8FFFEED36FB.dip0.t-ipconnect.de. [2003:51:4a1a:69d9:213:e8ff:feed:36fb]) by mx.google.com with ESMTPSA id gz3sm971806wib.1.2015.02.15.15.59.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Feb 2015 15:59:20 -0800 (PST) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org --=-=-= Content-Type: text/plain This uses a precompiled lisp heap image, which cannot be generated without already having another version of itself (not even another CL implementation), so it's perfect breeding ground for a Thompson hack. :-) I've been told to wait for Ludovic's input on whether the package is acceptable, due to the heap image issue, so postpone reviewing it if you want. Also, I assume there's no need to regenerate the heap image, unlike the "lisp kernel" which is a C program and therefore needs to be compiled by us to have its rpath and such fixed. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-gnu-Add-CCL.patch Content-Description: patch >From bf6f00133ab1b18ecd07d6f217376fb1ca1b3bd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?= Date: Mon, 16 Feb 2015 00:46:12 +0100 Subject: [PATCH] gnu: Add CCL. * gnu/packages/lisp.scm (ccl): New variable. --- gnu/packages/lisp.scm | 108 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 107 insertions(+), 1 deletion(-) diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm index fe9cdab..de6a170 100644 --- a/gnu/packages/lisp.scm +++ b/gnu/packages/lisp.scm @@ -36,7 +36,10 @@ #:use-module (gnu packages readline) #:use-module (gnu packages libsigsegv) #:use-module (gnu packages admin) - #:use-module (gnu packages ed)) + #:use-module (gnu packages ed) + #:use-module (gnu packages m4) + #:use-module (gnu packages version-control) + #:use-module (ice-9 match)) (define-public gcl (package @@ -278,3 +281,106 @@ statistical profiler, a code coverage tool, and many other extensions.") ;; loop macro has its own license. See COPYING file for further notes. (license (list license:public-domain license:bsd-2 (license:x11-style "file://src/code/loop.lisp"))))) + +(define-public ccl + (package + (name "ccl") + (version "1.10") + (source #f) + (build-system gnu-build-system) + ;; CCL consists of a "lisp kernel" and "heap image", both of which are + ;; shipped in precompiled form in source tarballs. The former is a C + ;; program which we can rebuild from scratch, but the latter cannot be + ;; generated without an already working copy of CCL, and is platform + ;; dependent, so we need to fetch the correct tarball for the platform. + (inputs + `(("ccl" + ,(origin + (method url-fetch) + (uri (string-append + "ftp://ftp.clozure.com/pub/release/1.10/ccl-" version "-" + (match (%current-system) + ((or "i686-linux" "x86_64-linux") "linuxx86") + ("armhf-linux" "linuxarm")) + ".tar.gz")) + (sha256 + (base32 + (match (%current-system) + ((or "i686-linux" "x86_64-linux") + "0mr653q5px05lr11z2mk551m5g47b4wq96vbfibpp0qlc9jp58lc") + ("armhf" + "1py02irpmi2qz5rq3h33wfv6impf15z8i2rign6hvhlqn7s99wwh")))))))) + (native-inputs + `(("m4" ,m4) + ("subversion" ,subversion))) + (arguments + `(#:tests? #f ;no 'check' target + #:phases + (alist-replace + 'unpack + (lambda* (#:key inputs #:allow-other-keys) + (and (zero? (system* "tar" "xzvf" (assoc-ref inputs "ccl"))) + (begin (chdir "ccl") #t))) + (alist-delete + 'configure + (alist-cons-before + 'build 'pre-build + ;; Enter the source directory for the current platform's lisp + ;; kernel, and run 'make clean' to remove the precompiled one. + (lambda _ + (chdir (string-append + "lisp-kernel/" + ,(match (or (%current-target-system) (%current-system)) + ("i686-linux" "linuxx8632") + ("x86_64-linux" "linuxx8664") + ("armhf-linux" "linuxarm")))) + (substitute* '("Makefile") + (("/bin/rm") "rm")) + (setenv "CC" "gcc") + (zero? (system* "make" "clean"))) + ;; XXX Do we need to recompile the heap image as well for Guix? + ;; For now just use the one we already got in the tarball. + (alist-replace + 'install + (lambda* (#:key outputs inputs #:allow-other-keys) + ;; The lisp kernel built by running 'make' in lisp-kernel/$system + ;; is put back into the original directory, so go back. The heap + ;; image is there as well. + (chdir "../..") + (let* ((out (assoc-ref outputs "out")) + (libdir (string-append out "/lib/")) + (bindir (string-append out "/bin/")) + (wrapper (string-append bindir "ccl")) + (bash (assoc-ref inputs "bash")) + (kernel + ,(match (or (%current-target-system) (%current-system)) + ("i686-linux" "lx86cl") + ("x86_64-linux" "lx86cl64") + ("armhf-linux" "armcl"))) + (heap (string-append kernel ".image"))) + (mkdir-p libdir) + (mkdir-p bindir) + (copy-file kernel (string-append libdir kernel)) + (copy-file heap (string-append libdir heap)) + (with-output-to-file wrapper + (lambda () + (display + (string-append + "#!" bash "/bin/sh\n" + "if [ -z \"$CCL_DEFAULT_DIRECTORY\" ]; then\n" + " CCL_DEFAULT_DIRECTORY=" libdir "\n" + "fi\n" + "export CCL_DEFAULT_DIRECTORY\n" + "exec " libdir kernel "\n")))) + (chmod wrapper #o755))) + %standard-phases)))))) + (home-page "http://ccl.clozure.com/") + (synopsis "Common Lisp implementation") + (description "Clozure CL (often called CCL for short) is a Common Lisp +implementation featuring fast compilation speed, native threads, a precise, +generational, compacting garbage collector, and a convenient foreign-function +interface.") + ;; See file doc/LICENSE for clarifications it makes regarding how the LGPL + ;; applies to Lisp code according to them. + (license (list license:lgpl2.1 + license:clarified-artistic)))) ;TRIVIAL-LDAP package -- 2.2.1 --=-=-=--