build: ruby: Add gitify phase.
* guix/build-system/ruby.scm (lower): Add git as implicit input. * guix/build/ruby-build-system.scm (gitify): New procedure. (%standard-phases): Add gitify phase.
This commit is contained in:
parent
927ff2c379
commit
7e7c6a1ac0
|
@ -43,22 +43,24 @@
|
||||||
(define private-keywords
|
(define private-keywords
|
||||||
'(#:source #:target #:ruby #:inputs #:native-inputs))
|
'(#:source #:target #:ruby #:inputs #:native-inputs))
|
||||||
|
|
||||||
(and (not target) ;XXX: no cross-compilation
|
(let ((version-control (resolve-interface '(gnu packages version-control))))
|
||||||
(bag
|
(and (not target) ;XXX: no cross-compilation
|
||||||
(name name)
|
(bag
|
||||||
(system system)
|
(name name)
|
||||||
(host-inputs `(,@(if source
|
(system system)
|
||||||
`(("source" ,source))
|
(host-inputs `(,@(if source
|
||||||
'())
|
`(("source" ,source))
|
||||||
,@inputs
|
'())
|
||||||
|
,@inputs
|
||||||
|
|
||||||
;; Keep the standard inputs of 'gnu-build-system'.
|
;; Keep the standard inputs of 'gnu-build-system'.
|
||||||
,@(standard-packages)))
|
,@(standard-packages)))
|
||||||
(build-inputs `(("ruby" ,ruby)
|
(build-inputs `(("ruby" ,ruby)
|
||||||
,@native-inputs))
|
("git" ,(module-ref version-control 'git))
|
||||||
(outputs outputs)
|
,@native-inputs))
|
||||||
(build ruby-build)
|
(outputs outputs)
|
||||||
(arguments (strip-keyword-arguments private-keywords arguments)))))
|
(build ruby-build)
|
||||||
|
(arguments (strip-keyword-arguments private-keywords arguments))))))
|
||||||
|
|
||||||
(define* (ruby-build store name inputs
|
(define* (ruby-build store name inputs
|
||||||
#:key
|
#:key
|
||||||
|
|
|
@ -39,6 +39,14 @@ directory."
|
||||||
((file-name . _) file-name)
|
((file-name . _) file-name)
|
||||||
(() (error "No files matching pattern: " pattern))))
|
(() (error "No files matching pattern: " pattern))))
|
||||||
|
|
||||||
|
;; Most gemspecs assume that builds are taking place within a git repository
|
||||||
|
;; by include calls to 'git ls-files'. In order for these gemspecs to work
|
||||||
|
;; as-is, every file in the source tree is added to the staging area.
|
||||||
|
(define gitify
|
||||||
|
(lambda _
|
||||||
|
(and (zero? (system* "git" "init"))
|
||||||
|
(zero? (system* "git" "add" ".")))))
|
||||||
|
|
||||||
(define build
|
(define build
|
||||||
(lambda _
|
(lambda _
|
||||||
(zero? (system* "gem" "build" (first-matching-file "\\.gemspec$")))))
|
(zero? (system* "gem" "build" (first-matching-file "\\.gemspec$")))))
|
||||||
|
@ -62,13 +70,16 @@ directory."
|
||||||
(first-matching-file "\\.gem$")))))
|
(first-matching-file "\\.gem$")))))
|
||||||
|
|
||||||
(define %standard-phases
|
(define %standard-phases
|
||||||
(alist-replace
|
(alist-cons-after
|
||||||
'build build
|
'unpack 'gitify gitify
|
||||||
(alist-replace
|
(alist-replace
|
||||||
'install install
|
'build build
|
||||||
(alist-replace
|
(alist-replace
|
||||||
'check check
|
'install install
|
||||||
(alist-delete 'configure gnu:%standard-phases)))))
|
(alist-replace
|
||||||
|
'check check
|
||||||
|
(alist-delete
|
||||||
|
'configure gnu:%standard-phases))))))
|
||||||
|
|
||||||
(define* (ruby-build #:key inputs (phases %standard-phases)
|
(define* (ruby-build #:key inputs (phases %standard-phases)
|
||||||
#:allow-other-keys #:rest args)
|
#:allow-other-keys #:rest args)
|
||||||
|
|
Loading…
Reference in New Issue