From 44fa8431be2fc9c4ae374fe5bced7a5c03461056 Mon Sep 17 00:00:00 2001 From: Adam Massmann Date: Fri, 22 Jun 2018 14:29:23 -0400 Subject: gnu: Add stalin. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/scheme.scm (stalin): New variable. Signed-off-by: Ludovic Courtès --- gnu/packages/scheme.scm | 80 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 79 insertions(+), 1 deletion(-) (limited to 'gnu/packages/scheme.scm') diff --git a/gnu/packages/scheme.scm b/gnu/packages/scheme.scm index dba5067e9e..0b15ea8376 100644 --- a/gnu/packages/scheme.scm +++ b/gnu/packages/scheme.scm @@ -9,6 +9,7 @@ ;;; Copyright © 2017 John Darrington ;;; Copyright © 2017 Clément Lassieur ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice +;;; Copyright © 2018 Adam Massmann ;;; ;;; This file is part of GNU Guix. ;;; @@ -356,7 +357,7 @@ (define-public chicken `(#:modules ((guix build gnu-build-system) (guix build utils) (srfi srfi-1)) - + ;; No `configure' script; run "make check" after "make install" as ;; prescribed by README. #:phases @@ -1025,3 +1026,80 @@ (define-public tinyscheme can be added and values can be defined in the Scheme environment. Being quite a small program, it is easy to comprehend, get to grips with, and use.") (license bsd-3))) ; there are no licence headers + +(define-public stalin + (let ((commit "ed1c9e339c352b7a6fee40bb2a47607c3466f0be")) + ;; FIXME: The Stalin "source" contains C code generated by itself: + ;; 'stalin-AMD64.c', etc. + (package + (name "stalin") + (version "0.11") + (source (origin + ;; Use Pearlmutter's upstream branch with AMD64 patches + ;; applied. Saves us from including those 20M! patches + ;; in Guix. For more info, see: + ;; + (method git-fetch) + (uri (git-reference + (url "https://github.com/barak/stalin.git") + (commit commit))) + (file-name (string-append name "-" version "-checkout")) + (sha256 + (base32 + "15a5gxj9v7jqlgkg0543gdflw0rbrir7fj5zgifnb33m074wiyhn")) + (modules '((guix build utils))) + (snippet + ;; remove gc libs from build, we have them as input + '(begin + (delete-file "gc6.8.tar.gz") + (delete-file-recursively "benchmarks") + (substitute* "build" + ((".*gc6.8.*") "") + ((" cd \\.\\.") "") + ((".*B include/libgc.a") "") + ((".*make.*") "")) + #t)))) + (build-system gnu-build-system) + (arguments + `(#:make-flags (list "ARCH_OPTS=-freg-struct-return") + #:phases + (modify-phases %standard-phases + (replace 'configure + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (include-out (string-append out "/include"))) + (invoke "./build") + (for-each (lambda (fname) + (install-file fname include-out)) + (find-files "include")) + (substitute* "makefile" + (("\\./include") include-out)) + (substitute* "post-make" + (("`pwd`") out)) + #t))) + (delete 'check) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (install-file "stalin.1" + (string-append out "/share/man/man1")) + (install-file "stalin" + (string-append out "/bin")) + #t)))))) + (inputs + `(("libx11" ,libx11))) + (propagated-inputs + `(("libgc" ,libgc))) + (supported-systems '("x86_64-linux")) + (home-page "https://engineering.purdue.edu/~qobi/papers/fdlcc.pdf") + (synopsis "Brutally efficient Scheme compiler") + (description + "Stalin is an aggressively optimizing whole-program compiler +for Scheme that does polyvariant interprocedural flow analysis, +flow-directed interprocedural escape analysis, flow-directed +lightweight CPS conversion, flow-directed lightweight closure +conversion, flow-directed interprocedural lifetime analysis, automatic +in-lining, unboxing, and flow-directed program-specific and +program-point-specific low-level representation selection and code +generation.") + (license gpl2+)))) -- cgit v1.2.3 From 24674e6141c089d8b4f1ece8cade44656853185d Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Tue, 26 Jun 2018 16:33:29 +0200 Subject: gnu: hop: Return #t from phases. * gnu/packages/scheme.scm (hop)[arguments]: Substitute INVOKE for SYSTEM*. --- gnu/packages/scheme.scm | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'gnu/packages/scheme.scm') diff --git a/gnu/packages/scheme.scm b/gnu/packages/scheme.scm index 0b15ea8376..ddc4014d7f 100644 --- a/gnu/packages/scheme.scm +++ b/gnu/packages/scheme.scm @@ -314,15 +314,14 @@ (define-public hop (replace 'configure (lambda* (#:key inputs outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) - (zero? - (system* "./configure" - (string-append "--prefix=" out) - (string-append "--blflags=" - ;; user flags completely override useful - ;; default flags, so repeat them here. - "-copt \\$(CPICFLAGS) " - "-L \\$(BUILDLIBDIR) " - "-ldopt -Wl,-rpath," out "/lib"))))))))) + (invoke "./configure" + (string-append "--prefix=" out) + (string-append "--blflags=" + ;; user flags completely override useful + ;; default flags, so repeat them here. + "-copt \\$(CPICFLAGS) " + "-L \\$(BUILDLIBDIR) " + "-ldopt -Wl,-rpath," out "/lib")))))))) (inputs `(("avahi" ,avahi) ("bigloo" ,bigloo) ("libgc" ,libgc) -- cgit v1.2.3 From b69819d8c25ac0e2989b54e998eaa63fa1ce80e0 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Tue, 26 Jun 2018 16:37:17 +0200 Subject: gnu: scmutils: Return #t from all phases. * gnu/packages/scheme.scm (scmutils)[arguments]: Substitute INVOKE for SYSTEM*. Return #t rather than undefined or #f from phases. --- gnu/packages/scheme.scm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'gnu/packages/scheme.scm') diff --git a/gnu/packages/scheme.scm b/gnu/packages/scheme.scm index ddc4014d7f..4d5c835454 100644 --- a/gnu/packages/scheme.scm +++ b/gnu/packages/scheme.scm @@ -660,7 +660,8 @@ (define (system-suffix) "| mit-scheme"))) (with-directory-excursion "scmutils/scmutils" (and (zero? (system "mit-scheme < compile.scm")) - (zero? (system make-img))))))) + (zero? (system make-img)))) + #t))) (add-before 'install 'fix-directory-names ;; Correct directory names in the startup script. (lambda* (#:key inputs outputs #:allow-other-keys) @@ -684,8 +685,8 @@ (define (system-suffix) ;; code. (lambda* (#:key inputs outputs #:allow-other-keys) (with-directory-excursion "scmutils/scmutils" - (zero? (apply system* "etags" - (find-files "." "\\.scm")))))) + (apply invoke "etags" (find-files "." "\\.scm"))) + #t)) (replace 'install ;; Copy files to the store. (lambda* (#:key outputs #:allow-other-keys) -- cgit v1.2.3 From 2e14ca198230878405a00d4351e5424a7b964a22 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Tue, 26 Jun 2018 16:39:45 +0200 Subject: gnu: slib: Return #t from phases. * gnu/packages/scheme.scm (slib)[arguments]: Substitute INVOKE for SYSTEM*. Return #t rather than undefined from phases. --- gnu/packages/scheme.scm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'gnu/packages/scheme.scm') diff --git a/gnu/packages/scheme.scm b/gnu/packages/scheme.scm index 4d5c835454..db39632f0c 100644 --- a/gnu/packages/scheme.scm +++ b/gnu/packages/scheme.scm @@ -882,12 +882,13 @@ (define-public slib (add-after 'install 'remove-bin-share (lambda* (#:key inputs outputs #:allow-other-keys) (delete-file-recursively - (string-append (assoc-ref outputs "out") "/bin")))) + (string-append (assoc-ref outputs "out") "/bin")) + #t)) (replace 'configure (lambda* (#:key inputs outputs #:allow-other-keys) - (zero? (system* "./configure" - (string-append "--prefix=" - (assoc-ref outputs "out"))))))))) + (invoke "./configure" + (string-append "--prefix=" + (assoc-ref outputs "out")))))))) (native-inputs `(("unzip" ,unzip) ("texinfo" ,texinfo))) (home-page "http://people.csail.mit.edu/jaffer/SLIB.html") -- cgit v1.2.3 From b44b14cd85b2962bc3062c6da59a83deacb0de13 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Tue, 26 Jun 2018 17:42:41 +0200 Subject: gnu: scm: Return #t from phases. * gnu/packages/scheme.scm (scm)[arguments]: Substitute INVOKE for SYSTEM*. Return #t rather than undefined from phases. --- gnu/packages/scheme.scm | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) (limited to 'gnu/packages/scheme.scm') diff --git a/gnu/packages/scheme.scm b/gnu/packages/scheme.scm index db39632f0c..4178a45a89 100644 --- a/gnu/packages/scheme.scm +++ b/gnu/packages/scheme.scm @@ -917,39 +917,34 @@ (define-public scm (modify-phases %standard-phases (replace 'configure (lambda* (#:key inputs outputs #:allow-other-keys) - (zero? (system* "./configure" - (string-append "--prefix=" - (assoc-ref outputs "out")))))) + (invoke "./configure" + (string-append "--prefix=" + (assoc-ref outputs "out"))))) (add-before 'build 'pre-build (lambda* (#:key inputs #:allow-other-keys) (substitute* "Makefile" - (("ginstall-info") "install-info")))) + (("ginstall-info") "install-info")) + #t)) (replace 'build (lambda* (#:key inputs outputs #:allow-other-keys) (setenv "SCHEME_LIBRARY_PATH" (string-append (assoc-ref inputs "slib") "/lib/slib/")) - (and - (zero? (system* "make" "scmlit" "CC=gcc")) - (zero? (system* "make" "all"))))) + (invoke "make" "scmlit" "CC=gcc") + (invoke "make" "all"))) (add-after 'install 'post-install (lambda* (#:key inputs outputs #:allow-other-keys) - (let ((req - (string-append (assoc-ref outputs "out") - "/lib/scm/require.scm"))) - (and - (delete-file req) - (format (open req (logior O_WRONLY O_CREAT)) - "(define (library-vicinity) ~s)\n" - (string-append (assoc-ref inputs "slib") - "/lib/slib/")) + (let* ((out (assoc-ref outputs "out")) + (req (string-append out "/lib/scm/require.scm"))) + (delete-file req) + (format (open req (logior O_WRONLY O_CREAT)) + "(define (library-vicinity) ~s)\n" + (string-append (assoc-ref inputs "slib") + "/lib/slib/")) - ;; We must generate the slibcat file - (zero? (system* - (string-append - (assoc-ref outputs "out") - "/bin/scm") - "-br" "new-catalog"))))))))) + ;; We must generate the slibcat file. + (invoke (string-append out "/bin/scm") + "-br" "new-catalog"))))))) (inputs `(("slib" ,slib))) (native-inputs `(("unzip" ,unzip) ("texinfo" ,texinfo))) -- cgit v1.2.3