diff options
Diffstat (limited to 'main/ruby/APKBUILD')
-rw-r--r-- | main/ruby/APKBUILD | 74 |
1 files changed, 55 insertions, 19 deletions
diff --git a/main/ruby/APKBUILD b/main/ruby/APKBUILD index f958649ac50..b7c061773db 100644 --- a/main/ruby/APKBUILD +++ b/main/ruby/APKBUILD @@ -1,9 +1,16 @@ # Contributor: Carlo Landmeter <clandmeter@alpinelinux.org> # Contributor: Jakub Jirutka <jakub@jirutka.cz> -# Contributor: Nulo <git@nulo.in> # Maintainer: Jakub Jirutka <jakub@jirutka.cz> # # secfixes: +# 3.1.4-r0: +# - CVE-2023-28755 +# - CVE-2023-28756 +# 3.1.3-r0: +# - CVE-2021-33621 +# 3.1.2-r0: +# - CVE-2022-28738 +# - CVE-2022-28739 # 3.0.3-r0: # - CVE-2021-41817 # - CVE-2021-41816 @@ -51,7 +58,7 @@ pkgname=ruby # When upgrading, upgrade also each ruby-<name> aport listed in file # gems/bundled_gems. If some aport is missing or not in the main repo, # create/move it. -pkgver=3.0.3 +pkgver=3.3.0 _abiver="${pkgver%.*}.0" pkgrel=0 pkgdesc="An object-oriented language for quick and easy programming" @@ -65,8 +72,17 @@ depends_dev=" gmp-dev libucontext-dev " -makedepends="$depends_dev zlib-dev openssl1.1-compat-dev gdbm-dev readline-dev - libffi-dev coreutils yaml-dev linux-headers autoconf" +makedepends="$depends_dev + autoconf + cargo + gdbm-dev + libffi-dev + linux-headers + openssl-dev>3 + readline-dev + yaml-dev + zlib-dev + " install="$pkgname.post-upgrade" subpackages="$pkgname-dbg $pkgname-doc $pkgname-dev $pkgname-rdoc::noarch @@ -74,10 +90,10 @@ subpackages="$pkgname-dbg $pkgname-doc $pkgname-dev $pkgname-full::noarch " source="https://cache.ruby-lang.org/pub/ruby/${pkgver%.*}/ruby-$pkgver.tar.gz - get-ruby_nonempty_memcpy-to-have-c-linkage.patch test_insns-lower-recursion-depth.patch fix-get_main_stack.patch dont-install-bundled-gems.patch + fix-riscv64-build.patch " replaces="ruby-gems" @@ -89,7 +105,6 @@ done _gemdir="/usr/lib/ruby/gems/$_abiver" _rubydir="/usr/lib/ruby/$_abiver" _chost="${CHOST/-alpine-/-}" -_depends_full='' # see prepare() case "$CARCH" in x86) _arch="i386";; @@ -112,17 +127,20 @@ prepare() { if ! apk add -qs "ruby-$name>=$ver" >/dev/null 2>&1; then warning "bump package ruby-$name to version $ver" fi - _depends_full="$_depends_full ruby-$name>=$ver" + echo "ruby-$name>=$ver" >> "$srcdir"/.ruby-full.depends esac done < "$builddir"/gems/bundled_gems } build() { # -fomit-frame-pointer makes ruby segfault, see gentoo bug #150413 - # In many places aliasing rules are broken; play it safe - # as it's risky with newer compilers to leave it as it is. - export CFLAGS="$CFLAGS -fno-omit-frame-pointer -fno-strict-aliasing" - export CPPFLAGS="$CPPFLAGS -fno-omit-frame-pointer -fno-strict-aliasing" + # In many places aliasing rules are broken; play it safe + # as it's risky with newer compilers to leave it as it is. + # -O2 - ruby is a language runtime, so performance is crucial. Moreover, + # ruby 3.1.1 fails with Bus Error when compiled with -Os on armhf/armv7. + # This makes ruby-libs 7% bigger (13.4 -> 14.4 MiB). + export CFLAGS="${CFLAGS/-Os/} -fno-omit-frame-pointer -fno-strict-aliasing" + export CPPFLAGS="${CPPFLAGS/-Os/} -fno-omit-frame-pointer -fno-strict-aliasing" # Needed for coroutine stuff export LIBS="-lucontext" @@ -130,6 +148,12 @@ build() { # ruby saves path to install. we want use $PATH export INSTALL=install + case "$CARCH" in + # Ruby segfaults when built with default (-O3). + # See https://bugs.ruby-lang.org/issues/20099. + s390x) export optflags="-O2";; + esac + # the configure script does not detect isnan/isinf as macros export ac_cv_func_isnan=yes export ac_cv_func_isinf=yes @@ -151,11 +175,23 @@ build() { } check() { - make test + # https://bugs.ruby-lang.org/issues/18380 + local disable_tests="-n !/TestAddressResolve#test_socket_getnameinfo_domain_blocking/" + + case "$CARCH" in + x86 | armhf | armv7) + # TestReadline#test_interrupt_in_other_thread fails on 32 bit arches according + # to upstream, but the test is disabled just on Travis, not in test suite. + # https://bugs.ruby-lang.org/issues/18393 + disable_tests="$disable_tests -n !/TestReadline#test_interrupt_in_other_thread/" + ;; + esac + + make test TESTS="$disable_tests" } package() { - make DESTDIR="$pkgdir" install + make DESTDIR="$pkgdir" SUDO="" install install -m 644 -D COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING @@ -209,15 +245,15 @@ full() { pkgdesc="Ruby with all bundled gems" # bundler is bundled since Ruby 2.6, so include it in ruby-full despite # that it's provided by a seprate aport/package. - depends="ruby ruby-rdoc ruby-bundler $_depends_full" + depends="ruby ruby-rdoc ruby-bundler $(cat "$srcdir"/.ruby-full.depends)" mkdir -p "$subpkgdir" } sha512sums=" -39dab51a0d784a38302372b99f96205817d466245202586d22123745761e9cb39db128ec2b984ebc3919b9faf2adf828d19c97d3fb1e56d44be0a81dc5d11b87 ruby-3.0.3.tar.gz -59f85e23f9487b6a3ff1a5de9f73c243f23d2f9538d2628b4ba1fe62b47d5cac254e812ae2a0212d5866fb9df89125b32829b77f8d9397a2fcc4d39d837916e9 get-ruby_nonempty_memcpy-to-have-c-linkage.patch -2ee66e841f841ad6e7c8877ec20b548d23b50d6a888a0d2d16f9062892c5d1c64efb59385f6723bae6cd1591824278787eefc0180768619c653243756d1300ab test_insns-lower-recursion-depth.patch -8e0a75899a3855f85441dabb6571569f13cf3472c2ccb2ec5c8e0e5cc9026af3c9951ebed4a754d9723dfd1c8ece32862802f20e18b7e5de4875125d92ef146b fix-get_main_stack.patch -10bda0462feaec73a7522ef622ffc18815b1d4302e771013ab78ef88d1d9f76277b1d24401eff054e031ca0fbc1ac80486d58282378cbdaf695786b212e6524d dont-install-bundled-gems.patch +26074009b501fc793d71a74e419f34a6033c9353433919ca74ba2d24a3de432dbb11fd92c2bc285f0e4d951a6d6c74bf5b69a2ab36200c8c26e871746d6e0fc6 ruby-3.3.0.tar.gz +16fc1f35aee327d1ecac420b091beaa53c675e0504d5a6932004f17ca68a2c38f57b053b0a3903696f2232c5add160d363e3972a962f7f7bcb52e4e998c7315d test_insns-lower-recursion-depth.patch +42cd45c1db089a1ae57834684479a502e357ddba82ead5fa34e64c13971e7ab7ad2919ddd60a104a817864dd3e2e35bdbedb679210eb41d82cab36a0687e43d4 fix-get_main_stack.patch +a77da5e5eb7d60caf3f1cabb81e09b88dc505ddd746e34efd1908c0096621156d81cc65095b846ba9bdb66028891aefce883a43ddec6b56b5beb4aac5e4ee33f dont-install-bundled-gems.patch +000530316af1fca007fe8cee694b59e2e801674bcc1a2ebea95e67745d4afc0ce66c902fdbc88ee847a4fbf55115b183cd803cbf7c98ef685938efb3e2b7c991 fix-riscv64-build.patch " |