mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-25 05:48:07 -05:00
build: ruby: Rewrite build system to use gem archives.
Co-Authored-By: Pjotr Prins <pjotr.public01@thebird.nl> * guix/build-system/ruby.scm (lower): Remove git dependency. (rubygems-uri): New procedure. * guix/build/ruby-build-system (gitify): Delete. (unpack): Use 'gem unpack' utility. (check): Add docstring. (build): Repack modified gem. (install): Rebuild unpacked gem and install it. (%standard-phases): Remove gitify and build phases. * gnu/packages/ruby.scm (ruby-hoe, ruby-rake-compiler, ruby-i18n, ruby-rspec-support, ruby-rspec-core, ruby-diff-lcs-for-rspec, ruby-rspec-expectations, ruby-rspec-mocks, ruby-rspec, bundler, ruby-useragent, ruby-bacon, ruby-arel, ruby-connection-pool, ruby-net-http-persistent, ruby-minitest, ruby-minitest-sprint, ruby-minitest-bacon, ruby-daemons, ruby-git, ruby-slop, ruby-multipart-post): Convert to new build system. * doc/guix.texi (ruby-build-system): Document the gem archive requirement.
This commit is contained in:
parent
4ab9f96a5c
commit
e83c6d009f
4 changed files with 145 additions and 196 deletions
|
@ -2469,6 +2469,13 @@ This variable is exported by @code{(guix build-system ruby)}. It
|
||||||
implements the RubyGems build procedure used by Ruby packages, which
|
implements the RubyGems build procedure used by Ruby packages, which
|
||||||
involves running @code{gem build} followed by @code{gem install}.
|
involves running @code{gem build} followed by @code{gem install}.
|
||||||
|
|
||||||
|
The @code{source} field of a package that uses this build system is
|
||||||
|
expected to reference a gem archive instead of a traditional tarball,
|
||||||
|
since this is the format that all Ruby developers use when releasing
|
||||||
|
their software. The build system unpacks the gem archive, potentially
|
||||||
|
patches the source, runs the test suite, repackages the gem, and
|
||||||
|
installs it.
|
||||||
|
|
||||||
Which Ruby package is used can be specified with the @code{#:ruby}
|
Which Ruby package is used can be specified with the @code{#:ruby}
|
||||||
parameter. A list of additional flags to be passed to the @command{gem}
|
parameter. A list of additional flags to be passed to the @command{gem}
|
||||||
command can be specified with the @code{#:gem-flags} parameter.
|
command can be specified with the @code{#:gem-flags} parameter.
|
||||||
|
|
|
@ -154,13 +154,11 @@ (define-public ruby-hoe
|
||||||
(name "ruby-hoe")
|
(name "ruby-hoe")
|
||||||
(version "3.13.1")
|
(version "3.13.1")
|
||||||
(source (origin
|
(source (origin
|
||||||
(method git-fetch)
|
(method url-fetch)
|
||||||
(uri (git-reference
|
(uri (rubygems-uri "hoe" version))
|
||||||
(url "https://github.com/seattlerb/hoe.git")
|
|
||||||
(commit "0c11836"))) ; no release tags :(
|
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"0i8dimf8kxcjgqj9x65bbi3l6hc9p9gbfbb1vmrz42764a4jjbz9"))) )
|
"1mac13krdrasn9819dd65xj27kklfy0xdbj3p6s2ij4vlcb46h8q"))) )
|
||||||
(build-system ruby-build-system)
|
(build-system ruby-build-system)
|
||||||
(synopsis "Ruby project management helper")
|
(synopsis "Ruby project management helper")
|
||||||
(description
|
(description
|
||||||
|
@ -178,22 +176,13 @@ (define-public ruby-rake-compiler
|
||||||
(version "0.9.5")
|
(version "0.9.5")
|
||||||
(source (origin
|
(source (origin
|
||||||
(method url-fetch)
|
(method url-fetch)
|
||||||
(uri (string-append
|
(uri (rubygems-uri "rake-compiler" version))
|
||||||
"https://github.com/rake-compiler/rake-compiler/archive/v"
|
|
||||||
version ".tar.gz"))
|
|
||||||
(file-name (string-append name "-" version ".tar.gz"))
|
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"07lk1vl0jqcaqwjjhmg0qshqwcxdyr5kscc9xxm13m03835xgpf3"))))
|
"1k8im2vzj849xdgjk6wafspkiwwapqwm738majchb4dnhnsk64cx"))))
|
||||||
(build-system ruby-build-system)
|
(build-system ruby-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
'(#:tests? #f ; needs cucumber
|
'(#:tests? #f)) ; needs cucumber
|
||||||
#:phases (modify-phases %standard-phases
|
|
||||||
(add-before 'build 'remove-cucumber-rake-task
|
|
||||||
(lambda _
|
|
||||||
;; Remove cucumber test file because the
|
|
||||||
;; dependencies are not available right now.
|
|
||||||
(delete-file "tasks/cucumber.rake"))))))
|
|
||||||
(synopsis "Building and packaging helper for Ruby native extensions")
|
(synopsis "Building and packaging helper for Ruby native extensions")
|
||||||
(description "Rake-compiler provides a framework for building and
|
(description "Rake-compiler provides a framework for building and
|
||||||
packaging native C and Java extensions in Ruby.")
|
packaging native C and Java extensions in Ruby.")
|
||||||
|
@ -206,12 +195,10 @@ (define-public ruby-i18n
|
||||||
(version "0.6.11")
|
(version "0.6.11")
|
||||||
(source (origin
|
(source (origin
|
||||||
(method url-fetch)
|
(method url-fetch)
|
||||||
(uri (string-append "https://github.com/svenfuchs/i18n/archive/v"
|
(uri (rubygems-uri "i18n" version))
|
||||||
version ".tar.gz"))
|
|
||||||
(file-name (string-append name "-" version ".tar.gz"))
|
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"1fdhnhh1p5g8vibv44d770z8nq208zrms3m2nswdvr54072y1m6k"))))
|
"0fwjlgmgry2blf8zlxn9c555cf4a16p287l599kz5104ncjxlzdk"))))
|
||||||
(build-system ruby-build-system)
|
(build-system ruby-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
'(#:tests? #f)) ; requires bundler
|
'(#:tests? #f)) ; requires bundler
|
||||||
|
@ -234,13 +221,10 @@ (define ruby-rspec-support
|
||||||
(version "3.2.2")
|
(version "3.2.2")
|
||||||
(source (origin
|
(source (origin
|
||||||
(method url-fetch)
|
(method url-fetch)
|
||||||
(uri (string-append
|
(uri (rubygems-uri "rspec-support" version))
|
||||||
"https://github.com/rspec/rspec-support/archive/v"
|
|
||||||
version ".tar.gz"))
|
|
||||||
(file-name (string-append name "-" version ".tar.gz"))
|
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"1pvzfrqgy0z0gwmdgjp9f2vz1d9c0cajyzfqj9z8i2ssxnzmj4bv"))))
|
"194zry5195ls2hni7r9824vqb5d3qfg4jb15fgj8glfy0rvw3zxl"))))
|
||||||
(build-system ruby-build-system)
|
(build-system ruby-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
'(#:tests? #f)) ; avoid dependency cycles
|
'(#:tests? #f)) ; avoid dependency cycles
|
||||||
|
@ -255,13 +239,10 @@ (define-public ruby-rspec-core
|
||||||
(version "3.2.3")
|
(version "3.2.3")
|
||||||
(source (origin
|
(source (origin
|
||||||
(method url-fetch)
|
(method url-fetch)
|
||||||
(uri (string-append
|
(uri (rubygems-uri "rspec-core" version))
|
||||||
"https://github.com/rspec/rspec-core/archive/v"
|
|
||||||
version ".tar.gz"))
|
|
||||||
(file-name (string-append name "-" version ".tar.gz"))
|
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"1clsa4lkh5c9c7xc3xa336ym00ycr67pchpg1bv4y3fz5hvzw8ki"))))
|
"0k2471iw30gc2cvv67damrx666pmsvx8l0ahk3hm20dhfnmcmpvv"))))
|
||||||
(build-system ruby-build-system)
|
(build-system ruby-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
'(#:tests? #f)) ; avoid dependency cycles
|
'(#:tests? #f)) ; avoid dependency cycles
|
||||||
|
@ -279,13 +260,10 @@ (define ruby-diff-lcs-for-rspec
|
||||||
(version "1.2.5")
|
(version "1.2.5")
|
||||||
(source (origin
|
(source (origin
|
||||||
(method url-fetch)
|
(method url-fetch)
|
||||||
(uri (string-append
|
(uri (rubygems-uri "diff-lcs" version))
|
||||||
"https://github.com/halostatue/diff-lcs/archive/v"
|
|
||||||
version ".tar.gz"))
|
|
||||||
(file-name (string-append name "-" version ".tar.gz"))
|
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"0kmfz2qdwbfjf97rx27hh9fm39mv3z9avjmvsajqnb5wxj2l5l4s"))))
|
"1vf9civd41bnqi6brr5d9jifdw73j9khc6fkhfl1f8r9cpkdvlx1"))))
|
||||||
(build-system ruby-build-system)
|
(build-system ruby-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
'(#:tests? #f)) ; avoid dependency cycles
|
'(#:tests? #f)) ; avoid dependency cycles
|
||||||
|
@ -303,13 +281,10 @@ (define-public ruby-rspec-expectations
|
||||||
(version "3.2.1")
|
(version "3.2.1")
|
||||||
(source (origin
|
(source (origin
|
||||||
(method url-fetch)
|
(method url-fetch)
|
||||||
(uri (string-append
|
(uri (rubygems-uri "rspec-expectations" version))
|
||||||
"https://github.com/rspec/rspec-expectations/archive/v"
|
|
||||||
version ".tar.gz"))
|
|
||||||
(file-name (string-append name "-" version ".tar.gz"))
|
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"0h0rpprbh6h59gmksiyi1b8w6cvcai4wdbkikajwx3w1asxi6f7x"))))
|
"01kmchabgpdcaqdsqg8r0g5gy385xhp1k1jsds3w264ypin17n14"))))
|
||||||
(build-system ruby-build-system)
|
(build-system ruby-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
'(#:tests? #f)) ; avoid dependency cycles
|
'(#:tests? #f)) ; avoid dependency cycles
|
||||||
|
@ -328,13 +303,10 @@ (define-public ruby-rspec-mocks
|
||||||
(version "3.2.1")
|
(version "3.2.1")
|
||||||
(source (origin
|
(source (origin
|
||||||
(method url-fetch)
|
(method url-fetch)
|
||||||
(uri (string-append
|
(uri (rubygems-uri "rspec-mocks" version))
|
||||||
"https://github.com/rspec/rspec-mocks/archive/v"
|
|
||||||
version ".tar.gz"))
|
|
||||||
(file-name (string-append name "-" version ".tar.gz"))
|
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"1xzxsg0idxkg7czmjgqq10lcd821ibw1hjzn404sk9j6rw0fbx2g"))))
|
"09yig1lwgxl8fsns71z3xhv7wkg7zvagydh37pvaqpw92dz55jv2"))))
|
||||||
(build-system ruby-build-system)
|
(build-system ruby-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
'(#:tests? #f)) ; avoid dependency cycles
|
'(#:tests? #f)) ; avoid dependency cycles
|
||||||
|
@ -353,13 +325,10 @@ (define-public ruby-rspec
|
||||||
(version "3.2.0")
|
(version "3.2.0")
|
||||||
(source (origin
|
(source (origin
|
||||||
(method url-fetch)
|
(method url-fetch)
|
||||||
(uri (string-append
|
(uri (rubygems-uri "rspec" version))
|
||||||
"https://github.com/rspec/rspec/archive/v"
|
|
||||||
version ".tar.gz"))
|
|
||||||
(file-name (string-append name "-" version ".tar.gz"))
|
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"1jg38dbaknsdhiav5vnrwfccg524fwcg6sq1715441vx1xl6p54q"))))
|
"0lkz01j4yxcwb3g5w6r1l9khnyw3sxib4rrh4npd2pxh390fcc4f"))))
|
||||||
(build-system ruby-build-system)
|
(build-system ruby-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
'(#:tests? #f)) ; avoid dependency cycles
|
'(#:tests? #f)) ; avoid dependency cycles
|
||||||
|
@ -382,12 +351,10 @@ (define-public bundler
|
||||||
(version "1.9.9")
|
(version "1.9.9")
|
||||||
(source (origin
|
(source (origin
|
||||||
(method url-fetch)
|
(method url-fetch)
|
||||||
(uri (string-append "https://github.com/bundler/bundler/archive/v"
|
(uri (rubygems-uri "bundler" version))
|
||||||
version ".tar.gz"))
|
|
||||||
(file-name (string-append name "-" version ".tar.gz"))
|
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"08flx3n9hb3yz8mm5k16cdz0sb7g774f6vxn6gc3wfh5la83vfyx"))))
|
"12qk1569pswa9mmid6lsqy2napn9fmkbmv0k7xkl52nyfh8rsy4d"))))
|
||||||
(build-system ruby-build-system)
|
(build-system ruby-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
'(#:tests? #f)) ; avoid dependency cycles
|
'(#:tests? #f)) ; avoid dependency cycles
|
||||||
|
@ -403,19 +370,13 @@ (define-public ruby-useragent
|
||||||
(version "0.13.3")
|
(version "0.13.3")
|
||||||
(source (origin
|
(source (origin
|
||||||
(method url-fetch)
|
(method url-fetch)
|
||||||
(uri (string-append
|
(uri (rubygems-uri "useragent" version))
|
||||||
"https://github.com/gshutler/useragent/archive/v"
|
|
||||||
version ".tar.gz"))
|
|
||||||
(file-name (string-append name "-" version ".tar.gz"))
|
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"1hj00fw06i0y3rwxxhxmnrqxhpnffv4zfqx2sqqpc5qc4fdvd2x9"))))
|
"0kz7yyz7528bv4a2kfymvkcm8whqcddhmgaw1ksw1d90n30hhkpc"))))
|
||||||
(build-system ruby-build-system)
|
(build-system ruby-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
'(#:test-target "spec"))
|
'(#:tests? #f)) ; no test suite
|
||||||
(native-inputs
|
|
||||||
`(("ruby-rspec" ,ruby-rspec)
|
|
||||||
("bundler" ,bundler)))
|
|
||||||
(synopsis "HTTP user agent parser for Ruby")
|
(synopsis "HTTP user agent parser for Ruby")
|
||||||
(description "UserAgent is a Ruby library that parses and compares HTTP
|
(description "UserAgent is a Ruby library that parses and compares HTTP
|
||||||
User Agents.")
|
User Agents.")
|
||||||
|
@ -425,26 +386,14 @@ (define-public ruby-useragent
|
||||||
(define-public ruby-bacon
|
(define-public ruby-bacon
|
||||||
(package
|
(package
|
||||||
(name "ruby-bacon")
|
(name "ruby-bacon")
|
||||||
(version "1.2")
|
(version "1.2.0")
|
||||||
(source (origin
|
(source (origin
|
||||||
(method url-fetch)
|
(method url-fetch)
|
||||||
(uri (string-append
|
(uri (rubygems-uri "bacon" version))
|
||||||
"https://github.com/chneukirchen/bacon/archive/"
|
|
||||||
version ".tar.gz"))
|
|
||||||
(file-name (string-append name "-" version ".tar.gz"))
|
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"0g03fxilrrx17dijww68n1lq5d8s69hrxgpga8c1i2k35bzcw5jc"))))
|
"1f06gdj77bmwzc1k5iragl1595hbn67yc7sqvs56ca8plrr2vmai"))))
|
||||||
(build-system ruby-build-system)
|
(build-system ruby-build-system)
|
||||||
(arguments
|
|
||||||
`(#:phases (modify-phases %standard-phases
|
|
||||||
(add-before 'build 'generate-docs
|
|
||||||
(lambda _
|
|
||||||
;; This rake task also tries to generate a ChangeLog
|
|
||||||
;; file from the Git log, which we don't have. It fails
|
|
||||||
;; but creates an empty file, allowing the rest of the
|
|
||||||
;; build to succeed.
|
|
||||||
(zero? (system* "rake" "predist")))))))
|
|
||||||
(synopsis "Small RSpec clone")
|
(synopsis "Small RSpec clone")
|
||||||
(description "Bacon is a small RSpec clone providing all essential
|
(description "Bacon is a small RSpec clone providing all essential
|
||||||
features.")
|
features.")
|
||||||
|
@ -457,16 +406,13 @@ (define-public ruby-arel
|
||||||
(version "6.0.0")
|
(version "6.0.0")
|
||||||
(source (origin
|
(source (origin
|
||||||
(method url-fetch)
|
(method url-fetch)
|
||||||
(uri (string-append
|
(uri (rubygems-uri "arel" version))
|
||||||
"https://github.com/rails/arel/archive/v"
|
|
||||||
version ".tar.gz"))
|
|
||||||
(file-name (string-append name "-" version ".tar.gz"))
|
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"0fldwp2hmrmddx22xf7hdmybngzv97qnv5rvz3qw61m94ddd6w4n"))))
|
"18wnfnzr2i5p3fygsddjbi1cimws6823nbk8drxidmnj8jz7h0ar"))))
|
||||||
(build-system ruby-build-system)
|
(build-system ruby-build-system)
|
||||||
(native-inputs
|
(arguments
|
||||||
`(("bundler" ,bundler)))
|
'(#:tests? #f)) ; no test suite
|
||||||
(synopsis "SQL AST manager for Ruby")
|
(synopsis "SQL AST manager for Ruby")
|
||||||
(description "Arel is a SQL AST manager for Ruby. It simplifies the
|
(description "Arel is a SQL AST manager for Ruby. It simplifies the
|
||||||
generation of complex SQL queries and adapts to various relational database
|
generation of complex SQL queries and adapts to various relational database
|
||||||
|
@ -480,13 +426,10 @@ (define-public ruby-connection-pool
|
||||||
(version "2.2.0")
|
(version "2.2.0")
|
||||||
(source (origin
|
(source (origin
|
||||||
(method url-fetch)
|
(method url-fetch)
|
||||||
(uri (string-append
|
(uri (rubygems-uri "connection_pool" version))
|
||||||
"https://github.com/mperham/connection_pool/archive/v"
|
|
||||||
version ".tar.gz"))
|
|
||||||
(file-name (string-append name "-" version ".tar.gz"))
|
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"02s5rwhmgy8qqns7a5y1daa0yaw38x6lzpwyvmy46h1yrj9mc6zf"))))
|
"1b2bb3k39ni5mzcnqlv9y4yjkbin20s7dkwzp0jw2jf1rmzcgrmy"))))
|
||||||
(build-system ruby-build-system)
|
(build-system ruby-build-system)
|
||||||
(native-inputs
|
(native-inputs
|
||||||
`(("bundler" ,bundler)))
|
`(("bundler" ,bundler)))
|
||||||
|
@ -502,13 +445,10 @@ (define-public ruby-net-http-persistent
|
||||||
(version "2.9.4")
|
(version "2.9.4")
|
||||||
(source (origin
|
(source (origin
|
||||||
(method url-fetch)
|
(method url-fetch)
|
||||||
(uri (string-append
|
(uri (rubygems-uri "net-http-persistent" version))
|
||||||
"https://github.com/drbrain/net-http-persistent/archive/v"
|
|
||||||
version ".tar.gz"))
|
|
||||||
(file-name (string-append name "-" version ".tar.gz"))
|
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"1q18vji31w8gfr6ajziqkqs8n5lzkw0bl00dm2a8s05zhavzw9j9"))))
|
"1y9fhaax0d9kkslyiqi1zys6cvpaqx9a0y0cywp24rpygwh4s9r4"))))
|
||||||
(build-system ruby-build-system)
|
(build-system ruby-build-system)
|
||||||
(native-inputs
|
(native-inputs
|
||||||
`(("ruby-connection-pool" ,ruby-connection-pool)
|
`(("ruby-connection-pool" ,ruby-connection-pool)
|
||||||
|
@ -524,16 +464,11 @@ (define-public ruby-minitest
|
||||||
(name "ruby-minitest")
|
(name "ruby-minitest")
|
||||||
(version "5.7.0")
|
(version "5.7.0")
|
||||||
(source (origin
|
(source (origin
|
||||||
(method git-fetch)
|
(method url-fetch)
|
||||||
;; No release tarballs nor git tags. This is the commit
|
(uri (rubygems-uri "minitest" version))
|
||||||
;; corresponding to the addition of the release notes to
|
|
||||||
;; History.rdoc.
|
|
||||||
(uri (git-reference
|
|
||||||
(url "https://github.com/seattlerb/minitest.git")
|
|
||||||
(commit "e975248")))
|
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"09xjiahk7q8hid1i39ahrmghaslpj9n36zna72i3ah7kf1bh2l01"))))
|
"0rxqfakp629mp3vwda7zpgb57lcns5znkskikbfd0kriwv8i1vq8"))))
|
||||||
(build-system ruby-build-system)
|
(build-system ruby-build-system)
|
||||||
(native-inputs
|
(native-inputs
|
||||||
`(("ruby-hoe" ,ruby-hoe)))
|
`(("ruby-hoe" ,ruby-hoe)))
|
||||||
|
@ -548,14 +483,11 @@ (define-public ruby-minitest-sprint
|
||||||
(name "ruby-minitest-sprint")
|
(name "ruby-minitest-sprint")
|
||||||
(version "1.1.0")
|
(version "1.1.0")
|
||||||
(source (origin
|
(source (origin
|
||||||
(method git-fetch)
|
(method url-fetch)
|
||||||
;; Same story as ruby-minitest.
|
(uri (rubygems-uri "minitest-sprint" version))
|
||||||
(uri (git-reference
|
|
||||||
(url "https://github.com/seattlerb/minitest-sprint.git")
|
|
||||||
(commit "49c02bc")))
|
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"0rbmxz94lqg5vjz60p8v2bzq8adwvmx501amvk0l124sfwmw94ms"))))
|
"179d6pj56l9xzm46fqsqj10mzjkr1f9fv4cxa8wvchs97hqz33w1"))))
|
||||||
(build-system ruby-build-system)
|
(build-system ruby-build-system)
|
||||||
(native-inputs
|
(native-inputs
|
||||||
`(("ruby-hoe" ,ruby-hoe)
|
`(("ruby-hoe" ,ruby-hoe)
|
||||||
|
@ -571,14 +503,11 @@ (define-public ruby-minitest-bacon
|
||||||
(name "ruby-minitest-bacon")
|
(name "ruby-minitest-bacon")
|
||||||
(version "1.0.2")
|
(version "1.0.2")
|
||||||
(source (origin
|
(source (origin
|
||||||
(method git-fetch)
|
(method url-fetch)
|
||||||
;; Same story as ruby-minitest.
|
(uri (rubygems-uri "minitest-bacon" version))
|
||||||
(uri (git-reference
|
|
||||||
(url "https://github.com/seattlerb/minitest-bacon.git")
|
|
||||||
(commit "38551d5")))
|
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"19r9fm41i0mm1xncqls8frbj1i9nr3sq1cx2mh878r6kdl02d70h"))))
|
"0cm7r68422743i3b6fm4rrm0r6cnnjmglq5gcmmgl1f0rk5hnf6r"))))
|
||||||
(build-system ruby-build-system)
|
(build-system ruby-build-system)
|
||||||
(native-inputs
|
(native-inputs
|
||||||
`(("ruby-hoe" ,ruby-hoe)))
|
`(("ruby-hoe" ,ruby-hoe)))
|
||||||
|
@ -596,13 +525,10 @@ (define-public ruby-daemons
|
||||||
(version "1.2.2")
|
(version "1.2.2")
|
||||||
(source (origin
|
(source (origin
|
||||||
(method url-fetch)
|
(method url-fetch)
|
||||||
(uri (string-append
|
(uri (rubygems-uri "daemons" version))
|
||||||
"https://github.com/thuehlinger/daemons/archive/v"
|
|
||||||
version ".tar.gz"))
|
|
||||||
(file-name (string-append name "-" version ".tar.gz"))
|
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"1v5bpdvpvhk240pc7fkn44vfclppl44pp6wd42ipi5sd5lkk7zfd"))))
|
"121c7vkimg3baxga69xvdkwxiq8wkmxqvdbyqi5i82vhih5d3cn3"))))
|
||||||
(build-system ruby-build-system)
|
(build-system ruby-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
`(#:tests? #f)) ; no test suite
|
`(#:tests? #f)) ; no test suite
|
||||||
|
@ -618,41 +544,27 @@ (define-public ruby-git
|
||||||
(version "1.2.9.1")
|
(version "1.2.9.1")
|
||||||
(source (origin
|
(source (origin
|
||||||
(method url-fetch)
|
(method url-fetch)
|
||||||
(uri (string-append
|
(uri (rubygems-uri "git" version))
|
||||||
"https://github.com/schacon/ruby-git/archive/v"
|
|
||||||
version ".tar.gz"))
|
|
||||||
(file-name (string-append name "-" version ".tar.gz"))
|
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"08zg20zc7f7yy34ix2qdd8jbiz7xhjc8alk370869sq3h75hs9jc"))))
|
"1sqfj8lmhl7c5zamcckkpik4izfph2zkv6krw0i8mzj5pdws5acs"))))
|
||||||
(build-system ruby-build-system)
|
(build-system ruby-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
'(#:phases (modify-phases %standard-phases
|
`(#:tests? #f ; no tests
|
||||||
(add-before 'build 'patch-git-binary
|
#:phases (modify-phases %standard-phases
|
||||||
(lambda* (#:key inputs #:allow-other-keys)
|
(add-after 'install 'patch-git-binary
|
||||||
|
(lambda* (#:key inputs outputs #:allow-other-keys)
|
||||||
;; Make the default git binary an absolute path to the
|
;; Make the default git binary an absolute path to the
|
||||||
;; store.
|
;; store.
|
||||||
(let ((git (string-append (assoc-ref inputs "git")
|
(let ((git (string-append (assoc-ref inputs "git")
|
||||||
"/bin/git")))
|
"/bin/git"))
|
||||||
(substitute* '("lib/git/config.rb")
|
(config (string-append (getenv "GEM_HOME")
|
||||||
|
"/gems/git-" ,version
|
||||||
|
"/lib/git/config.rb")))
|
||||||
|
(substitute* (list config)
|
||||||
(("'git'")
|
(("'git'")
|
||||||
(string-append "'" git "'")))
|
(string-append "'" git "'")))
|
||||||
;; Fix a test that expects the binary to be simply
|
#t))))))
|
||||||
;; 'git'.
|
|
||||||
(substitute* '("tests/units/test_logger.rb")
|
|
||||||
(("def test_logger")
|
|
||||||
(string-append
|
|
||||||
"def test_logger\n"
|
|
||||||
"Git::Base.config.binary_path = 'git'")))
|
|
||||||
#t)))
|
|
||||||
(add-before 'check 'create-fake-home
|
|
||||||
(lambda _
|
|
||||||
;; The test suite runs 'git config --global' commands,
|
|
||||||
;; so a fake home directory is needed for them to
|
|
||||||
;; succeed.
|
|
||||||
(let ((fake-home (string-append (getcwd) "/fake-home")))
|
|
||||||
(mkdir fake-home)
|
|
||||||
(setenv "HOME" fake-home)))))))
|
|
||||||
(inputs
|
(inputs
|
||||||
`(("git" ,git)))
|
`(("git" ,git)))
|
||||||
(synopsis "Ruby wrappers for Git")
|
(synopsis "Ruby wrappers for Git")
|
||||||
|
@ -667,13 +579,10 @@ (define-public ruby-slop
|
||||||
(version "4.1.0")
|
(version "4.1.0")
|
||||||
(source (origin
|
(source (origin
|
||||||
(method url-fetch)
|
(method url-fetch)
|
||||||
(uri (string-append
|
(uri (rubygems-uri "slop" version))
|
||||||
"https://github.com/leejarvis/slop/archive/v"
|
|
||||||
version ".tar.gz"))
|
|
||||||
(file-name (string-append name "-" version ".tar.gz"))
|
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"0cqs50a0b99kjd19xpln8jpnki07cjyp3l7wxbfr44ycasr6nznh"))))
|
"0dj0ps6v1mqd02k84mgwd7hp578n2bzl7c51h3grdhxfl3jkfsj5"))))
|
||||||
(build-system ruby-build-system)
|
(build-system ruby-build-system)
|
||||||
(native-inputs
|
(native-inputs
|
||||||
`(("ruby-minitest" ,ruby-minitest)))
|
`(("ruby-minitest" ,ruby-minitest)))
|
||||||
|
@ -689,13 +598,10 @@ (define-public ruby-multipart-post
|
||||||
(version "2.0.0")
|
(version "2.0.0")
|
||||||
(source (origin
|
(source (origin
|
||||||
(method url-fetch)
|
(method url-fetch)
|
||||||
(uri (string-append
|
(uri (rubygems-uri "multipart-post" version))
|
||||||
"https://github.com/nicksieger/multipart-post/archive/v"
|
|
||||||
version ".tar.gz"))
|
|
||||||
(file-name (string-append name "-" version ".tar.gz"))
|
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"03n271i3knfx4j9aingxzz2bajd379dw9nswsllviqc177lq1anm"))))
|
"09k0b3cybqilk1gwrwwain95rdypixb2q9w65gd44gfzsd84xi1x"))))
|
||||||
(build-system ruby-build-system)
|
(build-system ruby-build-system)
|
||||||
(native-inputs
|
(native-inputs
|
||||||
`(("bundler" ,bundler)))
|
`(("bundler" ,bundler)))
|
||||||
|
|
|
@ -26,10 +26,16 @@ (define-module (guix build-system ruby)
|
||||||
#:use-module (guix build-system)
|
#:use-module (guix build-system)
|
||||||
#:use-module (guix build-system gnu)
|
#:use-module (guix build-system gnu)
|
||||||
#:use-module (ice-9 match)
|
#:use-module (ice-9 match)
|
||||||
#:export (%ruby-build-system-modules
|
#:export (rubygems-uri
|
||||||
|
%ruby-build-system-modules
|
||||||
ruby-build
|
ruby-build
|
||||||
ruby-build-system))
|
ruby-build-system))
|
||||||
|
|
||||||
|
(define (rubygems-uri name version)
|
||||||
|
"Return a URI string for the gem archive for the release corresponding to
|
||||||
|
NAME and VERSION."
|
||||||
|
(string-append "https://rubygems.org/downloads/" name "-" version ".gem"))
|
||||||
|
|
||||||
(define %ruby-build-system-modules
|
(define %ruby-build-system-modules
|
||||||
;; Build-side modules imported by default.
|
;; Build-side modules imported by default.
|
||||||
`((guix build ruby-build-system)
|
`((guix build ruby-build-system)
|
||||||
|
@ -50,7 +56,6 @@ (define* (lower name
|
||||||
(define private-keywords
|
(define private-keywords
|
||||||
'(#:source #:target #:ruby #:inputs #:native-inputs))
|
'(#:source #:target #:ruby #:inputs #:native-inputs))
|
||||||
|
|
||||||
(let ((version-control (resolve-interface '(gnu packages version-control))))
|
|
||||||
(and (not target) ;XXX: no cross-compilation
|
(and (not target) ;XXX: no cross-compilation
|
||||||
(bag
|
(bag
|
||||||
(name name)
|
(name name)
|
||||||
|
@ -63,11 +68,10 @@ (define private-keywords
|
||||||
;; 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)
|
||||||
("git" ,(module-ref version-control 'git))
|
|
||||||
,@native-inputs))
|
,@native-inputs))
|
||||||
(outputs outputs)
|
(outputs outputs)
|
||||||
(build ruby-build)
|
(build ruby-build)
|
||||||
(arguments (strip-keyword-arguments private-keywords arguments))))))
|
(arguments (strip-keyword-arguments private-keywords arguments)))))
|
||||||
|
|
||||||
(define* (ruby-build store name inputs
|
(define* (ruby-build store name inputs
|
||||||
#:key
|
#:key
|
||||||
|
|
|
@ -21,6 +21,7 @@ (define-module (guix build ruby-build-system)
|
||||||
#:use-module ((guix build gnu-build-system) #:prefix gnu:)
|
#:use-module ((guix build gnu-build-system) #:prefix gnu:)
|
||||||
#:use-module (guix build utils)
|
#:use-module (guix build utils)
|
||||||
#:use-module (ice-9 match)
|
#:use-module (ice-9 match)
|
||||||
|
#:use-module (ice-9 popen)
|
||||||
#:use-module (ice-9 regex)
|
#:use-module (ice-9 regex)
|
||||||
#:use-module (srfi srfi-1)
|
#:use-module (srfi srfi-1)
|
||||||
#:use-module (srfi srfi-26)
|
#:use-module (srfi srfi-26)
|
||||||
|
@ -40,41 +41,72 @@ (define (first-matching-file pattern)
|
||||||
((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
|
(define* (unpack #:key source #:allow-other-keys)
|
||||||
;; by include calls to 'git ls-files'. In order for these gemspecs to work
|
"Unpack the gem SOURCE and enter the resulting directory."
|
||||||
;; as-is, every file in the source tree is added to the staging area.
|
(and (zero? (system* "gem" "unpack" source))
|
||||||
(define gitify
|
(begin
|
||||||
(lambda _
|
;; The unpacked gem directory is named the same as the archive, sans
|
||||||
(and (zero? (system* "git" "init"))
|
;; the ".gem" extension.
|
||||||
(zero? (system* "git" "add" ".")))))
|
(chdir (match:substring (string-match "^(.*)\\.gem$"
|
||||||
|
(basename source))
|
||||||
|
1))
|
||||||
|
#t)))
|
||||||
|
|
||||||
(define build
|
(define* (build #:key source #:allow-other-keys)
|
||||||
(lambda _
|
"Build a new gem using the gemspec from the SOURCE gem."
|
||||||
(match (find-files "." "\\.gemspec$")
|
|
||||||
;; No gemspec, try 'rake gem' instead.
|
;; Remove the original gemspec, if present, and replace it with a new one.
|
||||||
(()
|
;; This avoids issues with upstream gemspecs requiring tools such as git to
|
||||||
(zero? (system* "rake" "gem")))
|
;; generate the files list.
|
||||||
;; Build the first matching gemspec.
|
(let ((gemspec (or (false-if-exception
|
||||||
((gemspec . _)
|
(first-matching-file "\\.gemspec$"))
|
||||||
(zero? (system* "gem" "build" gemspec))))))
|
;; Make new gemspec if one wasn't shipped.
|
||||||
|
".gemspec")))
|
||||||
|
|
||||||
|
(when (file-exists? gemspec) (delete-file gemspec))
|
||||||
|
|
||||||
|
;; Extract gemspec from source gem.
|
||||||
|
(let ((pipe (open-pipe* OPEN_READ "gem" "spec" "--ruby" source)))
|
||||||
|
(dynamic-wind
|
||||||
|
(const #t)
|
||||||
|
(lambda ()
|
||||||
|
(call-with-output-file gemspec
|
||||||
|
(lambda (out)
|
||||||
|
;; 'gem spec' writes to stdout, but 'gem build' only reads
|
||||||
|
;; gemspecs from a file, so we redirect the output to a file.
|
||||||
|
(while (not (eof-object? (peek-char pipe)))
|
||||||
|
(write-char (read-char pipe) out))))
|
||||||
|
#t)
|
||||||
|
(lambda ()
|
||||||
|
(close-pipe pipe))))
|
||||||
|
|
||||||
|
;; Build a new gem from the current working directory. This also allows any
|
||||||
|
;; dynamic patching done in previous phases to be present in the installed
|
||||||
|
;; gem.
|
||||||
|
(zero? (system* "gem" "build" gemspec))))
|
||||||
|
|
||||||
(define* (check #:key tests? test-target #:allow-other-keys)
|
(define* (check #:key tests? test-target #:allow-other-keys)
|
||||||
|
"Run the gem's test suite rake task TEST-TARGET. Skip the tests if TESTS?
|
||||||
|
is #f."
|
||||||
(if tests?
|
(if tests?
|
||||||
(zero? (system* "rake" test-target))
|
(zero? (system* "rake" test-target))
|
||||||
#t))
|
#t))
|
||||||
|
|
||||||
(define* (install #:key source inputs outputs (gem-flags '())
|
(define* (install #:key inputs outputs (gem-flags '())
|
||||||
#:allow-other-keys)
|
#:allow-other-keys)
|
||||||
|
"Install the gem archive SOURCE to the output store item. Additional
|
||||||
|
GEM-FLAGS are passed to the 'gem' invokation, if present."
|
||||||
(let* ((ruby-version
|
(let* ((ruby-version
|
||||||
(match:substring (string-match "ruby-(.*)\\.[0-9]$"
|
(match:substring (string-match "ruby-(.*)\\.[0-9]$"
|
||||||
(assoc-ref inputs "ruby"))
|
(assoc-ref inputs "ruby"))
|
||||||
1))
|
1))
|
||||||
(out (assoc-ref outputs "out"))
|
(out (assoc-ref outputs "out"))
|
||||||
(gem-home (string-append out "/lib/ruby/gems/" ruby-version ".0")))
|
(gem-home (string-append out "/lib/ruby/gems/" ruby-version ".0")))
|
||||||
|
|
||||||
(setenv "GEM_HOME" gem-home)
|
(setenv "GEM_HOME" gem-home)
|
||||||
(mkdir-p gem-home)
|
(mkdir-p gem-home)
|
||||||
(zero? (apply system* "gem" "install" "--local"
|
(zero? (apply system* "gem" "install" (first-matching-file "\\.gem$")
|
||||||
(first-matching-file "\\.gem$")
|
"--local" "--ignore-dependencies"
|
||||||
;; Executables should go into /bin, not /lib/ruby/gems.
|
;; Executables should go into /bin, not /lib/ruby/gems.
|
||||||
"--bindir" (string-append out "/bin")
|
"--bindir" (string-append out "/bin")
|
||||||
gem-flags))))
|
gem-flags))))
|
||||||
|
@ -82,8 +114,8 @@ (define* (install #:key source inputs outputs (gem-flags '())
|
||||||
(define %standard-phases
|
(define %standard-phases
|
||||||
(modify-phases gnu:%standard-phases
|
(modify-phases gnu:%standard-phases
|
||||||
(delete 'configure)
|
(delete 'configure)
|
||||||
(add-after 'unpack 'gitify gitify)
|
|
||||||
(replace 'build build)
|
(replace 'build build)
|
||||||
|
(replace 'unpack unpack)
|
||||||
(replace 'install install)
|
(replace 'install install)
|
||||||
(replace 'check check)))
|
(replace 'check check)))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue