123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- # Contributor: Thomas Dziedzic <gostrc@gmail.com>
- # Contributor: Allan McRae <allan@archlinux.org>
- # Contributor: John Proctor <jproctor@prium.net>
- # Contributor: Jeramy Rutley <jrutley@gmail.com>
- # Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
- # Contributor: Daniel Milewski <niitotantei@riseup.net>
- # Contributor: André Silva <emulatorman@hyperbola.info>
- # Contributor: Luke Shumaker <lukeshu@parabola.nu>
- # Contributor: fauno <fauno@parabola.nu>
- # parabola changes and rationale:
- # - replace non-free 'generator.c' in bundled JSON extension
- # https://labs.parabola.nu/issues/674
- # https://bugs.ruby-lang.org/issues/11844
- # https://github.com/flori/json/issues/277
- # https://github.com/flori/json/pull/567
- # - specify *which* BSD license
- pkgname=ruby2.7
- pkgver=2.7.8
- pkgrel=1
- arch=(x86_64)
- pkgdesc='An object-oriented language for quick and easy programming, version 2.7'
- url='https://www.ruby-lang.org/en/'
- license=(BSD custom)
- depends=(libxcrypt gdbm openssl libffi libyaml gmp zlib)
- optdepends=(
- 'tk: for Ruby/TK'
- )
- makedepends=(tk)
- options=(!emptydirs !lto) # Disable LTO until fixes for https://bugs.ruby-lang.org/issues/18062 released
- _osslver=3.0.0
- source=(https://cache.ruby-lang.org/pub/ruby/${pkgver:0:3}/ruby-${pkgver}.tar.xz
- ruby2.7-do-not-depend-on-ext-openssl-deprecation-rb.patch::https://github.com/ruby/ruby/commit/28f3e038805a4f396f228c6884c531677c075867.patch
- ruby-openssl-$_osslver.tar.xz::https://github.com/ruby/openssl/archive/refs/tags/v$_osslver.tar.gz)
- sha512sums=('c7d9761f81a89b7448114b4ba2b29db568fc843f1da0f4af68b2071edc32b6081af6ab57b451e061288fd7072cbb1a767a0f6d783e55383ff36de80baeb9748b'
- 'SKIP'
- '743e19a2aeadf166eb604de02cf48cccc2101719b8a36be738de74262a75f33ba07ce273dd545ec86a2fcec9754e5e19960f7f7677049d714d8d91cc18edbff2'
- '076d2924b61c4f7704b47718a33732fb5285a3af39f328ed9e83add36589da99dfae73b3e893398fc3f2a74dcbead0b66edc682040fa1b48f9530894c7187f95')
- # Parabola: Mundane packaging considerations.
- license=( ${license[*]/BSD/custom:BSD-2-Clause} )
- arch+=(i686 armv7h)
- pkgrel+=.parabola1
- # Parabola: Replace the CVTUTF code with a free implementation.
- # https://github.com/flori/json/pull/567
- # We need to do this in mksource() (not of prepare()) so that the
- # .src.pkg.tar file doesn't include nonfree sources.
- _jsonver=b67679c13bca877e20b7fcd47fb1365f5cc01eb5
- _srcrel=1 # increment this to rebuild the sourceball (mksource, _jsonver) without bumping pkgver
- mksource=("${source[0]}"
- "ruby-json-${_jsonver}.tar.gz::https://github.com/parabola-gnulinuxlibre/ruby-json/archive/${_jsonver}.tar.gz"
- 0001-Prep-to-use-Parabola-s-patched-ruby-json.patch)
- mksha512sums=('4b49dff3e1c2e79d914e10418e4c03026f5d4c137dc337f5c720fe26cb9fcdcf4afc6b7c967356cf5fbe04cc5ef431174c48a035becf3e2322c2c45d3c9b2f59'
- '359aa5209740e902d25d947a37a4e7d2005fed531946201cc8fa4667f78d3231a7751c34b5c6b8a8127cb828e1af90706b3150478e48babcfa17ab3ef538df50'
- 'd57421b5bd19219d9b275eaa07af7fc64b0d7d4755240baf0c8fcc0045197d0d2e6b2500a47228deb713fda25c175e4e2cf1c44d2753505ea160999a4415aab7')
- source=("https://repo.parabola.nu/other/ruby-libre/ruby-${pkgver}-libre${_srcrel}.tar.gz"{,.sig} "${source[@]:1}")
- mkdepends=(ruby)
- mksource() {
- mkdir "$srcdir/ruby"
- mv -T "$srcdir/ruby-$pkgver" "$srcdir/ruby/ruby"
- mkdir "$srcdir/flori"
- mv -T "$srcdir/ruby-json-$_jsonver" "$srcdir/flori/json"
- pushd "$srcdir/ruby/ruby"
- patch -p1 -i ../../0001-Prep-to-use-Parabola-s-patched-ruby-json.patch
- ruby tool/sync_default_gems.rb json
- popd
- mv -T "$srcdir/ruby/ruby" "$srcdir/ruby-${pkgver}"
- rm -rf -- "$srcdir/ruby" "$srcdir/flori"
- }
- prepare() {
- cd ruby-${pkgver}
- patch -Np1 -i ../ruby2.7-do-not-depend-on-ext-openssl-deprecation-rb.patch
- rm -rf ext/openssl test/openssl
- mv ../openssl-$_osslver/ext/openssl ext
- mv ../openssl-$_osslver/lib ext/openssl
- mv ../openssl-$_osslver/{History.md,openssl.gemspec} ext/openssl
- mv ../openssl-$_osslver/test/openssl test
- }
- build() {
- cd ruby-${pkgver}
- # this uses malloc_usable_size, which is incompatible with fortification level 3
- export CFLAGS="${CFLAGS/_FORTIFY_SOURCE=3/_FORTIFY_SOURCE=2}"
- export CXXFLAGS="${CXXFLAGS/_FORTIFY_SOURCE=3/_FORTIFY_SOURCE=2}"
- ./configure \
- --prefix=/usr \
- --program-suffix=-2.7 \
- --with-soname=ruby-2.7 \
- --sysconfdir=/etc \
- --localstatedir=/var \
- --sharedstatedir=/var/lib \
- --libexecdir=/usr/lib/ruby \
- --enable-shared \
- --disable-rpath \
- --with-dbm-type=gdbm_compat \
- --disable-install-doc
- make
- }
- package() {
- cd ruby-${pkgver}
- make DESTDIR="${pkgdir}" install-nodoc
- install -D -m644 COPYING "${pkgdir}/usr/share/licenses/ruby2.7/LICENSE"
- install -D -m644 BSDL "${pkgdir}/usr/share/licenses/ruby2.7/BSDL"
- # remove files conflicting with 'ruby' package
- rm -r "$pkgdir"/usr/share/man/
- }
|