Commit | Line | Data |
---|---|---|
59f0d218 FF |
1 | TERMUX_PKG_HOMEPAGE=https://www.ruby-lang.org/ |
2 | TERMUX_PKG_DESCRIPTION="Dynamic programming language with a focus on simplicity and productivity" | |
98e0a8ee | 3 | _MAJOR_VERSION=2.3 |
549acba1 | 4 | TERMUX_PKG_VERSION=${_MAJOR_VERSION}.1 |
174a0b74 | 5 | TERMUX_PKG_BUILD_REVISION=4 |
59f0d218 FF |
6 | TERMUX_PKG_SRCURL=http://cache.ruby-lang.org/pub/ruby/${_MAJOR_VERSION}/ruby-${TERMUX_PKG_VERSION}.tar.xz |
7 | # libbffi is used by the fiddle extension module: | |
76d22fff | 8 | TERMUX_PKG_DEPENDS="libandroid-support, libffi, libgmp, readline, openssl, libutil" |
59f0d218 FF |
9 | TERMUX_PKG_KEEP_HEADER_FILES="true" |
10 | # Needed to fix compilation on android: | |
11 | TERMUX_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: |
13 | TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --without-gdbm" | |
14 | # Do not link in libcrypt.so if available (now in disabled-packages): | |
15 | TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_lib_crypt_crypt=no" | |
59f0d218 FF |
16 | |
17 | # Ruby does not use this directly, but specify for gem building C++-using extensions: | |
18 | CXXFLAGS+=" -frtti -fexceptions" # -lgnustl_shared" | |
19 | ||
20 | termux_step_pre_configure () { | |
21 | export GEM_HOME=$TERMUX_PREFIX/var/lib/gems | |
22 | mkdir -p $GEM_HOME | |
23 | } | |
24 | ||
25 | termux_step_make_install () { | |
26 | make install | |
27 | make uninstall # remove possible remains to get fresh timestamps | |
28 | make install | |
29 | ||
f34a276b FF |
30 | # rbconfig.rb, used to build native gems, thinks that ${TERMUX_HOST_PLATFORM}-$TOOLNAME should |
31 | # be used, but we want the unprefixed $TOOLNAME: | |
3a663827 | 32 | local RBCONFIG=$TERMUX_PREFIX/lib/ruby/${_MAJOR_VERSION}.0/${TERMUX_HOST_PLATFORM}/rbconfig.rb |
59f0d218 FF |
33 | for tool in gcc "g\+\+" strip nm objdump ar ranlib ld cpp; do |
34 | perl -p -i -e "s/${TERMUX_HOST_PLATFORM}-$tool/$tool/g" $RBCONFIG | |
35 | done | |
f34a276b FF |
36 | |
37 | # Fix absolute paths to executables: | |
a962e732 FF |
38 | perl -p -i -e 's/^.*CONFIG\["INSTALL"\].*$/ CONFIG["INSTALL"] = "install -c"/' $RBCONFIG |
39 | perl -p -i -e 's/^.*CONFIG\["PKG_CONFIG"\].*$/ CONFIG["PKG_CONFIG"] = "pkg-config"/' $RBCONFIG | |
40 | perl -p -i -e 's/^.*CONFIG\["MAKEDIRS"\].*$/ CONFIG["MAKEDIRS"] = "mkdir -p"/' $RBCONFIG | |
41 | perl -p -i -e 's/^.*CONFIG\["MKDIR_P"\].*$/ CONFIG["MKDIR_P"] = "mkdir -p"/' $RBCONFIG | |
42 | perl -p -i -e 's/^.*CONFIG\["EGREP"\].*$/ CONFIG["EGREP"] = "grep -E"/' $RBCONFIG | |
43 | perl -p -i -e 's/^.*CONFIG\["GREP"\].*$/ CONFIG["GREP"] = "grep"/' $RBCONFIG | |
f34a276b | 44 | |
0aa37fa2 FF |
45 | # Fix mention of $_SPECSFLAG in rbconfig: |
46 | perl -p -i -e "s|${_SPECSFLAG}||g" $RBCONFIG | |
59f0d218 | 47 | } |
10f54605 FF |
48 | |
49 | termux_step_post_massage () { | |
50 | if [ ! -f $TERMUX_PREFIX/lib/ruby/${_MAJOR_VERSION}.0/${TERMUX_HOST_PLATFORM}/readline.so ]; then | |
51 | echo "Error: The readline extension was not built" | |
52 | fi | |
53 | } |