diff options
author | Ludovic Courtès <ludo@gnu.org> | 2023-05-28 23:11:03 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2023-05-31 23:25:26 +0200 |
commit | e6f82fcd5f8d8340f7f4f5ac5e476db8caaaeef1 (patch) | |
tree | 39098b85cb6b271154757d942672285994a15d43 /guix/import | |
parent | d46d1bee1ea93d8fba97d7f8cadd142c493dc3bf (diff) |
import: gem: Factorize "bundler" special case for name mapping.
* guix/import/gem.scm (ruby-package-name): Add "bundler" special case.
(gem->guix-package): Adjust accordingly.
* tests/gem.scm ("gem-recursive-import")
("gem-recursive-import with a specific version"): Remove "ruby-bundler"
from the expected packages.
Diffstat (limited to 'guix/import')
-rw-r--r-- | guix/import/gem.scm | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/guix/import/gem.scm b/guix/import/gem.scm index 4e2be0f5f8..87a75bdaa6 100644 --- a/guix/import/gem.scm +++ b/guix/import/gem.scm @@ -93,9 +93,11 @@ (define (ruby-package-name name) "Given the NAME of a package on RubyGems, return a Guix-compliant name for the package." - (if (string-prefix? "ruby-" name) - (snake-case name) - (string-append "ruby-" (snake-case name)))) + (if (string=? name "bundler") + name ;special case: no prefix + (if (string-prefix? "ruby-" name) + (snake-case name) + (string-append "ruby-" (snake-case name))))) (define (make-gem-sexp name version hash home-page synopsis description dependencies licenses) @@ -135,11 +137,7 @@ Optionally include a VERSION string to fetch a specific version gem." (let* ((dependencies-names (map gem-dependency-name (gem-dependencies-runtime (gem-dependencies gem)))) - (dependencies (map (lambda (dep) - (if (string=? dep "bundler") - "bundler" ; special case, no prefix - (ruby-package-name dep))) - dependencies-names)) + (dependencies (map ruby-package-name dependencies-names)) (licenses (map string->license (gem-licenses gem)))) (values (make-gem-sexp (gem-name gem) (gem-version gem) (gem-sha256 gem) (gem-home-page gem) |