Skip to content
This repository has been archived by the owner on May 20, 2023. It is now read-only.

Commit

Permalink
upgpkg: ruby-i18n 1.9.0-1: Upgrade to 1.9.0.
Browse files Browse the repository at this point in the history
Add upstream patch to remove broken imports:
ruby-i18n/i18n#602
Add upstream patch to remove unused pry gem:
ruby-i18n/i18n#608
Simplify quoting in file.
Use check() to run tests (finally).
Various style fixes and simplifications.

git-svn-id: file:///srv/repos/svn-community/svn@1117463 9fca08f4-af9d-4005-b8df-a31f2cc04f65
  • Loading branch information
dvzrv authored and svntogit committed Jan 27, 2022
1 parent 181e19c commit f2b296d
Showing 1 changed file with 36 additions and 23 deletions.
59 changes: 36 additions & 23 deletions trunk/PKGBUILD
Expand Up @@ -2,50 +2,63 @@

_name=i18n
pkgname=ruby-i18n
pkgver=1.8.11
pkgver=1.9.0
pkgrel=1
pkgdesc="New wave internationalisation support for Ruby"
arch=('any')
arch=(any)
url="https://github.com/ruby-i18n/i18n"
license=('MIT')
depends=('ruby' 'ruby-activesupport' 'ruby-json' 'ruby-mocha')
makedepends=('ruby-bundler' 'ruby-rake' 'ruby-rdoc')
# # TODO: package ruby-pry
# checkdepends=('ruby-minitest' 'ruby-test_declarative')
license=(MIT)
depends=(ruby ruby-activesupport ruby-concurrent ruby-json ruby-mocha)
makedepends=(ruby-bundler ruby-rake ruby-rdoc)
checkdepends=(ruby-minitest ruby-test_declarative)
options=(!emptydirs)
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/ruby-i18n/${_name}/archive/v${pkgver}.tar.gz")
sha512sums=('af8fcc307de9959b5a01a79ac3c99d3a3573630f8cdf91c21208e07d35d1a0db60f4995f1b77921c5374a1a19ad66770a107cc41fb29cf480d02be00bf90634a')
b2sums=('e603077c6eb02f6fd89bafd6c06f85c72528d5eb4388854f060f05a4b49a3782a3830366a1f11bd95b191048f29fae251002a34d55cb185ecefb3afc06bb2f36')
source=(
"${pkgname}-${pkgver}.tar.gz::https://github.com/ruby-i18n/${_name}/archive/v${pkgver}.tar.gz"
"${pkgname}-1.9.0-broken_imports.patch::https://github.com/ruby-i18n/i18n/pull/602/commits/813124cd3cd889578cfe359de6cf46412f1548c9.patch"
"${pkgname}-1.9.0-remove_pry.patch::https://github.com/ruby-i18n/i18n/pull/608/commits/bd48ee07e939d903fcc52d8aa813654c457aed73.patch"
)
sha512sums=('3fb0f157d64312c518c986d9b462e73e30bdb9e639672c92a7bab6e68cb3e9b5dd490ed3cfd4101eb9bf4903a6d1172ab6fdf4f6ac0bc4ed8b0de505c9bf8291'
'810ebe6eab64eb4942506d6f49f85c789f2f13fe2e68ea36e517367e796dd265e405c83ff1abf2279cd50244fb605a9975bc8f780ed8ee09d05a3e1533aae2d1'
'fb46c3cc84473f7902dca16c515dd36639456568bfa16fc985444efdb289a62abca7207c36dc4b3c741e51590fa814167fdbb0617b4d32f91acb83b3ad634c8c')
b2sums=('3f86850655ff8de1090f21c731ba3a37d538112e4ed97d09ae22b7edd20e32d42b1bc6e67e26a0049f1e3acc422c11ffb7be7d48f4b7fc707193e613032fd8ee'
'9da69039e81df076fd4968e6efcd85a69449297560ffa93eddd91050d87b484df00c43fcbd8ef6be82382ec0ca61ba6392e7c3231798ae82ff379daba8034f11'
'9c17b8ebeba65a629d469626262a20cb4a7c86f6fbce484ce0a381965aa4b94ce55b13507324390e91317a5b2ca83a48bb8376157d82a380175f5a911c0ce2d7')

prepare() {
mv -v "${_name}-${pkgver}" "${pkgname}-${pkgver}"
cd ${pkgname}-${pkgver}
cd ${_name}-${pkgver}

# remove broken imports: https://github.com/ruby-i18n/i18n/pull/602
patch -Np1 -i ../${pkgname}-1.9.0-broken_imports.patch

# remove pry from Gemfile: https://github.com/ruby-i18n/i18n/issues/607
patch -Np1 -i ../${pkgname}-1.9.0-remove_pry.patch

# we don't do version pinning
sed -r 's|~>|>=|g' -i "${_name}.gemspec" Gemfile
}

build() {
cd ${pkgname}-${pkgver}
cd ${_name}-${pkgver}
gem build "${_name}.gemspec"
}

# # TODO: package ruby-pry
# check(){
# cd "${pkgname}-${pkgver}"
# rake test
# }
check(){
cd ${_name}-${pkgver}
rake test
}

package() {
cd "${pkgname}-${pkgver}"
local _gemdir="$(gem env gemdir)"

cd ${_name}-${pkgver}
gem install --ignore-dependencies \
--no-user-install \
-i "${pkgdir}/${_gemdir}" \
-n "${pkgdir}/usr/bin" \
${_name}-${pkgver}.gem
install -vDm 644 MIT-LICENSE \
"${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"

install -vDm 644 MIT-LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"

cd "${pkgdir}/${_gemdir}"
rm -rvf cache gems/${_name}-${pkgver}/{ext,lib/*/*.so} \
extensions/*/*/${_name}-${pkgver}/{mkmf.log,gem_make.out}
rm -rvf cache gems/${_name}-${pkgver}/{ext,lib/*/*.so} extensions/*/*/${_name}-${pkgver}/{mkmf.log,gem_make.out}
}

0 comments on commit f2b296d

Please sign in to comment.