upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / ruby / trunk / PKGBUILD
blob979a1c4317b8beeb6b4b0627fccf06e06948f86e
1 # Maintainer: Anatol Pomozov <anatol.pomozov@gmail.com>
2 # Maintainer: Andreas 'Segaja' Schleifer <segaja at archlinux dot org>
3 # Maintainer: Tim Meusel <tim@bastelfreak.de>
4 # Contributor: Thomas Dziedzic <gostrc@gmail.com>
5 # Contributor: Allan McRae <allan@archlinux.org>
6 # Contributor: John Proctor <jproctor@prium.net>
7 # Contributor: Jeramy Rutley <jrutley@gmail.com>
9 pkgname=(ruby ruby-docs ruby-stdlib ruby-bundledgems)
10 pkgver=3.0.5
11 pkgrel=1
12 arch=(x86_64)
13 url='https://www.ruby-lang.org/en/'
14 license=(BSD custom)
15 makedepends=(doxygen gdbm graphviz libffi libyaml openssl ttf-dejavu tk)
16 options=(!emptydirs !lto) # Disable LTO until fixes for https://bugs.ruby-lang.org/issues/18062 released
17 _osslver=3.0.0
18 source=(https://cache.ruby-lang.org/pub/ruby/${pkgver:0:3}/ruby-${pkgver}.tar.xz
19         ruby-openssl-$_osslver.tar.xz::https://github.com/ruby/openssl/archive/refs/tags/v$_osslver.tar.gz)
20 sha512sums=('1c69d18210a2156f7696c678a8d54bf05c4dc49a1401c1ecc5760b1c23fb6ac14053873a225564664d6a327cda274ce72f47d112a6ad8d378f978de4e507e9a0'
21             '076d2924b61c4f7704b47718a33732fb5285a3af39f328ed9e83add36589da99dfae73b3e893398fc3f2a74dcbead0b66edc682040fa1b48f9530894c7187f95')
22 b2sums=('581aa202f6b1b5c72bb18d486c4f74ec87a6c2dd38166c4841b75dba891aabd72c3889b158134b04763cddb22c0f60015f4d21c5130077053e1fcb13e28a8024'
23         '2eeb64caf188d79137686a8c5f0aa9d27860b3a3da8e0d4082f749beaa600928d814fe8cd70a6921358066603ce453d92838c1bce32509574ea333b6ca567fc8')
25 prepare() {
26   cd ruby-${pkgver}
27   rm -rf ext/openssl test/openssl
28   mv ../openssl-$_osslver/ext/openssl ext
29   mv ../openssl-$_osslver/lib ext/openssl
30   mv ../openssl-$_osslver/{History.md,openssl.gemspec} ext/openssl
31   mv ../openssl-$_osslver/test/openssl test
34 build() {
35   cd ruby-${pkgver}
37   ./configure \
38     --prefix=/usr \
39     --sysconfdir=/etc \
40     --localstatedir=/var \
41     --sharedstatedir=/var/lib \
42     --libexecdir=/usr/lib/ruby \
43     --enable-shared \
44     --disable-rpath \
45     --with-dbm-type=gdbm_compat
47   make
50 check() {
51   cd ruby-${pkgver}
53   make test
56 package_ruby() {
57   pkgdesc='An object-oriented language for quick and easy programming'
58   depends=(gdbm openssl libffi libyaml libxcrypt gmp zlib rubygems ruby-stdlib ruby-bundledgems)
59   optdepends=(
60       'ruby-docs: Ruby documentation'
61       'tk: for Ruby/TK'
62   )
64   cd ruby-${pkgver}
66   make DESTDIR="${pkgdir}" install-nodoc
68   install -D -m644 COPYING "${pkgdir}/usr/share/licenses/ruby/LICENSE"
69   install -D -m644 BSDL "${pkgdir}/usr/share/licenses/ruby/BSDL"
71   rubyver=${pkgver:0:3}.0
73   # remove rubygems as it shipped as a separate package
74   rm -r "${pkgdir}"/usr/lib/ruby/${rubyver}/{rubygems,rubygems.rb}
75   rm "${pkgdir}"/usr/bin/gem
77   # remove bundler as it shipped as a separate package
78   rm "${pkgdir}"/usr/bin/{bundle,bundler}
80   # remove bundled rdoc gem
81   rm "${pkgdir}"/usr/bin/{rdoc,ri}
82   rm "${pkgdir}"/usr/share/man/man1/ri.1
84   # remove irb as it is a separate package now
85   rm "${pkgdir}"/usr/bin/irb
86   rm "${pkgdir}"/usr/share/man/man1/irb.1
88   # remove other binaries that are shipped as separate packages
89   rm "${pkgdir}"/usr/bin/{rake,rbs,typeprof,erb,racc}
90   rm "${pkgdir}"/usr/share/man/man1/erb.1
92   # remove all bundled gems to avoid conflicts with ruby-* Arch packages
93   rm -r "${pkgdir}"/usr/lib/ruby/gems/${rubyver}/gems/*
94   rm "${pkgdir}"/usr/lib/ruby/gems/${rubyver}/specifications/*.gemspec
95   rm "${pkgdir}"/usr/lib/ruby/gems/${rubyver}/cache/*.gem
97   # remove already packaged stdlib gems (needs to be as dependency in ruby-stdlib)
98   local stdlib_gems=(
99     abbrev
100     base64
101     benchmark
102     bigdecimal
103     bundler
104     cgi
105     csv
106     date
107     delegate
108     did_you_mean
109     digest
110     drb
111     english
112     erb
113     etc
114     fcntl
115     fiddle
116     fileutils
117     find
118     forwardable
119     getoptlong
120     io-console
121     io-nonblock
122     io-wait
123     ipaddr
124     irb
125     json
126     logger
127     mutex_m
128     net-http
129     open-uri
130     psych
131     racc
132     rdoc
133     reline
134     stringio
135     time
136     tmpdir
137     uri
138   )
140   for stdlib_gem in "${stdlib_gems[@]}"; do
141     rm --force --recursive --verbose \
142       "${pkgdir}"/usr/lib/ruby/${rubyver}/${stdlib_gem} \
143       "${pkgdir}"/usr/lib/ruby/${rubyver}/${stdlib_gem}.rb \
144       "${pkgdir}"/usr/lib/ruby/${rubyver}/x86_64-linux/${stdlib_gem}.so \
145       "${pkgdir}"/usr/lib/ruby/gems/${rubyver}/specifications/default/${stdlib_gem}-*.gemspec
146   done
148   rm --recursive --verbose \
149     "${pkgdir}"/usr/lib/ruby/${rubyver}/English.rb \
150     "${pkgdir}"/usr/lib/ruby/${rubyver}/io/console \
151     "${pkgdir}"/usr/lib/ruby/${rubyver}/net/http \
152     "${pkgdir}"/usr/lib/ruby/${rubyver}/net/http.rb \
153     "${pkgdir}"/usr/lib/ruby/${rubyver}/net/https.rb \
154     "${pkgdir}"/usr/lib/ruby/${rubyver}/x86_64-linux/cgi \
155     "${pkgdir}"/usr/lib/ruby/${rubyver}/x86_64-linux/date_core.so \
156     "${pkgdir}"/usr/lib/ruby/${rubyver}/x86_64-linux/digest \
157     "${pkgdir}"/usr/lib/ruby/${rubyver}/x86_64-linux/io/console.so \
158     "${pkgdir}"/usr/lib/ruby/${rubyver}/x86_64-linux/io/nonblock.so \
159     "${pkgdir}"/usr/lib/ruby/${rubyver}/x86_64-linux/io/wait.so \
160     "${pkgdir}"/usr/lib/ruby/${rubyver}/x86_64-linux/json \
161     "${pkgdir}"/usr/lib/ruby/${rubyver}/x86_64-linux/racc
164 package_ruby-docs() {
165   pkgdesc='Documentation files for ruby'
167   cd ruby-${pkgver}
169   make DESTDIR="${pkgdir}" install-doc install-capi
171   install -D -m644 COPYING "${pkgdir}/usr/share/licenses/ruby-docs/LICENSE"
172   install -D -m644 BSDL "${pkgdir}/usr/share/licenses/ruby-docs/BSDL"
175 package_ruby-stdlib() {
176   # upstream list of gems contained in stdlib ( https://github.com/ruby/ruby/tree/master/{ext,lib} )
177   pkgdesc='A vast collection of classes and modules that you can require in your code for additional features'
179   depends=(
180     ruby-abbrev
181     ruby-base64
182     ruby-benchmark
183     ruby-bigdecimal
184     ruby-bundler
185     ruby-cgi
186     ruby-csv
187     ruby-date
188     #ruby-dbm   # removed in 3.1.2
189     #ruby-debug   # removed in 3.1.2
190     ruby-delegate
191     ruby-did_you_mean
192     ruby-digest
193     ruby-drb
194     ruby-english
195     ruby-erb
196     ruby-etc
197     ruby-fcntl
198     ruby-fiddle
199     ruby-fileutils
200     ruby-find
201     ruby-forwardable
202     #ruby-gdbm   # removed in 3.1.2
203     ruby-getoptlong
204     ruby-io-console
205     ruby-io-nonblock
206     ruby-io-wait
207     ruby-ipaddr
208     ruby-irb
209     ruby-json
210     ruby-logger
211     #ruby-matrix   # removed in 3.1.2
212     ruby-mutex_m
213     #ruby-net-ftp   # removed in 3.1.2
214     ruby-net-http
215     #ruby-net-imap   # removed in 3.1.2
216     #ruby-net-pop   # removed in 3.1.2
217     #ruby-net-protocol
218     #ruby-net-smtp   # removed in 3.1.2
219     #ruby-nkf
220     #ruby-observer
221     ruby-open-uri
222     #ruby-open3
223     #ruby-openssl
224     #ruby-optparse
225     #ruby-ostruct
226     #ruby-pathname
227     #ruby-pp
228     #ruby-prettyprint
229     #ruby-prime   # removed in 3.1.2
230     #ruby-pstore
231     ruby-psych
232     ruby-racc
233     ruby-rdoc
234     #ruby-readline
235     #ruby-readline-ext
236     ruby-reline
237     #ruby-resolv
238     #ruby-resolv-replace
239     #ruby-rinda
240     #ruby-securerandom
241     #ruby-set
242     #ruby-shellwords
243     #ruby-singleton
244     ruby-stringio
245     #ruby-strscan
246     #ruby-syslog
247     #ruby-tempfile
248     ruby-time
249     #ruby-timeout
250     ruby-tmpdir
251     #ruby-tracer   # removed in 3.1.2
252     #ruby-tsort
253     #ruby-un
254     ruby-uri
255     #ruby-weakref
256     #ruby-yaml
257     #ruby-zlib
259     #ruby-error_highlight   # new in 3.2.1
260     #ruby2_keywords   # new in 3.1.2 - already exists in [community]
261   )
264 package_ruby-bundledgems() {
265   # upstream list of bundled gems ( https://github.com/ruby/ruby/blob/master/gems/bundled_gems )
266   pkgdesc='Ruby Gems (third-party libraries) that are installed by default when Ruby is installed'
268   depends=(
269     ruby-minitest
270     ruby-power_assert
271     ruby-rake
272     #ruby-rbs
273     ruby-rexml
274     #ruby-rss
275     ruby-test-unit
276     #ruby-typeprof
278     # --- new in 3.1.2
279     #ruby-debug
280     #ruby-matrix
281     #ruby-net-ftp
282     #ruby-net-imap
283     #ruby-net-pop
284     #ruby-net-smtp
285     #ruby-prime
286   )
289 # vim: tabstop=2 shiftwidth=2 expandtab: