Commit 4c2458c1 authored by Jonah Brüchert's avatar Jonah Brüchert 🌳

WIP apple changes

parent 0ebe8d83
Pipeline #6056 passed with stages
in 28 minutes and 44 seconds
...@@ -142,7 +142,7 @@ elseif(WIN32) ...@@ -142,7 +142,7 @@ elseif(WIN32)
message(STATUS ${KAIDAN_ICNS}) message(STATUS ${KAIDAN_ICNS})
endif() endif()
link_directories(${QXmpp_LIBDIR}) link_directories(${QXmpp_LIBDIR} /tmp/qxmpp-ios-build/lib)
if(QUICK_COMPILER) if(QUICK_COMPILER)
qtquick_compiler_add_resources(KAIDAN_QML_QRC kaidan_qml.qrc) qtquick_compiler_add_resources(KAIDAN_QML_QRC kaidan_qml.qrc)
...@@ -260,6 +260,7 @@ if(STATIC_BUILD) ...@@ -260,6 +260,7 @@ if(STATIC_BUILD)
find_library(QSHAPES_PLUGIN qmlshapesplugin PATHS ${QT_QML_PATH}/qml/QtQuick/Shapes) find_library(QSHAPES_PLUGIN qmlshapesplugin PATHS ${QT_QML_PATH}/qml/QtQuick/Shapes)
find_library(QUICKSHAPES Qt5QuickShapes PATHS ${QT_LIBDIR}) find_library(QUICKSHAPES Qt5QuickShapes PATHS ${QT_LIBDIR})
find_library(QTEMPLATES_PLUGIN qtquicktemplates2plugin PATHS ${QT_QML_PATH}/qml/QtQuick/Templates.2) find_library(QTEMPLATES_PLUGIN qtquicktemplates2plugin PATHS ${QT_QML_PATH}/qml/QtQuick/Templates.2)
find_library(QTMULTIMEDIA_PLUGIN qtmultimediaplugin PATHS ${QT_QML_PATH}/qml/QtMultimedia)
find_library(QMODELS_PLUGIN modelsplugin PATHS ${QT_QML_PATH}/qml/QtQml/Models.2) find_library(QMODELS_PLUGIN modelsplugin PATHS ${QT_QML_PATH}/qml/QtQml/Models.2)
target_link_libraries(${PROJECT_NAME} target_link_libraries(${PROJECT_NAME}
${plugin_libs} ${plugin_libs}
......
...@@ -42,7 +42,7 @@ Kirigami.Page { ...@@ -42,7 +42,7 @@ Kirigami.Page {
Kirigami.Action { Kirigami.Action {
text: qsTr("Log in using a QR-Code") text: qsTr("Log in using a QR-Code")
icon.name: "view-barcode" icon.name: "view-barcode"
onTriggered: pageStack.layers.push(qrCodeScannerPage) // onTriggered: pageStack.layers.push(qrCodeScannerPage)
} }
] ]
......
...@@ -71,7 +71,7 @@ Kirigami.ApplicationWindow { ...@@ -71,7 +71,7 @@ Kirigami.ApplicationWindow {
Component {id: rosterPage; RosterPage {}} Component {id: rosterPage; RosterPage {}}
Component {id: emptyChatPage; EmptyChatPage {}} Component {id: emptyChatPage; EmptyChatPage {}}
Component {id: settingsPage; SettingsPage {}} Component {id: settingsPage; SettingsPage {}}
Component {id: qrCodeScannerPage; QrCodeScannerPage {}} // Component {id: qrCodeScannerPage; QrCodeScannerPage {}}
Component {id: userProfilePage; UserProfilePage {}} Component {id: userProfilePage; UserProfilePage {}}
function passiveNotification(text) { function passiveNotification(text) {
......
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
// This file imports static plugin classes for static plugins // This file imports static plugin classes for static plugins
#include <QtPlugin> #include <QtPlugin>
#define QT_STATICPLUGIN
#ifdef Q_OS_IOS #ifdef Q_OS_IOS
Q_IMPORT_PLUGIN(QIOSIntegrationPlugin) Q_IMPORT_PLUGIN(QIOSIntegrationPlugin)
Q_IMPORT_PLUGIN(QMacHeifPlugin) Q_IMPORT_PLUGIN(QMacHeifPlugin)
...@@ -52,6 +54,7 @@ Q_IMPORT_PLUGIN(QSvgIconPlugin) ...@@ -52,6 +54,7 @@ Q_IMPORT_PLUGIN(QSvgIconPlugin)
Q_IMPORT_PLUGIN(QGifPlugin) Q_IMPORT_PLUGIN(QGifPlugin)
Q_IMPORT_PLUGIN(QICOPlugin) Q_IMPORT_PLUGIN(QICOPlugin)
Q_IMPORT_PLUGIN(QJpegPlugin) Q_IMPORT_PLUGIN(QJpegPlugin)
// Q_IMPORT_PLUGIN(QtMultimedia)
// Qt Quick and network // Qt Quick and network
Q_IMPORT_PLUGIN(QLocalClientConnectionFactory) Q_IMPORT_PLUGIN(QLocalClientConnectionFactory)
......
#!/bin/bash -e
# NOTE: To use this script, you need to set $QT_IOS to your Qt for iOS installation # NOTE: To use this script, you need to set $QT_IOS to your Qt for iOS installation
if [ -z "$QT_IOS" ]; then if [ -z "$QT_IOS" ]; then
...@@ -8,11 +9,12 @@ fi ...@@ -8,11 +9,12 @@ fi
# Build type is one of: # Build type is one of:
# Debug, Release, RelWithDebInfo and MinSizeRel # Debug, Release, RelWithDebInfo and MinSizeRel
BUILD_TYPE="${BUILD_TYPE:-Debug}" BUILD_TYPE="${BUILD_TYPE:-Debug}"
IOS_PLATFORM="${IOS_PLATFORM:-OS64}" PLATFORM="${PLATFORM:-OS64}"
KAIDAN_SOURCES=$(dirname "$(greadlink -f "${0}")")/.. KAIDAN_SOURCES=$(dirname "$(greadlink -f "${0}")")/..
KIRIGAMI_BUILD=/tmp/kirigami-ios-build KIRIGAMI_BUILD=/tmp/kirigami-ios-build
QXMPP_BUILD=/tmp/qxmpp-ios-build QXMPP_BUILD=/tmp/qxmpp-ios-build
ZXING_BUILD=/tmp/zxing-ios-build
echo "-- Starting $BUILD_TYPE build of Kaidan --" echo "-- Starting $BUILD_TYPE build of Kaidan --"
...@@ -23,7 +25,7 @@ echo "*****************************************" ...@@ -23,7 +25,7 @@ echo "*****************************************"
export PKG_CONFIG_EXECUTABLE=/usr/local/bin/pkg-config export PKG_CONFIG_EXECUTABLE=/usr/local/bin/pkg-config
if [ ! -f "$KAIDAN_SOURCES/3rdparty/kirigami/.git" ] || [ ! -f "$KAIDAN_SOURCES/3rdparty/breeze-icons/.git" ]; then if [ ! -f "$KAIDAN_SOURCES/3rdparty/kirigami/.git" ] || [ ! -f "$KAIDAN_SOURCES/3rdparty/breeze-icons/.git" ]; then
echo "Cloning Kirigami and Breeze icons" echo "Cloning Kirigami, Breeze icons, QXmpp and ZXing-cpp"
git submodule update --init git submodule update --init
fi fi
...@@ -32,11 +34,6 @@ if [ ! -d "$KAIDAN_SOURCES/3rdparty/ios-cmake/.git" ]; then ...@@ -32,11 +34,6 @@ if [ ! -d "$KAIDAN_SOURCES/3rdparty/ios-cmake/.git" ]; then
git clone https://github.com/leetal/ios-cmake.git 3rdparty/ios-cmake git clone https://github.com/leetal/ios-cmake.git 3rdparty/ios-cmake
fi fi
if [ ! -d "$KAIDAN_SOURCES/3rdparty/qxmpp/.git" ]; then
echo "Cloning QXmpp"
git clone https://github.com/qxmpp-project/qxmpp.git 3rdparty/qxmpp
fi
cdnew() { cdnew() {
if [ -d "$1" ]; then if [ -d "$1" ]; then
rm -rf "$1" rm -rf "$1"
...@@ -46,7 +43,7 @@ cdnew() { ...@@ -46,7 +43,7 @@ cdnew() {
} }
export QT_SELECT=qt5 export QT_SELECT=qt5
export IOS_DEPLOYMENT_VERSION="10.0" export DEPLOYMENT_VERSION="10.0"
if [ ! -f "$QXMPP_BUILD/lib/pkgconfig/qxmpp.pc" ]; then if [ ! -f "$QXMPP_BUILD/lib/pkgconfig/qxmpp.pc" ]; then
echo "*****************************************" echo "*****************************************"
...@@ -60,8 +57,8 @@ echo "*****************************************" ...@@ -60,8 +57,8 @@ echo "*****************************************"
-DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_SHARED=OFF \ -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_SHARED=OFF \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$QXMPP_BUILD \ -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$QXMPP_BUILD \
-DCMAKE_TOOLCHAIN_FILE=../../ios-cmake/ios.toolchain.cmake \ -DCMAKE_TOOLCHAIN_FILE=../../ios-cmake/ios.toolchain.cmake \
-DIOS_PLATFORM=$IOS_PLATFORM \ -DPLATFORM=$PLATFORM \
-DIOS_DEPLOYMENT_TARGET="10.0"\ -DDEPLOYMENT_TARGET="10.0"\
-DPKG_CONFIG_EXECUTABLE=/usr/local/bin/pkg-config -DPKG_CONFIG_EXECUTABLE=/usr/local/bin/pkg-config
make -j$(sysctl -n hw.logicalcpu) make -j$(sysctl -n hw.logicalcpu)
make install make install
...@@ -82,9 +79,9 @@ echo "*****************************************" ...@@ -82,9 +79,9 @@ echo "*****************************************"
-DCMAKE_PREFIX_PATH=$QT_IOS \ -DCMAKE_PREFIX_PATH=$QT_IOS \
-DECM_ADDITIONAL_FIND_ROOT_PATH=$QT_IOS \ -DECM_ADDITIONAL_FIND_ROOT_PATH=$QT_IOS \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$KIRIGAMI_BUILD \ -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$KIRIGAMI_BUILD \
-DIOS_DEPLOYMENT_TARGET="10.0" \ -DDEPLOYMENT_TARGET="10.0" \
-DCMAKE_TOOLCHAIN_FILE=../../ios-cmake/ios.toolchain.cmake \ -DCMAKE_TOOLCHAIN_FILE=../../ios-cmake/ios.toolchain.cmake \
-DIOS_PLATFORM=$IOS_PLATFORM -DPLATFORM=$PLATFORM
make -j$(sysctl -n hw.logicalcpu) make -j$(sysctl -n hw.logicalcpu)
make install make install
...@@ -92,6 +89,27 @@ echo "*****************************************" ...@@ -92,6 +89,27 @@ echo "*****************************************"
} }
fi fi
if [ ! -f "$ZXING_BUILD/lib/libZXingCore.a" ]; then
echo "*****************************************"
echo "Building ZXing"
echo "*****************************************"
{
cdnew $KAIDAN_SOURCES/3rdparty/zxing-cpp/build
cmake .. \
-DCMAKE_PREFIX_PATH=$QT_IOS \
-DECM_ADDITIONAL_FIND_ROOT_PATH=$QT_IOS \
-DBUILD_SHARED_LIBRARY=OFF \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$ZXING_BUILD \
-DDEPLOYMENT_TARGET="10.0" \
-DCMAKE_TOOLCHAIN_FILE=../../ios-cmake/ios.toolchain.cmake \
-DPLATFORM=$PLATFORM
make -j$(nproc)
make install
rm -rf $KAIDAN_SOURCES/3rdparty/zxing-cpp/build
}
fi
if [ ! -f "$KAIDAN_SOURCES/misc/macos/kaidan.icns" ]; then if [ ! -f "$KAIDAN_SOURCES/misc/macos/kaidan.icns" ]; then
echo "*****************************************" echo "*****************************************"
echo "Rendering logos" echo "Rendering logos"
...@@ -138,12 +156,15 @@ cdnew $KAIDAN_SOURCES/build ...@@ -138,12 +156,15 @@ cdnew $KAIDAN_SOURCES/build
-DECM_DIR=/usr/local/share/ECM/cmake \ -DECM_DIR=/usr/local/share/ECM/cmake \
-DCMAKE_PREFIX_PATH=$QT_IOS\;$KIRIGAMI_BUILD\;$QXMPP_BUILD \ -DCMAKE_PREFIX_PATH=$QT_IOS\;$KIRIGAMI_BUILD\;$QXMPP_BUILD \
-DKF5Kirigami2_DIR=$KIRIGAMI_BUILD/lib/cmake/KF5Kirigami2 -DI18N=1 \ -DKF5Kirigami2_DIR=$KIRIGAMI_BUILD/lib/cmake/KF5Kirigami2 -DI18N=1 \
-DZXing_DIR=$ZXING_BUILD/lib/cmake/ZXing \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \ -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_TOOLCHAIN_FILE=../3rdparty/ios-cmake/ios.toolchain.cmake \ -DCMAKE_TOOLCHAIN_FILE=../3rdparty/ios-cmake/ios.toolchain.cmake \
-DPKG_CONFIG_EXECUTABLE=/usr/local/bin/pkg-config \ -DPKG_CONFIG_EXECUTABLE=/usr/local/bin/pkg-config \
-DIOS_PLATFORM=$IOS_PLATFORM \ -DPLATFORM=$PLATFORM \
-DIOS_DEPLOYMENT_TARGET="10.0" \ -DDEPLOYMENT_TARGET="10.0" \
-DIOS_ARCH="arm64" -DARCH="arm64" \
-DUSE_KNOTIFICATIONS=0
xcodebuild CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ENABLE_BITCODE=OFF
} }
fi fi
...@@ -14,6 +14,7 @@ BUILD_TYPE="${BUILD_TYPE:-Debug}" ...@@ -14,6 +14,7 @@ BUILD_TYPE="${BUILD_TYPE:-Debug}"
KAIDAN_SOURCES=$(dirname "$(greadlink -f "${0}")")/.. KAIDAN_SOURCES=$(dirname "$(greadlink -f "${0}")")/..
KIRIGAMI_BUILD=/tmp/kirigami-mac-build KIRIGAMI_BUILD=/tmp/kirigami-mac-build
QXMPP_BUILD=/tmp/qxmpp-mac-build QXMPP_BUILD=/tmp/qxmpp-mac-build
ZXING_BUILD=/tmp/zxing-mac-build
echo "-- Starting $BUILD_TYPE build of Kaidan --" echo "-- Starting $BUILD_TYPE build of Kaidan --"
...@@ -31,6 +32,12 @@ if [ ! -e "$KAIDAN_SOURCES/3rdparty/qxmpp/.git" ]; then ...@@ -31,6 +32,12 @@ if [ ! -e "$KAIDAN_SOURCES/3rdparty/qxmpp/.git" ]; then
git clone https://github.com/qxmpp-project/qxmpp.git 3rdparty/qxmpp git clone https://github.com/qxmpp-project/qxmpp.git 3rdparty/qxmpp
fi fi
if [ ! -e "$KAIDAN_SOURCES/3rdparty/zxing-cpp/" ]; then
echo "Cloning ZXing"
git clone https://github.com/nu-book/zxing-cpp.git 3rdparty/zxing-cpp
fi
cdnew() { cdnew() {
if [ -d "$1" ]; then if [ -d "$1" ]; then
rm -rf "$1" rm -rf "$1"
...@@ -48,9 +55,11 @@ echo "*****************************************" ...@@ -48,9 +55,11 @@ echo "*****************************************"
{ {
cdnew $KAIDAN_SOURCES/3rdparty/qxmpp/build cdnew $KAIDAN_SOURCES/3rdparty/qxmpp/build
cmake .. \ cmake .. \
-G"Unix Makefiles" \
-DCMAKE_PREFIX_PATH=$QT_MACOS \ -DCMAKE_PREFIX_PATH=$QT_MACOS \
-DBUILD_EXAMPLES=OFF \ -DBUILD_EXAMPLES=OFF \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$QXMPP_BUILD -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$QXMPP_BUILD
make -j$(sysctl -n hw.logicalcpu) make -j$(sysctl -n hw.logicalcpu)
make install make install
rm -rf $KAIDAN_SOURCES/3rdparty/qxmpp/build rm -rf $KAIDAN_SOURCES/3rdparty/qxmpp/build
...@@ -75,6 +84,24 @@ echo "*****************************************" ...@@ -75,6 +84,24 @@ echo "*****************************************"
} }
fi fi
if [ ! -f "$ZXING_BUILD/lib/libZXingCore.dylib" ]; then
echo "*****************************************"
echo "Building ZXing"
echo "*****************************************"
{
cdnew $KAIDAN_SOURCES/3rdparty/zxing-cpp/build
cmake .. \
-DCMAKE_PREFIX_PATH=$QT_MACOS \
-DBUILD_SHARED_LIBRARY=ON \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$ZXING_BUILD
make -j$(sysctl -n hw.logicalcpu)
make install
rm -rf $KAIDAN_SOURCES/3rdparty/zxing-cpp/build
}
fi
if [ ! -f "$KAIDAN_SOURCES/misc/macos/kaidan.icns" ]; then if [ ! -f "$KAIDAN_SOURCES/misc/macos/kaidan.icns" ]; then
echo "*****************************************" echo "*****************************************"
echo "Rendering logos" echo "Rendering logos"
...@@ -118,8 +145,10 @@ echo "*****************************************" ...@@ -118,8 +145,10 @@ echo "*****************************************"
-DECM_DIR=/usr/local/share/ECM/cmake \ -DECM_DIR=/usr/local/share/ECM/cmake \
-DCMAKE_PREFIX_PATH=$QT_MACOS\;$KIRIGAMI_BUILD\;$QXMPP_BUILD \ -DCMAKE_PREFIX_PATH=$QT_MACOS\;$KIRIGAMI_BUILD\;$QXMPP_BUILD \
-DKF5Kirigami2_DIR=$KIRIGAMI_BUILD/lib/cmake/KF5Kirigami2 -DI18N=1 \ -DKF5Kirigami2_DIR=$KIRIGAMI_BUILD/lib/cmake/KF5Kirigami2 -DI18N=1 \
-DZXing_DIR=$ZXING_BUILD/lib/cmake/ZXing \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \ -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DQUICK_COMPILER=1 -DQUICK_COMPILER=1 \
-DUSE_KNOTIFICATIONS=0
make -j$(sysctl -n hw.logicalcpu) make -j$(sysctl -n hw.logicalcpu)
} }
...@@ -130,7 +159,7 @@ echo "Macdeployqt" ...@@ -130,7 +159,7 @@ echo "Macdeployqt"
echo "*****************************************" echo "*****************************************"
{ {
cd $KAIDAN_SOURCES/build cd $KAIDAN_SOURCES/build
export LD_LIBRARY_PATH=$QT_MACOS/lib/:$KIRIGAMI_BUILD/lib:$LD_LIBRARY_PATH export LD_LIBRARY_PATH=$QT_MACOS/lib/:$KIRIGAMI_BUILD/lib:$ZXING_BUILD/lib:$LD_LIBRARY_PATH
export PATH=$QT_MACOS/bin/:$PATH export PATH=$QT_MACOS/bin/:$PATH
# FIXME: Use `macdeployqt -qmlimport` when QTBUG-70977 is fixed # FIXME: Use `macdeployqt -qmlimport` when QTBUG-70977 is fixed
...@@ -139,5 +168,5 @@ echo "*****************************************" ...@@ -139,5 +168,5 @@ echo "*****************************************"
ln -s $KIRIGAMI_BUILD/lib/qml/org/kde/kirigami.2 $QT_MACOS/qml/org/kde/kirigami.2 ln -s $KIRIGAMI_BUILD/lib/qml/org/kde/kirigami.2 $QT_MACOS/qml/org/kde/kirigami.2
fi fi
macdeployqt bin/kaidan.app -qmldir=../src/qml/ -libpath=$KIRIGAMI_BUILD/lib/ -dmg macdeployqt bin/kaidan.app -qmldir=../src/qml/ -libpath=$KIRIGAMI_BUILD/lib/ -dmg -appstore-compliant
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment