diff options
author | Viktor Drobot | 2020-01-02 23:52:52 +0300 |
---|---|---|
committer | Viktor Drobot | 2020-01-02 23:52:52 +0300 |
commit | 3bdd56698759aaf5e8b7db0f9c8ad6be164ef8cb (patch) | |
tree | 7785ad6ebe198e9268d51f98090cc8a940035bdd /PKGBUILD | |
parent | dd37accb8b32cd54b9d991647db2cf09944b20d8 (diff) | |
download | aur-3bdd56698759aaf5e8b7db0f9c8ad6be164ef8cb.tar.gz |
Build from src now
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 175 |
1 files changed, 34 insertions, 141 deletions
@@ -1,157 +1,50 @@ # Maintainer: Viktor Drobot (aka dviktor) linux776 [at] gmail [dot] com +# Contributor: bastelfreak -_gemname="gettext" -_gembuilder=("install" - "man" - "license" - "fix") -_ruby="/usr/bin/ruby" -_gem="/usr/bin/gem" - -pkgname="ruby-gettext" +_gemname='gettext' +pkgname="ruby-${_gemname}" pkgver=3.2.9 -pkgrel=1 -pkgdesc="Gettext is a pure Ruby libary and tools to localize messages." -arch=("any") -url="http://ruby-gettext.github.io/" -license=("RUBY") -_licensefile=() -groups=("pacgem") -makedepends=("ruby" - "binutils") -depends=("ruby" - "ruby-text" - "ruby-locale") -conflicts=() -optdepends=("ruby-rake: Ruby based make-like utility." - "ruby-racc: Racc is a LALR(1) parser generator" - "ruby-yard: Documentation tool for consistent and usable documentation in Ruby." - "ruby-redcarpet: Markdown that smells nice" - "ruby-test-unit: test-unit - Improved version of Test::Unit bundled in Ruby 1.8.x." - "ruby-test-unit-notify: Test::Unit::Notify - A test result notify extension for Test::Unit." - "ruby-test-unit-rr: test-unit-rr is a RR adapter for test-unit.") -source=("http://rubygems.org/gems/$_gemname-$pkgver.gem") -noextract=("$_gemname-$pkgver.gem") +pkgrel=2 +pkgdesc='Gettext gem is a pure Ruby Localization(L10n) library and tool which is modeled after the GNU gettext package.' +arch=(any) +url="https://github.com/ruby-gettext/gettext" +license=('RUBY' 'LGPL3') +makedepends=('ruby-rdoc' 'ruby-test-unit' 'ruby-rake' 'ruby-yard' 'ruby-irb' 'ruby-bundler') +depends=('ruby' 'ruby-locale' 'ruby-text') +source=("https://github.com/ruby-gettext/gettext/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz") options=("!emptydirs") +sha512sums=('e7352a343485c25077cdf08f2f92d7ae7ba798cb662ad090ce9e367576ee585753588dca2b7c8247ad007a816b87e57027ce70160b8f1bee83e3276e3725f314') -_gem_install() { - msg 'Installing gem...' - - # Install the gem - install -d -m755 $_bindir $_gemdir - $_gem install --no-document --ignore-dependencies --no-user-install \ - --bindir $_bindir --install-dir $_gemdir "$srcdir/$_gemname-$pkgver.gem" -} - -_gem_man() { - msg 'Installing man pages...' - - # Find man pages and move them to the correct directory - local mandir="$_gemdir/gems/$_gemname-$pkgver/man" - if [[ -d $mandir ]]; then - install -d -m755 $_mandir - local file - for file in $(find $mandir -type f -and -name *.[0-9]); do - local dir=$_mandir/man${file##*.} - install -d -m755 $dir - mv $file $dir - done - rm -rf $mandir - fi -} - -_gem_license() { - if [[ "${#_licensefile[@]}" -ne 0 ]]; then - msg "Installing license $license..." - install -d -m755 "$pkgdir/usr/share/licenses/$pkgname" - local file - for file in ${_licensefile[@]}; do - ln -s "../../../..$_gemdestdir/gems/$_gemname-$pkgver/$file" "$pkgdir/usr/share/licenses/$pkgname/$file" - done - fi -} - -_gem_fix() { - msg 'Fixing gem installation...' - - # Set mode of executables to 755 - [[ -d "$_gemdir/bin" ]] && find "$_gemdir/bin" -type f -exec chmod 755 -- '{}' ';' +# update the gemspec to allow newer versions of rake +# remove deprecated options from the gemspec +prepare() { + cd "${_gemname}-${pkgver}" - # Remove cached gem file - rm -f "$_gemdir/cache/$_gemname-$pkgver.gem" - - # Sometimes there are files which are not world readable. Fix this. - find $pkgdir -type f '!' -perm '-004' -exec chmod o+r -- '{}' ';' -} - -_gem_cleanext() { - msg 'Removing native build leftovers...' - local extdir="$_gemdir/gems/$_gemname-$pkgver/ext" - [[ -d $extdir ]] && find "$extdir" -name '*.o' -exec rm -f -- '{}' ';' -} - -# Check if dependency is already satisfied -_dependency_satisfied() { - local dep=$1 deps="${depends[@]}" - [[ $(type -t in_array) == 'function' ]] || error "in_array should be provided by makepkg" - while true; do - in_array $dep ${deps[@]} && return 0 - local found=0 pkg - # Warning: This could break easily if the pacman output format changes. - for pkg in $(LC_ALL=C pacman -Qi ${deps[@]} 2>/dev/null | sed '/Depends On/!d;s/.*: //;s/None\|[<>]=\?[^ ]*\|=[^ ]*//g'); do - if ! in_array $pkg ${deps[@]}; then - deps=(${deps[@]} $pkg) && found=1 - fi - done - (( $found )) || break - done - return 1 + sed --in-place '/s.rubyforge_project/d' "${_gemname}.gemspec" + sed --in-place '/test\/unit\/notify/d' test/run-test.rb + sed --in-place '/test\/unit\/rr/d' test/run-test.rb + sed --in-place '/s.add_development_dependency("test-unit-notify")/d' "${_gemname}.gemspec" + sed --in-place '/s.add_development_dependency("test-unit-rr")/d' "${_gemname}.gemspec" } -_gem_autodepends() { - msg 'Automatic dependency resolution...' - # Find all referenced shared libraries - local deps=$(find $pkgdir -type f -name '*.so') - [[ -n $deps ]] || return 0 +build() { + cd "${_gemname}-${pkgver}" - deps=$(readelf -d $deps | sed -n 's/.*Shared library: \[\(.*\)\].*/\1/p' | sort | uniq) - - # Find referenced libraries on the library search path - local libs=() lib path - for lib in $deps; do - for path in /lib /usr/lib; do - [[ -f "$path/$lib" ]] && libs=(${libs[@]} "$path/$lib") - done - done - (( ${#libs} )) || return 0 - - msg2 "Referenced libraries: ${libs[*]}" - - # Find matching packages with pacman -Qo - # and add them to the depends array - local pkg - for pkg in $(pacman -Qqo ${libs[@]}); do - _dependency_satisfied $pkg || depends=(${depends[@]} $pkg) - done - msg2 "Referenced packages: ${depends[*]}" + gem build "${_gemname}.gemspec" } -_rbconfig() { - $_ruby -e "require 'rbconfig'; puts RbConfig::CONFIG['$1']" -} +# tests are currently broken upstream +#check() { + #cd "${_gemname}-${pkgver}" + #rake test +#} package() { - # Directories defined inside build() because if ruby is not installed on the system - # makepkg will barf when sourcing the PKGBUILD - _gemdestdir=$($_gem environment gemdir) - _gemdir=$pkgdir$_gemdestdir - _bindir=$pkgdir$(_rbconfig bindir) - _mandir=$pkgdir$(_rbconfig mandir) + cd "${_gemname}-${pkgver}" + + local _gemdir="$(gem env gemdir)" + gem install --verbose --ignore-dependencies --no-user-install --install-dir "${pkgdir}/${_gemdir}" --bindir "${pkgdir}/usr/bin" "${_gemname}-${pkgver}.gem" - local i - for i in ${_gembuilder[@]}; do - _gem_$i - done + rm -rf "${pkgdir}/${_gemdir}/cache" } -md5sums=('09a755cd03ab617835e20a2e910581f4') |