PKGBUILD 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  1. # Maintainer: Luke T. Shumaker <lukeshu@parabola.nu>
  2. # Contributor: Omar Vega Ramos <ovruni@gnu.org.pe>
  3. # Contributor: Daniel Milewski <niitotantei@riseup.net>
  4. # Contributor: André Silva <emulatorman@hyperbola.info>
  5. # Contributor: fauno <fauno@parabola.nu>
  6. # Maintainer (arch): Anatol Pomozov <anatol.pomozov@gmail.com>
  7. # Maintainer (arch): Andreas 'Segaja' Schleifer <segaja at archlinux dot org>
  8. # Maintainer (arch): Tim Meusel <tim@bastelfreak.de>
  9. # Contributor (arch): Thomas Dziedzic <gostrc@gmail.com>
  10. # Contributor (arch): Allan McRae <allan@archlinux.org>
  11. # Contributor (arch): John Proctor <jproctor@prium.net>
  12. # Contributor (arch): Jeramy Rutley <jrutley@gmail.com>
  13. # Parabola changes and rationale:
  14. #
  15. # FSDG:
  16. # - replace non-free 'generator.c' in bundled JSON extension
  17. # https://labs.parabola.nu/issues/674
  18. # https://bugs.ruby-lang.org/issues/11844
  19. # https://github.com/flori/json/issues/277
  20. # https://github.com/flori/json/pull/567
  21. # - disable default TPPM (rubygems.org, which hosts non-free
  22. # packages) in ruby-default-gems-bootstrap
  23. # https://wiki.parabola.nu/TPPM_Liberation_Project
  24. # Parabola policy:
  25. # - get check() to work without networking
  26. # technical:
  27. # - incorporate https://gitlab.archlinux.org/archlinux/packaging/packages/ruby/-/merge_requests/6
  28. # - incorporate https://gitlab.archlinux.org/archlinux/packaging/packages/ruby/-/merge_requests/7
  29. # - backport 055613fd868a8c94e43893f8c58a00cdd2a81f6d, per Arch 32
  30. # - disable tests that trigger qemu-arm-static bugs/limitations
  31. # - add replaces/conflicts for Parabola's old 'ruby-bootstraplib'
  32. # - set options=(!strip) to avoid creating ruby-debug, because extra/ruby-debug is the 'debug' gem
  33. # Do not de-vendor and create separate packages for default gems (see
  34. # https://stdgems.org/), leave them vendored as part of the main
  35. # 'ruby' package. Creating a separate package for a default gem will
  36. # lead to multiple problems.
  37. #
  38. # ... except for default gems that provide a tool in /usr/bin. Having
  39. # separate de-vendored packages for them is OK I guess. (In the code
  40. # below, this distinction is represented as _default_gems=() vs
  41. # _default_tool_gems=()).
  42. pkgname=(
  43. ruby
  44. ruby-docs
  45. ruby-default-gems
  46. ruby-default-gems-bootstrap
  47. ruby-bundled-gems
  48. ruby-bundled-gems-bootstrap
  49. ruby-stdlib
  50. )
  51. pkgver=3.2.5
  52. _rubyver="${pkgver%.*}.0"
  53. pkgrel=1
  54. pkgdesc='An object-oriented language for quick and easy programming'
  55. url='https://www.ruby-lang.org/en/'
  56. arch=(x86_64)
  57. license=(BSD-2-Clause)
  58. makedepends=(
  59. doxygen
  60. gcc-libs
  61. gdbm
  62. glibc
  63. gmp
  64. graphviz
  65. libffi
  66. libxcrypt
  67. libyaml
  68. openssl
  69. readline
  70. rust
  71. tk
  72. zlib
  73. )
  74. checkdepends=(
  75. inetutils
  76. procps-ng
  77. )
  78. options=('!emptydirs')
  79. source=("https://cache.ruby-lang.org/pub/ruby/${pkgver:0:3}/ruby-${pkgver}.tar.xz")
  80. # After updating pkgver, run `./updvars.sh` to update the `*sums` and `_*_gem` variables.
  81. sha512sums=('0321fd9303fd49ac1d36a502e66babf63df096b25750a86b905362f2529380074f875eeb78079e59a79806c7e1397c531de66cbe88a6f2ba78a8c2af776c3004'
  82. 'SKIP'
  83. '9f8ffe740cd2f218c16e85bd7329b6c7b0f58c71834f3d256a2bed90dd36d652d202dae6265d0a19eb79fbbd1909af59b94f722ec8abfa5637469e6b0e81d08d'
  84. 'ad0357a047b57bb0314b158f92e83485cec9fe6a3dfeb16117d57cf746ee38545f652397093448862ff36d13945bda3b26bb22b5d0d91643b16ae11548ef463b'
  85. '4031dc10cfd3fbdd8f023328df661159bf01d6fefac89a2750119c2dbe58ed2daf75737598002164c9760e366bdb7e5c1076430c2d67502ab0cae51ef94b5ed7'
  86. 'b24746c74ba6571c04ba1d95de3c557cc208870075cf7e9f603b18ac8b8dafbf5b2c8b2c58f564e91c58002947a64b5b30eed37069910e7d5bfa175faa2a58de'
  87. '926f6d54df2258f45ba53f8be90cb5af8a6b74634288ef82a511690ba27614bc283c4e262889e80469c8b48c2c770310402b17f1dd7bca28a24624c4a7d47de2'
  88. '098aae28f94124071047602e41dc76a8941a5625ea21c554c040aea9973ea285928acadf42cbf361753b84d2d5a21166da6589cf98cc0a2d3edcf0a1280df1d6'
  89. 'db0dd71efd6e502558b8b9eb10566783f82afcd32e779b0d45c2614c9149f28a0992843b8d2aab62640d857aea5aa8a5745377b01a098cd5da9fc8d206264c0c'
  90. '60403154901c774548e1e8e9e037c8294c0afe740942fe42864f4f91912bd7645de3a4d66a90bf43a4e4f4353cf0ba182513c7961343fc9ddae633d5ab94e11f'
  91. '490b947841884517ca9c331c0f286b8475d09206781e09f81cbe2874effff2958f6e13d8e73148b7bd13cb8e6eb6fccf78518d5c395b4683469ca65c76715aa1')
  92. b2sums=('a2c89de93364f29b08f5fa92295458bbe819f689134ffb2a295264372804ef4c10d23a8417a123033c14977fa1172a3c93246a91adda7eb8ad7a28e31d3b4c2a'
  93. 'SKIP'
  94. '2b1f4cb32961abf0db9875b116aa8cbf281f82406beff268111bfe6cc8e613f15c4bd3d29b2fa4f598038b66db6bbe9be5db5c6de9c7033eb3be1c59bbdc5039'
  95. 'a40399223c659b548e59605eb537faae8eff139cacf793fea6af1e543016f8afa80049490dccf915edb0063bd3d71705e47c6343e1f616903b8c12a6f37c8cf4'
  96. '41df21678a628fff7f86167bf80afcc602da2d5263c2f12e666cbce9401a51ff82887cfdf32fec85194b2511930525e2b2f1dda902437379ed45b78d99f830b2'
  97. '6808da5cd3bb24cd8f77d887fca9fbe7dd1759fd93b594eddc014a7183f890b0a6d943abe65d3bc14ecebe2c88630dc3ba8ec46b5326db5d363ebf0daf3d49af'
  98. '213877e9b9990f510c786bc06813f8747b40ff652955e8ad7343f4f462bffe308f7cd4e9b33f1f49d82337d19942bf9bf66da2642d81a8fbe45471df440df1a2'
  99. '3ed5fa59d88025487dd207218d6ec7d252c447fdd37c5a6e13ed3ef967de977ee80e3b31a7b6c97609c8814863b6f8738f528644f471fcd5e807cc63ebd94c30'
  100. 'eaf183b76fd3b7734702e48501a9dd3a8924b8e6fd7efb32acb943b8ccec121626a12db4539c73583c172be9a4b88f96492291258bd48202abfc5151418b9fe8'
  101. '314f95301c8359fca684b6d485a66326064b9816fd8ee0031e97f8f218d94ef870a019388e264916471f94432dcd08c6b88829eb471954259b732db727a3f9ec'
  102. '5e5d4ceb6f7688742ae396149430af308d73ac6744017847d67030cb40c78d2e5d6d156ecd377b2e3bcb7c6d65da8b50a92c17165be2d7a80762e313189fffa7')
  103. _bundled_gems=(
  104. debug=1.7.1
  105. matrix=0.4.2
  106. minitest=5.16.3
  107. net-ftp=0.2.1
  108. net-imap=0.3.4.1
  109. net-pop=0.1.2
  110. net-smtp=0.3.4
  111. power_assert=2.0.3
  112. prime=0.1.2
  113. rake=13.0.6
  114. rbs=2.8.2
  115. rexml=3.3.2
  116. rss=0.2.9
  117. test-unit=3.5.7
  118. typeprof=0.21.3
  119. )
  120. _default_gems=(
  121. abbrev
  122. base64
  123. benchmark
  124. bigdecimal
  125. cgi
  126. csv
  127. date
  128. delegate
  129. did_you_mean
  130. digest
  131. drb
  132. english
  133. error_highlight
  134. etc
  135. fcntl
  136. fiddle
  137. fileutils
  138. find
  139. forwardable
  140. getoptlong
  141. io-console
  142. io-nonblock
  143. io-wait
  144. ipaddr
  145. json
  146. logger
  147. mutex_m
  148. net-http
  149. net-protocol
  150. nkf
  151. observer
  152. open-uri
  153. open3
  154. openssl
  155. optparse
  156. ostruct
  157. pathname
  158. pp
  159. prettyprint
  160. pstore
  161. psych
  162. readline
  163. readline-ext
  164. reline
  165. resolv
  166. resolv-replace
  167. rinda
  168. ruby2_keywords
  169. securerandom
  170. set
  171. shellwords
  172. singleton
  173. stringio
  174. strscan
  175. syntax_suggest
  176. syslog
  177. tempfile
  178. time
  179. timeout
  180. tmpdir
  181. tsort
  182. un
  183. uri
  184. weakref
  185. yaml
  186. zlib
  187. )
  188. _default_tool_gems=(
  189. bundler
  190. erb
  191. irb
  192. racc
  193. rdoc
  194. rubygems
  195. )
  196. # Parabola: Mundane packaging considerations.
  197. arch+=(armv7h i686)
  198. pkgrel+=.parabola3
  199. # Parabola: Disable the 'ruby-debug' package, that name is for the
  200. # 'debug' gem, not detatched debugging symbols for /bin/ruby. Arch
  201. # doesn't need to do this because Arch doesn't ship -debug packages.
  202. # We say !strip rather than !debug because we do want the debugging
  203. # symbols to be available to those who want them.
  204. options+=('!strip')
  205. # Parabola: Replace the CVTUTF code with a free implementation.
  206. # https://github.com/flori/json/pull/567
  207. # We need to do this in mksource() (not in prepare()) so that the
  208. # .src.pkg.tar file doesn't include nonfree sources.
  209. _jsonver=4bcec6c2950bdf7e1bbd086e91bdd431577f10a4
  210. _srcrel=1 # increment this to rebuild the sourceball (mksource, _jsonver) without bumping pkgver
  211. mksource=("${source[0]}"
  212. "ruby-json-${_jsonver}.tar.gz::https://github.com/parabola-gnulinuxlibre/ruby-json/archive/${_jsonver}.tar.gz"
  213. 0001-Prep-to-use-Parabola-s-patched-ruby-json.patch)
  214. mksha512sums=('092348b84b513aec62e63ec10b326370d0e3d1fa3126c59c03c84f28e2d7741a4772c461b077ec6a7dac3964a20f434655729e1acd50a3438755d7ad64073305'
  215. '3ddfc3d0a517173b4bebb3fc6709ae6f11a917fc510bba14e3263e16fb8237dba2e531db68fd4370353b2dab48781be691304ba7977429c6a194fcb3fd61a543'
  216. 'a627e6ddd695ac3ea54387f248a94845475a25a07e2b8de39e437b7a7c29a0b2521e7ecc956be6aab701ee7d976f5f2fb1779a84d4d188e4c0dadf8db49fe0f1')
  217. mkb2sums=('a37c92a0f751e81dcae328b8944c4ecf10f6aee4f4468d6d08bb924c9808c8556c5febb71a825dd62dbcccf56385138e6e306bf3efae3589bdf0512d16d99d1a'
  218. '2f223ba48712e519ddf9e03bc15347de1a9aa8fea3b907d2c6a95ff250986fd2a7e5bacb60fe76cafe474f5dc2678f293f42ad786b878767adb9ef49d55f659b'
  219. 'e35578d39808edca20b295dcfbce9b318b9b27f44d7900784cc05686585a3e127b4c92fe3be31d2e7b7e21633fb2775a1f891784684ab232223ef38e791a64d9')
  220. source=("https://repo.parabola.nu/other/ruby-libre/ruby-${pkgver}-libre${_srcrel}.tar.gz"{,.sig} "${source[@]:1}")
  221. mkdepends=(ruby git)
  222. mksource() {
  223. mkdir "$srcdir/ruby"
  224. mv -T "$srcdir/ruby-$pkgver" "$srcdir/ruby/ruby"
  225. mkdir "$srcdir/flori"
  226. mv -T "$srcdir/ruby-json-$_jsonver" "$srcdir/flori/json"
  227. pushd "$srcdir/ruby/ruby"
  228. git init .
  229. git add .
  230. git commit -m 'initial commit'
  231. patch -p1 -i ../../0001-Prep-to-use-Parabola-s-patched-ruby-json.patch
  232. ruby tool/sync_default_gems.rb json
  233. # sync_default_gems.rb does a `git checkout` to restore the
  234. # `ext/json{,/generator,/parser}/depend` files to the
  235. # properly-generated versions. If not for it also doing that for
  236. # `prereq.mk`, I'd drop the `git` stuff and just do `update-deps`
  237. # after syncing:
  238. #
  239. # ruby tool/update-deps --fix
  240. rm -rf .git
  241. popd
  242. mv -T "$srcdir/ruby/ruby" "$srcdir/ruby-${pkgver}"
  243. rm -rf -- "$srcdir/ruby" "$srcdir/flori"
  244. }
  245. # Parabola: Fix check() with networking disabled.
  246. _rspec_ver=3.13.0
  247. source+=(0001-Fix-failures-when-all-network-interfaces-are-down.patch::https://github.com/ruby/ruby/commit/94e79e4c2da8d69f45e67228a051bb1c09a367ec.patch
  248. "https://rubygems.org/downloads/diff-lcs-1.5.1.gem"
  249. "https://rubygems.org/downloads/rspec-${_rspec_ver}.gem"
  250. "https://rubygems.org/downloads/rspec-core-${_rspec_ver}.gem"
  251. "https://rubygems.org/downloads/rspec-expectations-${_rspec_ver}.gem"
  252. "https://rubygems.org/downloads/rspec-mocks-${_rspec_ver}.gem"
  253. "https://rubygems.org/downloads/rspec-support-${_rspec_ver}.gem")
  254. # Parabola: Fix build on i686
  255. source+=(0002-Fix-pointer-incompatiblity.patch::https://github.com/ruby/ruby/commit/055613fd868a8c94e43893f8c58a00cdd2a81f6d.patch)
  256. # Parabola: disable default TPPM
  257. source+=(0001-FSDG-rubygems-Have-default_sources-be-empty.patch)
  258. # Parabola: Apply the above patches
  259. prepare() {
  260. cd "ruby-${pkgver}"
  261. local patch
  262. for patch in ../*.patch; do
  263. patch -Np1 -i "$patch"
  264. done
  265. }
  266. build() {
  267. cd "ruby-${pkgver}"
  268. # this uses malloc_usable_size, which is incompatible with fortification level 3
  269. export CFLAGS="${CFLAGS/_FORTIFY_SOURCE=3/_FORTIFY_SOURCE=2}"
  270. export CXXFLAGS="${CXXFLAGS/_FORTIFY_SOURCE=3/_FORTIFY_SOURCE=2}"
  271. # I (LukeShu) can't get the tests to pass on i686 unless --disable-jit-support.
  272. # Yes, I tried -fno-stack-protector.
  273. ./configure \
  274. $(if [[ $CARCH == i686 ]]; then echo --disable-jit-support; fi) \
  275. --prefix=/usr \
  276. --sysconfdir=/etc \
  277. --localstatedir=/var \
  278. --sharedstatedir=/var/lib \
  279. --libexecdir=/usr/lib/ruby \
  280. --enable-shared \
  281. --disable-rpath \
  282. --with-dbm-type=gdbm_compat
  283. make
  284. make rdoc capi
  285. }
  286. check() {
  287. cd "ruby-${pkgver}"
  288. # this uses malloc_usable_size, which is incompatible with fortification level 3
  289. export CFLAGS="${CFLAGS/_FORTIFY_SOURCE=3/_FORTIFY_SOURCE=2}"
  290. export CXXFLAGS="${CXXFLAGS/_FORTIFY_SOURCE=3/_FORTIFY_SOURCE=2}"
  291. # Parabola: Fix check() with networking disabled.
  292. #
  293. # This is pre-empting the `gem install` that `make
  294. # test-syntax-suggest-prepare` will do:
  295. #
  296. # yes-test-syntax-suggest-prepare: yes-test-syntax-suggest-precheck
  297. # $(XRUBY) -C "$(srcdir)" bin/gem install --no-document \
  298. # --install-dir .bundle --conservative "bundler" "rake" "rspec:~> 3" #"ruby-prof"
  299. local xruby=(./miniruby tool/runruby.rb --extout=.ext --)
  300. # "bundler" : just spoof the gemspec for the bundler we already have
  301. "${xruby[@]}" \
  302. -r'fileutils' \
  303. -r'rubygems' \
  304. -e'filename = "lib/bundler/bundler.gemspec"' \
  305. -e'spec = eval(File.read(filename, encoding: "utf-8:-"), binding, filename)' \
  306. -e'Gem.write_binary(".bundle/specifications/#{spec.full_name}.gemspec", spec.to_ruby)'
  307. # "rake" : already installed in .bundle
  308. # "rspec" : we downloaded rspec and deps in source=(), now we need to install them
  309. # `gem install` will search the current directory for dependencies
  310. ln -s ../*.gem .
  311. "${xruby[@]}" bin/gem install --no-document \
  312. --install-dir .bundle --conservative --local "rspec-${_rspec_ver}.gem"
  313. rm *.gem
  314. # Parabola: Disable checks that fail in cross-arch chroots.
  315. # These are bugs/limitations in `qemu-arm-static`.
  316. if grep -q [q]emu /proc/$$/cmdline; then
  317. # The `make test-all` suite.
  318. echo >>test/excludes/TestIO.rb "exclude :test_io_select_with_many_files , 'qemu-arm-static SIGABRTs instead of returning EINVAL'"
  319. echo >>test/excludes/TestSignal.rb "exclude :test_ignored_interrupt , 'qemu-arm-static handles the signal wrong'"
  320. echo >>test/excludes/TestRubyOptions.rb "exclude /test_set(proctitle|_program_name)/ , 'qemu-arm-static does not support adjusting argv at runtime'"
  321. # The `make test-spec` suite.
  322. # qemu-arm-static does not support adjusting argv at runtime
  323. MSPECOPT+=" --exclude='Process.setproctitle should set the process title'"
  324. MSPECOPT+=" --exclude='actually sets the program name'"
  325. export MSPECOPT
  326. # The `make test-syntax-suggest` suite.
  327. # The default timeout is 1s, bump it to 10s because emulation is slow.
  328. export SYNTAX_SUGGEST_TIMEOUT=10
  329. fi
  330. make check
  331. }
  332. _pick() {
  333. local p="$1" f d; shift
  334. for f; do
  335. [[ -e $f ]] || continue
  336. d="$srcdir/$p/${f#$pkgdir/}"
  337. mkdir -p "$(dirname "$d")"
  338. mv "$f" "$d"
  339. rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
  340. done
  341. }
  342. _list_bins() {
  343. local gemspec="${1?}"
  344. # Note that unlike .gemspec files in the sources, installed
  345. # gemspec files have been normalized, and so are much more
  346. # regular and easy to parse with simple expressions like this.
  347. cat "$gemspec" |
  348. # extract the `...` from `s.executables=[...]` lines
  349. sed -En 's/^\s*s\.executables\s*=\s*\[([^]]+)\]\s*$/\1/p' |
  350. # dequote; turn `"bundle".freeze, "bundler".freeze` into `bundle\nbundler`
  351. sed -e 's/^\s*"//' -e 's/"\.freeze,\s*"/\n/g' -e 's/"\.freeze\s*$//'
  352. }
  353. _pick_gems() {
  354. local typ="${1?}"
  355. local gems=("${@:2}")
  356. local dst="${typ}-gems"
  357. local gem bins bin
  358. for gem in "${gems[@]}"; do
  359. msg2 "removing ${typ} gem ${gem}"
  360. case "$typ" in
  361. default)
  362. if [[ "$gem" == rubygems ]]; then
  363. # For some reason ruby doesn't ship the rubygems gemspec.
  364. bins=(gem)
  365. else
  366. readarray -t bins < <(_list_bins "${pkgdir}/usr/lib/ruby/gems/${_rubyver}/specifications/default/${gem}"-*.gemspec)
  367. _pick "$dst" "${pkgdir}/usr/lib/ruby/gems/${_rubyver}/specifications/default/${gem}"-*.gemspec
  368. fi
  369. _pick "$dst" "${pkgdir}/usr/lib/ruby/${_rubyver}"/*-linux/"${gem}"
  370. _pick "$dst" "${pkgdir}/usr/lib/ruby/${_rubyver}/${gem}"*
  371. ;;
  372. bundled)
  373. readarray -t bins < <(_list_bins "${pkgdir}/usr/lib/ruby/gems/${_rubyver}/specifications/${gem}"-*.gemspec)
  374. _pick "$dst" "${pkgdir}/usr/lib/ruby/gems/${_rubyver}/specifications/${gem}"-*.gemspec
  375. _pick "$dst" "${pkgdir}/usr/lib/ruby/gems/${_rubyver}/extensions"/*-linux/"${_rubyver}/${gem}"-*
  376. ;;
  377. esac
  378. _pick "$dst" "${pkgdir}/usr/lib/ruby/gems/${_rubyver}/gems/${gem}"-*
  379. for bin in "${bins[@]}"; do
  380. _pick "$dst" "${pkgdir}/usr/bin/${bin}"
  381. _pick "$dst" "${pkgdir}/usr/share/man/man1/${bin}.1"
  382. done
  383. done
  384. }
  385. package_ruby() {
  386. depends=(
  387. gcc-libs
  388. gdbm
  389. glibc
  390. gmp
  391. libffi
  392. libxcrypt
  393. libyaml
  394. openssl
  395. readline
  396. zlib
  397. )
  398. optdepends=(
  399. 'tk: for Ruby/TK'
  400. 'ruby-docs: Documentation for Ruby'
  401. 'ruby-default-gems: Default gems which are part of Ruby StdLib'
  402. 'ruby-bundled-gems: Bundled gems which are part of Ruby StdLib'
  403. 'ruby-stdlib: Full Ruby StdLib including default gems, bundled gems and tools'
  404. )
  405. provides=(
  406. libruby.so
  407. )
  408. replaces=("${_default_gems[@]/#/ruby-}")
  409. conflicts=("${_default_gems[@]/#/ruby-}")
  410. provides+=("${_default_gems[@]/#/ruby-}")
  411. cd "ruby-${pkgver}"
  412. make DESTDIR="${pkgdir}" install-nodoc
  413. install --verbose -D --mode=0644 BSDL COPYING --target-directory "${pkgdir}/usr/share/licenses/${pkgname}"
  414. install --verbose -D --mode=0644 *.md --target-directory "${pkgdir}/usr/share/doc/${pkgname}"
  415. # remove unrepreducible files
  416. rm --recursive --verbose \
  417. "${pkgdir}/usr/lib/ruby/gems/${_rubyver}/cache"
  418. # remove de-vendored parts
  419. _pick_gems default "${_default_tool_gems[@]}"
  420. _pick_gems bundled "${_bundled_gems[@]%=*}"
  421. # Most of the _default_tool_gems are in optdepends via
  422. # ruby-default-gems, but some of them need to be non-optional.
  423. depends+=(
  424. rubygems
  425. )
  426. }
  427. package_ruby-docs() {
  428. pkgdesc='Documentation files for Ruby'
  429. cd "ruby-${pkgver}"
  430. make DESTDIR="${pkgdir}" install-doc install-capi
  431. install --verbose -D --mode=0644 BSDL COPYING --target-directory "${pkgdir}/usr/share/licenses/${pkgname}"
  432. }
  433. package_ruby-default-gems() {
  434. pkgdesc='Depends on gems that are a part of Ruby and you can always require directly'
  435. # We only need to depend on default gems that we've de-vendored, not all of the default gems.
  436. depends=("${_default_tool_gems[@]/#/ruby-}")
  437. cd "ruby-${pkgver}"
  438. install --verbose -D --mode=0644 BSDL COPYING --target-directory "${pkgdir}/usr/share/licenses/${pkgname}"
  439. }
  440. package_ruby-default-gems-bootstrap() {
  441. pkgdesc='The versions of ruby-default-gems that are distributed with the Ruby source release'
  442. depends=("ruby=${pkgver}")
  443. provides=("${_default_tool_gems[@]/#/ruby-}" rubygems)
  444. conflicts=("${_default_tool_gems[@]/#/ruby-}" rubygems)
  445. replaces+=(ruby-bootstraplib) # Parabola
  446. conflicts+=(ruby-bootstraplib) # Parabola
  447. mv -v "${srcdir}/default-gems"/* "$pkgdir"
  448. cd "ruby-${pkgver}"
  449. install --verbose -D --mode=0644 BSDL COPYING --target-directory "${pkgdir}/usr/share/licenses/${pkgname}"
  450. }
  451. package_ruby-bundled-gems() {
  452. pkgdesc='Depends on optional gems that are installed by default with Ruby'
  453. replaces=(ruby-bundledgems)
  454. conflicts=(ruby-bundledgems)
  455. # Parabola: Disable the version constraint on ruby-rexml for now,
  456. # because extra/ruby-rexml=3.2.6 is behind ruby-rexml>=3.3.2.
  457. depends=($(printf '%s\n' "${_bundled_gems[@]}" | sed -e 's/^/ruby-/' -e 's/=/>=/' -e 's/ruby-rexml>.*/ruby-rexml/'))
  458. cd "ruby-${pkgver}"
  459. install --verbose -D --mode=0644 BSDL COPYING --target-directory "${pkgdir}/usr/share/licenses/${pkgname}"
  460. }
  461. package_ruby-bundled-gems-bootstrap() {
  462. pkgdesc='The versions of ruby-bundled-gems that are distributed with the Ruby source release'
  463. depends=("ruby=${pkgver}")
  464. provides=("${_bundled_gems[@]/#/ruby-}")
  465. conflicts=("${_bundled_gems[@]/#/ruby-}")
  466. mv -v "${srcdir}/bundled-gems"/* "$pkgdir"
  467. cd "ruby-${pkgver}"
  468. install --verbose -D --mode=0644 BSDL COPYING --target-directory "${pkgdir}/usr/share/licenses/${pkgname}"
  469. }
  470. package_ruby-stdlib() {
  471. pkgdesc='Full Ruby StdLib including default gems, bundled gems and tools'
  472. depends=(ruby-default-gems ruby-bundled-gems)
  473. cd "ruby-${pkgver}"
  474. install --verbose -D --mode=0644 BSDL COPYING --target-directory "${pkgdir}/usr/share/licenses/${pkgname}"
  475. }
  476. # vim: tabstop=2 shiftwidth=2 expandtab: