From 1f4c1ccee8cd9e54290b35b023ea8422762eec16 Mon Sep 17 00:00:00 2001 From: Xinglu Chen Date: Sun, 7 Mar 2021 10:35:17 +0100 Subject: package.scm: Fix package definition. Copy wrapper phase from the package definition in Guix proper. * package.scm (%source-dir): New variable. --- package.scm | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/package.scm b/package.scm index 2cb202f..c76a5db 100644 --- a/package.scm +++ b/package.scm @@ -23,15 +23,40 @@ (use-modules (guix packages) (guix licenses) (guix build-system gnu) + (guix build utils) (gnu)) (use-package-modules autotools pkg-config guile gnupg xdisorg) +(define %source-dir + (dirname (current-filename))) + (package (name "shroud") - (version "0.1") - (source #f) + (version "git") + (source %source-dir) (build-system gnu-build-system) + (arguments + `(#:modules ((guix build gnu-build-system) + (guix build utils) + (ice-9 popen) + (ice-9 rdelim)) + #:phases + (modify-phases %standard-phases + (add-after 'install 'wrap-shroud + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (guile (assoc-ref inputs "guile")) + (effective (read-line + (open-pipe* OPEN_READ + (string-append guile "/bin/guile") + "-c" "(display (effective-version))"))) + (ccachedir (string-append out + "/lib/guile/" effective "/site-ccache")) + (prog (string-append out "/bin/shroud"))) + (wrap-program prog + `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,ccachedir))) + #t)))))) (native-inputs `(("pkg-config" ,pkg-config) ("autoconf" ,autoconf) -- cgit v1.2.3