From e442eb024321696e82d503881d4d85e7ae3cfd93 Mon Sep 17 00:00:00 2001 From: Omar Vega Ramos Date: Sun, 7 Jan 2018 13:59:22 -0500 Subject: Add ruby2.4 --- libre/ruby2.4/PKGBUILD | 110 ++++++++++++++++++++++++ libre/ruby2.4/json-2.0.4-libre.patch | 32 +++++++ libre/ruby2.4/ruby-2.4.3-add-json_pure.patch | 22 +++++ libre/ruby2.4/ruby-2.4.3-remove-json-ext.patch | 114 +++++++++++++++++++++++++ 4 files changed, 278 insertions(+) create mode 100644 libre/ruby2.4/PKGBUILD create mode 100644 libre/ruby2.4/json-2.0.4-libre.patch create mode 100644 libre/ruby2.4/ruby-2.4.3-add-json_pure.patch create mode 100644 libre/ruby2.4/ruby-2.4.3-remove-json-ext.patch (limited to 'libre') diff --git a/libre/ruby2.4/PKGBUILD b/libre/ruby2.4/PKGBUILD new file mode 100644 index 000000000..2e4a4f545 --- /dev/null +++ b/libre/ruby2.4/PKGBUILD @@ -0,0 +1,110 @@ +# 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: Omar Vega Ramos + +# 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.4 +pkgname=ruby2.4 +pkgver=${_rubyver}.3 +_jsonver=2.0.4 +pkgdesc='An object-oriented language for quick and easy programming' +pkgrel=1.parabola1 +_srcrel=1 # increment this to rebuild the sourceball without bumping pkgver +arch=(i686 x86_64 armv7h) +url='http://www.ruby-lang.org/en/' +license=(BSD custom) +depends=(gdbm openssl libffi libyaml gmp zlib) +optdepends=('tk: for Ruby/TK') +makedepends=(doxygen graphviz ttf-dejavu tk) +options=(!emptydirs) +source=(https://repo.parabola.nu/other/ruby-libre/ruby-${pkgver}-libre${_srcrel}.tar.gz) +sha512sums=('bf754b0cc507d50530e64b16ff8c1a18d8dc657f00ec8e225e92f8cae8bfdf69b286c9acec70eb206883c2a3ad3ef0b593ce447441ac6893cac54f0194c40596') + +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}-libre.patch) +mksha512sums=('8bcf60c994a96787da5d743c66f5609a5a6d834d6d61243cdea7fd059197c3b10da43c99e5649be85e2f2329eedcbb1dd76e89ce3ac586be9056348f7449ed09' + 'a7b6a5a6da4861ee51f3e9a9064c39ef1e5f2efb7d969f20f93028acfa0eed0264c336fce2eb1c6a3bdcdc595ef2cf3441b5db7cd4eebf5f24e5cb4a19a7d915' + '303172561a4ba54515fddfd9ea7e0c833e550b0ae5e9f331956f178f8c5e20aa0e3c4036251ddfd04312769ef7d71d83fde0afe64f6fa8e9052ca5a294c62927' + '9f310b46184dec0499fd77a06d4ffade267e1a612b3f4401cf568ff10f9e096411e55498bcafdd6e9723b6c9176ac5041f68f3e3fbb9fa14cd8716bbd97b8a2a' + '582017bd0f98878c0ac6f4625854422662d83ae6274a34762082a720052023780dceb17694b1f4e18d9a0dcbb525990341176eac31040aa63099a8b3a8d52071') + +mksource() { + # Start with the vanilla version of json + cd "$srcdir/json-${_jsonver}" + # 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} + + 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" +} diff --git a/libre/ruby2.4/json-2.0.4-libre.patch b/libre/ruby2.4/json-2.0.4-libre.patch new file mode 100644 index 000000000..04eced89d --- /dev/null +++ b/libre/ruby2.4/json-2.0.4-libre.patch @@ -0,0 +1,32 @@ +--- a/lib/json.rb 2017-04-18 04:16:28.000000000 -0500 ++++ b/lib/json.rb 2018-01-07 12:54:09.516275320 -0500 +@@ -55,9 +55,5 @@ + module JSON + require 'json/version' + +- begin +- require 'json/ext' +- rescue LoadError +- require 'json/pure' +- end ++ require 'json/pure' + end +--- a/tests/test_helper.rb 2017-04-18 04:16:28.000000000 -0500 ++++ b/tests/test_helper.rb 2018-01-07 12:55:21.359687486 -0500 +@@ -1,14 +1,5 @@ +-case ENV['JSON'] +-when 'pure' +- $:.unshift 'lib' +- require 'json/pure' +-when 'ext' +- $:.unshift 'ext', 'lib' +- require 'json/ext' +-else +- $:.unshift 'ext', 'lib' +- require 'json' +-end ++$:.unshift 'lib' ++require 'json' + + require 'test/unit' + begin diff --git a/libre/ruby2.4/ruby-2.4.3-add-json_pure.patch b/libre/ruby2.4/ruby-2.4.3-add-json_pure.patch new file mode 100644 index 000000000..5630451ea --- /dev/null +++ b/libre/ruby2.4/ruby-2.4.3-add-json_pure.patch @@ -0,0 +1,22 @@ +diff --git a/doc/maintainers.rdoc b/doc/maintainers.rdoc +index ec6a6b7134..11a1079e57 100644 +--- a/doc/maintainers.rdoc ++++ b/doc/maintainers.rdoc +@@ -72,6 +72,8 @@ Zachary Scott (zzak) + Akinori MUSHA (knu) + [lib/irb.rb, lib/irb/*] + Keiju ISHITSUKA (keiju) ++[lib/json] ++ NARUSE, Yui (naruse) + [lib/logger.rb] + Naotoshi Seo (sonots) + [lib/mathn.rb] +diff --git a/lib/json/.document b/lib/json/.document +new file mode 100644 +index 0000000000..7ae6b614de +--- /dev/null ++++ b/lib/json/.document +@@ -0,0 +1,3 @@ ++*.rb ++add/*.rb ++pure/*.rb diff --git a/libre/ruby2.4/ruby-2.4.3-remove-json-ext.patch b/libre/ruby2.4/ruby-2.4.3-remove-json-ext.patch new file mode 100644 index 000000000..4005e4ccf --- /dev/null +++ b/libre/ruby2.4/ruby-2.4.3-remove-json-ext.patch @@ -0,0 +1,114 @@ +diff --git a/LEGAL b/LEGAL +index 8080cfef61..d5dfef033c 100644 +--- a/LEGAL ++++ b/LEGAL +@@ -593,28 +593,6 @@ ext/digest/sha2/sha2.[ch]: + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + +-ext/json/generator/generator.c: +- +- Copyright 2001-2004 Unicode, Inc. +- +- Disclaimer +- +- This source code is provided as is by Unicode, Inc. No claims are +- made as to fitness for any particular purpose. No warranties of any +- kind are expressed or implied. The recipient agrees to determine +- applicability of information provided. If this file has been +- purchased on magnetic or optical media from Unicode, Inc., the +- sole remedy for any claim will be exchange of defective media +- within 90 days of receipt. +- +- Limitations on Rights to Redistribute This Code +- +- Unicode, Inc. hereby grants the right to freely use the information +- supplied in this file in the creation of products supporting the +- Unicode Standard, and to make copies of this file in any form +- for internal or external distribution as long as this notice +- remains attached. +- + ext/nkf/nkf-utf8/config.h: + ext/nkf/nkf-utf8/nkf.c: + ext/nkf/nkf-utf8/utf8tbl.c: +diff --git a/common.mk b/common.mk +index 3f4bcf6c3a..6c5bea5402 100644 +--- a/common.mk ++++ b/common.mk +@@ -814,8 +814,7 @@ EXT_SRCS = $(srcdir)/ext/ripper/ripper.c \ + + srcs-ext: $(EXT_SRCS) + +-srcs-extra: $(srcdir)/ext/json/parser/parser.c \ +- $(srcdir)/ext/date/zonetab.h \ ++srcs-extra: $(srcdir)/ext/date/zonetab.h \ + $(empty) + + LIB_SRCS = $(srcdir)/lib/unicode_normalize/tables.rb +@@ -911,11 +910,6 @@ $(srcdir)/ext/ripper/ripper.c: $(srcdir)/parse.y id.h + Q=$(Q) ECHO=$(ECHO) RM="$(RM)" top_srcdir=../.. srcdir=. VPATH="$(PWD)" \ + RUBY="$(BASERUBY)" PATH_SEPARATOR="$(PATH_SEPARATOR)" + +-$(srcdir)/ext/json/parser/parser.c: $(srcdir)/ext/json/parser/parser.rl +- $(ECHO) generating $@ +- $(Q) $(CHDIR) $(@D) && $(exec) $(MAKE) -f prereq.mk $(MFLAGS) \ +- Q=$(Q) ECHO=$(ECHO) top_srcdir=../../.. srcdir=. VPATH=../../.. BASERUBY="$(BASERUBY)" +- + $(srcdir)/ext/date/zonetab.h: $(srcdir)/ext/date/zonetab.list + $(ECHO) generating $@ + $(Q) $(CHDIR) $(@D) && $(exec) $(MAKE) -f prereq.mk $(MFLAGS) \ +diff --git a/doc/maintainers.rdoc b/doc/maintainers.rdoc +index d22d09f7a4..ec6a6b7134 100644 +--- a/doc/maintainers.rdoc ++++ b/doc/maintainers.rdoc +@@ -209,8 +209,6 @@ Zachary Scott (zzak) + Nobuyuki Nakada (nobu) + [ext/io/wait] + Nobuyuki Nakada (nobu) +-[ext/json] +- NARUSE, Yui (naruse) + [ext/mathn/complex] + Keiju ISHITSUKA (keiju) + [ext/mathn/rational] +diff --git a/ext/.document b/ext/.document +index 2e6fc78879..f5da0912ed 100644 +--- a/ext/.document ++++ b/ext/.document +@@ -35,9 +35,6 @@ io/console/console.c + io/nonblock/nonblock.c + io/wait/lib + io/wait/wait.c +-json/ext/generator/generator.c +-json/ext/parser/parser.c +-json/lib + mathn/complex/complex.c + mathn/rational/rational.c + nkf/lib +diff --git a/ext/Setup b/ext/Setup +index 0929d647ae..7d5e99bca7 100644 +--- a/ext/Setup ++++ b/ext/Setup +@@ -20,9 +20,6 @@ + #io/console + #io/nonblock + #io/wait +-#json +-#json/generator +-#json/parser + #mathn/complex + #mathn/rational + #nkf +diff --git a/ext/Setup.nacl b/ext/Setup.nacl +index eb8a1a70cd..4b1cca1392 100644 +--- a/ext/Setup.nacl ++++ b/ext/Setup.nacl +@@ -22,9 +22,6 @@ + # io/console + # io/nonblock + # io/wait +-# #json +-# json/generator +-# json/parser + # mathn/complex + # mathn/rational + # nkf -- cgit v1.2.3