summaryrefslogtreecommitdiff
path: root/libre/ruby
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-06-23 22:56:35 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2017-06-23 23:09:19 -0400
commit7fb951ae581a543f924a308fa6f71bc36e04fff2 (patch)
treeb45513cc7559f69789ca8d56274279a73edaaa27 /libre/ruby
parentd8bf5e41cae0442f8c6bb8aeb1c659d1378c472c (diff)
libre/ruby: Clean up (bump pkgrel 3.parabola1 -> 3.parabola2)
The mksource() function was a shitshow. I mean no disrespect towards niitotantei, the user who originally contributed it. But he should have been given feedback, rather than it just being added as-is to Parabola (*cough* André). The new source tarball (ruby-2.4.1-libre1.tar.gz) should be functionally identical to old one (ruby-libre-2.4.1.tar.xz); it doesn't include a "json-1.8.1/" directory in the root, and the json-1.8.1.gem file is slightly different (the file contains some timestamps, and the version of 'gem' that created it): $ diff -r src.bak/ruby-2.4.1 src/ruby-2.4.1 Binary files src.bak/ruby-2.4.1/gems/json-1.8.1.gem and src/ruby-2.4.1/gems/json-1.8.1.gem differ The old mksource() function *almost* created the json-1.8.1.gem file, but didn't; instead checking in a pre-generated json-1.8.1.gem to git. That said, there are still problems: - The json gem is now on 2.1.0, not 1.8.1, and needs to be updated here - There are problems shipping it as a gem https://labs.parabola.nu/issues/1376 But IMO, this is a necessary step to resolving either of these, because it allows us to now answer "how was 1.8.1 being modified; what do we need to carry forward?"
Diffstat (limited to 'libre/ruby')
-rw-r--r--libre/ruby/PKGBUILD74
-rw-r--r--libre/ruby/json-1.8.1-libre.patch (renamed from libre/ruby/remove-nonfree-json-references.patch)0
-rw-r--r--libre/ruby/json-1.8.1.gembin124416 -> 0 bytes
-rw-r--r--libre/ruby/ruby-2.4-libre.patch (renamed from libre/ruby/remove-nonfree-ruby-references.patch)0
4 files changed, 39 insertions, 35 deletions
diff --git a/libre/ruby/PKGBUILD b/libre/ruby/PKGBUILD
index 11cb2d7c1..a837f85b4 100644
--- a/libre/ruby/PKGBUILD
+++ b/libre/ruby/PKGBUILD
@@ -2,55 +2,59 @@
# Contributor (Arch): Allan McRae <allan@archlinux.org>
# Contributor (Arch): John Proctor <jproctor@prium.net>
# Contributor (Arch): Jeramy Rutley <jrutley@gmail.com>
-# Maintainer: Daniel Milewski <niitotantei@riseup.net>
-# Contributor: André Silva <emulatorman@parabola.nu>
+
# Maintainer: fauno <fauno@parabola.nu>
+# Contributor: Daniel Milewski <niitotantei@riseup.net>
+# Contributor: André Silva <emulatorman@parabola.nu>
+# Contributor: Luke Shumaker <lukeshu@parabola.nu>
pkgname=(ruby ruby-docs)
pkgver=2.4.1
_jsonver=1.8.1
-pkgrel=3.parabola1
+pkgrel=3.parabola2
+_srcrel=1 # increment this to rebuild the sourceball without bumping pkgver
arch=(i686 x86_64 armv7h)
url='http://www.ruby-lang.org/en/'
-license=(custom:BSDL custom:Ruby)
+license=(BSD2 custom)
makedepends=(gdbm openssl libffi doxygen graphviz libyaml ttf-dejavu tk)
options=(!emptydirs)
-mksource=(https://cache.ruby-lang.org/pub/ruby/${pkgver:0:3}/ruby-${pkgver}.tar.xz
- https://github.com/flori/json/archive/v${_jsonver}.tar.gz
- remove-nonfree-json-references.patch
- remove-nonfree-ruby-references.patch
- json-${_jsonver}.gem)
-source=(https://repo.parabola.nu/other/ruby-libre/ruby-libre-${pkgver}.tar.xz
+source=(https://repo.parabola.nu/other/ruby-libre/ruby-${pkgver}-libre${_srcrel}.tar.gz
gemrc)
+sha1sums=('2f110797f2188c05231e4a5c11aa1a30493f2c0f'
+ '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
+ json-${_jsonver}.tar.gz::https://github.com/flori/json/archive/v${_jsonver}.tar.gz
+ json-${_jsonver}-libre.patch)
mksha512sums=('e6fd290b6edd166348b70f0f1c56f7ed9d956c4c1eb91d97d0548041ca4196b9b75ec1ad35c745bdbfd4de195899093e7205d7f02b014ecf1c48e6f31cf25903'
- '58906415c3f9a573950fe9c0606f808c8b9b1198ac08cd995fbec03ab1e315a5cff504245958a303dabf0e0fb3466abfd35f3c3b536161f805f1abccc9f5ccb6'
- '3e3e2d48522fea84855e5305e08e7f8cc2ec7a2643c8882bc0a260c821ccdb16e70590d7ceec916d0d09297486b3c5bb6a1b4b31f670ec4ede72a429255db317'
'fbb204bfbd1866b03f6e57b4d260fa8a62de9391d340ba081e8bf017b25f848b229ae54bedc2d4adff78e0195da400319aa3bf42716f1e67135895d436e7bdae'
- '59ce07837a3e522f0afdeee7084ef159dde8dce881060895f20c0efb9795f2b2675695671a0ebf93609d860a1d13bbf381fb101084f2ea07de06a058ecb75b7f')
-sha512sums=('d6db642c8091ce40300591b9eb82d58558b58465f20adc34dbed43f0c462122b17087640c47af2ee7c566c7b0407c39a4100606aaad45849b7d3d767adeff8f2'
- '8cafd14d414ee3c16aa94f79072bc6c100262f925dc1300e785846c3fabbbbffc1356b8e2223af5684e3340c55032d41231179ffa948bb12e01dbae0f4131911')
+ '58906415c3f9a573950fe9c0606f808c8b9b1198ac08cd995fbec03ab1e315a5cff504245958a303dabf0e0fb3466abfd35f3c3b536161f805f1abccc9f5ccb6'
+ '3e3e2d48522fea84855e5305e08e7f8cc2ec7a2643c8882bc0a260c821ccdb16e70590d7ceec916d0d09297486b3c5bb6a1b4b31f670ec4ede72a429255db317')
mksource() {
- rm -rv ruby-${pkgver}/ext/json
- rm -rv ruby-${pkgver}/test/json
- rm -rv json-${_jsonver}/ext
-
- cd ruby-${pkgver}
-
- install -D -m644 ${srcdir}/json-${_jsonver}.gem gems
-
- patch -Np1 -i ${srcdir}/remove-nonfree-ruby-references.patch
-
- # extract the gem. if it isn't extract like the other bundled gems,
- # the gem dir will be created with u-w permissions for some reason.
- install -d -m 755 gems/json-${_jsonver}
+ # First build a libre version of json-${_jsonver}.gem
+ cd "$srcdir/json-${_jsonver}"
+ rm -rf ext
+ patch -p1 -i ../json-${_jsonver}-libre.patch
+ gem build json.gemspec
+ mv json-${_jsonver}.gem ..
+
+ # 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 xvzf -
-
- cd ${srcdir}/json-${_jsonver}
-
- patch -Np1 -i ${srcdir}/remove-nonfree-json-references.patch
+ bsdtar xqOf ../json-${_jsonver}.gem data.tar.gz | bsdtar xzf -
}
build() {
@@ -76,7 +80,7 @@ check() {
}
package_ruby() {
- pkgdesc='An object-oriented language for quick and easy programming, with free variant of json gem'
+ pkgdesc='An object-oriented language for quick and easy programming'
depends=(gdbm openssl libffi libyaml gmp zlib)
optdepends=(
'ruby-docs: Ruby documentation'
diff --git a/libre/ruby/remove-nonfree-json-references.patch b/libre/ruby/json-1.8.1-libre.patch
index 4fb5dd1e2..4fb5dd1e2 100644
--- a/libre/ruby/remove-nonfree-json-references.patch
+++ b/libre/ruby/json-1.8.1-libre.patch
diff --git a/libre/ruby/json-1.8.1.gem b/libre/ruby/json-1.8.1.gem
deleted file mode 100644
index 6c1362988..000000000
--- a/libre/ruby/json-1.8.1.gem
+++ /dev/null
Binary files differ
diff --git a/libre/ruby/remove-nonfree-ruby-references.patch b/libre/ruby/ruby-2.4-libre.patch
index 3f6647cca..3f6647cca 100644
--- a/libre/ruby/remove-nonfree-ruby-references.patch
+++ b/libre/ruby/ruby-2.4-libre.patch