PKGBUILD 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. # Contributor: 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. # parabola changes and rationale:
  11. # - replace non-free 'generator.c' in bundled JSON extension
  12. # https://labs.parabola.nu/issues/674
  13. # https://bugs.ruby-lang.org/issues/11844
  14. # https://github.com/flori/json/issues/277
  15. # https://github.com/flori/json/pull/567
  16. # - specify *which* BSD license
  17. pkgname=ruby2.7
  18. pkgver=2.7.8
  19. pkgrel=1
  20. arch=(x86_64)
  21. pkgdesc='An object-oriented language for quick and easy programming, version 2.7'
  22. url='https://www.ruby-lang.org/en/'
  23. license=(BSD custom)
  24. depends=(libxcrypt gdbm openssl libffi libyaml gmp zlib)
  25. optdepends=(
  26. 'tk: for Ruby/TK'
  27. )
  28. makedepends=(tk)
  29. options=(!emptydirs !lto) # Disable LTO until fixes for https://bugs.ruby-lang.org/issues/18062 released
  30. _osslver=3.0.0
  31. source=(https://cache.ruby-lang.org/pub/ruby/${pkgver:0:3}/ruby-${pkgver}.tar.xz
  32. ruby2.7-do-not-depend-on-ext-openssl-deprecation-rb.patch::https://github.com/ruby/ruby/commit/28f3e038805a4f396f228c6884c531677c075867.patch
  33. ruby-openssl-$_osslver.tar.xz::https://github.com/ruby/openssl/archive/refs/tags/v$_osslver.tar.gz)
  34. sha512sums=('c7d9761f81a89b7448114b4ba2b29db568fc843f1da0f4af68b2071edc32b6081af6ab57b451e061288fd7072cbb1a767a0f6d783e55383ff36de80baeb9748b'
  35. 'SKIP'
  36. '743e19a2aeadf166eb604de02cf48cccc2101719b8a36be738de74262a75f33ba07ce273dd545ec86a2fcec9754e5e19960f7f7677049d714d8d91cc18edbff2'
  37. '076d2924b61c4f7704b47718a33732fb5285a3af39f328ed9e83add36589da99dfae73b3e893398fc3f2a74dcbead0b66edc682040fa1b48f9530894c7187f95')
  38. # Parabola: Mundane packaging considerations.
  39. license=( ${license[*]/BSD/custom:BSD-2-Clause} )
  40. arch+=(i686 armv7h)
  41. pkgrel+=.parabola1
  42. # Parabola: Replace the CVTUTF code with a free implementation.
  43. # https://github.com/flori/json/pull/567
  44. # We need to do this in mksource() (not of prepare()) so that the
  45. # .src.pkg.tar file doesn't include nonfree sources.
  46. _jsonver=b67679c13bca877e20b7fcd47fb1365f5cc01eb5
  47. _srcrel=1 # increment this to rebuild the sourceball (mksource, _jsonver) without bumping pkgver
  48. mksource=("${source[0]}"
  49. "ruby-json-${_jsonver}.tar.gz::https://github.com/parabola-gnulinuxlibre/ruby-json/archive/${_jsonver}.tar.gz"
  50. 0001-Prep-to-use-Parabola-s-patched-ruby-json.patch)
  51. mksha512sums=('4b49dff3e1c2e79d914e10418e4c03026f5d4c137dc337f5c720fe26cb9fcdcf4afc6b7c967356cf5fbe04cc5ef431174c48a035becf3e2322c2c45d3c9b2f59'
  52. '359aa5209740e902d25d947a37a4e7d2005fed531946201cc8fa4667f78d3231a7751c34b5c6b8a8127cb828e1af90706b3150478e48babcfa17ab3ef538df50'
  53. 'd57421b5bd19219d9b275eaa07af7fc64b0d7d4755240baf0c8fcc0045197d0d2e6b2500a47228deb713fda25c175e4e2cf1c44d2753505ea160999a4415aab7')
  54. source=("https://repo.parabola.nu/other/ruby-libre/ruby-${pkgver}-libre${_srcrel}.tar.gz"{,.sig} "${source[@]:1}")
  55. mkdepends=(ruby)
  56. mksource() {
  57. mkdir "$srcdir/ruby"
  58. mv -T "$srcdir/ruby-$pkgver" "$srcdir/ruby/ruby"
  59. mkdir "$srcdir/flori"
  60. mv -T "$srcdir/ruby-json-$_jsonver" "$srcdir/flori/json"
  61. pushd "$srcdir/ruby/ruby"
  62. patch -p1 -i ../../0001-Prep-to-use-Parabola-s-patched-ruby-json.patch
  63. ruby tool/sync_default_gems.rb json
  64. popd
  65. mv -T "$srcdir/ruby/ruby" "$srcdir/ruby-${pkgver}"
  66. rm -rf -- "$srcdir/ruby" "$srcdir/flori"
  67. }
  68. prepare() {
  69. cd ruby-${pkgver}
  70. patch -Np1 -i ../ruby2.7-do-not-depend-on-ext-openssl-deprecation-rb.patch
  71. rm -rf ext/openssl test/openssl
  72. mv ../openssl-$_osslver/ext/openssl ext
  73. mv ../openssl-$_osslver/lib ext/openssl
  74. mv ../openssl-$_osslver/{History.md,openssl.gemspec} ext/openssl
  75. mv ../openssl-$_osslver/test/openssl test
  76. }
  77. build() {
  78. cd ruby-${pkgver}
  79. # this uses malloc_usable_size, which is incompatible with fortification level 3
  80. export CFLAGS="${CFLAGS/_FORTIFY_SOURCE=3/_FORTIFY_SOURCE=2}"
  81. export CXXFLAGS="${CXXFLAGS/_FORTIFY_SOURCE=3/_FORTIFY_SOURCE=2}"
  82. ./configure \
  83. --prefix=/usr \
  84. --program-suffix=-2.7 \
  85. --with-soname=ruby-2.7 \
  86. --sysconfdir=/etc \
  87. --localstatedir=/var \
  88. --sharedstatedir=/var/lib \
  89. --libexecdir=/usr/lib/ruby \
  90. --enable-shared \
  91. --disable-rpath \
  92. --with-dbm-type=gdbm_compat \
  93. --disable-install-doc
  94. make
  95. }
  96. package() {
  97. cd ruby-${pkgver}
  98. make DESTDIR="${pkgdir}" install-nodoc
  99. install -D -m644 COPYING "${pkgdir}/usr/share/licenses/ruby2.7/LICENSE"
  100. install -D -m644 BSDL "${pkgdir}/usr/share/licenses/ruby2.7/BSDL"
  101. # remove files conflicting with 'ruby' package
  102. rm -r "$pkgdir"/usr/share/man/
  103. }