l_template_changes.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --- template.orig 2020-11-23 22:44:13.976004000 +0600
  2. +++ template 2020-11-24 22:09:08.930216000 +0600
  3. @@ -5,2 +5,4 @@ pkgname=ruby
  4. version=2.7.2
  5. +# Liberation: Adds pure Ruby json version
  6. +_jsonver=2.3.0
  7. revision=1
  8. @@ -18,4 +20,7 @@ maintainer="Leah Neukirchen <leah@vuxu.o
  9. license="Ruby, BSD-2-Clause"
  10. -distfiles="https://cache.ruby-lang.org/pub/ruby/${version%.*}/${pkgname}-${version}.tar.bz2"
  11. -checksum=65a590313d244d48dc2ef9a9ad015dd8bc6faf821621bbb269aa7462829c75ed
  12. +# Liberation: Adds pure Ruby json distfile
  13. +distfiles="https://cache.ruby-lang.org/pub/ruby/${version%.*}/${pkgname}-${version}.tar.bz2
  14. + https://github.com/flori/json/archive/v${_jsonver}.tar.gz"
  15. +checksum="65a590313d244d48dc2ef9a9ad015dd8bc6faf821621bbb269aa7462829c75ed
  16. + b8a7576b9b6dfb997d9b3911e13b2e5b1bde50ff1f5aea46b116c560649ec1a4"
  17. @@ -55,2 +60,24 @@ post_patch() {
  18. patch -sNp1 -i ${FILESDIR}/rubygems-avoid-platform-specific-gems.patch
  19. +
  20. + # Liberation: Implement pure Ruby json
  21. + # Some codes are taken from:
  22. + # https://git.parabola.nu/abslibre.git/tree/libre/ruby/PKGBUILD
  23. + cd "${XBPS_BUILDDIR}/json-${_jsonver}"
  24. +
  25. + # Modify 'json' so that it doesn't try to load (non-free!) 'json/ext'
  26. + echo "applying json-libre.patch to json"
  27. + rm -rf -- json.gemspec ext lib/json/ext*
  28. + patch -p1 -i "${FILESDIR}/json-libre.patch"
  29. +
  30. + # Now remove the json ext from the ruby sources
  31. + cd "${XBPS_BUILDDIR}/${wrksrc}"
  32. + rm -r ext/json test/json
  33. +
  34. + # and insert the json_pure lib instead
  35. + cp -r ../json-${_jsonver}/lib/* -t lib/
  36. + cp ../json-${_jsonver}/json_pure.gemspec -t lib/json/
  37. + cp -rT ../json-${_jsonver}/tests test/json
  38. +
  39. + # Clean up the original json sources
  40. + rm -rf "{XBPS_BUILDDIR}/json-${_jsonver}"
  41. }