From 188ab260252cef5e15b5b318276d1edb76358160 Mon Sep 17 00:00:00 2001 From: Henrik Grimler Date: Fri, 7 Aug 2020 11:51:27 +0200 Subject: [PATCH 1/2] licenses: install all licenses even if basenames are the same For for example libandroid-support we now have TERMUX_PKG_SRCDIR/License.txt and TERMUX_PKG_SRCDIR/wcwidth-$version/License.txt. Previously the latter would have overwritten the first one in the install step as the file names are the same. --- scripts/build/termux_step_install_license.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/build/termux_step_install_license.sh b/scripts/build/termux_step_install_license.sh index 5f04c97d8..ab6d5d498 100644 --- a/scripts/build/termux_step_install_license.sh +++ b/scripts/build/termux_step_install_license.sh @@ -3,15 +3,25 @@ termux_step_install_license() { mkdir -p "$TERMUX_PREFIX/share/doc/$TERMUX_PKG_NAME" local LICENSE + local COUNTER=0 if [ ! "${TERMUX_PKG_LICENSE_FILE}" = "" ]; then + INSTALLED_LICENSES=() + COUNTER=1 while read -r LICENSE; do if [ ! -f "$TERMUX_PKG_SRCDIR/$LICENSE" ]; then termux_error_exit "$TERMUX_PKG_SRCDIR/$LICENSE does not exist" fi - cp -f "${TERMUX_PKG_SRCDIR}/${LICENSE}" "${TERMUX_PREFIX}/share/doc/${TERMUX_PKG_NAME}"/ + if [[ " ${INSTALLED_LICENSES[@]} " =~ " $(basename $LICENSE) " ]]; then + # We have already installed a license file named $(basename $LICENSE) so add a suffix to it + TARGET="$TERMUX_PREFIX/share/doc/${TERMUX_PKG_NAME}/$(basename $LICENSE).$COUNTER" + COUNTER=$((COUNTER + 1)) + else + TARGET="$TERMUX_PREFIX/share/doc/${TERMUX_PKG_NAME}/$(basename $LICENSE)" + INSTALLED_LICENSES+=("$(basename $LICENSE)") + fi + cp -f "${TERMUX_PKG_SRCDIR}/${LICENSE}" "$TARGET" done < <(echo "$TERMUX_PKG_LICENSE_FILE" | sed "s/,/\n/g") else - local COUNTER=0 while read -r LICENSE; do # These licenses contain copyright information, so # we cannot use a generic license file From b2d97c63cff83a4db42102da33412e2283bc0d34 Mon Sep 17 00:00:00 2001 From: Henrik Grimler Date: Fri, 7 Aug 2020 11:57:15 +0200 Subject: [PATCH 2/2] libandroid-support: update to v28 specify license MIT for wcwidth github.com/termux/wcwidth as well as github.com/jquast/wcwidth are licensed under MIT. --- packages/libandroid-support/build.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/libandroid-support/build.sh b/packages/libandroid-support/build.sh index 6fd203b02..f935e08f9 100644 --- a/packages/libandroid-support/build.sh +++ b/packages/libandroid-support/build.sh @@ -1,12 +1,13 @@ TERMUX_PKG_HOMEPAGE=https://github.com/termux/libandroid-support TERMUX_PKG_DESCRIPTION="Library extending the Android C library (Bionic) for additional multibyte, locale and math support" -TERMUX_PKG_LICENSE="Apache-2.0" -TERMUX_PKG_VERSION=(26 - 1) +TERMUX_PKG_LICENSE="Apache-2.0, MIT" +TERMUX_PKG_VERSION=(28 + 3) +TERMUX_PKG_LICENSE_FILE="LICENSE.txt, wcwidth-${TERMUX_PKG_VERSION[1]}/LICENSE.txt" TERMUX_PKG_SRCURL=(https://github.com/termux/libandroid-support/archive/v${TERMUX_PKG_VERSION[0]}.tar.gz https://github.com/termux/wcwidth/archive/v${TERMUX_PKG_VERSION[1]}.tar.gz) -TERMUX_PKG_SHA256=(ae2a62547f027624aec8442a0cb724b41de5f60d56d52634f605c566a34cde9b - 088e31ad4d3aa47fd81fe02f0a484338b9708199d59865f1ab44b46f868d5a45) +TERMUX_PKG_SHA256=(ef35260994ffa3bd054be66068dfc28934c823ac8de2394796d94d1cd5de3be4 + d38062a53edb2545b9988be41bd8d217f803fa985158b7cadf95d804761dd1f6) TERMUX_PKG_PRE_DEPENDS="dpkg (>= 1.19.4-3)" TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_ESSENTIAL=true