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" | |
3 | _MAJOR_VERSION=2.2 | |
cf741c10 | 4 | TERMUX_PKG_VERSION=${_MAJOR_VERSION}.3 |
3a663827 | 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: | |
8 | TERMUX_PKG_DEPENDS="libffi, libgmp, readline, openssl" | |
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" | |
12 | ||
13 | # Ruby does not use this directly, but specify for gem building C++-using extensions: | |
14 | CXXFLAGS+=" -frtti -fexceptions" # -lgnustl_shared" | |
15 | ||
16 | termux_step_pre_configure () { | |
17 | export GEM_HOME=$TERMUX_PREFIX/var/lib/gems | |
18 | mkdir -p $GEM_HOME | |
19 | } | |
20 | ||
21 | termux_step_make_install () { | |
22 | make install | |
23 | make uninstall # remove possible remains to get fresh timestamps | |
24 | make install | |
25 | ||
f34a276b FF |
26 | # rbconfig.rb, used to build native gems, thinks that ${TERMUX_HOST_PLATFORM}-$TOOLNAME should |
27 | # be used, but we want the unprefixed $TOOLNAME: | |
3a663827 | 28 | local RBCONFIG=$TERMUX_PREFIX/lib/ruby/${_MAJOR_VERSION}.0/${TERMUX_HOST_PLATFORM}/rbconfig.rb |
59f0d218 FF |
29 | for tool in gcc "g\+\+" strip nm objdump ar ranlib ld cpp; do |
30 | perl -p -i -e "s/${TERMUX_HOST_PLATFORM}-$tool/$tool/g" $RBCONFIG | |
31 | done | |
f34a276b FF |
32 | |
33 | # Fix absolute paths to executables: | |
34 | perl -p -i -e 's@"/bin/mkdir@"mkdir@' $RBCONFIG | |
35 | perl -p -i -e "s@/usr/bin/install@install@" $RBCONFIG | |
36 | ||
59f0d218 FF |
37 | # Make C++-using gems link against libgnustl_shared instead of the limited system libstdc++: |
38 | perl -p -i -e 's/\(CXX\) -shared/\(CXX\) -shared -lgnustl_shared/' $RBCONFIG | |
0aa37fa2 FF |
39 | # Fix mention of $_SPECSFLAG in rbconfig: |
40 | perl -p -i -e "s|${_SPECSFLAG}||g" $RBCONFIG | |
59f0d218 | 41 | } |