PKGBUILD 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. # Contributor (arch): Thomas Dziedzic <gostrc@gmail.com>
  2. # Contributor: Allan McRae <allan@archlinux.org>
  3. # Contributor: John Proctor <jproctor@prium.net>
  4. # Contributor: Jeramy Rutley <jrutley@gmail.com>
  5. # Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
  6. # Contributor: Daniel Milewski <niitotantei@riseup.net>
  7. # Contributor: André Silva <emulatorman@hyperbola.info>
  8. # Contributor: Luke Shumaker <lukeshu@parabola.nu>
  9. # Contributor: fauno <fauno@parabola.nu>
  10. # Rationale for inclusion in [libre]: Problematic license of
  11. # generator.c in bundled json extension.
  12. #
  13. # https://labs.parabola.nu/issues/674
  14. # https://bugs.ruby-lang.org/issues/11844
  15. # https://github.com/flori/json/issues/277
  16. pkgname=ruby2.7
  17. pkgver=2.7.3
  18. _json_ver=2.3.0
  19. pkgrel=1
  20. pkgrel+=.parabola1
  21. arch=(x86_64)
  22. arch+=(i686 armv7h)
  23. url='https://www.ruby-lang.org/en/'
  24. license=(BSD custom)
  25. license=(${license[*]/BSD/BSD2/})
  26. depends=(libxcrypt gdbm openssl libffi libyaml gmp zlib)
  27. optdepends=(
  28. 'tk: for Ruby/TK'
  29. )
  30. makedepends=(tk)
  31. provides=(ruby)
  32. options=(!emptydirs)
  33. source=(https://cache.ruby-lang.org/pub/ruby/${pkgver:0:3}/ruby-${pkgver}.tar.xz)
  34. source+=(json-${_json_ver}.tar.gz::https://github.com/flori/json/archive/v${_json_ver}.tar.gz
  35. json-libre.patch
  36. ruby-remove-json-ext.patch
  37. ruby-add-json_pure.patch)
  38. sha512sums=('b755d418b3bab2f9f6a8893afd13869269f17065643dde78b9e85ae3538a6d0617893db6e9c3908e00a40c7577a5c912a7c822d8f245cdcfb857be76dfb66c1e')
  39. sha512sums+=('0cda44a77212748d9513e61314dfbc7c0cf82beebcc56eb8b043e4ada698bc475502100389b80fa5c9090341fd1c6d2841fc5c9332e520f1c8dd1084ca505379'
  40. '582017bd0f98878c0ac6f4625854422662d83ae6274a34762082a720052023780dceb17694b1f4e18d9a0dcbb525990341176eac31040aa63099a8b3a8d52071'
  41. 'f952db3774f5eb5bc6c445b690262a883553b51f42dfdcc802c6de5bc2b2907d73472ede38d9d7a1b8efe8fc9cd00e64d986d78353f0a1c86497f71ebd522c48'
  42. '9ff8a2ec9fdecd05fd506ed6f977dcd483e47611dc6bbe6c4622100a2071c0f6c7b3f813a94b73bebb9f0ed7fe9f6257289cdf971030ad525a3c8a0d065b09c2')
  43. prepare() {
  44. cd "$srcdir/json-${_json_ver}"
  45. # Modify 'json' so that it doesn't try to load (non-free!) 'json/ext'
  46. echo "applying json-libre.patch"
  47. rm -rf -- json.gemspec ext lib/json/ext*
  48. patch -p1 -i ../json-libre.patch
  49. # Now remove the json ext from the ruby sources
  50. cd "$srcdir/ruby-${pkgver}"
  51. echo "applying ruby-remove-json-ext.patch"
  52. rm -r ext/json test/json
  53. patch -p1 -i ../ruby-remove-json-ext.patch
  54. # and insert the json_pure lib instead
  55. echo "applying ruby-add-json_pure.patch"
  56. cp -r ../json-${_json_ver}/lib/* -t lib/
  57. cp ../json-${_json_ver}/json_pure.gemspec -t lib/json/
  58. cp -rT ../json-${_json_ver}/tests test/json
  59. patch -p1 -i ../ruby-add-json_pure.patch
  60. # Delete original json sources
  61. cd "$srcdir"
  62. rm -rf "json-${_json_ver}"
  63. }
  64. build() {
  65. cd ruby-${pkgver}
  66. ./configure \
  67. --prefix=/usr \
  68. --program-suffix=-2.7 \
  69. --with-soname=ruby-2.7 \
  70. --sysconfdir=/etc \
  71. --localstatedir=/var \
  72. --sharedstatedir=/var/lib \
  73. --libexecdir=/usr/lib/ruby \
  74. --enable-shared \
  75. --disable-rpath \
  76. --with-dbm-type=gdbm_compat \
  77. --disable-install-doc
  78. make
  79. }
  80. package() {
  81. cd ruby-${pkgver}
  82. make DESTDIR="${pkgdir}" install-nodoc
  83. install -D -m644 COPYING "${pkgdir}/usr/share/licenses/ruby2.7/LICENSE"
  84. install -D -m644 BSDL "${pkgdir}/usr/share/licenses/ruby2.7/BSDL"
  85. # remove files conflicting with 'ruby' package
  86. rm -r "$pkgdir"/usr/share/man/
  87. }