From patchwork Mon Oct 3 02:41:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Patterson X-Patchwork-Id: 16203 Received: (qmail 64032 invoked by uid 89); 3 Oct 2016 02:43:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.5 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=IDE, asd, Hide, 8493 X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: lists.gnu.org Received: from lists.gnu.org (HELO lists.gnu.org) (208.118.235.17) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 03 Oct 2016 02:43:26 +0000 Received: from localhost ([::1]:33504 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bqtDw-0000wx-Ug for patchwork@sourceware.org; Sun, 02 Oct 2016 22:43:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45450) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bqtCY-0008Gx-BG for guix-devel@gnu.org; Sun, 02 Oct 2016 22:42:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bqtCW-0004xQ-DN for guix-devel@gnu.org; Sun, 02 Oct 2016 22:41:58 -0400 Received: from mailservices.uwaterloo.ca ([129.97.128.141]:45393 helo=minos.uwaterloo.ca) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bqtCW-0004wZ-3c for guix-devel@gnu.org; Sun, 02 Oct 2016 22:41:56 -0400 Received: from jalisou.gateway.2wire.net (bas1-jockvale05-3096537756.dsl.bell.ca [184.145.106.156]) (authenticated bits=0) by minos.uwaterloo.ca (8.14.4/8.14.4) with ESMTP id u932fgFp020024 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Sun, 2 Oct 2016 22:41:55 -0400 From: Andy Patterson To: guix-devel@gnu.org Subject: [PATCH v2 12/13] gnu: Add cl-slynk. Date: Sun, 2 Oct 2016 22:41:38 -0400 Message-Id: <20161003024139.19975-13-ajpatter@uwaterloo.ca> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20161003024139.19975-1-ajpatter@uwaterloo.ca> References: <20160927041532.27097-1-ajpatter@uwaterloo.ca> <20161003024139.19975-1-ajpatter@uwaterloo.ca> X-UUID: 71191f95-296b-4100-8302-490e18ccdda9 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 129.97.128.141 X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list 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+patchwork=sourceware.org@gnu.org Sender: "Guix-devel" * gnu/packages/lisp.scm (cl-slynk, sbcl-slynk, ecl-slynk): New variables. --- gnu/packages/lisp.scm | 283 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 283 insertions(+) diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm index 3a59c86..05c3101 100644 --- a/gnu/packages/lisp.scm +++ b/gnu/packages/lisp.scm @@ -849,3 +849,286 @@ productive, customizable lisp based systems.") (inherit base) (outputs '("out")) (arguments '())))) + +(define slynk-change-directory + '(lambda _ + (chdir "slynk") + #t)) + +(define sbcl-slynk-boot0 + (package + (name "sbcl-slynk") + (version "1.0.0-beta") + (source + (origin + (method url-fetch) + (uri (string-append "https://github.com/capitaomorte/sly/archive/" + version ".tar.gz")) + (sha256 + (base32 "0mc3w6afgx97y2bh3pjv29dndidm016adpd11zn86kp7zq6xf8sv")) + (file-name (string-append "slynk-" version ".tar.gz")) + (modules '((guix build utils))) + (snippet + '(begin + ;; Move the contribs into the main source directory for easier + ;; access + (substitute* "slynk/slynk.asd" + (("\\.\\./contrib") + "contrib")) + (substitute* "contrib/slynk-trace-dialog.lisp" + (("\\(slynk::reset-inspector\\)") ; Causes problems on load + "nil")) + (mkdir-p "slynk/contrib") + (copy-recursively "contrib" "slynk/contrib"))))) + (build-system asdf-build-system/sbcl) + (arguments + `(#:tests? #f ; No test suite + #:phases + (modify-phases %standard-phases + (add-before 'copy-source 'change-directory + ,slynk-change-directory) + (delete 'cleanup)))) + (synopsis "Common Lisp IDE for Emacs") + (description "SLY is a fork of SLIME. It also featrues a completely +redesigned REPL based on Emacs's own full-featured comint.el, live code +annotations, and a consistent interactive button interface. Everything can be +copied to the REPL. One can create multiple inspectors with independent +history.") + (home-page "https://github.com/capitaomorte/sly") + (license license:public-domain) + (properties `((cl-source-variant . ,(delay cl-slynk)))))) + +(define-public cl-slynk + (let ((base (sbcl-package->cl-source-package sbcl-slynk-boot0))) + (package + (inherit base) + (arguments + `(#:phases + (modify-phases %standard-phases/source + (add-before 'install 'change-directory + ,slynk-change-directory))))))) + +(define ecl-slynk-boot0 + (sbcl-package->ecl-package sbcl-slynk-boot0)) + +(define sbcl-slynk-arglists + (package + (inherit sbcl-slynk-boot0) + (name "sbcl-slynk-arglists") + (inputs `(("sbcl-slynk" ,sbcl-slynk-boot0))) + (arguments + (substitute-keyword-arguments + `(#:compile-dependencies '("slynk") + #:modules ((ice-9 match) + ,@%asdf-build-modules) + ,@(package-arguments sbcl-slynk-boot0)) + ((#:phases phases) + `(modify-phases %standard-phases + (add-before 'copy-source 'change-directory + (assoc-ref ,phases 'change-directory)) + (add-before 'build 'copy-output + ;; Copy in slynk's output, so it doesn't have to be re-compiled + ;; in each contrib package. + (lambda* (#:key outputs inputs lisp #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (slynk (assoc-ref inputs + (string-append lisp "-slynk")))) + (copy-recursively slynk out) + ;; Hide all asd files providing slynk other than the source + (for-each delete-file + (append (find-files + (string-append out "/lib/") "\\.asd$") + (find-files + (string-append out + "/share/common-lisp/" + lisp "-bundle-systems/")))) + (unsetenv "XDG_DATA_DIRS") + #t))) + (add-after 'copy-output 'delete-bundle + ;; Ensure only one system is provided + (lambda* (#:key outputs lisp #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (match lisp + ("sbcl" + (delete-file + (string-append out "/lib/" lisp "/slynk--system.fasl"))) + ("ecl" + (begin + (delete-file + (string-append out "/lib/" lisp "/slynk.fasb")) + (delete-file + (string-append out "/lib/" lisp "/slynk.a"))))) + #t))))))))) + +(define ecl-slynk-arglists + (sbcl-package->ecl-package sbcl-slynk-arglists)) + +(define sbcl-slynk-util + (package + (inherit sbcl-slynk-arglists) + (name "sbcl-slynk-util"))) + +(define ecl-slynk-util + (sbcl-package->ecl-package sbcl-slynk-util)) + +(define sbcl-slynk-fuzzy + (package + (inherit sbcl-slynk-arglists) + (name "sbcl-slynk-fuzzy") + (inputs `(("sbcl-slynk-util" ,sbcl-slynk-util) + ,@(package-inputs sbcl-slynk-arglists))) + (arguments + (substitute-keyword-arguments (package-arguments sbcl-slynk-arglists) + ((#:compile-dependencies _) + ''("slynk" "slynk-util")))))) + +(define ecl-slynk-fuzzy + (sbcl-package->ecl-package sbcl-slynk-fuzzy)) + +(define sbcl-slynk-c-p-c + (package + (inherit sbcl-slynk-fuzzy) + (name "sbcl-slynk-c-p-c"))) + +(define ecl-slynk-c-p-c + (sbcl-package->ecl-package sbcl-slynk-c-p-c)) + +(define sbcl-slynk-fancy-inspector + (package + (inherit sbcl-slynk-fuzzy) + (name "sbcl-slynk-fancy-inspector"))) + +(define ecl-slynk-fancy-inspector + (sbcl-package->ecl-package sbcl-slynk-fancy-inspector)) + +(define sbcl-slynk-package-fu + (package + (inherit sbcl-slynk-arglists) + (name "sbcl-slynk-package-fu"))) + +(define ecl-slynk-package-fu + (sbcl-package->ecl-package sbcl-slynk-package-fu)) + +(define sbcl-slynk-mrepl + (package + (inherit sbcl-slynk-arglists) + (name "sbcl-slynk-mrepl"))) + +(define ecl-slynk-mrepl + (sbcl-package->ecl-package sbcl-slynk-mrepl)) + +(define sbcl-slynk-trace-dialog + (package + (inherit sbcl-slynk-arglists) + (name "sbcl-slynk-trace-dialog"))) + +(define ecl-slynk-trace-dialog + (sbcl-package->ecl-package sbcl-slynk-trace-dialog)) + +(define sbcl-slynk-profiler + (package + (inherit sbcl-slynk-arglists) + (name "sbcl-slynk-profiler"))) + +(define ecl-slynk-profiler + (sbcl-package->ecl-package sbcl-slynk-profiler)) + +(define sbcl-slynk-stickers + (package + (inherit sbcl-slynk-arglists) + (name "sbcl-slynk-stickers"))) + +(define ecl-slynk-stickers + (sbcl-package->ecl-package sbcl-slynk-stickers)) + +(define sbcl-slynk-indentation + (package + (inherit sbcl-slynk-arglists) + (name "sbcl-slynk-indentation"))) + +(define ecl-slynk-indentation + (sbcl-package->ecl-package sbcl-slynk-indentation)) + +(define sbcl-slynk-retro + (package + (inherit sbcl-slynk-arglists) + (name "sbcl-slynk-retro"))) + +(define ecl-slynk-retro + (sbcl-package->ecl-package sbcl-slynk-retro)) + +(define-public sbcl-slynk + (let ((dependencies + '("slynk-util" + "slynk-arglists" + "slynk-c-p-c" + "slynk-fuzzy" + "slynk-fancy-inspector" + "slynk-package-fu" + "slynk-mrepl" + "slynk-profiler" + "slynk-trace-dialog" + "slynk-stickers" + "slynk-indentation" + "slynk-retro"))) + (package + (inherit sbcl-slynk-boot0) + (name "sbcl-slynk") + (inputs `(("slynk" ,sbcl-slynk-boot0) + ("slynk-util" ,sbcl-slynk-util) + ("slynk-arglists" ,sbcl-slynk-arglists) + ("slynk-c-p-c" ,sbcl-slynk-c-p-c) + ("slynk-fuzzy" ,sbcl-slynk-fuzzy) + ("slynk-fancy-inspector" ,sbcl-slynk-fancy-inspector) + ("slynk-package-fu" ,sbcl-slynk-package-fu) + ("slynk-mrepl" ,sbcl-slynk-mrepl) + ("slynk-profiler" ,sbcl-slynk-profiler) + ("slynk-trace-dialog" ,sbcl-slynk-trace-dialog) + ("slynk-stickers" ,sbcl-slynk-stickers) + ("slynk-indentation" ,sbcl-slynk-indentation) + ("slynk-retro" ,sbcl-slynk-retro))) + (outputs '("out" "image")) + (arguments + (substitute-keyword-arguments + `(#:image-dependencies ',dependencies + ,@(package-arguments sbcl-slynk-boot0)) + ((#:phases _) + `(modify-phases %standard-phases + (add-before 'build 'copy-slynk + (lambda* (#:key outputs inputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (slynk (assoc-ref inputs "slynk"))) + (copy-recursively slynk out)))) + (add-after 'generate-image 'link-contribs + (lambda* (#:key outputs inputs lisp #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (asd-file (string-append out "/lib/" lisp "/slynk.asd")) + (link-file (string-append + out "/share/common-lisp/" lisp + "-bundle-systems/slynk.asd"))) + ;; Patch the asd file for slynk so that it can find + ;; contribs, but doesn't load them. Avoids circular + ;; loading. + (patch-asd-file + asd-file + (map + (lambda (dependency) + `(,dependency + . ,(string-append + (assoc-ref inputs dependency)))) + ',dependencies) + lisp + '()) + (delete-file link-file) + (symlink asd-file link-file)))) + (delete 'copy-source) + (delete 'build) + (delete 'check) + (delete 'link-dependencies) + (delete 'create-symlinks))))) + (properties `((ecl-variant . ,(delay ecl-slynk))))))) + +(define-public ecl-slynk + (package + (inherit (sbcl-package->ecl-package sbcl-slynk)) + (outputs '("out"))))