1
0
mirror of https://github.com/termux/termux-packages synced 2024-06-14 12:46:42 +00:00

Merge branch 'master' into readline

This commit is contained in:
Fredrik Fornwall 2019-02-24 20:41:00 +02:00 committed by GitHub
commit 6f8d64a790
45 changed files with 642 additions and 548 deletions

View File

@ -35,8 +35,12 @@ Normally, all pull requests will be tested by [Travis CI](https://travis-ci.org/
All tests for master branch are done by Gitlab CI.
## Mailing Lists
## Contacts
- [General Mailing List](https://groups.io/g/termux)
- General Mailing List: https://groups.io/g/termux
- [Developer Mailing List](https://groups.io/g/termux-dev)
- Developer Mailing List: https://groups.io/g/termux-dev
- Developer Chat: https://gitter.im/termux/dev or #termux/development on IRC/freenode.
If you are interested in our weekly development sessions, please check the https://wiki.termux.com/wiki/Dev:Development_Sessions. Also, you may want to check the https://wiki.termux.com/wiki/Development.

View File

@ -116,15 +116,16 @@ termux_setup_rust() {
# Utility function to setup a current ninja build system.
termux_setup_ninja() {
local NINJA_VERSION=1.8.2
local NINJA_VERSION=1.9.0
local NINJA_FOLDER=$TERMUX_COMMON_CACHEDIR/ninja-$NINJA_VERSION
if [ ! -x "$NINJA_FOLDER/ninja" ]; then
mkdir -p "$NINJA_FOLDER"
local NINJA_ZIP_FILE=$TERMUX_PKG_TMPDIR/ninja-$NINJA_VERSION.zip
termux_download https://github.com/ninja-build/ninja/releases/download/v$NINJA_VERSION/ninja-linux.zip \
"$NINJA_ZIP_FILE" \
d2fea9ff33b3ef353161ed906f260d565ca55b8ca0568fa07b1d2cab90a84a07
609cc10d0f226a4d9050e4d4a57be9ea706858cce64b9132102c3789c868da92
unzip "$NINJA_ZIP_FILE" -d "$NINJA_FOLDER"
chmod 755 $NINJA_FOLDER/ninja
fi
export PATH=$NINJA_FOLDER:$PATH
}
@ -357,7 +358,7 @@ termux_step_setup_variables() {
if [ ! -d "$NDK" ]; then
termux_error_exit 'NDK not pointing at a directory!'
fi
if ! grep -s -q "Pkg.Revision = $TERMUX_NDK_VERSION" "$NDK/source.properties"; then
if ! grep -s -q "Pkg.Revision = $TERMUX_NDK_VERSION_NUM" "$NDK/source.properties"; then
termux_error_exit "Wrong NDK version - we need $TERMUX_NDK_VERSION"
fi
@ -556,7 +557,7 @@ termux_step_start_build() {
TERMUX_STANDALONE_TOOLCHAIN="$TERMUX_COMMON_CACHEDIR/${TERMUX_NDK_VERSION}-${TERMUX_ARCH}-${TERMUX_PKG_API_LEVEL}"
# Bump the below version if a change is made in toolchain setup to ensure
# that everyone gets an updated toolchain:
TERMUX_STANDALONE_TOOLCHAIN+="-v4"
TERMUX_STANDALONE_TOOLCHAIN+="-v1"
if [ -n "${TERMUX_PKG_BLACKLISTED_ARCHES:=""}" ] && [ "$TERMUX_PKG_BLACKLISTED_ARCHES" != "${TERMUX_PKG_BLACKLISTED_ARCHES/$TERMUX_ARCH/}" ]; then
echo "Skipping building $TERMUX_PKG_NAME for arch $TERMUX_ARCH"
@ -568,10 +569,12 @@ termux_step_start_build() {
if [ "$TERMUX_SKIP_DEPCHECK" = false ] && [ "$TERMUX_INSTALL_DEPS" = true ]; then
# Download dependencies
local pkg dep_arch dep_version deb_file _PKG_DEPENDS _PKG_BUILD_DEPENDS
# remove (>= 1.0) and similar version tags with sed:
_PKG_DEPENDS=$(echo ${TERMUX_PKG_DEPENDS//,/ } | sed "s/[(][^)]*[)]//g")
_PKG_BUILD_DEPENDS=${TERMUX_PKG_BUILD_DEPENDS//,/ }
for pkg in $_PKG_DEPENDS $_PKG_BUILD_DEPENDS; do
# remove (>= 1.0) and similar version tags:
_PKG_DEPENDS=$(echo ${TERMUX_PKG_DEPENDS// /} | sed "s/[(][^)]*[)]//g")
_PKG_BUILD_DEPENDS=${TERMUX_PKG_BUILD_DEPENDS// /}
for pkg in ${_PKG_DEPENDS//,/ } ${_PKG_BUILD_DEPENDS//,/ }; do
# handle "or" in dependencies (use first one):
if [ ! "$pkg" = "${pkg/|/}" ]; then pkg=$(echo "$pkg" | sed "s%|.*%%"); fi
# llvm doesn't build if ndk-sysroot is installed:
if [ "$pkg" = "ndk-sysroot" ]; then continue; fi
read dep_arch dep_version <<< $(termux_extract_dep_info "$pkg")
@ -691,7 +694,7 @@ termux_step_start_build() {
Requires:
Libs: -lz
HERE
ln -sf $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/$TERMUX_HOST_PLATFORM/$TERMUX_PKG_API_LEVEL/libz.so $TERMUX_PREFIX/lib/libz.so
# Keep track of when build started so we can see what files have been created.
# We start by sleeping so that any generated files above (such as zlib.pc) get
# an older timestamp than the TERMUX_BUILD_TS_FILE.
@ -783,7 +786,11 @@ termux_step_setup_toolchain() {
export AS=${TERMUX_HOST_PLATFORM}-clang
export CC=$TERMUX_HOST_PLATFORM-clang
export CXX=$TERMUX_HOST_PLATFORM-clang++
export CCTERMUX_HOST_PLATFORM=$TERMUX_HOST_PLATFORM$TERMUX_PKG_API_LEVEL
if [ $TERMUX_ARCH = arm ]; then
CCTERMUX_HOST_PLATFORM=armv7a-linux-androideabi$TERMUX_PKG_API_LEVEL
fi
export AR=$TERMUX_HOST_PLATFORM-ar
export CPP=${TERMUX_HOST_PLATFORM}-cpp
export CC_FOR_BUILD=gcc
@ -889,7 +896,7 @@ termux_step_setup_toolchain() {
# Setup the cpp preprocessor:
cp $_TERMUX_TOOLCHAIN_TMPDIR/bin/$TERMUX_HOST_PLATFORM-clang \
$_TERMUX_TOOLCHAIN_TMPDIR/bin/$TERMUX_HOST_PLATFORM-cpp
sed -i 's/clang70/clang70 -E/' \
sed -i 's/clang80/clang80 -E/' \
$_TERMUX_TOOLCHAIN_TMPDIR/bin/$TERMUX_HOST_PLATFORM-cpp
cd $_TERMUX_TOOLCHAIN_TMPDIR/sysroot
@ -914,9 +921,7 @@ termux_step_setup_toolchain() {
sed -i "s/define __ANDROID_API__ __ANDROID_API_FUTURE__/define __ANDROID_API__ $TERMUX_PKG_API_LEVEL/" \
usr/include/android/api-level.h
local _LIBDIR=usr/lib
if [ $TERMUX_ARCH = x86_64 ]; then _LIBDIR+=64; fi
$TERMUX_ELF_CLEANER $_LIBDIR/*.so
$TERMUX_ELF_CLEANER usr/lib/*/*/*.so
# zlib is really version 1.2.8 in the Android platform (at least
# starting from Android 5), not older as the NDK headers claim.
@ -925,11 +930,7 @@ termux_step_setup_toolchain() {
https://raw.githubusercontent.com/madler/zlib/v1.2.8/$file
done
unset file
cd $_TERMUX_TOOLCHAIN_TMPDIR/include/c++/4.9.x
sed "s%\@TERMUX_HOST_PLATFORM\@%${TERMUX_HOST_PLATFORM}%g" $TERMUX_SCRIPTDIR/ndk-patches/*.cpppatch | patch -p1
# Fix relative path in gcc/g++ script:
sed -i "s%\`dirname \$0\`/../../../../%$NDK/toolchains/%g" $_TERMUX_TOOLCHAIN_TMPDIR/bin/${TERMUX_HOST_PLATFORM}-gcc
sed -i "s%\`dirname \$0\`/../../../../%$NDK/toolchains/%g" $_TERMUX_TOOLCHAIN_TMPDIR/bin/${TERMUX_HOST_PLATFORM}-g++
grep -lrw $_TERMUX_TOOLCHAIN_TMPDIR/sysroot/usr/include/c++/v1 -e '<version>' | xargs -n 1 sed -i 's/<version>/\"version\"/g'
mv $_TERMUX_TOOLCHAIN_TMPDIR $TERMUX_STANDALONE_TOOLCHAIN
fi
@ -946,14 +947,7 @@ termux_step_setup_toolchain() {
mkdir -p "$TERMUX_PREFIX/lib"
cd "$TERMUX_PREFIX/lib"
local _STL_LIBFILE=
if [ "$TERMUX_ARCH" = arm ]; then
local _STL_LIBFILE=$TERMUX_STANDALONE_TOOLCHAIN/${TERMUX_HOST_PLATFORM}/lib/armv7-a/$_STL_LIBFILE_NAME
elif [ "$TERMUX_ARCH" = x86_64 ]; then
local _STL_LIBFILE=$TERMUX_STANDALONE_TOOLCHAIN/${TERMUX_HOST_PLATFORM}/lib64/$_STL_LIBFILE_NAME
else
local _STL_LIBFILE=$TERMUX_STANDALONE_TOOLCHAIN/${TERMUX_HOST_PLATFORM}/lib/$_STL_LIBFILE_NAME
fi
local _STL_LIBFILE=$TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/${TERMUX_HOST_PLATFORM}/$_STL_LIBFILE_NAME
cp "$_STL_LIBFILE" .
$STRIP --strip-unneeded $_STL_LIBFILE_NAME
@ -1041,7 +1035,7 @@ termux_step_configure_autotools() {
fi
local QUIET_BUILD=
if [ ! -z ${TERMUX_QUIET_BUILD+x} ]; then
if [ $TERMUX_QUIET_BUILD = true ]; then
QUIET_BUILD="--enable-silent-rules --silent --quiet"
fi
@ -1136,6 +1130,9 @@ termux_step_configure_cmake() {
else
MAKE_PROGRAM_PATH=$(which make)
fi
CFLAGS+=" --target=$CCTERMUX_HOST_PLATFORM"
CXXFLAGS+=" --target=$CCTERMUX_HOST_PLATFORM"
LDFLAGS+=" --target=$CCTERMUX_HOST_PLATFORM"
# XXX: CMAKE_{AR,RANLIB} needed for at least jsoncpp build to not
# pick up cross compiled binutils tool in $PREFIX/bin:
@ -1192,7 +1189,7 @@ termux_step_post_configure() {
termux_step_make() {
local QUIET_BUILD=
if [ ! -z ${TERMUX_QUIET_BUILD+x} ]; then
if [ $TERMUX_QUIET_BUILD = true ]; then
QUIET_BUILD="-s"
fi

View File

@ -1,14 +0,0 @@
--- /home/builder/cstddef.orig 2017-07-15 01:17:10.637496279 +0000
+++ ./cstddef 2017-07-15 10:28:28.526713523 +0000
@@ -40,7 +40,11 @@
#endif
// Don't include our own <stddef.h>; we don't want to declare ::nullptr_t.
+#ifdef __clang__
#include_next <stddef.h>
+#else
+#include "../../../lib/gcc/@TERMUX_HOST_PLATFORM@/4.9.x/include/stddef.h"
+#endif
#include <__nullptr>
_LIBCPP_BEGIN_NAMESPACE_STD

View File

@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="Tools and libraries to manipulate a wide range of multim
TERMUX_PKG_LICENSE="GPL-3.0"
# NOTE: mpv has to be rebuilt and version bumped after updating ffmpeg.
TERMUX_PKG_VERSION=4.1.1
TERMUX_PKG_REVISION=1
TERMUX_PKG_SHA256=373749824dfd334d84e55dff406729edfd1606575ee44dd485d97d45ea4d2d86
TERMUX_PKG_SRCURL=https://www.ffmpeg.org/releases/ffmpeg-${TERMUX_PKG_VERSION}.tar.xz
# libbz2 is used by matroska decoder:

View File

@ -2,7 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://gstreamer.freedesktop.org/
TERMUX_PKG_DESCRIPTION="GStreamer Bad Plug-ins"
TERMUX_PKG_LICENSE="LGPL-2.0"
TERMUX_PKG_VERSION=1.14.4
TERMUX_PKG_REVISION=1
TERMUX_PKG_REVISION=2
TERMUX_PKG_SHA256=910b4e0e2e897e8b6d06767af1779d70057c309f67292f485ff988d087aa0de5
TERMUX_PKG_SRCURL=https://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_BUILD_IN_SRC=yes

View File

@ -2,6 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://gstreamer.freedesktop.org/
TERMUX_PKG_DESCRIPTION="GStreamer Ugly Plug-ins"
TERMUX_PKG_LICENSE="LGPL-2.0"
TERMUX_PKG_VERSION=1.14.4
TERMUX_PKG_REVISION=1
TERMUX_PKG_SHA256=ac02d837f166c35ff6ce0738e281680d0b90052cfb1f0255dcf6aaca5f0f6d23
TERMUX_PKG_SRCURL=https://gstreamer.freedesktop.org/src/gst-plugins-ugly/gst-plugins-ugly-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_BUILD_IN_SRC=yes

View File

@ -30,7 +30,6 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
"
TERMUX_PKG_KEEP_STATIC_LIBRARIES=true
TERMUX_PKG_NO_DEVELSPLIT=yes
TERMUX_PKG_MAINTAINER="Joakim @joakim-noah"
termux_step_post_extract_package() {
mv llvm-${TERMUX_PKG_VERSION[1]}.src llvm

View File

@ -9,3 +9,6 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
-H$TERMUX_PKG_SRCDIR
-B$TERMUX_PKG_BUILDDIR
"
termux_step_pre_configure() {
LDFLAGS+=" -lm"
}

View File

@ -21,7 +21,7 @@ bin/macho-dump
lib/libgomp.a
lib/libiomp5.a
"
TERMUX_PKG_DEPENDS="binutils, ncurses, ndk-sysroot, ndk-stl, libffi"
TERMUX_PKG_DEPENDS="binutils, ncurses, ndk-sysroot, libffi"
# Replace gcc since gcc is deprecated by google on android and is not maintained upstream.
# Conflict with clang versions earlier than 3.9.1-3 since they bundled llvm.
TERMUX_PKG_CONFLICTS="gcc, clang (<< 3.9.1-3)"

View File

@ -1,11 +1,49 @@
--- ../cache/cfe-6.0.0.src/lib/Driver/ToolChains/Linux.cpp 2017-12-11 18:14:51.000000000 +0000
+++ ./tools/clang/lib/Driver/ToolChains/Linux.cpp 2018-03-13 03:32:36.142985756 +0000
@@ -816,7 +816,7 @@
--- ./linux.cpp.orig 2019-02-18 04:44:14.793138642 +0000
+++ ./tools/clang/lib/Driver/ToolChains/Linux.cpp 2019-02-18 04:52:44.527535617 +0000
@@ -311,6 +311,8 @@
// possible permutations of these directories, and seeing which ones it added
// to the link paths.
path_list &Paths = getFilePaths();
+ if(IsAndroid)
+ addPathIfExists(D, "@TERMUX_PREFIX@/lib", Paths);
const std::string OSLibDir = getOSLibDir(Triple, Args);
const std::string MultiarchTriple = getMultiarchTriple(D, Triple, SysRoot);
@@ -652,8 +654,27 @@
return;
if (!DriverArgs.hasArg(options::OPT_nostdlibinc))
+ if (getTriple().isAndroid()) {
+ switch (getTriple().getArch()) {
+ case llvm::Triple::x86_64:
+ addSystemInclude(DriverArgs, CC1Args, SysRoot + "@TERMUX_PREFIX@/include/x86_64-linux-android");
+ break;
+ case llvm::Triple::x86:
+ addSystemInclude(DriverArgs, CC1Args, SysRoot + "@TERMUX_PREFIX@/include/i686-linux-android");
+ break;
+ case llvm::Triple::aarch64:
+ addSystemInclude(DriverArgs, CC1Args, SysRoot + "@TERMUX_PREFIX@/include/aarch64-linux-android");
+ break;
+ case llvm::Triple::arm:
+ case llvm::Triple::thumb:
+ addSystemInclude(DriverArgs, CC1Args, SysRoot + "@TERMUX_PREFIX@/include/arm-linux-androideabi");
+ break;
+ default:
+ break;
+ }
+
addSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/local/include");
-
+ }
if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
SmallString<128> P(D.ResourceDir);
llvm::sys::path::append(P, "include");
@@ -968,7 +989,7 @@
}
bool Linux::isPIEDefault() const {
- return (getTriple().isAndroid() && !getTriple().isAndroidVersionLT(16)) ||
+ return getTriple().isAndroid() ||
+ return getTriple().isAndroid() ||
getTriple().isMusl() || getSanitizerArgs().requiresPIE();
}

View File

@ -1,8 +1,8 @@
TERMUX_PKG_HOMEPAGE=https://wiki.gnome.org/action/show/Projects/LibRsvg
TERMUX_PKG_DESCRIPTION="Library to render SVG files using cairo"
TERMUX_PKG_LICENSE="LGPL-2.0"
TERMUX_PKG_VERSION=2.45.4
TERMUX_PKG_SHA256=eeb6105cb28deec7a8a2ef270ae86b13fc555ff7dc85014a6b3e7cf0e88a7b4f
TERMUX_PKG_VERSION=2.45.5
TERMUX_PKG_SHA256=600872dc608fe5e01bfd8d5b3046d01b53b99121bc5ab9663531b53630843700
TERMUX_PKG_SRCURL=http://ftp.gnome.org/pub/GNOME/sources/librsvg/${TERMUX_PKG_VERSION:0:4}/librsvg-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_DEPENDS="libcroco,pango,gdk-pixbuf,libcairo-gobject"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--disable-introspection --disable-pixbuf-loader"

View File

@ -1,8 +1,8 @@
TERMUX_PKG_HOMEPAGE=https://www.videolan.org/developers/x264.html
TERMUX_PKG_DESCRIPTION="Library for encoding video streams into the H.264/MPEG-4 AVC format"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_VERSION=20180211
TERMUX_PKG_SHA256=cc9eaecaa7acc450120330979a53dbf8479c21ce7f4ab1aecc245d42384894bd
TERMUX_PKG_VERSION=20190215
TERMUX_PKG_SHA256=731c26a106dd97509feaaba2e6b57b27c754031d48186af6e1474cc0e1eee582
TERMUX_PKG_SRCURL=http://ftp.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-${TERMUX_PKG_VERSION}-2245-stable.tar.bz2
# Avoid linking against ffmpeg libraries to avoid circular dependency:
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="

View File

@ -2,7 +2,6 @@ TERMUX_PKG_HOMEPAGE=https://developer.android.com/tools/sdk/ndk/index.html
TERMUX_PKG_DESCRIPTION="Multilib binaries for cross-compilation"
TERMUX_PKG_LICENSE="NCSA"
TERMUX_PKG_VERSION=$TERMUX_NDK_VERSION
TERMUX_PKG_REVISION=3
TERMUX_PKG_NO_DEVELSPLIT=yes
TERMUX_PKG_KEEP_STATIC_LIBRARIES="true"
TERMUX_PKG_PLATFORM_INDEPENDENT=true

View File

@ -1,22 +0,0 @@
TERMUX_PKG_HOMEPAGE=https://developer.android.com/tools/sdk/ndk/index.html
TERMUX_PKG_DESCRIPTION="Header files from the Android NDK needed for compiling C++ programs using STL"
TERMUX_PKG_LICENSE="NCSA"
TERMUX_PKG_VERSION=$TERMUX_NDK_VERSION
TERMUX_PKG_REVISION=4
TERMUX_PKG_NO_DEVELSPLIT=yes
termux_step_extract_into_massagedir() {
mkdir -p $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/include/c++/v1/
cp -Rf $TERMUX_STANDALONE_TOOLCHAIN/include/c++/4.9.x/* $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/include/c++/v1/
( cd $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/include/c++/v1/ && patch -p1 < $TERMUX_PKG_BUILDER_DIR/math-header.diff )
# Revert the patch for <cstddef> that's only used for using g++
# from the ndk (https://github.com/android-ndk/ndk/issues/215):
cd $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/include/c++/v1/
sed "s%\@TERMUX_HOST_PLATFORM\@%${TERMUX_HOST_PLATFORM}%g" $TERMUX_SCRIPTDIR/ndk-patches/cstddef.cpppatch | patch -p1 -R
}
termux_step_massage() {
echo "overriding termux_step_massage to avoid removing header files"
}

View File

@ -1,24 +0,0 @@
diff -u -r ../../../../../../../../../massage-pristine/data/data/com.termux/files/usr/include/c++/v1/cmath ./cmath
--- ../../../../../../../../../massage-pristine/data/data/com.termux/files/usr/include/c++/v1/cmath 2018-01-03 00:47:31.973545021 +0100
+++ ./cmath 2018-01-03 00:48:02.453189261 +0100
@@ -302,7 +302,7 @@
*/
#include <__config>
-#include <math.h>
+#include <c++/v1/math.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
diff -u -r ../../../../../../../../../massage-pristine/data/data/com.termux/files/usr/include/c++/v1/math.h ./math.h
--- ../../../../../../../../../massage-pristine/data/data/com.termux/files/usr/include/c++/v1/math.h 2018-01-03 00:47:31.985544880 +0100
+++ ./math.h 2018-01-03 00:48:24.732929153 +0100
@@ -298,7 +298,7 @@
#pragma GCC system_header
#endif
-#include_next <math.h>
+#include <../../math.h>
#ifdef __cplusplus

View File

@ -2,13 +2,13 @@ TERMUX_PKG_HOMEPAGE=https://developer.android.com/tools/sdk/ndk/index.html
TERMUX_PKG_DESCRIPTION="System header and library files from the Android NDK needed for compiling C programs"
TERMUX_PKG_LICENSE="NCSA"
TERMUX_PKG_VERSION=$TERMUX_NDK_VERSION
TERMUX_PKG_REVISION=10
#TERMUX_PKG_REVISION=10
TERMUX_PKG_NO_DEVELSPLIT=yes
TERMUX_PKG_KEEP_STATIC_LIBRARIES="true"
# This package has taken over <pty.h> from the previous libutil-dev
# and iconv.h from libandroid-support-dev:
TERMUX_PKG_CONFLICTS="libutil-dev, libgcc, libandroid-support-dev"
TERMUX_PKG_REPLACES="libutil-dev, libgcc, libandroid-support-dev"
TERMUX_PKG_REPLACES="libutil-dev, libgcc, libandroid-support-dev, ndk-stl"
termux_step_extract_into_massagedir() {
mkdir -p $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/lib/pkgconfig \
@ -17,11 +17,7 @@ termux_step_extract_into_massagedir() {
cp -Rf $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/include/* \
$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/include
local _LIBDIR=lib
if [ "$TERMUX_ARCH" = "x86_64" ]; then
_LIBDIR=lib64
fi
cp $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/${_LIBDIR}/*.o \
cp $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/$TERMUX_HOST_PLATFORM/$TERMUX_PKG_API_LEVEL/*.o \
$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/lib
cp "$PKG_CONFIG_LIBDIR/zlib.pc" \
@ -35,8 +31,9 @@ termux_step_extract_into_massagedir() {
local LIBGCC_PATH=$TERMUX_STANDALONE_TOOLCHAIN/lib/gcc/$TERMUX_HOST_PLATFORM/4.9.x
if [ $TERMUX_ARCH = "arm" ]; then LIBGCC_PATH+="/armv7-a"; fi
LIBGCC_PATH+="/libgcc.a"
cp $LIBGCC_PATH $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/lib/
cp $LIBGCC_PATH/* $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/lib/
cp $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/$TERMUX_HOST_PLATFORM/$TERMUX_PKG_API_LEVEL/libcompiler_rt-extras.a $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/lib/
# librt and libpthread are built into libc on android, so setup them as symlinks
# to libc for compatibility with programs that users try to build:

View File

@ -34,6 +34,10 @@ termux_step_host_build() {
rm -Rf build/
}
termux_step_pre_configure() {
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" -DLUA_MATH_LIBRARY=$TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/$TERMUX_HOST_PLATFORM/$TERMUX_PKG_API_LEVEL/libm.so"
}
termux_step_post_make_install() {
local _CONFIG_DIR=$TERMUX_PREFIX/share/nvim
mkdir -p $_CONFIG_DIR

View File

@ -1,9 +1,9 @@
TERMUX_PKG_HOMEPAGE=https://ninja-build.org
TERMUX_PKG_DESCRIPTION="A small build system with a focus on speed"
TERMUX_PKG_LICENSE="Apache-2.0"
TERMUX_PKG_VERSION=1.8.2
TERMUX_PKG_REVISION=2
TERMUX_PKG_SHA256=86b8700c3d0880c2b44c2ff67ce42774aaf8c28cbf57725cb881569288c1c6f4
TERMUX_PKG_VERSION=1.9.0
TERMUX_PKG_REVISION=1
TERMUX_PKG_SHA256=5d7ec75828f8d3fd1a0c2f31b5b0cea780cdfe1031359228c428c1a48bfcd5b9
TERMUX_PKG_SRCURL=https://github.com/ninja-build/ninja/archive/v${TERMUX_PKG_VERSION}.tar.gz
termux_step_configure() {

View File

@ -6,7 +6,7 @@ index a443748..697a110 100755
objs += cxx('minidump-win32')
objs += cc('getopt')
else:
+ objs += cc('posix_spawn')
+ objs += cxx('spawn')
objs += cxx('subprocess-posix')
if platform.is_aix():
objs += cc('getopt')

View File

@ -1,162 +0,0 @@
diff --git a/src/posix_spawn.c b/src/posix_spawn.c
new file mode 100644
index 0000000..18ceb06
--- /dev/null
+++ b/src/posix_spawn.c
@@ -0,0 +1,156 @@
+/*
+ * dhcpcd - DHCP client daemon
+ * Copyright (c) 2006-2012 Roy Marples <roy@marples.name>
+ * All rights reserved
+
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/* This implementation of posix_spawn is only suitable for the needs of dhcpcd
+ * but it could easily be extended to other applications. */
+
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#include <errno.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "posix_spawn.h"
+
+#ifndef _NSIG
+#ifdef _SIG_MAXSIG
+#define _NSIG _SIG_MAXSIG + 1
+#else
+/* Guess */
+#define _NSIG SIGPWR + 1
+#endif
+#endif
+
+extern char **environ;
+
+static int
+posix_spawnattr_handle(const posix_spawnattr_t *attrp)
+{
+ struct sigaction sa;
+ int i;
+
+ if (attrp->posix_attr_flags & POSIX_SPAWN_SETSIGMASK)
+ sigprocmask(SIG_SETMASK, &attrp->posix_attr_sigmask, NULL);
+
+ if (attrp->posix_attr_flags & POSIX_SPAWN_SETSIGDEF) {
+ memset(&sa, 0, sizeof(sa));
+ sa.sa_handler = SIG_DFL;
+ for (i = 1; i < _NSIG; i++) {
+ if (sigismember(&attrp->posix_attr_sigdefault, i)) {
+ if (sigaction(i, &sa, NULL) == -1)
+ return -1;
+ }
+ }
+ }
+
+ return 0;
+}
+
+inline static int
+is_vfork_safe(short int flags)
+{
+ return !(flags & (POSIX_SPAWN_SETSIGDEF | POSIX_SPAWN_SETSIGMASK));
+}
+
+int
+posix_spawn(pid_t *pid, const char *path,
+ const posix_spawn_file_actions_t *file_actions,
+ const posix_spawnattr_t *attrp,
+ char *const argv[], char *const envp[])
+{
+ short int flags;
+ pid_t p;
+ volatile int error;
+
+ error = 0;
+ flags = attrp ? attrp->posix_attr_flags : 0;
+ if (file_actions == NULL && is_vfork_safe(flags))
+ p = vfork();
+ else
+#ifdef THERE_IS_NO_FORK
+ return ENOSYS;
+#else
+ p = fork();
+#endif
+ switch (p) {
+ case -1:
+ return errno;
+ case 0:
+ if (attrp) {
+ error = posix_spawnattr_handle(attrp);
+ if (error)
+ _exit(127);
+ }
+ execve(path, argv, envp);
+ error = errno;
+ _exit(127);
+ default:
+ if (error != 0)
+ waitpid(p, NULL, WNOHANG);
+ else if (pid != NULL)
+ *pid = p;
+ return error;
+ }
+}
+
+int
+posix_spawnattr_init(posix_spawnattr_t *attr)
+{
+
+ memset(attr, 0, sizeof(*attr));
+ attr->posix_attr_flags = 0;
+ sigprocmask(0, NULL, &attr->posix_attr_sigmask);
+ sigemptyset(&attr->posix_attr_sigdefault);
+ return 0;
+}
+
+int
+posix_spawnattr_setflags(posix_spawnattr_t *attr, short flags)
+{
+
+ attr->posix_attr_flags = flags;
+ return 0;
+}
+
+int
+posix_spawnattr_setsigmask(posix_spawnattr_t *attr, const sigset_t *sigmask)
+{
+
+ attr->posix_attr_sigmask = *sigmask;
+ return 0;
+}
+
+int
+posix_spawnattr_setsigdefault(posix_spawnattr_t *attr, const sigset_t *sigmask)
+{
+
+ attr->posix_attr_sigdefault = *sigmask;
+ return 0;
+}

View File

@ -1,59 +0,0 @@
diff --git a/src/posix_spawn.h b/src/posix_spawn.h
new file mode 100644
index 0000000..ccfb0f0
--- /dev/null
+++ b/src/posix_spawn.h
@@ -0,0 +1,53 @@
+/*
+ * dhcpcd - DHCP client daemon
+ * Copyright (c) 2006-2012 Roy Marples <roy@marples.name>
+ * All rights reserved
+
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef POSIX_SPAWN_H
+#define POSIX_SPAWN_H
+
+#include <signal.h>
+
+typedef struct {
+ short posix_attr_flags;
+#define POSIX_SPAWN_SETSIGDEF 0x10
+#define POSIX_SPAWN_SETSIGMASK 0x20
+ sigset_t posix_attr_sigmask;
+ sigset_t posix_attr_sigdefault;
+} posix_spawnattr_t;
+
+typedef struct {
+// int unused;
+} posix_spawn_file_actions_t;
+
+int posix_spawn(pid_t *, const char *,
+ const posix_spawn_file_actions_t *, const posix_spawnattr_t *,
+ char *const [], char *const []);
+int posix_spawnattr_init(posix_spawnattr_t *);
+int posix_spawnattr_setflags(posix_spawnattr_t *, short);
+int posix_spawnattr_setsigmask(posix_spawnattr_t *, const sigset_t *);
+int posix_spawnattr_setsigdefault(posix_spawnattr_t *, const sigset_t *);
+
+#endif

View File

@ -0,0 +1,387 @@
diff --git a/src/spawn.cc b/src/spawn.cc
new file mode 100644
index 0000000..1eed715
--- /dev/null
+++ b/src/spawn.cc
@@ -0,0 +1,381 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <android/fdsan.h>
+
+#include "spawn.h"
+
+// Bionic "private/ScopedSignalBlocker.h" + one macro needed
+#define BIONIC_DISALLOW_COPY_AND_ASSIGN(TypeName) \
+ TypeName(const TypeName&) = delete; \
+ void operator=(const TypeName&) = delete
+
+class ScopedSignalBlocker {
+ public:
+ // Block all signals.
+ explicit ScopedSignalBlocker() {
+ sigset_t set;
+ sigfillset(&set);
+ sigprocmask(SIG_BLOCK, &set, &old_set_);
+ }
+
+ // Block just the specified signal.
+ explicit ScopedSignalBlocker(int signal) {
+ sigset_t set = {};
+ sigaddset(&set, signal);
+ sigprocmask(SIG_BLOCK, &set, &old_set_);
+ }
+
+ ~ScopedSignalBlocker() {
+ reset();
+ }
+
+ void reset() {
+ sigprocmask(SIG_SETMASK, &old_set_, nullptr);
+ }
+
+ sigset_t old_set_;
+
+ BIONIC_DISALLOW_COPY_AND_ASSIGN(ScopedSignalBlocker);
+};
+
+// Bionic "private/SigSetConverter.h"
+union SigSetConverter {
+ int bsd;
+ sigset_t sigset;
+ sigset64_t sigset64;
+};
+
+enum Action {
+ kOpen,
+ kClose,
+ kDup2
+};
+
+struct __posix_spawn_file_action {
+ __posix_spawn_file_action* next;
+
+ Action what;
+ int fd;
+ int new_fd;
+ char* path;
+ int flags;
+ mode_t mode;
+
+ void Do() {
+ if (what == kOpen) {
+ fd = open(path, flags, mode);
+ if (fd == -1) _exit(127);
+ // If it didn't land where we wanted it, move it.
+ if (fd != new_fd) {
+ if (dup2(fd, new_fd) == -1) _exit(127);
+ close(fd);
+ }
+ } else if (what == kClose) {
+ // Failure to close is ignored.
+ close(fd);
+ } else {
+ if (dup2(fd, new_fd) == -1) _exit(127);
+ }
+ }
+};
+
+struct __posix_spawn_file_actions {
+ __posix_spawn_file_action* head;
+ __posix_spawn_file_action* last;
+
+ void Do() {
+ for (__posix_spawn_file_action* action = head; action != nullptr; action = action->next) {
+ action->Do();
+ }
+ }
+};
+
+struct __posix_spawnattr {
+ short flags;
+ pid_t pgroup;
+ sched_param schedparam;
+ int schedpolicy;
+ SigSetConverter sigmask;
+ SigSetConverter sigdefault;
+};
+
+static void ApplyAttrs(short flags, const posix_spawnattr_t* attr) {
+ // POSIX: "If POSIX_SPAWN_SETSIGDEF is set ... signals in sigdefault ...
+ // shall be set to their default actions in the child process."
+ // POSIX: "Signals set to be caught by the calling process shall be
+ // set to the default action in the child process."
+ bool use_sigdefault = ((flags & POSIX_SPAWN_SETSIGDEF) != 0);
+ const struct sigaction default_sa = { .sa_handler = SIG_DFL };
+ for (int s = 1; s < _NSIG; ++s) {
+ bool reset = false;
+ if (use_sigdefault && sigismember(&(*attr)->sigdefault.sigset, s)) {
+ reset = true;
+ } else {
+ struct sigaction current;
+ if (sigaction(s, nullptr, &current) == -1) _exit(127);
+ reset = (current.sa_handler != SIG_IGN && current.sa_handler != SIG_DFL);
+ }
+ if (reset && sigaction(s, &default_sa, nullptr) == -1) _exit(127);
+ }
+
+ if ((flags & POSIX_SPAWN_SETPGROUP) != 0 && setpgid(0, (*attr)->pgroup) == -1) _exit(127);
+ if ((flags & POSIX_SPAWN_SETSID) != 0 && setsid() == -1) _exit(127);
+
+ // POSIX_SPAWN_SETSCHEDULER overrides POSIX_SPAWN_SETSCHEDPARAM, but it is not an error
+ // to set both.
+ if ((flags & POSIX_SPAWN_SETSCHEDULER) != 0) {
+ if (sched_setscheduler(0, (*attr)->schedpolicy, &(*attr)->schedparam) == -1) _exit(127);
+ } else if ((flags & POSIX_SPAWN_SETSCHEDPARAM) != 0) {
+ if (sched_setparam(0, &(*attr)->schedparam) == -1) _exit(127);
+ }
+
+ if ((flags & POSIX_SPAWN_RESETIDS) != 0) {
+ if (seteuid(getuid()) == -1 || setegid(getgid()) == -1) _exit(127);
+ }
+
+ if ((flags & POSIX_SPAWN_SETSIGMASK) != 0) {
+ if (sigprocmask(SIG_SETMASK, &(*attr)->sigmask.sigset, nullptr)) _exit(127);
+ }
+}
+
+static int posix_spawn(pid_t* pid_ptr,
+ const char* path,
+ const posix_spawn_file_actions_t* actions,
+ const posix_spawnattr_t* attr,
+ char* const argv[],
+ char* const env[],
+ int exec_fn(const char* path, char* const argv[], char* const env[])) {
+ // See http://man7.org/linux/man-pages/man3/posix_spawn.3.html
+ // and http://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_spawn.html
+
+ ScopedSignalBlocker ssb;
+
+ short flags = attr ? (*attr)->flags : 0;
+ bool use_vfork = ((flags & POSIX_SPAWN_USEVFORK) != 0) || (actions == nullptr && flags == 0);
+
+ pid_t pid = use_vfork ? vfork() : fork();
+ if (pid == -1) return errno;
+
+ if (pid == 0) {
+ // Child.
+ ApplyAttrs(flags, attr);
+ if (actions) (*actions)->Do();
+ if ((flags & POSIX_SPAWN_SETSIGMASK) == 0) ssb.reset();
+ exec_fn(path, argv, env ? env : environ);
+ _exit(127);
+ }
+
+ // Parent.
+ if (pid_ptr) *pid_ptr = pid;
+ return 0;
+}
+
+int posix_spawn(pid_t* pid, const char* path, const posix_spawn_file_actions_t* actions,
+ const posix_spawnattr_t* attr, char* const argv[], char* const env[]) {
+ return posix_spawn(pid, path, actions, attr, argv, env, execve);
+}
+
+int posix_spawnp(pid_t* pid, const char* file, const posix_spawn_file_actions_t* actions,
+ const posix_spawnattr_t* attr, char* const argv[], char* const env[]) {
+ return posix_spawn(pid, file, actions, attr, argv, env, execvpe);
+}
+
+int posix_spawnattr_init(posix_spawnattr_t* attr) {
+ *attr = reinterpret_cast<__posix_spawnattr*>(calloc(1, sizeof(__posix_spawnattr)));
+ return (*attr == nullptr) ? errno : 0;
+}
+
+int posix_spawnattr_destroy(posix_spawnattr_t* attr) {
+ free(*attr);
+ *attr = nullptr;
+ return 0;
+}
+
+int posix_spawnattr_setflags(posix_spawnattr_t* attr, short flags) {
+ if ((flags & ~(POSIX_SPAWN_RESETIDS | POSIX_SPAWN_SETPGROUP | POSIX_SPAWN_SETSIGDEF |
+ POSIX_SPAWN_SETSIGMASK | POSIX_SPAWN_SETSCHEDPARAM | POSIX_SPAWN_SETSCHEDULER |
+ POSIX_SPAWN_USEVFORK | POSIX_SPAWN_SETSID)) != 0) {
+ return EINVAL;
+ }
+ (*attr)->flags = flags;
+ return 0;
+}
+
+int posix_spawnattr_getflags(const posix_spawnattr_t* attr, short* flags) {
+ *flags = (*attr)->flags;
+ return 0;
+}
+
+int posix_spawnattr_setpgroup(posix_spawnattr_t* attr, pid_t pgroup) {
+ (*attr)->pgroup = pgroup;
+ return 0;
+}
+
+int posix_spawnattr_getpgroup(const posix_spawnattr_t* attr, pid_t* pgroup) {
+ *pgroup = (*attr)->pgroup;
+ return 0;
+}
+
+int posix_spawnattr_setsigmask(posix_spawnattr_t* attr, const sigset_t* mask) {
+ (*attr)->sigmask.sigset = *mask;
+ return 0;
+}
+
+int posix_spawnattr_setsigmask64(posix_spawnattr_t* attr, const sigset64_t* mask) {
+ (*attr)->sigmask.sigset64 = *mask;
+ return 0;
+}
+
+int posix_spawnattr_getsigmask(const posix_spawnattr_t* attr, sigset_t* mask) {
+ *mask = (*attr)->sigmask.sigset;
+ return 0;
+}
+
+int posix_spawnattr_getsigmask64(const posix_spawnattr_t* attr, sigset64_t* mask) {
+ *mask = (*attr)->sigmask.sigset64;
+ return 0;
+}
+
+int posix_spawnattr_setsigdefault(posix_spawnattr_t* attr, const sigset_t* mask) {
+ (*attr)->sigdefault.sigset = *mask;
+ return 0;
+}
+
+int posix_spawnattr_setsigdefault64(posix_spawnattr_t* attr, const sigset64_t* mask) {
+ (*attr)->sigdefault.sigset64 = *mask;
+ return 0;
+}
+
+int posix_spawnattr_getsigdefault(const posix_spawnattr_t* attr, sigset_t* mask) {
+ *mask = (*attr)->sigdefault.sigset;
+ return 0;
+}
+
+int posix_spawnattr_getsigdefault64(const posix_spawnattr_t* attr, sigset64_t* mask) {
+ *mask = (*attr)->sigdefault.sigset64;
+ return 0;
+}
+
+int posix_spawnattr_setschedparam(posix_spawnattr_t* attr, const struct sched_param* param) {
+ (*attr)->schedparam = *param;
+ return 0;
+}
+
+int posix_spawnattr_getschedparam(const posix_spawnattr_t* attr, struct sched_param* param) {
+ *param = (*attr)->schedparam;
+ return 0;
+}
+
+int posix_spawnattr_setschedpolicy(posix_spawnattr_t* attr, int policy) {
+ (*attr)->schedpolicy = policy;
+ return 0;
+}
+
+int posix_spawnattr_getschedpolicy(const posix_spawnattr_t* attr, int* policy) {
+ *policy = (*attr)->schedpolicy;
+ return 0;
+}
+
+int posix_spawn_file_actions_init(posix_spawn_file_actions_t* actions) {
+ *actions = reinterpret_cast<__posix_spawn_file_actions*>(calloc(1, sizeof(**actions)));
+ return (*actions == nullptr) ? errno : 0;
+}
+
+int posix_spawn_file_actions_destroy(posix_spawn_file_actions_t* actions) {
+ __posix_spawn_file_action* a = (*actions)->head;
+ while (a) {
+ __posix_spawn_file_action* last = a;
+ a = a->next;
+ free(last->path);
+ free(last);
+ }
+ free(*actions);
+ *actions = nullptr;
+ return 0;
+}
+
+static int posix_spawn_add_file_action(posix_spawn_file_actions_t* actions,
+ Action what,
+ int fd,
+ int new_fd,
+ const char* path,
+ int flags,
+ mode_t mode) {
+ __posix_spawn_file_action* action =
+ reinterpret_cast<__posix_spawn_file_action*>(malloc(sizeof(*action)));
+ if (action == nullptr) return errno;
+
+ action->next = nullptr;
+ if (path != nullptr) {
+ action->path = strdup(path);
+ if (action->path == nullptr) {
+ free(action);
+ return errno;
+ }
+ } else {
+ action->path = nullptr;
+ }
+ action->what = what;
+ action->fd = fd;
+ action->new_fd = new_fd;
+ action->flags = flags;
+ action->mode = mode;
+
+ if ((*actions)->head == nullptr) {
+ (*actions)->head = (*actions)->last = action;
+ } else {
+ (*actions)->last->next = action;
+ (*actions)->last = action;
+ }
+
+ return 0;
+}
+
+int posix_spawn_file_actions_addopen(posix_spawn_file_actions_t* actions,
+ int fd, const char* path, int flags, mode_t mode) {
+ if (fd < 0) return EBADF;
+ return posix_spawn_add_file_action(actions, kOpen, -1, fd, path, flags, mode);
+}
+
+int posix_spawn_file_actions_addclose(posix_spawn_file_actions_t* actions, int fd) {
+ if (fd < 0) return EBADF;
+ return posix_spawn_add_file_action(actions, kClose, fd, -1, nullptr, 0, 0);
+}
+
+int posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t* actions, int fd, int new_fd) {
+ if (fd < 0 || new_fd < 0) return EBADF;
+ return posix_spawn_add_file_action(actions, kDup2, fd, new_fd, nullptr, 0, 0);
+}

View File

@ -0,0 +1,96 @@
diff --git a/src/spawn.h b/src/spawn.h
new file mode 100644
index 0000000..2e239bf
--- /dev/null
+++ b/src/spawn.h
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _SPAWN_H_
+#define _SPAWN_H_
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <sched.h>
+#include <signal.h>
+
+__BEGIN_DECLS
+
+#define POSIX_SPAWN_RESETIDS 1
+#define POSIX_SPAWN_SETPGROUP 2
+#define POSIX_SPAWN_SETSIGDEF 4
+#define POSIX_SPAWN_SETSIGMASK 8
+#define POSIX_SPAWN_SETSCHEDPARAM 16
+#define POSIX_SPAWN_SETSCHEDULER 32
+#if defined(__USE_GNU)
+#define POSIX_SPAWN_USEVFORK 64
+#define POSIX_SPAWN_SETSID 128
+#endif
+
+typedef struct __posix_spawnattr* posix_spawnattr_t;
+typedef struct __posix_spawn_file_actions* posix_spawn_file_actions_t;
+
+int posix_spawn(pid_t* __pid, const char* __path, const posix_spawn_file_actions_t* __actions, const posix_spawnattr_t* __attr, char* const __argv[], char* const __env[]) __INTRODUCED_IN(28);
+int posix_spawnp(pid_t* __pid, const char* __file, const posix_spawn_file_actions_t* __actions, const posix_spawnattr_t* __attr, char* const __argv[], char* const __env[]) __INTRODUCED_IN(28);
+
+int posix_spawnattr_init(posix_spawnattr_t* __attr) __INTRODUCED_IN(28);
+int posix_spawnattr_destroy(posix_spawnattr_t* __attr) __INTRODUCED_IN(28);
+
+int posix_spawnattr_setflags(posix_spawnattr_t* __attr, short __flags) __INTRODUCED_IN(28);
+int posix_spawnattr_getflags(const posix_spawnattr_t* __attr, short* __flags) __INTRODUCED_IN(28);
+
+int posix_spawnattr_setpgroup(posix_spawnattr_t* __attr, pid_t __pgroup) __INTRODUCED_IN(28);
+int posix_spawnattr_getpgroup(const posix_spawnattr_t* __attr, pid_t* __pgroup) __INTRODUCED_IN(28);
+
+int posix_spawnattr_setsigmask(posix_spawnattr_t* __attr, const sigset_t* __mask) __INTRODUCED_IN(28);
+int posix_spawnattr_setsigmask64(posix_spawnattr_t* __attr, const sigset64_t* __mask) __INTRODUCED_IN(28);
+int posix_spawnattr_getsigmask(const posix_spawnattr_t* __attr, sigset_t* __mask) __INTRODUCED_IN(28);
+int posix_spawnattr_getsigmask64(const posix_spawnattr_t* __attr, sigset64_t* __mask) __INTRODUCED_IN(28);
+
+int posix_spawnattr_setsigdefault(posix_spawnattr_t* __attr, const sigset_t* __mask) __INTRODUCED_IN(28);
+int posix_spawnattr_setsigdefault64(posix_spawnattr_t* __attr, const sigset64_t* __mask) __INTRODUCED_IN(28);
+int posix_spawnattr_getsigdefault(const posix_spawnattr_t* __attr, sigset_t* __mask) __INTRODUCED_IN(28);
+int posix_spawnattr_getsigdefault64(const posix_spawnattr_t* __attr, sigset64_t* __mask) __INTRODUCED_IN(28);
+
+int posix_spawnattr_setschedparam(posix_spawnattr_t* __attr, const struct sched_param* __param) __INTRODUCED_IN(28);
+int posix_spawnattr_getschedparam(const posix_spawnattr_t* __attr, struct sched_param* __param) __INTRODUCED_IN(28);
+
+int posix_spawnattr_setschedpolicy(posix_spawnattr_t* __attr, int __policy) __INTRODUCED_IN(28);
+int posix_spawnattr_getschedpolicy(const posix_spawnattr_t* __attr, int* __policy) __INTRODUCED_IN(28);
+
+int posix_spawn_file_actions_init(posix_spawn_file_actions_t* __actions) __INTRODUCED_IN(28);
+int posix_spawn_file_actions_destroy(posix_spawn_file_actions_t* __actions) __INTRODUCED_IN(28);
+
+int posix_spawn_file_actions_addopen(posix_spawn_file_actions_t* __actions, int __fd, const char* __path, int __flags, mode_t __mode) __INTRODUCED_IN(28);
+int posix_spawn_file_actions_addclose(posix_spawn_file_actions_t* __actions, int __fd) __INTRODUCED_IN(28);
+int posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t* __actions, int __fd, int __new_fd) __INTRODUCED_IN(28);
+
+__END_DECLS
+
+#endif

View File

@ -10,59 +10,18 @@ index 1de22c3..f988297 100644
extern char** environ;
+#include "posix_spawn.h"
+#include "spawn.h"
#include "util.h"
Subprocess::Subprocess(bool use_console) : fd_(-1), pid_(-1),
@@ -54,11 +54,11 @@ bool Subprocess::Start(SubprocessSet* set, const string& command) {
SetCloseOnExec(fd_);
posix_spawn_file_actions_t action;
- if (posix_spawn_file_actions_init(&action) != 0)
+ /*if (posix_spawn_file_actions_init(&action) != 0)
Fatal("posix_spawn_file_actions_init: %s", strerror(errno));
if (posix_spawn_file_actions_addclose(&action, output_pipe[0]) != 0)
- Fatal("posix_spawn_file_actions_addclose: %s", strerror(errno));
+ Fatal("posix_spawn_file_actions_addclose: %s", strerror(errno));*/
posix_spawnattr_t attr;
if (posix_spawnattr_init(&attr) != 0)
@@ -73,7 +73,7 @@ bool Subprocess::Start(SubprocessSet* set, const string& command) {
// default action in the new process image, so no explicit
// POSIX_SPAWN_SETSIGDEF parameter is needed.
- if (!use_console_) {
+ /*if (!use_console_) {
// Put the child in its own process group, so ctrl-c won't reach it.
flags |= POSIX_SPAWN_SETPGROUP;
// No need to posix_spawnattr_setpgroup(&attr, 0), it's the default.
@@ -92,7 +92,7 @@ bool Subprocess::Start(SubprocessSet* set, const string& command) {
Fatal("posix_spawn_file_actions_addclose: %s", strerror(errno));
// In the console case, output_pipe is still inherited by the child and
// closed when the subprocess finishes, which then notifies ninja.
- }
+ }*/
#ifdef POSIX_SPAWN_USEVFORK
flags |= POSIX_SPAWN_USEVFORK;
#endif
@@ -100,15 +100,15 @@ bool Subprocess::Start(SubprocessSet* set, const string& command) {
if (posix_spawnattr_setflags(&attr, flags) != 0)
Fatal("posix_spawnattr_setflags: %s", strerror(errno));
@@ -110,8 +110,8 @@ bool Subprocess::Start(SubprocessSet* set, const string& command) {
if (err != 0)
Fatal("posix_spawnattr_setflags: %s", strerror(err));
- const char* spawned_args[] = { "/bin/sh", "-c", command.c_str(), NULL };
- if (posix_spawn(&pid_, "/bin/sh", &action, &attr,
+ const char* spawned_args[] = { "/system/bin/sh", "-c", command.c_str(), NULL };
+ if (posix_spawn(&pid_, "/system/bin/sh", &action, &attr,
const_cast<char**>(spawned_args), environ) != 0)
Fatal("posix_spawn: %s", strerror(errno));
- if (posix_spawnattr_destroy(&attr) != 0)
+ /*if (posix_spawnattr_destroy(&attr) != 0)
Fatal("posix_spawnattr_destroy: %s", strerror(errno));
if (posix_spawn_file_actions_destroy(&action) != 0)
- Fatal("posix_spawn_file_actions_destroy: %s", strerror(errno));
+ Fatal("posix_spawn_file_actions_destroy: %s", strerror(errno));*/
close(output_pipe[1]);
return true;
- err = posix_spawn(&pid_, "/bin/sh", &action, &attr,
+ const char* spawned_args[] = { "@TERMUX_PREFIX@/bin/sh", "-c", command.c_str(), NULL };
+ err = posix_spawn(&pid_, "@TERMUX_PREFIX@/bin/sh", &action, &attr,
const_cast<char**>(spawned_args), environ);
if (err != 0)
Fatal("posix_spawn: %s", strerror(err));

View File

@ -1,8 +1,8 @@
TERMUX_PKG_HOMEPAGE=https://github.com/jarun/nnn
TERMUX_PKG_DESCRIPTION="Free, fast, friendly file browser"
TERMUX_PKG_LICENSE="BSD 2-Clause"
TERMUX_PKG_VERSION=2.2
TERMUX_PKG_SHA256=88dd08d624ae7a61ef749b1e258e4b29ed61ba9fcc5a18813f291ce80efc5e74
TERMUX_PKG_VERSION=2.3
TERMUX_PKG_SHA256=eaad2ccf0d781aeeb38fdfc4ad75a0405ca3da4f82ded64cce766a74a2b299ab
TERMUX_PKG_SRCURL=https://github.com/jarun/nnn/archive/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_DEPENDS="file, findutils, ncurses"
TERMUX_PKG_DEPENDS="file, findutils, readline"
TERMUX_PKG_BUILD_IN_SRC=yes

View File

@ -5,11 +5,11 @@ diff -u -r ../php-7.1.3/ext/pgsql/config.m4 ./ext/pgsql/config.m4
LDFLAGS=$old_LDFLAGS
PHP_ADD_LIBRARY_WITH_PATH(pq, $PGSQL_LIBDIR, PGSQL_SHARED_LIBADD)
+ dnl The pgsql extension uses pcre so needs to link explicitly
+ dnl The pgsql extension uses pcre2 so needs to link explicitly
+ dnl against it to work on android (the php binary, which dlopen():s
+ dnl this module already links to pcre, but that is not enough on
+ dnl this module already links to pcre2, but that is not enough on
+ dnl Android, see https://github.com/android-ndk/ndk/issues/201):
+ PHP_ADD_LIBRARY_WITH_PATH(pcre, $PGSQL_LIBDIR, PGSQL_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH(pcre2-8, $PGSQL_LIBDIR, PGSQL_SHARED_LIBADD)
PHP_SUBST(PGSQL_SHARED_LIBADD)
PHP_ADD_INCLUDE($PGSQL_INCLUDE)

View File

@ -1,23 +1,25 @@
TERMUX_PKG_HOMEPAGE=http://profanity.im
TERMUX_PKG_DESCRIPTION="Profanity is a console based XMPP client written in C using ncurses and libstrophe, inspired by Irssi"
TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_VERSION=0.5.1
TERMUX_PKG_REVISION=3
TERMUX_PKG_VERSION=0.6.0
TERMUX_PKG_REVISION=1
TERMUX_PKG_MAINTAINER="Oliver Schmidhauser @Neo-Oli"
TERMUX_PKG_SRCURL=http://profanity.im/profanity-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=e3513713e74ec3363fbdbac2919bdc17e249988780cc5a4589d1425807a7feb8
TERMUX_PKG_DEPENDS="libandroid-support,ncurses,glib,libmesode,libcurl,readline,libuuid,libotr,gpgme,python"
TERMUX_PKG_SHA256=51b0932924a391656423af0d85f14dde049ac1e94214f948849d37df1c2759c4
TERMUX_PKG_DEPENDS="libandroid-support, ncurses, glib, libmesode, libcurl, readline, libuuid, libotr, gpgme, python, libassuan, libgpg-error"
# openssl, libexpat needed by libmesode, pcre needed by glib:
TERMUX_PKG_BUILD_DEPENDS="openssl, libexpat, pcre, libgcrypt-dev, libcrypt-dev"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --disable-python-plugins"
TERMUX_PKG_BUILD_IN_SRC=yes
termux_step_pre_configure() {
CPPFLAGS+=" -I$TERMUX_PREFIX/include/python3.7m"
LDFLAGS+=" -lpython3.7m"
CPPFLAGS+=" -I$TERMUX_PREFIX/include/python3.7m"
LDFLAGS+=" -lpython3.7m"
}
termux_step_post_configure() {
# Enable python support manually, as trying to go using --enable-python-plugins
# causes configure trying to execut python:
echo '#define HAVE_PYTHON 1' >> $TERMUX_PKG_SRCDIR/src/config.h
perl -p -i -e 's|#am__objects_2|am__objects_2|' $TERMUX_PKG_SRCDIR/Makefile
# Enable python support manually, as trying to go using --enable-python-plugins
# causes configure trying to execute python:
echo '#define HAVE_PYTHON 1' >> $TERMUX_PKG_SRCDIR/src/config.h
perl -p -i -e 's|#am__objects_2|am__objects_2|' $TERMUX_PKG_SRCDIR/Makefile
}

View File

@ -2,11 +2,11 @@ TERMUX_PKG_HOMEPAGE=https://proot-me.github.io/
TERMUX_PKG_DESCRIPTION="Emulate chroot, bind mount and binfmt_misc for non-root users"
TERMUX_PKG_LICENSE="GPL-2.0"
# Just bump commit and version when needed:
_COMMIT=df715ceac26cf331a626b7ccabcb94c4fd7d12cf
_COMMIT=0e29e5a9db6c56beddcca8b50d4ba91af5b1c171
TERMUX_PKG_VERSION=5.1.107
TERMUX_PKG_REVISION=18
TERMUX_PKG_REVISION=19
TERMUX_PKG_SRCURL=https://github.com/termux/proot/archive/${_COMMIT}.zip
TERMUX_PKG_SHA256=026d3f522d4d55310c433e00839be5410a46b9e5626a54bdb1b1c9869dd1d032
TERMUX_PKG_SHA256=0cc2748aa53beaf3f23384237b0b5537679976087536de0d065dacea812379c5
TERMUX_PKG_DEPENDS="libtalloc"
# Install loader in libexec instead of extracting it every time

View File

@ -1,10 +1,10 @@
TERMUX_PKG_HOMEPAGE=https://www.ruby-lang.org/
TERMUX_PKG_DESCRIPTION="Dynamic programming language with a focus on simplicity and productivity"
TERMUX_PKG_LICENSE="BSD 2-Clause"
_MAJOR_VERSION=2.5
TERMUX_PKG_VERSION=${_MAJOR_VERSION}.3
TERMUX_PKG_REVISION=2
TERMUX_PKG_SHA256=1cc9d0359a8ea35fc6111ec830d12e60168f3b9b305a3c2578357d360fcf306f
_MAJOR_VERSION=2.6
TERMUX_PKG_VERSION=${_MAJOR_VERSION}.1
TERMUX_PKG_REVISION=1
TERMUX_PKG_SHA256=47b629808e9fd44ce1f760cdf3ed14875fc9b19d4f334e82e2cf25cb2898f2f2
TERMUX_PKG_SRCURL=https://cache.ruby-lang.org/pub/ruby/${_MAJOR_VERSION}/ruby-${TERMUX_PKG_VERSION}.tar.xz
# libbffi is used by the fiddle extension module:
TERMUX_PKG_DEPENDS="libandroid-support, libffi, libgmp, readline, openssl, libutil, libyaml"

View File

@ -1,21 +0,0 @@
--- /home/vagrant/ruby-2.5.0/configure.ac 2017-12-15 09:43:40.000000000 +0000
+++ src/configure.ac 2018-02-14 19:07:11.272257521 +0000
@@ -742,7 +742,7 @@
rb_cv_warnflags="$warnflags"
AS_IF([test "$GCC:${warnflags+set}:no" = yes::no], [
AS_IF([test $gcc_major -ge 4], [
- extra_warning=-Werror=extra-tokens
+ extra_warning=
], [
extra_warning=
])
@@ -765,9 +765,7 @@
-Werror=pointer-arith \
-Werror=write-strings \
-Werror=declaration-after-statement \
- -Werror=shorten-64-to-32 \
-Werror=implicit-function-declaration \
- -Werror=division-by-zero \
-Werror=deprecated-declarations \
-Werror=misleading-indentation \
-Wno-packed-bitfield-compat \

View File

@ -1,21 +0,0 @@
--- /home/vagrant/ruby-2.5.0/configure 2017-12-25 07:00:28.000000000 +0000
+++ src/configure 2018-02-14 19:06:28.742701948 +0000
@@ -7434,7 +7434,7 @@
if test $gcc_major -ge 4; then :
- extra_warning=-Werror=extra-tokens
+ extra_warning=
else
@@ -7464,9 +7464,7 @@
-Werror=pointer-arith \
-Werror=write-strings \
-Werror=declaration-after-statement \
- -Werror=shorten-64-to-32 \
-Werror=implicit-function-declaration \
- -Werror=division-by-zero \
-Werror=deprecated-declarations \
-Werror=misleading-indentation \
-Wno-packed-bitfield-compat \

View File

@ -95,30 +95,6 @@ diff -uNr ruby-2.4.2/lib/resolv.rb ruby-2.4.2.mod/lib/resolv.rb
if File.exist? filename
config_hash = Config.parse_resolv_conf(filename)
else
diff -uNr ruby-2.4.2/lib/rubygems/config_file.rb ruby-2.4.2.mod/lib/rubygems/config_file.rb
--- ruby-2.4.2/lib/rubygems/config_file.rb 2016-09-28 03:57:53.000000000 +0300
+++ ruby-2.4.2.mod/lib/rubygems/config_file.rb 2017-09-15 13:47:05.912800582 +0300
@@ -81,7 +81,7 @@
path.strip
rescue LoadError
- RbConfig::CONFIG["sysconfdir"] || "/etc"
+ RbConfig::CONFIG["sysconfdir"] || "@TERMUX_PREFIX@/etc"
end
end
diff -uNr ruby-2.4.2/lib/rubygems/defaults.rb ruby-2.4.2.mod/lib/rubygems/defaults.rb
--- ruby-2.4.2/lib/rubygems/defaults.rb 2017-09-15 11:42:55.262805911 +0300
+++ ruby-2.4.2.mod/lib/rubygems/defaults.rb 2017-09-15 13:59:05.152800068 +0300
@@ -116,7 +116,7 @@
def self.default_bindir
if defined? RUBY_FRAMEWORK_VERSION then # mac framework support
- '/usr/bin'
+ '@TERMUX_PREFIX@/bin'
else # generic install
RbConfig::CONFIG['bindir']
end
diff -uNr ruby-2.4.2/lib/webrick/config.rb ruby-2.4.2.mod/lib/webrick/config.rb
--- ruby-2.4.2/lib/webrick/config.rb 2016-12-07 14:59:48.000000000 +0200
+++ ruby-2.4.2.mod/lib/webrick/config.rb 2017-09-15 12:03:02.402805048 +0300

View File

@ -1,13 +0,0 @@
--- /home/vagrant/ruby-2.5.0/lib/fileutils.rb 2017-12-22 08:00:10.000000000 +0000
+++ ./lib/fileutils.rb 2018-02-17 23:19:55.344655246 +0000
@@ -744,8 +744,8 @@
#
def compare_stream(a, b)
bsize = fu_stream_blksize(a, b)
- sa = String.new(capacity: bsize)
- sb = String.new(capacity: bsize)
+ sa = String.new
+ sb = String.new
begin
a.read(bsize, sa)
b.read(bsize, sb)

View File

@ -1,14 +0,0 @@
diff -u -r ../ruby-2.4.0/lib/rubygems/defaults.rb ./lib/rubygems/defaults.rb
--- ../ruby-2.4.0/lib/rubygems/defaults.rb 2016-06-24 06:13:11.000000000 +0200
+++ ./lib/rubygems/defaults.rb 2017-01-31 22:53:59.125074751 +0100
@@ -191,6 +191,9 @@
# end
def self.platform_defaults
- {}
+ {
+ 'install' => '--no-rdoc --no-ri --env-shebang',
+ 'update' => '--no-rdoc --no-ri --env-shebang'
+ }
end
end

View File

@ -1,12 +0,0 @@
diff -u -r ../ruby-2.4.0/lib/rubygems/installer.rb ./lib/rubygems/installer.rb
--- ../ruby-2.4.0/lib/rubygems/installer.rb 2016-09-28 03:16:43.000000000 +0200
+++ ./lib/rubygems/installer.rb 2017-01-31 22:49:11.992624578 +0100
@@ -31,7 +31,7 @@
# Paths where env(1) might live. Some systems are broken and have it in
# /bin
- ENV_PATHS = %w[/usr/bin/env /bin/env]
+ ENV_PATHS = %w[@TERMUX_PREFIX@/bin/env /usr/bin/env]
##
# Deprecated in favor of Gem::Ext::BuildError

View File

@ -1,6 +1,7 @@
--- /home/vagrant/ruby-2.5.0/process.c 2017-12-14 10:24:38.000000000 +0000
+++ src/process.c 2018-02-14 18:48:50.591627727 +0000
@@ -1240,9 +1240,9 @@
diff -u -r ../ruby-2.6.1/process.c ./process.c
--- ../ruby-2.6.1/process.c 2018-12-22 10:23:06.000000000 +0000
+++ ./process.c 2019-02-16 09:27:04.713434722 +0000
@@ -1569,9 +1569,9 @@
*argv = (char *)prog;
*--argv = (char *)"sh";
if (envp)
@ -12,19 +13,19 @@
}
#else
@@ -1310,9 +1310,9 @@
@@ -1639,9 +1639,9 @@
}
#else
if (envp_str)
- execle("/bin/sh", "sh", "-c", str, (char *)NULL, (char **)RSTRING_PTR(envp_str)); /* async-signal-safe */
+ execle("@TERMUX_PREFIX@/bin/sh", "sh", "-c", str, (char *)NULL, (char **)RSTRING_PTR(envp_str)); /* async-signal-safe */
- execle("/bin/sh", "sh", "-c", str, (char *)NULL, RB_IMEMO_TMPBUF_PTR(envp_str)); /* async-signal-safe */
+ execle("@TERMUX_PREFIX@/bin/sh", "sh", "-c", str, (char *)NULL, RB_IMEMO_TMPBUF_PTR(envp_str)); /* async-signal-safe */
else
- execl("/bin/sh", "sh", "-c", str, (char *)NULL); /* async-signal-safe (since SUSv4) */
+ execl("@TERMUX_PREFIX@/bin/sh", "sh", "-c", str, (char *)NULL); /* async-signal-safe (since SUSv4) */
#endif /* _WIN32 */
return errno;
}
@@ -1415,7 +1415,7 @@
@@ -1744,7 +1744,7 @@
if (status == -1 && errno == ENOEXEC) {
*argv = (char *)prog;
*--argv = (char *)"sh";
@ -33,7 +34,7 @@
after_exec();
if (status == -1) errno = ENOEXEC;
}
@@ -1453,7 +1453,7 @@
@@ -1782,7 +1782,7 @@
char *shell = dln_find_exe_r("sh", 0, fbuf, sizeof(fbuf));
before_exec();

View File

@ -1,11 +0,0 @@
--- /home/vagrant/ruby-2.5.0/template/configure-ext.mk.tmpl 2017-04-23 16:19:22.000000000 +0000
+++ ./template/configure-ext.mk.tmpl 2018-02-17 23:31:02.304445580 +0000
@@ -24,7 +24,7 @@
MINIRUBY = <%=miniruby%>
SCRIPT_ARGS = <%=script_args%>
EXTMK_ARGS = $(SCRIPT_ARGS) --gnumake=$(gnumake) --extflags="$(EXTLDFLAGS)" \
- --make-flags='MINIRUBY=$(MINIRUBY)'
+ --make-flags="MINIRUBY='$(MINIRUBY)'"
all: exts gems
exts:

View File

@ -5,7 +5,7 @@
def install_default_gem(dir, srcdir)
- gem_dir = Gem.default_dir
+ gem_dir = "@TERMUX_PREFIX@/lib/ruby/gems/2.5.0"
+ gem_dir = "@TERMUX_PREFIX@/lib/ruby/gems/2.6.0"
directories = Gem.ensure_gem_subdirectories(gem_dir, :mode => $dir_mode)
prepare "default gems from #{dir}", gem_dir, directories
@ -14,7 +14,7 @@
install?(:ext, :comm, :gem, :'bundled-gems') do
- gem_dir = Gem.default_dir
+ gem_dir = "@TERMUX_PREFIX@/lib/ruby/gems/2.5.0"
+ gem_dir = "@TERMUX_PREFIX@/lib/ruby/gems/2.6.0"
directories = Gem.ensure_gem_subdirectories(gem_dir, :mode => $dir_mode)
prepare "bundled gems", gem_dir, directories
install_dir = with_destdir(gem_dir)

View File

@ -2,8 +2,8 @@ TERMUX_PKG_HOMEPAGE=https://www.torproject.org
TERMUX_PKG_DESCRIPTION="The Onion Router anonymizing overlay network"
TERMUX_PKG_LICENSE="BSD 3-Clause"
TERMUX_PKG_DEPENDS="libevent, openssl, liblzma"
TERMUX_PKG_VERSION=0.3.5.7
TERMUX_PKG_SHA256=1b0887fc21ac535befea7243c5d5f1e31394d7458d64b30807a3e98cca0d839e
TERMUX_PKG_VERSION=0.3.5.8
TERMUX_PKG_SHA256=d5c56603942a8927670f50a4a469fb909e29d3571fdd013389d567e57abc0b47
TERMUX_PKG_SRCURL=https://www.torproject.org/dist/tor-$TERMUX_PKG_VERSION.tar.gz
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--disable-zstd --disable-unittests"
TERMUX_PKG_CONFFILES="etc/tor/torrc"

View File

@ -16,6 +16,7 @@ termux_step_pre_configure() {
if [ "$TERMUX_ARCH" == "aarch64" ]; then
cp $TERMUX_PKG_BUILDER_DIR/aarch64-setjmp.S $TERMUX_PKG_SRCDIR
autoreconf -if
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --enable-only64bit"
fi
if [ "$TERMUX_ARCH" == "arm" ]; then
# valgrind doesn't like arm; armv7 works, though.

View File

@ -4,8 +4,8 @@ TERMUX_PKG_LICENSE="VIM License"
TERMUX_PKG_DEPENDS="ncurses, vim-runtime, python"
# vim should only be updated every 50 releases on multiples of 50.
# Update both vim and vim-python to the same version in one PR.
TERMUX_PKG_VERSION=8.1.0900
TERMUX_PKG_SHA256=5a7cfa4dcaa96c41b32332ea5c6b9d1f6b3dc0a5f010ce7095ed15ae37eb0f33
TERMUX_PKG_VERSION=8.1.0950
TERMUX_PKG_SHA256=0c43a741424ac3b15347359247d806d3f62d79eea7e8a20f1bfd04bb2cc89f5c
TERMUX_PKG_SRCURL="https://github.com/vim/vim/archive/v${TERMUX_PKG_VERSION}.tar.gz"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
vim_cv_getcwd_broken=no

View File

@ -4,8 +4,8 @@ TERMUX_PKG_LICENSE="VIM License"
TERMUX_PKG_DEPENDS="ncurses, vim-runtime"
# vim should only be updated every 50 releases on multiples of 50.
# Update both vim and vim-python to the same version in one PR.
TERMUX_PKG_VERSION=8.1.0900
TERMUX_PKG_SHA256=5a7cfa4dcaa96c41b32332ea5c6b9d1f6b3dc0a5f010ce7095ed15ae37eb0f33
TERMUX_PKG_VERSION=8.1.0950
TERMUX_PKG_SHA256=0c43a741424ac3b15347359247d806d3f62d79eea7e8a20f1bfd04bb2cc89f5c
TERMUX_PKG_SRCURL="https://github.com/vim/vim/archive/v${TERMUX_PKG_VERSION}.tar.gz"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
vim_cv_getcwd_broken=no

View File

@ -1,8 +1,8 @@
TERMUX_PKG_HOMEPAGE=https://weechat.org/
TERMUX_PKG_DESCRIPTION="Fast, light and extensible IRC chat client"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_VERSION=2.3
TERMUX_PKG_SHA256=3c5919c23feb40368fae08f3581448c707e1bdb14c835c06c31b78ebadbb2456
TERMUX_PKG_VERSION=2.4
TERMUX_PKG_SHA256=61a6afe9849b96e99c1f3cde612d1748a03c807059dad459e3a6acbc5cf100fd
TERMUX_PKG_SRCURL=https://www.weechat.org/files/src/weechat-${TERMUX_PKG_VERSION}.tar.bz2
TERMUX_PKG_DEPENDS="ncurses, libgcrypt, libcurl, libgnutls, libandroid-support"
TERMUX_PKG_RM_AFTER_INSTALL="bin/weechat-curses share/man/man1/weechat-headless.1 share/icons"

View File

@ -1,5 +1,7 @@
TERMUX_NDK_VERSION=18
TERMUX_ANDROID_BUILD_TOOLS_VERSION=28.0.3
TERMUX_NDK_VERSION_NUM=19
TERMUX_NDK_REVISION=b
TERMUX_NDK_VERSION=$TERMUX_NDK_VERSION_NUM$TERMUX_NDK_REVISION
test -f "$HOME/.termuxrc" && . "$HOME/.termuxrc"

View File

@ -7,7 +7,7 @@ set -e -u
ANDROID_SDK_FILE=sdk-tools-linux-4333796.zip
ANDROID_SDK_SHA256=92ffee5a1d98d856634e8b71132e8a95d96c83a63fde1099be3d86df3106def9
ANDROID_NDK_FILE=android-ndk-r${TERMUX_NDK_VERSION}-Linux-x86_64.zip
ANDROID_NDK_SHA256=c413dd014edc37f822d0dc88fabc05b64232d07d5c6e9345224e47073fdf140b
ANDROID_NDK_SHA256=0fbb1645d0f1de4dde90a4ff79ca5ec4899c835e729d692f433fda501623257a
if [ ! -d $ANDROID_HOME ]; then
mkdir -p $ANDROID_HOME