Update global to 6.6.1 (#1938)
[termux-packages] / packages / ruby / build.sh
CommitLineData
59f0d218
FF
1TERMUX_PKG_HOMEPAGE=https://www.ruby-lang.org/
2TERMUX_PKG_DESCRIPTION="Dynamic programming language with a focus on simplicity and productivity"
ed198efe 3_MAJOR_VERSION=2.4
2f630286 4TERMUX_PKG_VERSION=${_MAJOR_VERSION}.2
cc548e72 5TERMUX_PKG_REVISION=2
2f630286 6TERMUX_PKG_SHA256=748a8980d30141bd1a4124e11745bb105b436fb1890826e0d2b9ea31af27f735
6257a921 7TERMUX_PKG_SRCURL=https://cache.ruby-lang.org/pub/ruby/${_MAJOR_VERSION}/ruby-${TERMUX_PKG_VERSION}.tar.xz
59f0d218 8# libbffi is used by the fiddle extension module:
c55bda6d 9TERMUX_PKG_DEPENDS="libandroid-support, libffi, libgmp, readline, openssl, libutil, libyaml"
59f0d218
FF
10# Needed to fix compilation on android:
11TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_func_setgroups=no ac_cv_func_setresuid=no ac_cv_func_setreuid=no --enable-rubygems"
6352f1b9
FF
12# The gdbm module seems to be very little used:
13TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --without-gdbm"
14# Do not link in libcrypt.so if available (now in disabled-packages):
15TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_lib_crypt_crypt=no"
a8dfe862
FF
16# Fix DEPRECATED_TYPE macro clang compatibility:
17TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" rb_cv_type_deprecated=x"
7ce56385
FF
18# getresuid(2) does not work on ChromeOS - https://github.com/termux/termux-app/issues/147:
19# TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_func_getresuid=no"
59f0d218 20
ec940174
HG
21termux_step_pre_configure() {
22 # This exception is to avoid a broken ruby on 32-bit arm
23 # with NDK r15c and ruby 2.4.2 - see #1520.
24 if [ "$TERMUX_ARCH" = arm ]; then
25 CFLAGS=${CFLAGS/Oz/O1}
26 fi
27}
28
59f0d218
FF
29termux_step_make_install () {
30 make install
31 make uninstall # remove possible remains to get fresh timestamps
32 make install
33
ed198efe 34 local RBCONFIG=$TERMUX_PREFIX/lib/ruby/${_MAJOR_VERSION}.0/${TERMUX_HOST_PLATFORM}/rbconfig.rb
f34a276b
FF
35
36 # Fix absolute paths to executables:
ed198efe
FF
37 perl -p -i -e 's/^.*CONFIG\["INSTALL"\].*$/ CONFIG["INSTALL"] = "install -c"/' $RBCONFIG
38 perl -p -i -e 's/^.*CONFIG\["PKG_CONFIG"\].*$/ CONFIG["PKG_CONFIG"] = "pkg-config"/' $RBCONFIG
39 perl -p -i -e 's/^.*CONFIG\["MAKEDIRS"\].*$/ CONFIG["MAKEDIRS"] = "mkdir -p"/' $RBCONFIG
40 perl -p -i -e 's/^.*CONFIG\["MKDIR_P"\].*$/ CONFIG["MKDIR_P"] = "mkdir -p"/' $RBCONFIG
41 perl -p -i -e 's/^.*CONFIG\["EGREP"\].*$/ CONFIG["EGREP"] = "grep -E"/' $RBCONFIG
42 perl -p -i -e 's/^.*CONFIG\["GREP"\].*$/ CONFIG["GREP"] = "grep"/' $RBCONFIG
59f0d218 43}
10f54605
FF
44
45termux_step_post_massage () {
ed198efe
FF
46 if [ ! -f $TERMUX_PREFIX/lib/ruby/${_MAJOR_VERSION}.0/${TERMUX_HOST_PLATFORM}/readline.so ]; then
47 echo "Error: The readline extension was not built"
48 fi
10f54605 49}