feat(build scripts): allow packages to define extra static split patterns

- add variable `TERMUX_PKG_STATICSPLIT_EXTRA_PATTERNS`

Signed-off-by: Aditya Alok <dev.aditya.alok@gmail.com>
This commit is contained in:
Aditya Alok 2022-03-07 16:03:00 +05:30 committed by xtkoba
parent dc2474b2c2
commit 3a1acb712b
3 changed files with 4 additions and 2 deletions

View File

@ -3,7 +3,7 @@ termux_create_debian_subpackages() {
if [ "$TERMUX_PKG_NO_STATICSPLIT" = "false" ] && [[ -n $(shopt -s globstar; shopt -s nullglob; echo lib/**/*.a) ]]; then
# Add virtual -static sub package if there are include files:
local _STATIC_SUBPACKAGE_FILE=$TERMUX_PKG_TMPDIR/${TERMUX_PKG_NAME}-static.subpackage.sh
echo TERMUX_SUBPKG_INCLUDE=\"lib/**/*.a lib/**/*.la\" > "$_STATIC_SUBPACKAGE_FILE"
echo TERMUX_SUBPKG_INCLUDE=\"lib/**/*.a lib/**/*.la $TERMUX_PKG_STATICSPLIT_EXTRA_PATTERNS\" > "$_STATIC_SUBPACKAGE_FILE"
echo "TERMUX_SUBPKG_DESCRIPTION=\"Static libraries for ${TERMUX_PKG_NAME}\"" >> "$_STATIC_SUBPACKAGE_FILE"
fi

View File

@ -3,7 +3,7 @@ termux_create_pacman_subpackages() {
if [ "$TERMUX_PKG_NO_STATICSPLIT" = "false" ] && [[ -n $(shopt -s globstar; shopt -s nullglob; echo lib/**/*.a) ]]; then
# Add virtual -static sub package if there are include files:
local _STATIC_SUBPACKAGE_FILE=$TERMUX_PKG_TMPDIR/${TERMUX_PKG_NAME}-static.subpackage.sh
echo TERMUX_SUBPKG_INCLUDE=\"lib/**/*.a lib/**/*.la\" > "$_STATIC_SUBPACKAGE_FILE"
echo TERMUX_SUBPKG_INCLUDE=\"lib/**/*.a lib/**/*.la $TERMUX_PKG_STATICSPLIT_EXTRA_PATTERNS\" > "$_STATIC_SUBPACKAGE_FILE"
echo "TERMUX_SUBPKG_DESCRIPTION=\"Static libraries for ${TERMUX_PKG_NAME}\"" >> "$_STATIC_SUBPACKAGE_FILE"
fi

View File

@ -112,6 +112,7 @@ termux_step_setup_variables() {
TERMUX_PKG_METAPACKAGE=false
TERMUX_PKG_NO_ELF_CLEANER=false # set this to true to disable running of termux-elf-cleaner on built binaries
TERMUX_PKG_NO_STATICSPLIT=false
TERMUX_PKG_STATICSPLIT_EXTRA_PATTERNS=""
TERMUX_PKG_PACKAGEDIR=$TERMUX_TOPDIR/$TERMUX_PKG_NAME/package
TERMUX_PKG_PLATFORM_INDEPENDENT=false
TERMUX_PKG_PRE_DEPENDS=""
@ -127,6 +128,7 @@ termux_step_setup_variables() {
TERMUX_PKG_SERVICE_SCRIPT=() # Fill with entries like: ("daemon name" 'script to execute'). Script is echoed with -e so can contain \n for multiple lines
TERMUX_PKG_GROUPS="" # https://wiki.archlinux.org/title/Pacman#Installing_package_groups
TERMUX_PKG_NO_SHEBANG_FIX=false # if true, skip fixing shebang accordingly to TERMUX_PREFIX
TERMUX_PKG_IS_HASKELL_LIB=true # by default assume haskell package is lib package as most of them will always be libs.
unset CFLAGS CPPFLAGS LDFLAGS CXXFLAGS
}