summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinglu Chen <public@yoctocell.xyz>2021-03-07 10:35:17 +0100
committerDavid Thompson <dthompson@vistahigherlearning.com>2021-03-18 10:32:37 -0400
commit1f4c1ccee8cd9e54290b35b023ea8422762eec16 (patch)
tree091d30a909eb0a4adce41849354f1ab7274d0379
parentce779700810ae4f664d04753c70de3a81b6d8b89 (diff)
package.scm: Fix package definition.
Copy wrapper phase from the package definition in Guix proper. * package.scm (%source-dir): New variable.
-rw-r--r--package.scm29
1 files 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)