From 213349485ac6296e3b423dec50c8dd2a748adac1 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 4 Jul 2017 21:31:51 -0400 Subject: add libre/ruby2.3 --- libre/ruby2.3/PKGBUILD | 118 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 libre/ruby2.3/PKGBUILD (limited to 'libre/ruby2.3/PKGBUILD') diff --git a/libre/ruby2.3/PKGBUILD b/libre/ruby2.3/PKGBUILD new file mode 100644 index 000000000..fb0cf9725 --- /dev/null +++ b/libre/ruby2.3/PKGBUILD @@ -0,0 +1,118 @@ +# Maintainer (Arch): Sven-Hendrik Haase +# Contributor (Arch): Sergey Shatunov +# Contributor (Arch): Jonne Haß +# Contributor (Arch): Thomas Dziedzic +# Contributor (Arch): Allan McRae +# Contributor (Arch): John Proctor +# Contributor (Arch): Jeramy Rutley + +# Maintainer: Luke Shumaker + +# 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 + +_rubyver=2.3 +pkgname=ruby2.3 +pkgver=${_rubyver}.4 +_jsonver=1.8.3 +pkgdesc='An object-oriented language for quick and easy programming' +pkgrel=3.parabola1 +_srcrel=1 # increment this to rebuild the sourceball without bumping pkgver +arch=(i686 x86_64) +url='http://www.ruby-lang.org/en/' +license=(BSD custom) +depends=(gdbm openssl-1.0 libffi libyaml gmp zlib) +optdepends=('tk: for Ruby/TK') +makedepends=(gdbm openssl-1.0 libffi doxygen graphviz libyaml ttf-dejavu tk) +options=(!emptydirs) +source=(https://repo.parabola.nu/other/ruby-libre/ruby-${pkgver}-libre${_srcrel}.tar.gz) +sha512sums=('3cae39dfd8a2ad98f55d8e09346e8c26cb8d44229f6de9aaa0c179ba6ed2ae6959e24ec9121a6c8172796cba507514cda3b5d292128a93831f25133e22bb0c8e') + +mksource=(https://cache.ruby-lang.org/pub/ruby/${pkgver:0:3}/ruby-${pkgver}.tar.xz + ruby-${pkgver}-remove-json-ext.patch + ruby-${pkgver}-add-json_pure.patch + json-${_jsonver}.tar.gz::https://github.com/flori/json/archive/v${_jsonver}.tar.gz + json-${_jsonver}-ruby-${pkgver}-backports.patch + json-${_jsonver}-libre.patch) +mksha512sums=('9e3adc2de6703e50e75db37db2981006d4c69759929d61db6a0d63627cfe5977d0ad66d2c69d7161cfc0c0d1c2cb38e5181a06ccd2790df2f72ec25c2ad01e02' + 'bd36519010a36d9368450de3bb6e46fd4b95682521877450f5875d0c0fc87119c52bd32cfdd7bcadf336d59e51665437a632d43d2f41934c808079ce6623a58c' + 'fcfde775beb157db7a9788c897b06c11191a5f1c34e94a1644ce9c9b32675dab9001b66f1b26fdb6082eb9e85ba38423ccc9917716c788bb9cd8fa54e723c757' + '147ce1834a1a0f02596386969c6e95c14237cc4d5303be974b9293d349d61a074cf9cc99d2f6bc434aa6da8aac9ddc35cfdeb7b9f77b14c112f8be70ff0846f7' + '05078d112741d80289acfe7221d98c244dad6c905b536c16886001ca78fef93523af0ba4d49f19cc8ebf0ac6a0e10278f53c07f055d8ae658a6bc57fcdc1c5ad' + 'aac35c74c16be38b4c7b2a5677189036bf90fbc00bcffdffe6a76ddaf6eb87d0ddb30ad239aefe4d7ff5c13ddd2b2fa18007e4d0a8f5e38b1153aed6e3d35c58') +mksource() { + # Start with the vanilla version of json + cd "$srcdir/json-${_jsonver}" + # Apply changes made to it for the ruby distribution + patch -p1 -i ../json-${_jsonver}-ruby-${pkgver}-backports.patch + chmod 644 tests/test_json_* + # Modify it so that 'json' doesn't try to load (non-free!) 'json/ext' + rm -rf -- json.gemspec ext lib/json/ext* + patch -p1 -i ../json-${_jsonver}-libre.patch + + # Now modify the ruby sources to include the json_pure lib instead + # of the json ext + cd "$srcdir/ruby-${pkgver}" + # remove the json ext + rm -rv ext/json test/json + patch -p1 -i ../ruby-${pkgver}-remove-json-ext.patch + # and insert the json_pure lib + cp -r ../json-${_jsonver}/lib/* -t lib/ + cp ../json-${_jsonver}/json_pure.gemspec -t lib/json/ + cp -rT ../json-${_jsonver}/tests test/json + patch -p1 -i ../ruby-${pkgver}-add-json_pure.patch + + # Clean up the original json sources + cd "$srcdir" + rm -rf "json-${_jsonver}" +} + +build() { + cd ruby-${pkgver} + + CFLAGS+=' -O1' # GCC 7 produces a broken Ruby 2.3 with -O2 + CPPFLAGS+=' -U_FORTIFY_SOURCE' # _FORTIFY_SOURCE requires at least -O2 + + export PKG_CONFIG_PATH=/usr/lib/openssl-1.0/pkgconfig + PKG_CONFIG=/usr/bin/pkg-config ./configure \ + --prefix=/opt/ruby${_rubyver} \ + --program-suffix=-${_rubyver} \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --sharedstatedir=/var/lib \ + --libexecdir=/usr/lib/ruby \ + --enable-shared \ + --disable-rpath \ + --with-dbm-type=gdbm_compat + + make ruby +} + +check() { + cd ruby-${pkgver} + + make test +} + +package() { + cd ruby-${pkgver} + + make DESTDIR="${pkgdir}" install-nodoc + + install -dm755 $pkgdir/usr/bin + install -dm755 $pkgdir/usr/lib + + for i in erb irb rdoc ri ruby testrb rake gem; do + ln -s /opt/$pkgname/bin/$i-${_rubyver} $pkgdir/usr/bin/$i-${_rubyver} + ln -s /opt/$pkgname/bin/$i-${_rubyver} $pkgdir/opt/$pkgname/bin/$i + done + + ln -s /opt/$pkgname/lib/libruby.so.${_rubyver} $pkgdir/usr/lib/libruby.so.${_rubyver} + + install -D -m644 COPYING "${pkgdir}/usr/share/licenses/$pkgname/LICENSE" + install -D -m644 BSDL "${pkgdir}/usr/share/licenses/$pkgname/BSDL" +} -- cgit v1.2.3