1 # Maintainer: Andreas 'Segaja' Schleifer <archlinux at segaja dot de>
4 pkgname="ruby-$_gemname"
7 pkgdesc='A Ruby/Rack web server built for concurrency'
10 license=('BSD-3-CLAUSE')
12 depends=('ruby' 'ruby-nio4r' 'ruby-sd_notify')
13 makedepends=('ruby-bundler' 'ruby-minitest' 'ruby-minitest-proveit' 'ruby-minitest-retry' 'ruby-minitest-stub-const' 'ruby-rack' 'ruby-rake' 'ruby-rake-compiler' 'ruby-rdoc')
14 source=("https://github.com/puma/puma/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz"
15 "${pkgname}_fix_tests.patch")
16 sha512sums=('0ad41f3372732bdea6594a20b116ec4fc03a8a1d2ff807b3c315e7769aef4e5361ff775975575125002fbfc83315e6906fa8691ce666161bd8beee8c469289d8'
17 'da06b0dafb1ff45d79b3dff05c53334ba1ef2f4f8f8edd904d6418961da51e78f1dff5e1aee19154699651a8ea5c1241b8018eab3f1769fb163a3609b1ac5df0')
20 cd "${_gemname}-${pkgver}"
22 # remove some tests and fix others
23 patch --verbose --strip=1 --input="../${pkgname}_fix_tests.patch"
25 # we built based on a tar archive, not a git repo
26 sed --in-place 's/git ls-files/find/' "${_gemname}.gemspec"
28 # update gemspec/Gemfile to allow newer version of the deps
29 sed --in-place --regexp-extended 's|~>|>=|g' "${_gemname}.gemspec" Gemfile
31 # disable rubocop, we don't have that in our repos and it doesn't provide any benefits during building
32 sed --in-place '/rubocop/Id' Rakefile Gemfile
34 # disable m. Only required for debugging during development
35 sed --in-place "/'m'/d" Gemfile
37 # disable localhost. Only required for self-signed certificates during development
38 sed --in-place "/localhost/d" Gemfile
42 cd "${_gemname}-${pkgver}"
49 cd "${_gemname}-${pkgver}"
51 # https://github.com/puma/puma/blob/master/CONTRIBUTING.md#file-limits
54 # some seeds cause random errors ( https://github.com/puma/puma/issues/2825 ) so we use a fixed seed
55 export TESTOPTS="--seed=21082"
61 cd "${_gemname}-${pkgver}"
63 local _gemdir="$(gem env gemdir)"
68 --ignore-dependencies \
70 --install-dir "${pkgdir}/${_gemdir}" \
71 --bindir "${pkgdir}/usr/bin" \
72 "pkg/${_gemname}-${pkgver}.gem"
74 # remove unrepreducible files
75 rm --force --recursive --verbose \
76 "${pkgdir}/${_gemdir}/cache/" \
77 "${pkgdir}/${_gemdir}/gems/${_gemname}-${pkgver}/vendor/" \
78 "${pkgdir}/${_gemdir}/doc/${_gemname}-${pkgver}/ri/ext/"
80 find "${pkgdir}/${_gemdir}/gems/" \
87 -iname "gem.build_complete" -o \
92 find "${pkgdir}/${_gemdir}/extensions/" \
95 -iname "mkmf.log" -o \
96 -iname "gem_make.out" \
100 install -D --mode=644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
101 install -D --mode=644 *.md --target-directory "${pkgdir}/usr/share/doc/${pkgname}"