Browse Source
build-package.sh: use globstar when splitting static libraries
Handle cases when static libraries located in subdirectory.
Enables support for globstar (example './**/*.a') pattern in subpackage
splitting.
emacs-27
Leonid Plyushch
6 years ago
No known key found for this signature in database
GPG Key ID: 45F2964132545795
1 changed files with
5 additions and
1 deletions
-
scripts/build/termux_create_subpackages.sh
|
|
@ -3,7 +3,7 @@ termux_create_subpackages() { |
|
|
|
if [[ -n $(shopt -s nullglob; echo lib/*.a) ]] && [ -z "${TERMUX_PKG_NO_STATICSPLIT}" ]; 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\" > "$_STATIC_SUBPACKAGE_FILE" |
|
|
|
echo "TERMUX_SUBPKG_DESCRIPTION=\"Static libraries for ${TERMUX_PKG_NAME}\"" >> "$_STATIC_SUBPACKAGE_FILE" |
|
|
|
fi |
|
|
|
|
|
|
@ -30,16 +30,20 @@ termux_create_subpackages() { |
|
|
|
# shellcheck source=/dev/null |
|
|
|
source "$subpackage" |
|
|
|
|
|
|
|
# Allow globstar (i.e. './**/') patterns. |
|
|
|
shopt -s globstar |
|
|
|
for includeset in $TERMUX_SUBPKG_INCLUDE; do |
|
|
|
local _INCLUDE_DIRSET |
|
|
|
_INCLUDE_DIRSET=$(dirname "$includeset") |
|
|
|
test "$_INCLUDE_DIRSET" = "." && _INCLUDE_DIRSET="" |
|
|
|
|
|
|
|
if [ -e "$includeset" ] || [ -L "$includeset" ]; then |
|
|
|
# Add the -L clause to handle relative symbolic links: |
|
|
|
mkdir -p "$SUB_PKG_MASSAGE_DIR/$_INCLUDE_DIRSET" |
|
|
|
mv "$includeset" "$SUB_PKG_MASSAGE_DIR/$_INCLUDE_DIRSET" |
|
|
|
fi |
|
|
|
done |
|
|
|
shopt -u globstar |
|
|
|
|
|
|
|
local SUB_PKG_ARCH=$TERMUX_ARCH |
|
|
|
test -n "$TERMUX_SUBPKG_PLATFORM_INDEPENDENT" && SUB_PKG_ARCH=all |
|
|
|