From b9a372066669b863a872efd0a48940f16a0a3698 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sun, 3 Jan 2021 21:18:58 +0100 Subject: gnu: guile-cairo: Compile Scheme sources. * gnu/packages/gtk.scm (guile-cairo)[arguments]: Add phase "install-go-files". --- gnu/packages/gtk.scm | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) (limited to 'gnu/packages/gtk.scm') diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm index f15ce07b51..5e090eb5ed 100644 --- a/gnu/packages/gtk.scm +++ b/gnu/packages/gtk.scm @@ -8,7 +8,7 @@ ;;; Copyright © 2015 Sou Bunnbu ;;; Copyright © 2015 Andy Wingo ;;; Copyright © 2015 David Hashe -;;; Coypright © 2015, 2016, 2017, 2018, 2020 Ricardo Wurmus +;;; Coypright © 2015, 2016, 2017, 2018, 2020, 2021 Ricardo Wurmus ;;; Copyright © 2016, 2017, 2020 Efraim Flashner ;;; Copyright © 2016 Fabian Harfert ;;; Copyright © 2016 Kei Kebreau @@ -951,8 +951,35 @@ application suites.") (arguments ;; Uses of 'scm_t_uint8' & co. are deprecated; don't stop the build ;; because of them. - '(#:configure-flags '("--disable-Werror") - #:make-flags '("GUILE_AUTO_COMPILE=0"))) ; to prevent guild warnings + `(#:configure-flags '("--disable-Werror") + #:make-flags '("GUILE_AUTO_COMPILE=0") ; to prevent guild warnings + #:modules ((guix build gnu-build-system) + (guix build utils) + (ice-9 rdelim) + (ice-9 popen)) + #:phases + (modify-phases %standard-phases + (add-after 'install 'install-go-files + (lambda* (#:key outputs inputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (effective (read-line + (open-pipe* OPEN_READ + "guile" "-c" + "(display (effective-version))"))) + (module-dir (string-append out "/share/guile/site/" + effective)) + (object-dir (string-append out "/lib/guile/" effective + "/site-ccache")) + (prefix (string-length module-dir))) + ;; compile to the destination + (for-each (lambda (file) + (let* ((base (string-drop (string-drop-right file 4) + prefix)) + (go (string-append object-dir base ".go"))) + (invoke "guild" "compile" "-L" module-dir + file "-o" go))) + (find-files module-dir "\\.scm$")) + #t)))))) (inputs `(("guile-lib" ,guile-lib) ("expat" ,expat) -- cgit v1.2.3 From 8caf7939220c464a8982f9bfa44430860067e8aa Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sun, 3 Jan 2021 21:19:46 +0100 Subject: gnu: guile-rsvg: Compile Scheme files. * gnu/packages/gtk.scm (guile-rsvg)[arguments]: Add phase "install-go-files". --- gnu/packages/gtk.scm | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) (limited to 'gnu/packages/gtk.scm') diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm index 5e090eb5ed..89efcd61c4 100644 --- a/gnu/packages/gtk.scm +++ b/gnu/packages/gtk.scm @@ -1040,10 +1040,36 @@ exceptions, macros, and a dynamic programming environment.") (file-name (string-append name "-" version ".tar.gz")))) (build-system gnu-build-system) (arguments - `(#:phases (modify-phases %standard-phases - (replace 'bootstrap - (lambda _ - (invoke "autoreconf" "-vfi")))))) + `(#:modules ((guix build gnu-build-system) + (guix build utils) + (ice-9 rdelim) + (ice-9 popen)) + #:phases + (modify-phases %standard-phases + (replace 'bootstrap + (lambda _ + (invoke "autoreconf" "-vfi"))) + (add-after 'install 'install-go-files + (lambda* (#:key outputs inputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (effective (read-line + (open-pipe* OPEN_READ + "guile" "-c" + "(display (effective-version))"))) + (module-dir (string-append out "/share/guile/site/" + effective)) + (object-dir (string-append out "/lib/guile/" effective + "/site-ccache")) + (prefix (string-length module-dir))) + ;; compile to the destination + (for-each (lambda (file) + (let* ((base (string-drop (string-drop-right file 4) + prefix)) + (go (string-append object-dir base ".go"))) + (invoke "guild" "compile" "-L" module-dir + file "-o" go))) + (find-files module-dir "\\.scm$")) + #t)))))) (native-inputs `(("pkg-config" ,pkg-config) ("autoconf" ,autoconf) ("automake" ,automake) -- cgit v1.2.3