diff --git a/srcpkgs/ruby/template b/srcpkgs/ruby/template index 736253a0427..67bc2a1352a 100644 --- a/srcpkgs/ruby/template +++ b/srcpkgs/ruby/template @@ -3,7 +3,7 @@ _ruby_abiver=2.7.0 pkgname=ruby version=2.7.1 -revision=2 +revision=3 build_style=gnu-configure configure_args="--enable-shared --disable-rpath DOXYGEN=/usr/bin/doxygen DOT=/usr/bin/dot PKG_CONFIG=/usr/bin/pkg-config" @@ -38,6 +38,7 @@ case "$XBPS_TARGET_MACHINE" in configure_args+=" --with-coroutine=ppc64le" ;; ppc-musl) + _need_libucontext=yes makedepends+=" libucontext-devel" configure_args+=" LIBS=-lucontext" ;; @@ -54,6 +55,25 @@ post_patch() { patch -sNp1 -i ${FILESDIR}/rubygems-avoid-platform-specific-gems.patch } +pre_configure() { + # this allows the test suite to pass without crashing + export CFLAGS+=" -fno-omit-frame-pointer -fno-strict-aliasing" + export CPPFLAGS+=" -fno-omit-frame-pointer -fno-strict-aliasing" + + case "$XBPS_TARGET_MACHINE" in + ppc64le*) ;; + ppc*) + # Random segfaults otherwise + export CFLAGS+=" -Os" + export CPPFLAGS+=" -Os" + ;; + esac + + # force this to pass on systems with these as macros (musl) + export ac_cv_func_isnan=yes + export ac_cv_func_isinf=yes +} + pre_build() { # Force getaddrinfo detection. sed -e 's,\(checking_for("wide getaddrinfo") {try_\)run,\1link,' -i ext/socket/extconf.rb @@ -99,9 +119,9 @@ ruby-devel-doc_package() { ruby-devel_package() { depends="ruby-${version}_${revision} gmp-devel" - case "$XBPS_TARGET_MACHINE" in - ppc-musl) depends+=" libucontext-devel" ;; - esac + if [ "$_need_libucontext" ]; then + depends+=" libucontext-devel" + fi short_desc+=" - development files" pkg_install() { vmove usr/include