PKGBUILD 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. # Maintainer: Luke T. Shumaker <lukeshu@parabola.nu>
  2. # Maintainer (arch): Anatol Pomozov <anatol.pomozov@gmail.com>
  3. # Maintainer (arch): Andreas 'Segaja' Schleifer <segaja at archlinux dot org>
  4. # Parabola changes and rationale:
  5. #
  6. # FSDG:
  7. # - Disable default TPPM (rubygems.org, which hosts non-free packages).
  8. # https://wiki.parabola.nu/TPPM_Liberation_Project
  9. pkgname=rubygems
  10. pkgver=3.4.19
  11. pkgrel=1
  12. pkgrel+=.parabola1
  13. pkgdesc='Package management framework for Ruby'
  14. arch=('any')
  15. url='https://rubygems.org/'
  16. license=('MIT')
  17. depends=(
  18. ruby
  19. )
  20. makedepends=(
  21. rubygems
  22. ruby-default-gems-bootstrap # Parabola: which 'rubygems' implementation to use for bootstrapping
  23. ruby-rdoc
  24. )
  25. checkdepends=(
  26. cmake
  27. git
  28. ruby-rake
  29. ruby-test-unit
  30. ruby-webrick
  31. )
  32. provides=(
  33. ruby-rubygems
  34. )
  35. options=('!emptydirs')
  36. source=(
  37. "https://github.com/rubygems/rubygems/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz"
  38. # https://github.com/rubygems/rubygems/pull/7143
  39. ruby-3.4-fix-test-install_extension_in_lib.patch
  40. 0001-FSDG-rubygems-Have-default_sources-be-empty.patch # Parabola
  41. operating_system.rb)
  42. sha512sums=('8d0bc225ef01d3cc5e3ad12a1bf0bbb3923349bb9b79b76a9ac58bb8dcf79666a478a871d19919adc15f1aa2599efde5d3938c61801579277117b569e7007656'
  43. '21ae6a370b0980d75beab168c8ea627dcca661e60ba676bcec8285be989f859eaccbf571e947a26cb275202208c784388cd7d3cb61b49c22ab544e2a44929a2a'
  44. '490b947841884517ca9c331c0f286b8475d09206781e09f81cbe2874effff2958f6e13d8e73148b7bd13cb8e6eb6fccf78518d5c395b4683469ca65c76715aa1'
  45. '9d74b5528fc87c78316abdd5423a15a8859aec0cd230b20906c53e7e05d8ba8a156af42dc0f6cff270f0c75196079e622c45cc9f0b2f512fc5311fd54e37ab11')
  46. b2sums=('adf618f326fa83a8eb7febb9872a71f2bf78048dfa7c4db07343c9813ba5d858c86bcd6e54df1a559e60e458ba8d73d2a7ac82ee5e0cbde6e9d8b45c12793d4c'
  47. 'b2ad268d3bebdf2e26e2c1b95c5ec890b077d6ee71aae3f507614792d356d99cf494c6429a4df85d8142f866755fc331547d77f41411c68dbaa7a2fdd2cdf1cc'
  48. '5e5d4ceb6f7688742ae396149430af308d73ac6744017847d67030cb40c78d2e5d6d156ecd377b2e3bcb7c6d65da8b50a92c17165be2d7a80762e313189fffa7'
  49. '714ce47535ede25cad914002c45c908de7d4ff6eae5b25daf9ab1d3a75e09fffe6e17bc73422f9ba2fe16ae5e120352c536d2ab6152a36431a7f35e9c5466b47')
  50. prepare() {
  51. cd "rubygems-${pkgver}"
  52. sed --in-place --regexp-extended 's|git ls-files|find -type f -not -path "*/\.git/*"|' Rakefile
  53. patch -Np1 < ../ruby-3.4-fix-test-install_extension_in_lib.patch
  54. patch -Np1 < ../0001-FSDG-rubygems-Have-default_sources-be-empty.patch # Parabola
  55. }
  56. check() {
  57. cd "rubygems-${pkgver}"
  58. rake update_manifest test
  59. }
  60. package() {
  61. cd "rubygems-${pkgver}"
  62. local _gemdir="$(ruby -e 'puts Gem.dir')"
  63. local _extension_api_version="$(ruby -e 'puts Gem.extension_api_version')"
  64. export GEM_HOME="${pkgdir}${_gemdir}"
  65. install --verbose -d --mode=0755 \
  66. "${GEM_HOME}" \
  67. "${pkgdir}/usr/lib/ruby/${_extension_api_version}"
  68. # define the current version as previous version to avoid printing the changelog
  69. ruby setup.rb \
  70. --destdir="${pkgdir}" \
  71. --prefix="/usr" \
  72. --previous-version="${pkgver}" \
  73. --verbose
  74. # fix package structure
  75. mv --verbose "${pkgdir}/usr/lib/${pkgname}.rb" "${pkgdir}/usr/lib/ruby/${_extension_api_version}"
  76. mv --verbose "${pkgdir}/usr/lib/${pkgname}" "${pkgdir}/usr/lib/ruby/${_extension_api_version}"
  77. # cleanup - remove any bundler references as they are provided by https://archlinux.org/packages/community/any/ruby-bundler/
  78. rm --force --verbose --recursive \
  79. "${pkgdir}/usr/bin/"{bundle*,rake,rake-compiler,rspec,rdbg,rbs,typeprof,erb} \
  80. "${pkgdir}/usr/gems" \
  81. "${pkgdir}/usr/lib/bundler.rb" \
  82. "${pkgdir}/usr/lib/bundler" \
  83. "${pkgdir}/usr/specifications"
  84. install --verbose -D --mode=0644 ../operating_system.rb --target-directory "${pkgdir}/usr/lib/ruby/vendor_ruby/rubygems/defaults"
  85. install --verbose -D --mode=0644 LICENSE.txt MIT.txt --target-directory "${pkgdir}/usr/share/licenses/${pkgname}"
  86. install --verbose -D --mode=0644 *.md --target-directory "${pkgdir}/usr/share/doc/${pkgname}"
  87. }
  88. # vim: tabstop=2 shiftwidth=2 expandtab: