build-package.sh: more fixes
This commit is contained in:
parent
d08dc0fa13
commit
52ceb56d3f
@ -203,7 +203,7 @@ while getopts :a:hdDfiIqso: option; do
|
||||
;;
|
||||
h) _show_usage;;
|
||||
d) export TERMUX_DEBUG=true;;
|
||||
D) local TERMUX_IS_DISABLED=true;;
|
||||
D) TERMUX_IS_DISABLED=true;;
|
||||
f) TERMUX_FORCE_BUILD=true;;
|
||||
i)
|
||||
if [ "$TERMUX_ON_DEVICE_BUILD" = "true" ]; then
|
||||
|
@ -102,7 +102,7 @@ termux_step_post_make_install() {
|
||||
cp ../src/projects/openmp/runtime/exports/common.min.50.ompt.optional/include/omp.h $TERMUX_PREFIX/include
|
||||
fi
|
||||
|
||||
if [ $TERMUX_CMAKE_BUILD = Ninja ]; then
|
||||
if [ "$TERMUX_CMAKE_BUILD" = Ninja ]; then
|
||||
ninja docs-llvm-man
|
||||
else
|
||||
make docs-llvm-man
|
||||
|
@ -28,7 +28,7 @@ termux_step_configure_autotools() {
|
||||
fi
|
||||
|
||||
local QUIET_BUILD=
|
||||
if [ $TERMUX_QUIET_BUILD = true ]; then
|
||||
if [ "$TERMUX_QUIET_BUILD" = true ]; then
|
||||
QUIET_BUILD="--enable-silent-rules --silent --quiet"
|
||||
fi
|
||||
|
||||
|
@ -7,11 +7,11 @@ termux_step_configure_cmake() {
|
||||
local CMAKE_PROC=$TERMUX_ARCH
|
||||
test $CMAKE_PROC == "arm" && CMAKE_PROC='armv7-a'
|
||||
local MAKE_PROGRAM_PATH
|
||||
if [ $TERMUX_CMAKE_BUILD = Ninja ]; then
|
||||
if [ "$TERMUX_CMAKE_BUILD" = Ninja ]; then
|
||||
termux_setup_ninja
|
||||
MAKE_PROGRAM_PATH=$(which ninja)
|
||||
MAKE_PROGRAM_PATH=$(command -v ninja)
|
||||
else
|
||||
MAKE_PROGRAM_PATH=$(which make)
|
||||
MAKE_PROGRAM_PATH=$(command -v make)
|
||||
fi
|
||||
|
||||
CXXFLAGS+=" -fno-addrsig"
|
||||
@ -30,15 +30,15 @@ termux_step_configure_cmake() {
|
||||
CMAKE_ADDITIONAL_ARGS+=("-DCMAKE_SYSTEM_PROCESSOR=$CMAKE_PROC")
|
||||
CMAKE_ADDITIONAL_ARGS+=("-DCMAKE_ANDROID_STANDALONE_TOOLCHAIN=$TERMUX_STANDALONE_TOOLCHAIN")
|
||||
else
|
||||
CMAKE_ADDITIONAL_ARGS+=("-DCMAKE_LINKER=$(which $LD) $LDFLAGS")
|
||||
CMAKE_ADDITIONAL_ARGS+=("-DCMAKE_LINKER=$(command -v $LD) $LDFLAGS")
|
||||
fi
|
||||
|
||||
# XXX: CMAKE_{AR,RANLIB} needed for at least jsoncpp build to not
|
||||
# pick up cross compiled binutils tool in $TERMUX_PREFIX/bin:
|
||||
cmake -G "$TERMUX_CMAKE_BUILD" "$TERMUX_PKG_SRCDIR" \
|
||||
-DCMAKE_AR="$(which $AR)" \
|
||||
-DCMAKE_UNAME="$(which uname)" \
|
||||
-DCMAKE_RANLIB="$(which $RANLIB)" \
|
||||
-DCMAKE_AR="$(command -v $AR)" \
|
||||
-DCMAKE_UNAME="$(command -v uname)" \
|
||||
-DCMAKE_RANLIB="$(command -v $RANLIB)" \
|
||||
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
|
||||
-DCMAKE_C_FLAGS="$CFLAGS $CPPFLAGS" \
|
||||
-DCMAKE_CXX_FLAGS="$CXXFLAGS $CPPFLAGS" \
|
||||
|
@ -16,7 +16,7 @@ termux_download_deb() {
|
||||
local PACKAGE_FILE_PATH="${TERMUX_REPO_NAME}-${TERMUX_REPO_DISTRIBUTION[$idx-1]}-${TERMUX_REPO_COMPONENT[$idx-1]}-Packages"
|
||||
if [ -f "${TERMUX_COMMON_CACHEDIR}-${PACKAGE_ARCH}/${PACKAGE_FILE_PATH}" ]; then
|
||||
read -d "\n" PKG_PATH PKG_HASH <<<$(./scripts/get_hash_from_file.py "${TERMUX_COMMON_CACHEDIR}-${PACKAGE_ARCH}/$PACKAGE_FILE_PATH" $PACKAGE $VERSION)
|
||||
if [ ! -z "$PKG_HASH" ]; then
|
||||
if [ -n "$PKG_HASH" ]; then
|
||||
if [ ! "$TERMUX_QUIET_BUILD" = true ]; then
|
||||
echo "Found $PACKAGE in ${TERMUX_REPO_URL[$idx-1]}/dists/${TERMUX_REPO_DISTRIBUTION[$idx-1]}"
|
||||
fi
|
||||
|
@ -31,7 +31,7 @@ termux_get_repo_files() {
|
||||
for arch in all $TERMUX_ARCH; do
|
||||
local PACKAGES_HASH=$(./scripts/get_hash_from_file.py ${RELEASE_FILE} $arch ${TERMUX_REPO_COMPONENT[$idx-1]})
|
||||
# If packages_hash = "" then the repo probably doesn't contain debs for $arch
|
||||
if [ ! -z "$PACKAGES_HASH" ]; then
|
||||
if [ -n "$PACKAGES_HASH" ]; then
|
||||
termux_download "${TERMUX_REPO_URL[$idx-1]}/dists/${TERMUX_REPO_DISTRIBUTION[$idx-1]}/${TERMUX_REPO_COMPONENT[$idx-1]}/binary-$arch/Packages" \
|
||||
"${TERMUX_COMMON_CACHEDIR}-$arch/${TERMUX_REPO_NAME}-${TERMUX_REPO_DISTRIBUTION[$idx-1]}-${TERMUX_REPO_COMPONENT[$idx-1]}-Packages" \
|
||||
$PACKAGES_HASH
|
||||
|
@ -8,7 +8,7 @@ termux_step_create_datatar() {
|
||||
termux_error_exit "Package contains hard links: $HARDLINKS"
|
||||
fi
|
||||
|
||||
if [ -z "${TERMUX_PKG_METAPACKAGE+x}" ] && [ "$(find . -type f)" = "" ]; then
|
||||
if [ "${TERMUX_PKG_METAPACKAGE-false}" = "false" ] && [ "$(find . -type f)" = "" ]; then
|
||||
termux_error_exit "No files in package"
|
||||
fi
|
||||
tar -cJf "$TERMUX_PKG_PACKAGEDIR/data.tar.xz" .
|
||||
|
@ -1,5 +1,5 @@
|
||||
termux_step_extract_package() {
|
||||
if [ -z "${TERMUX_PKG_SRCURL:=""}" ] || [ -n "${TERMUX_PKG_SKIP_SRC_EXTRACT:=""}" ]; then
|
||||
if [ -z "${TERMUX_PKG_SRCURL:=""}" ] || [ "${TERMUX_PKG_SKIP_SRC_EXTRACT-false}" = "true" ]; then
|
||||
mkdir -p "$TERMUX_PKG_SRCDIR"
|
||||
return
|
||||
fi
|
||||
|
@ -1,6 +1,6 @@
|
||||
termux_step_make() {
|
||||
local QUIET_BUILD=
|
||||
if [ $TERMUX_QUIET_BUILD = true ]; then
|
||||
if [ "$TERMUX_QUIET_BUILD" = true ]; then
|
||||
QUIET_BUILD="-s"
|
||||
fi
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
termux_step_make_install() {
|
||||
if test -f build.ninja; then
|
||||
ninja -w dupbuild=warn -j $TERMUX_MAKE_PROCESSES install
|
||||
elif ls ./*akefile &> /dev/null || [ ! -z "$TERMUX_PKG_EXTRA_MAKE_ARGS" ]; then
|
||||
elif ls ./*akefile &> /dev/null || [ -n "$TERMUX_PKG_EXTRA_MAKE_ARGS" ]; then
|
||||
: "${TERMUX_PKG_MAKE_INSTALL_TARGET:="install"}"
|
||||
# Some packages have problem with parallell install, and it does not buy much, so use -j 1.
|
||||
if [ -z "$TERMUX_PKG_EXTRA_MAKE_ARGS" ]; then
|
||||
|
@ -1,8 +1,8 @@
|
||||
termux_step_patch_package() {
|
||||
cd "$TERMUX_PKG_SRCDIR"
|
||||
local DEBUG_PATCHES=""
|
||||
if [ "$TERMUX_DEBUG" = "true" ] && [ -f $TERMUX_PKG_BUILDER_DIR/*.patch.debug ] ; then
|
||||
DEBUG_PATCHES="$(ls $TERMUX_PKG_BUILDER_DIR/*.patch.debug)"
|
||||
if [ "$TERMUX_DEBUG" = "true" ]; then
|
||||
DEBUG_PATCHES=$(find $TERMUX_PKG_BUILDER_DIR -mindepth 1 -maxdepth 1 -name \*.patch.debug)
|
||||
fi
|
||||
# Suffix patch with ".patch32" or ".patch64" to only apply for these bitnesses:
|
||||
shopt -s nullglob
|
||||
|
@ -11,6 +11,7 @@ termux_step_setup_variables() {
|
||||
: "${TERMUX_DEBDIR:="${TERMUX_SCRIPTDIR}/debs"}"
|
||||
: "${TERMUX_SKIP_DEPCHECK:="false"}"
|
||||
: "${TERMUX_INSTALL_DEPS:="false"}"
|
||||
: "${TERMUX_FORCE_BUILD:="false"}"
|
||||
: "${TERMUX_PACKAGES_DIRECTORIES:="packages"}"
|
||||
|
||||
if [ "$TERMUX_ON_DEVICE_BUILD" = "true" ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user