From 60f547f8e15074cc1599dab66d2043edd0d4498f Mon Sep 17 00:00:00 2001 From: bill-auger Date: Sat, 24 Jul 2021 02:24:22 -0400 Subject: [ruby2.7]: add package --- libre/ruby2.7/PKGBUILD | 103 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 libre/ruby2.7/PKGBUILD (limited to 'libre/ruby2.7/PKGBUILD') diff --git a/libre/ruby2.7/PKGBUILD b/libre/ruby2.7/PKGBUILD new file mode 100644 index 000000000..e2dd77c17 --- /dev/null +++ b/libre/ruby2.7/PKGBUILD @@ -0,0 +1,103 @@ +# Contributor (arch): Thomas Dziedzic +# Contributor: Allan McRae +# Contributor: John Proctor +# Contributor: Jeramy Rutley +# Maintainer: Omar Vega Ramos +# Contributor: Daniel Milewski +# Contributor: André Silva +# Contributor: Luke Shumaker +# Contributor: fauno + +# Rationale for inclusion in [libre]: Problematic license of +# 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 + + +pkgname=ruby2.7 +pkgver=2.7.3 +_json_ver=2.3.0 +pkgrel=1 +pkgrel+=.parabola1 +arch=(x86_64) +arch+=(i686 armv7h) +url='https://www.ruby-lang.org/en/' +license=(BSD custom) +license=(${license[*]/BSD/BSD2/}) +depends=(libxcrypt gdbm openssl libffi libyaml gmp zlib) +optdepends=( + 'tk: for Ruby/TK' +) +makedepends=(tk) +provides=(ruby) +options=(!emptydirs) +source=(https://cache.ruby-lang.org/pub/ruby/${pkgver:0:3}/ruby-${pkgver}.tar.xz) +source+=(json-${_json_ver}.tar.gz::https://github.com/flori/json/archive/v${_json_ver}.tar.gz + json-libre.patch + ruby-remove-json-ext.patch + ruby-add-json_pure.patch) +sha512sums=('b755d418b3bab2f9f6a8893afd13869269f17065643dde78b9e85ae3538a6d0617893db6e9c3908e00a40c7577a5c912a7c822d8f245cdcfb857be76dfb66c1e') +sha512sums+=('0cda44a77212748d9513e61314dfbc7c0cf82beebcc56eb8b043e4ada698bc475502100389b80fa5c9090341fd1c6d2841fc5c9332e520f1c8dd1084ca505379' + '582017bd0f98878c0ac6f4625854422662d83ae6274a34762082a720052023780dceb17694b1f4e18d9a0dcbb525990341176eac31040aa63099a8b3a8d52071' + 'f952db3774f5eb5bc6c445b690262a883553b51f42dfdcc802c6de5bc2b2907d73472ede38d9d7a1b8efe8fc9cd00e64d986d78353f0a1c86497f71ebd522c48' + '9ff8a2ec9fdecd05fd506ed6f977dcd483e47611dc6bbe6c4622100a2071c0f6c7b3f813a94b73bebb9f0ed7fe9f6257289cdf971030ad525a3c8a0d065b09c2') + + +prepare() { + cd "$srcdir/json-${_json_ver}" + + # Modify 'json' so that it doesn't try to load (non-free!) 'json/ext' + echo "applying json-libre.patch" + rm -rf -- json.gemspec ext lib/json/ext* + patch -p1 -i ../json-libre.patch + + # Now remove the json ext from the ruby sources + cd "$srcdir/ruby-${pkgver}" + echo "applying ruby-remove-json-ext.patch" + rm -r ext/json test/json + patch -p1 -i ../ruby-remove-json-ext.patch + + # and insert the json_pure lib instead + echo "applying ruby-add-json_pure.patch" + cp -r ../json-${_json_ver}/lib/* -t lib/ + cp ../json-${_json_ver}/json_pure.gemspec -t lib/json/ + cp -rT ../json-${_json_ver}/tests test/json + patch -p1 -i ../ruby-add-json_pure.patch + + # Delete original json sources + cd "$srcdir" + rm -rf "json-${_json_ver}" +} + +build() { + cd ruby-${pkgver} + + ./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/ +} -- cgit v1.2.3