diff options
Diffstat (limited to 'guix/build')
-rw-r--r-- | guix/build/ruby-build-system.scm | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/guix/build/ruby-build-system.scm b/guix/build/ruby-build-system.scm index 40aa974dee..1310c4a0b3 100644 --- a/guix/build/ruby-build-system.scm +++ b/guix/build/ruby-build-system.scm @@ -39,6 +39,14 @@ directory." ((file-name . _) file-name) (() (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 (lambda _ (zero? (system* "gem" "build" (first-matching-file "\\.gemspec$"))))) @@ -53,17 +61,19 @@ directory." (match:substring (string-match "ruby-(.*)$" (assoc-ref inputs "ruby")) 1)) - (gem-home (string-append (assoc-ref outputs "out") - "/lib/ruby/gems/" - ruby-version))) + (out (assoc-ref outputs "out")) + (gem-home (string-append out "/lib/ruby/gems/" ruby-version))) (setenv "GEM_HOME" gem-home) (mkdir-p gem-home) (zero? (system* "gem" "install" "--local" - (first-matching-file "\\.gem$"))))) + (first-matching-file "\\.gem$") + ;; Executables should go into /bin, not /lib/ruby/gems. + "--bindir" (string-append out "/bin"))))) (define %standard-phases (modify-phases gnu:%standard-phases (delete configure) + (add-after unpack gitify gitify) (replace build build) (replace install install) (replace check check))) |