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 FF |
3 | _MAJOR_VERSION=2.3 |
4 | TERMUX_PKG_VERSION=${_MAJOR_VERSION}.0 | |
59f0d218 FF |
5 | TERMUX_PKG_SRCURL=http://cache.ruby-lang.org/pub/ruby/${_MAJOR_VERSION}/ruby-${TERMUX_PKG_VERSION}.tar.xz |
6 | # libbffi is used by the fiddle extension module: | |
6352f1b9 | 7 | TERMUX_PKG_DEPENDS="libffi, libgmp, readline, openssl, libutil" |
59f0d218 FF |
8 | TERMUX_PKG_KEEP_HEADER_FILES="true" |
9 | # Needed to fix compilation on android: | |
10 | TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_func_setgroups=no ac_cv_func_setresuid=no ac_cv_func_setreuid=no --enable-rubygems" | |
6352f1b9 FF |
11 | # The gdbm module seems to be very little used: |
12 | TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --without-gdbm" | |
13 | # Do not link in libcrypt.so if available (now in disabled-packages): | |
14 | TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_lib_crypt_crypt=no" | |
59f0d218 FF |
15 | |
16 | # Ruby does not use this directly, but specify for gem building C++-using extensions: | |
17 | CXXFLAGS+=" -frtti -fexceptions" # -lgnustl_shared" | |
18 | ||
19 | termux_step_pre_configure () { | |
20 | export GEM_HOME=$TERMUX_PREFIX/var/lib/gems | |
21 | mkdir -p $GEM_HOME | |
22 | } | |
23 | ||
24 | termux_step_make_install () { | |
25 | make install | |
26 | make uninstall # remove possible remains to get fresh timestamps | |
27 | make install | |
28 | ||
f34a276b FF |
29 | # rbconfig.rb, used to build native gems, thinks that ${TERMUX_HOST_PLATFORM}-$TOOLNAME should |
30 | # be used, but we want the unprefixed $TOOLNAME: | |
3a663827 | 31 | local RBCONFIG=$TERMUX_PREFIX/lib/ruby/${_MAJOR_VERSION}.0/${TERMUX_HOST_PLATFORM}/rbconfig.rb |
59f0d218 FF |
32 | for tool in gcc "g\+\+" strip nm objdump ar ranlib ld cpp; do |
33 | perl -p -i -e "s/${TERMUX_HOST_PLATFORM}-$tool/$tool/g" $RBCONFIG | |
34 | done | |
f34a276b FF |
35 | |
36 | # Fix absolute paths to executables: | |
37 | perl -p -i -e 's@"/bin/mkdir@"mkdir@' $RBCONFIG | |
38 | perl -p -i -e "s@/usr/bin/install@install@" $RBCONFIG | |
39 | ||
59f0d218 FF |
40 | # Make C++-using gems link against libgnustl_shared instead of the limited system libstdc++: |
41 | perl -p -i -e 's/\(CXX\) -shared/\(CXX\) -shared -lgnustl_shared/' $RBCONFIG | |
0aa37fa2 FF |
42 | # Fix mention of $_SPECSFLAG in rbconfig: |
43 | perl -p -i -e "s|${_SPECSFLAG}||g" $RBCONFIG | |
59f0d218 | 44 | } |