[graphics/krita] /: Android: build boost as part of 3rdparty to patch Bintray out
L. E. Segovia
null at kde.org
Thu Jun 3 16:19:02 BST 2021
Git commit e1115fa78a6f1e82ef3c9ce80f39b68e2f7f97ae by L. E. Segovia.
Committed on 03/06/2021 at 15:18.
Pushed by lsegovia into branch 'master'.
Android: build boost as part of 3rdparty to patch Bintray out
CCMAIL: kimageshop at kde.org
A +26 -0 3rdparty/ext_boost/0001-Update-Boost-URLs-Bintray-shut-down.patch
M +22 -0 3rdparty/ext_boost/CMakeLists.txt
M +3 -14 packaging/android/androidbuild.sh
https://invent.kde.org/graphics/krita/commit/e1115fa78a6f1e82ef3c9ce80f39b68e2f7f97ae
diff --git a/3rdparty/ext_boost/0001-Update-Boost-URLs-Bintray-shut-down.patch b/3rdparty/ext_boost/0001-Update-Boost-URLs-Bintray-shut-down.patch
new file mode 100644
index 0000000000..3c37260ea1
--- /dev/null
+++ b/3rdparty/ext_boost/0001-Update-Boost-URLs-Bintray-shut-down.patch
@@ -0,0 +1,26 @@
+From e4d661b7d0d5324348a2c91a8dd5e816eaf0eb38 Mon Sep 17 00:00:00 2001
+From: "L. E. Segovia" <amy at amyspark.me>
+Date: Wed, 2 Jun 2021 01:55:16 +0000
+Subject: [PATCH] Update Boost URLs, Bintray shut down
+
+Closes #220
+---
+ build-android.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/build-android.sh b/build-android.sh
+index 308a4eb..fed08b9 100755
+--- a/build-android.sh
++++ b/build-android.sh
+@@ -205,7 +205,7 @@ echo "Building boost version: $BOOST_VER1.$BOOST_VER2.$BOOST_VER3"
+ # Build constants
+ # -----------------------
+
+-BOOST_DOWNLOAD_LINK="http://dl.bintray.com/boostorg/release/$BOOST_VER1.$BOOST_VER2.$BOOST_VER3/source/boost_${BOOST_VER1}_${BOOST_VER2}_${BOOST_VER3}.tar.bz2"
++BOOST_DOWNLOAD_LINK="https://boostorg.jfrog.io/artifactory/main/release/$BOOST_VER1.$BOOST_VER2.$BOOST_VER3/source/boost_${BOOST_VER1}_${BOOST_VER2}_${BOOST_VER3}.tar.bz2"
+ BOOST_TAR="boost_${BOOST_VER1}_${BOOST_VER2}_${BOOST_VER3}.tar.bz2"
+ BOOST_DIR="boost_${BOOST_VER1}_${BOOST_VER2}_${BOOST_VER3}"
+ BUILD_DIR="./build/"
+--
+2.31.1
+
diff --git a/3rdparty/ext_boost/CMakeLists.txt b/3rdparty/ext_boost/CMakeLists.txt
index 003dc6c4ca..3ab451df9b 100644
--- a/3rdparty/ext_boost/CMakeLists.txt
+++ b/3rdparty/ext_boost/CMakeLists.txt
@@ -24,6 +24,28 @@ if(MINGW)
COMMAND ${CMAKE_COMMAND} -E copy ${PREFIX_ext_boost}/lib/libboost_system-mgw${KRITA_boost_COMPILER_VERSION}-mt-1_61.dll ${PREFIX_ext_boost}/bin/
DEPENDEES install
)
+elseif(ANDROID)
+ ExternalProject_Add( ext_boost
+ DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
+ URL https://github.com/moritz-wundke/Boost-for-Android/archive/dc37be02fd7e4bc87a184d0f6934da5a5beb7f51.tar.gz
+ URL_HASH SHA256=a962e2572bd15b5b8fcf5a9331195ebd41954209b556766ae178bb82de5dd0d1
+
+ PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/0001-Update-Boost-URLs-Bintray-shut-down.patch
+
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND <SOURCE_DIR>/build-android.sh --prefix=${PREFIX_ext_boost} --with-libraries=system --boost=1.70.0 --arch=${ANDROID_ABI} ${CMAKE_ANDROID_NDK}
+ INSTALL_COMMAND ""
+ INSTALL_DIR ${PREFIX_ext_boost}
+
+ UPDATE_COMMAND ""
+ BUILD_IN_SOURCE 1
+ )
+ ExternalProject_Add_Step(
+ ext_boost
+ post_install
+ COMMAND sh -c "cp ${PREFIX_ext_boost}/${ANDROID_ABI}/lib/libboost_system-*-1_70.a ${PREFIX_ext_boost}/${ANDROID_ABI}/lib/libboost_system.a"
+ DEPENDEES install
+ )
else()
ExternalProject_Add( ext_boost
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
diff --git a/packaging/android/androidbuild.sh b/packaging/android/androidbuild.sh
index 2f32a4a3e3..2f8621fced 100755
--- a/packaging/android/androidbuild.sh
+++ b/packaging/android/androidbuild.sh
@@ -104,20 +104,9 @@ build_ext() {
}
build_boost() {
- VERSION="1_70"
- if [[ ! -d $DOWNLOADS_DIR/boost ]]; then
- git clone https://github.com/moritz-wundke/Boost-for-Android $DOWNLOADS_DIR/boost
- fi
-
- cd $DOWNLOADS_DIR/boost
- ./build-android.sh --prefix=$THIRDPARTY_INSTALL --with-libraries=system \
- --boost=1.70.0 --arch=$ANDROID_ABI $CMAKE_ANDROID_NDK
-
- cd $THIRDPARTY_INSTALL/$ANDROID_ABI/lib
-
- # possible because just one library is being used
- mv libboost_system-*-$VERSION.a libboost_system.a
-
+ configure_ext
+ cd $DEPS_BUILD
+ cmake --build . --config $BUILD_TYPE --target ext_boost -- -j$PROC_COUNT
cd $BUILD_ROOT
}
More information about the kimageshop
mailing list