summaryrefslogtreecommitdiff
path: root/libre/ruby/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'libre/ruby/PKGBUILD')
-rw-r--r--libre/ruby/PKGBUILD63
1 files changed, 40 insertions, 23 deletions
diff --git a/libre/ruby/PKGBUILD b/libre/ruby/PKGBUILD
index a837f85b4..e5e4c1d77 100644
--- a/libre/ruby/PKGBUILD
+++ b/libre/ruby/PKGBUILD
@@ -8,11 +8,18 @@
# Contributor: André Silva <emulatorman@parabola.nu>
# Contributor: Luke Shumaker <lukeshu@parabola.nu>
+# 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=(ruby ruby-docs)
pkgver=2.4.1
-_jsonver=1.8.1
-pkgrel=3.parabola2
-_srcrel=1 # increment this to rebuild the sourceball without bumping pkgver
+_jsonver=2.0.2
+pkgrel=3.parabola3
+_srcrel=2 # increment this to rebuild the sourceball without bumping pkgver
arch=(i686 x86_64 armv7h)
url='http://www.ruby-lang.org/en/'
license=(BSD2 custom)
@@ -20,41 +27,47 @@ makedepends=(gdbm openssl libffi doxygen graphviz libyaml ttf-dejavu tk)
options=(!emptydirs)
source=(https://repo.parabola.nu/other/ruby-libre/ruby-${pkgver}-libre${_srcrel}.tar.gz
gemrc)
-sha1sums=('2f110797f2188c05231e4a5c11aa1a30493f2c0f'
+sha1sums=('ca7ca50c2e96200062afe081bf82c2cfaa3d18a1'
'dc536754c8fac2c3d82965c5a708cd8f79562d98')
mkdepends=('ruby') # for 'gem build'
mksource=(https://cache.ruby-lang.org/pub/ruby/${pkgver:0:3}/ruby-${pkgver}.tar.xz
- ruby-${pkgver:0:3}-libre.patch
+ 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=('e6fd290b6edd166348b70f0f1c56f7ed9d956c4c1eb91d97d0548041ca4196b9b75ec1ad35c745bdbfd4de195899093e7205d7f02b014ecf1c48e6f31cf25903'
- 'fbb204bfbd1866b03f6e57b4d260fa8a62de9391d340ba081e8bf017b25f848b229ae54bedc2d4adff78e0195da400319aa3bf42716f1e67135895d436e7bdae'
- '58906415c3f9a573950fe9c0606f808c8b9b1198ac08cd995fbec03ab1e315a5cff504245958a303dabf0e0fb3466abfd35f3c3b536161f805f1abccc9f5ccb6'
- '3e3e2d48522fea84855e5305e08e7f8cc2ec7a2643c8882bc0a260c821ccdb16e70590d7ceec916d0d09297486b3c5bb6a1b4b31f670ec4ede72a429255db317')
+ 'a7b6a5a6da4861ee51f3e9a9064c39ef1e5f2efb7d969f20f93028acfa0eed0264c336fce2eb1c6a3bdcdc595ef2cf3441b5db7cd4eebf5f24e5cb4a19a7d915'
+ '29185acc7ea3ad48e805945e53717bfd8483a0581236eb49e63eb8e9f467ddcede38a606d089aa35e5fb73099a1ebdb253fc4c51a7933b900fc36918a43628b8'
+ '405f09681808c108ec4a889f7628ede4aec15122c8a6848b5a7ec99a17bd8d72bf410152461164acd0f17d92a460732bf525c26a17b319b94dc940dccf6d3ebf'
+ '1882619e98fa4b6cc2738c25ebf0ba957499f6b20f6837f23379b90700a6a751d0a9be85032f1c9e1d98f8d839784a3caa611266ad68e311dd3747cb0396b817'
+ '53459f8971e87a3a5dfff3e72be5d27460a624eff06ccabb57bef1fd039c77d67f0f9eecdc03661c929d9eda9bff8f86383c9b16b15602a874bcf1914aecf633')
mksource() {
- # First build a libre version of json-${_jsonver}.gem
+ # Start with the vanilla version of json
cd "$srcdir/json-${_jsonver}"
- rm -rf ext
+ # Apply changes made to it for the ruby distribution
+ patch -p1 -i ../json-${_jsonver}-ruby-${pkgver}-backports.patch
+ # 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
- gem build json.gemspec
- mv json-${_jsonver}.gem ..
+
+ # 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}"
-
- # Modify the Ruby sources to use the json .gem we created above.
- cd "$srcdir/ruby-${pkgver}"
- # remove the supplied json version
- rm -rv ext/json test/json
- patch -p1 -i ../ruby-${pkgver:0:3}-libre.patch
- # and insert ours
- cp ../"json-${_jsonver}.gem" gems/
- mkdir -p gems/json-${_jsonver}
- cd gems/json-${_jsonver}
- bsdtar xqOf ../json-${_jsonver}.gem data.tar.gz | bsdtar xzf -
}
build() {
@@ -110,4 +123,8 @@ package_ruby-docs() {
install -D -m644 COPYING "${pkgdir}/usr/share/licenses/ruby-docs/LICENSE"
install -D -m644 BSDL "${pkgdir}/usr/share/licenses/ruby-docs/BSDL"
+
+ # sometimes it installs ruby/capi/doxygen_objdb_XXXXXXX.tmp;
+ # otherwise /usr/share/doc is empty
+ rm -rf "$pkgdir/usr/share/doc"
}