[PATCH] Fix kirigami build

Anton Lundin glance at acc.umu.se
Wed Aug 17 09:50:35 PDT 2016


This fixes the subsurface-mobile build on my Linux desktop and on
android.

To get it to run on Linux desktop, set QT_QUICK_CONTROLS_STYLE to
something that kirigami doesn't know about, like kakor. Otherwise it
will detect Desktop and die on:
qrc:/styles/Desktop/Icon.qml:23 module "org.kde.kquickcontrolsaddons" is not installed

This works with kirigami 32c980c46, when 47fb7821 is reverted.

Signed-off-by: Anton Lundin <glance at acc.umu.se>
---
The cmake parts are sketchy at best, and should be fixed in a better way.

It would also be nice if kirigami static build did have a install target
that created a dir contaning the needed parts.

 CMakeLists.txt              |  3 ++-
 packaging/android/build.sh  | 13 +++++++++----
 scripts/build.sh            | 10 +++++-----
 scripts/mobilecomponents.sh |  7 ++++---
 4 files changed, 20 insertions(+), 13 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index a824d03..6328dc0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -240,7 +240,8 @@ if(${SUBSURFACE_TARGET_EXECUTABLE} MATCHES "MobileExecutable")
 	endif()
 	ADD_LIBRARY(kirigami_static_library STATIC IMPORTED)
 	SET_TARGET_PROPERTIES(kirigami_static_library PROPERTIES
-		IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/../kirigami-build/src/libkirigamiplugin.a)
+		IMPORTED_LOCATION ${KIRIGAMI_LIBRARY})
+	add_definitions(-DKIRIGAMI_BUILD_TYPE_STATIC)
 	target_link_libraries(
 		${SUBSURFACE_TARGET}
 		subsurface_profile
diff --git a/packaging/android/build.sh b/packaging/android/build.sh
index d844e8d..4b353e3 100644
--- a/packaging/android/build.sh
+++ b/packaging/android/build.sh
@@ -316,11 +316,15 @@ if [ "$SUBSURFACE_MOBILE" = "ON" ] ; then
 	pushd $SUBSURFACE_SOURCE
 	bash ./scripts/mobilecomponents.sh
 	popd
-	rm -rf kirigami-build
-	mkdir -p kirigami-build
-	pushd kirigami-build
-	cmake $SUBSURFACE_SOURCE/mobile-widgets/qml/kirigami/ -DSTATIC_LIBRARY=ON -DCMAKE_PREFIX_PATH:UNINITIALIZED=${QT5_ANDROID}/android_${QT_ARCH}/lib/cmake
+	rm -rf kirigami-build-$ARCH
+	mkdir -p kirigami-build-$ARCH
+	pushd kirigami-build-$ARCH
+	cmake \
+		$SUBSURFACE_SOURCE/../kirigami/ \
+		-DSTATIC_LIBRARY=ON \
+		-DCMAKE_PREFIX_PATH:UNINITIALIZED=${QT5_ANDROID}/android_${QT_ARCH}/lib/cmake
 	make -j4
+	KIRIGAMI_LIBRARY="-DKIRIGAMI_LIBRARY=../kirigami-build-$ARCH/src/libkirigamiplugin.a"
 	popd
 fi
 
@@ -361,6 +365,7 @@ cmake $MOBILE_CMAKE \
 	-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
 	-DMAKE_TESTS=OFF \
 	-DFTDISUPPORT=${FTDI} \
+	$KIRIGAMI_LIBRARY \
 	$SUBSURFACE_SOURCE
 
 # sometimes cmake tries to link both against the static and shared
diff --git a/scripts/build.sh b/scripts/build.sh
index 02f1095..113ab6f 100755
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -232,20 +232,20 @@ for (( i=0 ; i < ${#BUILDS[@]} ; i++ )) ; do
 	if [ "$SUBSURFACE_EXECUTABLE" = "MobileExecutable" ] ; then
 		cd $SRC/subsurface
 		bash ./scripts/mobilecomponents.sh
-		cd mobile-widgets/qml/kirigami
-		# hack to work around issue in current kirigami
-		sed -i.bak -e '/styles\/Desktop\/ContextDrawer.qml/d' kirigami.qrc
-		sed -i.bak -e '/ecm_create_qm_loader/d' src/CMakeLists.txt
 		mkdir -p $SRC/kirigami-build
 		cd $SRC/kirigami-build
-		cmake $SRC/subsurface/mobile-widgets/qml/kirigami/ -DSTATIC_LIBRARY=ON
+		cmake $SRC/kirigami \
+			-DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH \
+			-DSTATIC_LIBRARY=ON
 		make -j4
+		KIRIGAMI_LIBRARY="-DKIRIGAMI_LIBRARY=$SRC/kirigami-build/src/libkirigamiplugin.a"
 	fi
 
 	mkdir -p $SRC/subsurface/$BUILDDIR
 	cd $SRC/subsurface/$BUILDDIR
 	export CMAKE_PREFIX_PATH="$INSTALL_ROOT/lib/cmake;${CMAKE_PREFIX_PATH}"
 	cmake -DCMAKE_BUILD_TYPE=Debug .. \
+		$KIRIGAMI_LIBRARY \
 		-DSUBSURFACE_TARGET_EXECUTABLE=$SUBSURFACE_EXECUTABLE \
 		-DLIBGIT2_INCLUDE_DIR=$INSTALL_ROOT/include \
 		-DLIBGIT2_LIBRARIES=$INSTALL_ROOT/lib/libgit2.$SH_LIB_EXT \
diff --git a/scripts/mobilecomponents.sh b/scripts/mobilecomponents.sh
index 4072bf4..a907538 100755
--- a/scripts/mobilecomponents.sh
+++ b/scripts/mobilecomponents.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -e
 #
 # if you run the build.sh script to build Subsurface you'll never need
 # this, but if you build your binaries differently for some reason and
@@ -48,9 +48,10 @@ PMMC=kirigami
 BREEZE=breeze-icons
 
 rm -rf $MC
-mkdir -p $MC/icons
-cp -R $PMMC/* $MC/
+mkdir -p $MC/src
+cp $PMMC/src/kirigamiplugin.h $MC/src
 
+mkdir -p $MC/icons
 cp $BREEZE/icons/actions/24/dialog-cancel.svg $MC/icons
 cp $BREEZE/icons/actions/24/distribute-horizontal-x.svg $MC/icons
 cp $BREEZE/icons/actions/24/document-edit.svg $MC/icons
-- 
2.7.4



More information about the subsurface mailing list