1 # Maintainer: Andreas 'Segaja' Schleifer <segaja at archlinux dot org>
4 pkgname="ruby-${_gemname}"
7 pkgdesc='A template language whose goal is reduce the syntax to the essential parts without becoming cryptic'
9 url="https://github.com/slim-template/${_gemname}"
11 depends=('ruby' 'ruby-temple' 'ruby-tilt')
12 checkdepends=('ruby-kramdown' 'ruby-pandoc-ruby' 'ruby-rack-test' 'ruby-sassc' 'ruby-sinatra')
13 options=('!emptydirs')
14 source=("${url}/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz"
15 "${pkgname}_fix_gemspec.patch"
16 "${pkgname}_fix_openstruct.patch::https://github.com/slim-template/slim/commit/15286536094c84c5cb28cd9a8997346e0f314178.patch"
17 "${pkgname}_fix_tests.patch")
18 sha512sums=('0507781497ba5bca0bd6a9bca50d5454b9c0325219eafd760eec57aa2f19d85e42a03d296f52375ef84db8307cb369a461bc1d6d2f4caccaa83e5a351386f333'
19 '8e7f1d8859c6275eafcb061a98e767722b78bcd553a453605a8b2812d66885079d8e92c8823a11b490e38ae39cd594afed7ef7dc16ecb23588ead56ed3ab85c8'
20 '0d18fb9e7ef9677b0755ee407e71199c6902695b22203ca86a88468da095575b3e97572666fd5494d821e5fd886f102c66245f3400fca733e256f1680c18d201'
21 '74c43dfef0de1f3398c29ca6166923762a40c5eb031894cdc7b6b2dff956b2d17eb0f56ad6304a3b6674e1d18144f6f460e8ecfdb321ae78bfb62a4749dbdd5c')
24 cd "${_gemname}-${pkgver}"
26 patch --verbose --strip=1 --input="../${pkgname}_fix_gemspec.patch"
27 patch --verbose --strip=1 --input="../${pkgname}_fix_openstruct.patch"
28 patch --verbose --strip=1 --input="../${pkgname}_fix_tests.patch"
30 # update gemspec/Gemfile to allow newer version of the dependencies
31 sed --in-place --regexp-extended 's|~>|>=|g' "${_gemname}.gemspec"
33 # replace git based file detection as we don't build from a git source
34 sed --in-place --regexp-extended 's|git ls-files -- bin/\*|find bin -type f|g' "${_gemname}.gemspec"
35 sed --in-place --regexp-extended 's|git ls-files|find . -type f -not -path "\*/\.git/*"|g' "${_gemname}.gemspec"
38 sed --in-place '/def test_rails/,+10d' test/core/test_commands.rb
42 cd "${_gemname}-${pkgver}"
44 local _gemdir="$(gem env gemdir)"
46 gem build "${_gemname}.gemspec"
51 --ignore-dependencies \
53 --install-dir "tmp_install/${_gemdir}" \
54 --bindir "tmp_install/usr/bin" \
55 "${_gemname}-${pkgver}.gem"
57 # remove unrepreducible files
58 rm --force --recursive --verbose \
59 "tmp_install/${_gemdir}/cache/" \
60 "tmp_install/${_gemdir}/gems/${_gemname}-${pkgver}/vendor/" \
61 "tmp_install/${_gemdir}/doc/${_gemname}-${pkgver}/ri/ext/"
63 find "tmp_install/${_gemdir}/gems/" \
70 -iname "gem.build_complete" -o \
75 find "tmp_install/${_gemdir}/extensions/" \
78 -iname "mkmf.log" -o \
79 -iname "gem_make.out" \
85 cd "${_gemname}-${pkgver}"
87 local _gemdir="$(gem env gemdir)"
89 GEM_HOME="tmp_install/${_gemdir}" rake test
93 cd "${_gemname}-${pkgver}"
95 cp --archive --verbose tmp_install/* "${pkgdir}"
97 install --verbose -D --mode=0644 LICENSE* --target-directory "${pkgdir}/usr/share/licenses/${pkgname}"
98 install --verbose -D --mode=0644 *.md --target-directory "${pkgdir}/usr/share/doc/${pkgname}"