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)
message(STATUS ${KAIDAN_ICNS})
endif()
link_directories(${QXmpp_LIBDIR})
link_directories(${QXmpp_LIBDIR} /tmp/qxmpp-ios-build/lib)
if(QUICK_COMPILER)
qtquick_compiler_add_resources(KAIDAN_QML_QRC kaidan_qml.qrc)
......@@ -260,6 +260,7 @@ if(STATIC_BUILD)
find_library(QSHAPES_PLUGIN qmlshapesplugin PATHS ${QT_QML_PATH}/qml/QtQuick/Shapes)
find_library(QUICKSHAPES Qt5QuickShapes PATHS ${QT_LIBDIR})
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)
target_link_libraries(${PROJECT_NAME}
${plugin_libs}
......
......@@ -42,7 +42,7 @@ Kirigami.Page {
Kirigami.Action {
text: qsTr("Log in using a QR-Code")
icon.name: "view-barcode"
onTriggered: pageStack.layers.push(qrCodeScannerPage)
// onTriggered: pageStack.layers.push(qrCodeScannerPage)
}
]
......
......@@ -71,7 +71,7 @@ Kirigami.ApplicationWindow {
Component {id: rosterPage; RosterPage {}}
Component {id: emptyChatPage; EmptyChatPage {}}
Component {id: settingsPage; SettingsPage {}}
Component {id: qrCodeScannerPage; QrCodeScannerPage {}}
// Component {id: qrCodeScannerPage; QrCodeScannerPage {}}
Component {id: userProfilePage; UserProfilePage {}}
function passiveNotification(text) {
......
......@@ -31,6 +31,8 @@
// This file imports static plugin classes for static plugins
#include <QtPlugin>
#define QT_STATICPLUGIN
#ifdef Q_OS_IOS
Q_IMPORT_PLUGIN(QIOSIntegrationPlugin)
Q_IMPORT_PLUGIN(QMacHeifPlugin)
......@@ -52,6 +54,7 @@ Q_IMPORT_PLUGIN(QSvgIconPlugin)
Q_IMPORT_PLUGIN(QGifPlugin)
Q_IMPORT_PLUGIN(QICOPlugin)
Q_IMPORT_PLUGIN(QJpegPlugin)
// Q_IMPORT_PLUGIN(QtMultimedia)
// Qt Quick and network
Q_IMPORT_PLUGIN(QLocalClientConnectionFactory)
......
#!/bin/bash -e
# NOTE: To use this script, you need to set $QT_IOS to your Qt for iOS installation
if [ -z "$QT_IOS" ]; then
......@@ -8,11 +9,12 @@ fi
# Build type is one of:
# Debug, Release, RelWithDebInfo and MinSizeRel
BUILD_TYPE="${BUILD_TYPE:-Debug}"
IOS_PLATFORM="${IOS_PLATFORM:-OS64}"
PLATFORM="${PLATFORM:-OS64}"
KAIDAN_SOURCES=$(dirname "$(greadlink -f "${0}")")/..
KIRIGAMI_BUILD=/tmp/kirigami-ios-build
QXMPP_BUILD=/tmp/qxmpp-ios-build
ZXING_BUILD=/tmp/zxing-ios-build
echo "-- Starting $BUILD_TYPE build of Kaidan --"
......@@ -23,7 +25,7 @@ echo "*****************************************"
export PKG_CONFIG_EXECUTABLE=/usr/local/bin/pkg-config
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
fi
......@@ -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
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() {
if [ -d "$1" ]; then
rm -rf "$1"
......@@ -46,7 +43,7 @@ cdnew() {
}
export QT_SELECT=qt5
export IOS_DEPLOYMENT_VERSION="10.0"
export DEPLOYMENT_VERSION="10.0"
if [ ! -f "$QXMPP_BUILD/lib/pkgconfig/qxmpp.pc" ]; then
echo "*****************************************"
......@@ -60,8 +57,8 @@ echo "*****************************************"
-DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_SHARED=OFF \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$QXMPP_BUILD \
-DCMAKE_TOOLCHAIN_FILE=../../ios-cmake/ios.toolchain.cmake \
-DIOS_PLATFORM=$IOS_PLATFORM \
-DIOS_DEPLOYMENT_TARGET="10.0"\
-DPLATFORM=$PLATFORM \
-DDEPLOYMENT_TARGET="10.0"\
-DPKG_CONFIG_EXECUTABLE=/usr/local/bin/pkg-config
make -j$(sysctl -n hw.logicalcpu)
make install
......@@ -82,9 +79,9 @@ echo "*****************************************"
-DCMAKE_PREFIX_PATH=$QT_IOS \
-DECM_ADDITIONAL_FIND_ROOT_PATH=$QT_IOS \
-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 \
-DIOS_PLATFORM=$IOS_PLATFORM
-DPLATFORM=$PLATFORM
make -j$(sysctl -n hw.logicalcpu)
make install
......@@ -92,6 +89,27 @@ echo "*****************************************"
}
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
echo "*****************************************"
echo "Rendering logos"
......@@ -138,12 +156,15 @@ cdnew $KAIDAN_SOURCES/build
-DECM_DIR=/usr/local/share/ECM/cmake \
-DCMAKE_PREFIX_PATH=$QT_IOS\;$KIRIGAMI_BUILD\;$QXMPP_BUILD \
-DKF5Kirigami2_DIR=$KIRIGAMI_BUILD/lib/cmake/KF5Kirigami2 -DI18N=1 \
-DZXing_DIR=$ZXING_BUILD/lib/cmake/ZXing \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_TOOLCHAIN_FILE=../3rdparty/ios-cmake/ios.toolchain.cmake \
-DPKG_CONFIG_EXECUTABLE=/usr/local/bin/pkg-config \
-DIOS_PLATFORM=$IOS_PLATFORM \
-DIOS_DEPLOYMENT_TARGET="10.0" \
-DIOS_ARCH="arm64"
-DPLATFORM=$PLATFORM \
-DDEPLOYMENT_TARGET="10.0" \
-DARCH="arm64" \
-DUSE_KNOTIFICATIONS=0
xcodebuild CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ENABLE_BITCODE=OFF
}
fi
......@@ -14,6 +14,7 @@ BUILD_TYPE="${BUILD_TYPE:-Debug}"
KAIDAN_SOURCES=$(dirname "$(greadlink -f "${0}")")/..
KIRIGAMI_BUILD=/tmp/kirigami-mac-build
QXMPP_BUILD=/tmp/qxmpp-mac-build
ZXING_BUILD=/tmp/zxing-mac-build
echo "-- Starting $BUILD_TYPE build of Kaidan --"
......@@ -31,6 +32,12 @@ if [ ! -e "$KAIDAN_SOURCES/3rdparty/qxmpp/.git" ]; then
git clone https://github.com/qxmpp-project/qxmpp.git 3rdparty/qxmpp
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() {
if [ -d "$1" ]; then
rm -rf "$1"
......@@ -48,9 +55,11 @@ echo "*****************************************"
{
cdnew $KAIDAN_SOURCES/3rdparty/qxmpp/build
cmake .. \
-G"Unix Makefiles" \
-DCMAKE_PREFIX_PATH=$QT_MACOS \
-DBUILD_EXAMPLES=OFF \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$QXMPP_BUILD
make -j$(sysctl -n hw.logicalcpu)
make install
rm -rf $KAIDAN_SOURCES/3rdparty/qxmpp/build
......@@ -75,6 +84,24 @@ echo "*****************************************"
}
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
echo "*****************************************"
echo "Rendering logos"
......@@ -118,8 +145,10 @@ echo "*****************************************"
-DECM_DIR=/usr/local/share/ECM/cmake \
-DCMAKE_PREFIX_PATH=$QT_MACOS\;$KIRIGAMI_BUILD\;$QXMPP_BUILD \
-DKF5Kirigami2_DIR=$KIRIGAMI_BUILD/lib/cmake/KF5Kirigami2 -DI18N=1 \
-DZXing_DIR=$ZXING_BUILD/lib/cmake/ZXing \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DQUICK_COMPILER=1
-DQUICK_COMPILER=1 \
-DUSE_KNOTIFICATIONS=0
make -j$(sysctl -n hw.logicalcpu)
}
......@@ -130,7 +159,7 @@ echo "Macdeployqt"
echo "*****************************************"
{
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
# FIXME: Use `macdeployqt -qmlimport` when QTBUG-70977 is fixed
......@@ -139,5 +168,5 @@ echo "*****************************************"
ln -s $KIRIGAMI_BUILD/lib/qml/org/kde/kirigami.2 $QT_MACOS/qml/org/kde/kirigami.2
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