- # rbconfig.rb, used to build native gems, thinks that ${TERMUX_HOST_PLATFORM}-gcc should
- # be used, but we want normal gcc
- local RBCONFIG=$TERMUX_PREFIX/lib/ruby/${_MAJOR_VERSION}.0/arm-linux-androideabi/rbconfig.rb
- for tool in gcc "g\+\+" strip nm objdump ar ranlib ld cpp; do
- perl -p -i -e "s/${TERMUX_HOST_PLATFORM}-$tool/$tool/g" $RBCONFIG
- done
- perl -p -i -e 's@"/bin/mkdir@"/system/bin/mkdir@' $RBCONFIG
- perl -p -i -e "s@/usr/bin/install@$TERMUX_PREFIX/bin/applets/install@" $RBCONFIG
- # Make C++-using gems link against libgnustl_shared instead of the limited system libstdc++:
- perl -p -i -e 's/\(CXX\) -shared/\(CXX\) -shared -lgnustl_shared/' $RBCONFIG
- # Fix mention of $_SPECSFLAG in rbconfig:
- perl -p -i -e "s|${_SPECSFLAG}||g" $RBCONFIG
-}