Port Linux action to Qt 6 (#310)

* Port Linux action to Qt 6

* Disable Qt scaling engine option with Qt 6 as unsupported
This commit is contained in:
ilya-fedin 2022-02-14 14:07:42 +00:00 committed by GitHub
parent 1a80a91e13
commit f55aa06e0a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 58 additions and 67 deletions

View file

@ -68,7 +68,7 @@ jobs:
env: env:
GIT: "https://github.com" GIT: "https://github.com"
QT: "5_15_2" QT: "6_2_3"
CMAKE_VER: "3.21.3" CMAKE_VER: "3.21.3"
UPLOAD_ARTIFACT: "true" UPLOAD_ARTIFACT: "true"
ONLY_CACHE: "false" ONLY_CACHE: "false"
@ -124,7 +124,7 @@ jobs:
- name: First set up. - name: First set up.
run: | run: |
wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" wget -c -nv "$GIT/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
chmod a+x linuxdeployqt-continuous-x86_64.AppImage chmod a+x linuxdeployqt-continuous-x86_64.AppImage
./linuxdeployqt-continuous-x86_64.AppImage -version ./linuxdeployqt-continuous-x86_64.AppImage -version
@ -178,7 +178,7 @@ jobs:
run: | run: |
cd $LibrariesPath cd $LibrariesPath
git clone -b v5.88.0 --depth=1 $GIT/KDE/extra-cmake-modules.git git clone -b v5.90.0 --depth=1 $GIT/KDE/extra-cmake-modules.git
cd extra-cmake-modules cd extra-cmake-modules
cmake -B build -GNinja . -DCMAKE_BUILD_TYPE=Release cmake -B build -GNinja . -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel cmake --build build --parallel
@ -195,7 +195,7 @@ jobs:
run: | run: |
cd $LibrariesPath cd $LibrariesPath
wget https://github.com/ninja-build/ninja/releases/download/v1.10.0/ninja-linux.zip wget $GIT/ninja-build/ninja/releases/download/v1.10.0/ninja-linux.zip
unzip ninja-linux.zip unzip ninja-linux.zip
chmod +x ninja chmod +x ninja
mv ninja /usr/local/bin mv ninja /usr/local/bin
@ -229,7 +229,7 @@ jobs:
run: | run: |
cd $LibrariesPath cd $LibrariesPath
git clone -b v1.3 --depth=1 $GIT/xiph/opus git clone -b v1.3.1 --depth=1 $GIT/xiph/opus
cd opus cd opus
./autogen.sh ./autogen.sh
./configure ./configure
@ -310,11 +310,11 @@ jobs:
run: | run: |
cd $LibrariesPath cd $LibrariesPath
git clone -b 1.23 --depth=1 https://gitlab.freedesktop.org/wayland/wayland-protocols.git git clone -b 1.24 --depth=1 https://gitlab.freedesktop.org/wayland/wayland-protocols.git
cd wayland-protocols cd wayland-protocols
./autogen.sh meson build --buildtype=release -Dtests=false
make -j$(nproc) meson compile -C build
make install meson install -C build
cd .. cd ..
rm -rf wayland-protocols rm -rf wayland-protocols
@ -322,7 +322,7 @@ jobs:
run: | run: |
cd $LibrariesPath cd $LibrariesPath
git clone -b v1.4.0 --depth=1 $GIT/KDE/plasma-wayland-protocols.git git clone -b v1.5.0 --depth=1 $GIT/KDE/plasma-wayland-protocols.git
cd plasma-wayland-protocols cd plasma-wayland-protocols
cmake -B build -GNinja . -DCMAKE_BUILD_TYPE=Release cmake -B build -GNinja . -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel cmake --build build --parallel
@ -330,116 +330,103 @@ jobs:
cd .. cd ..
rm -rf plasma-wayland-protocols rm -rf plasma-wayland-protocols
- name: Qt 5.15.2 cache. - name: Libepoxy.
run: |
cd $LibrariesPath
git clone -b 1.5.9 --depth=1 $GIT/anholt/libepoxy.git
cd libepoxy
git apply ../patches/libepoxy.patch
meson build \
--buildtype=release \
--default-library=static \
-Dtests=false
meson compile -C build
meson install -C build
cd ..
rm -rf libepoxy
- name: Qt 6.2.3 cache.
id: cache-qt id: cache-qt
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
path: ${{ env.LibrariesPath }}/qt-cache path: ${{ env.LibrariesPath }}/qt-cache
key: ${{ runner.OS }}-qt-${{ env.CACHE_KEY }}-${{ hashFiles('**/qtbase_5_15_2/*') }}-${{ hashFiles('**/qtwayland_5_15_2/*') }} key: ${{ runner.OS }}-qt-${{ env.CACHE_KEY }}-${{ hashFiles('**/qtbase_6_2_3/*') }}-${{ hashFiles('**/qtwayland_6_2_3/*') }}-${{ hashFiles('**/qt5compat_6_2_3/*') }}
- name: Qt 5.15.2 build. - name: Qt 6.2.3 build.
if: steps.cache-qt.outputs.cache-hit != 'true' if: steps.cache-qt.outputs.cache-hit != 'true'
run: | run: |
cd $LibrariesPath cd $LibrariesPath
git clone -b v5.15.2 --depth=1 git://code.qt.io/qt/qt5.git qt_${QT} git clone -b v6.2.3 --depth=1 git://code.qt.io/qt/qt5.git qt_${QT}
cd qt_${QT} cd qt_${QT}
perl init-repository --module-subset=qtbase,qtwayland,qtimageformats,qtsvg,qttools,qtx11extras perl init-repository --module-subset=qtbase,qtwayland,qtimageformats,qtsvg,qt5compat,qttools
cd qtbase cd qtbase
find ../../patches/qtbase_${QT} -type f -print0 | sort -z | xargs -r0 git apply find ../../patches/qtbase_${QT} -type f -print0 | sort -z | xargs -r0 git apply
cd ../qtwayland cd ../qtwayland
find ../../patches/qtwayland_${QT} -type f -print0 | sort -z | xargs -r0 git apply find ../../patches/qtwayland_${QT} -type f -print0 | sort -z | xargs -r0 git apply
cd ../qt5compat
find ../../patches/qt5compat_${QT} -type f -print0 | sort -z | xargs -r0 git apply
cd .. cd ..
./configure -prefix /usr/local \ ./configure -prefix /usr/local \
-release \ -release \
-opensource \ -opensource \
-confirm-license \ -confirm-license \
-xcb \
-qt-libpng \ -qt-libpng \
-qt-harfbuzz \ -qt-harfbuzz \
-qt-pcre \ -qt-pcre \
-no-feature-xcb-sm \ -no-feature-xcb-sm \
-no-feature-wayland-server \ -no-feature-highdpiscaling \
-openssl-linked \ -openssl-linked \
QMAKE_CXX="$CXX" \
QMAKE_LINK="$CXX" \
-nomake examples \ -nomake examples \
-nomake tests -nomake tests
make -j$(nproc) cmake --build . --parallel
make INSTALL_ROOT="$LibrariesPath/qt-cache" install DESTDIR="$LibrariesPath/qt-cache" cmake --install .
cd .. cd ..
rm -rf qt_${QT} rm -rf qt_${QT}
- name: Qt 5.15.2 install. - name: Qt 6.2.3 install.
run: | run: |
cd $LibrariesPath cd $LibrariesPath
cp -R qt-cache/. / cp -R qt-cache/. /
ldconfig ldconfig
- name: Qt Style Plugins. - name: Qt6Gtk2.
run: | run: |
cd $LibrariesPath cd $LibrariesPath
git clone --depth=1 git://code.qt.io/qt/qtstyleplugins.git git clone -b 0.1 --depth=1 $GIT/trialuser02/qt6gtk2.git
cd qtstyleplugins cd qt6gtk2
find ../patches/qtstyleplugins -type f -print0 | sort -z | xargs -r0 git apply wget https://github.com/trialuser02/qt6gtk2/commit/3d2cf8cbade92a175b2c878090f5f44a1b8a395c.patch
git apply 3d2cf8cbade92a175b2c878090f5f44a1b8a395c.patch
qmake qmake
make -j$(nproc) make -j$(nproc)
make install make install
cd .. cd ..
rm -rf qtstyleplugins rm -rf qt6gtk2
- name: KWayland. - name: Qt6Ct.
run: | run: |
cd $LibrariesPath cd $LibrariesPath
git clone -b v5.88.0 --depth=1 $GIT/KDE/kwayland.git git clone -b 0.5 --depth=1 $GIT/trialuser02/qt6ct.git
cd kwayland cd qt6ct
cmake -B build -GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTING=OFF \
-DKDE_INSTALL_LIBDIR=lib
cmake --build build --parallel
cmake --install build
ldconfig
cd ..
rm -rf kwayland
- name: KWindowSystem.
run: |
cd $LibrariesPath
git clone -b v5.88.0 --depth=1 $GIT/KDE/kwindowsystem.git
cd kwindowsystem
cmake -B build -GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTING=OFF \
-DKDE_INSTALL_LIBDIR=lib
cmake --build build --parallel
cmake --install build
ldconfig
cd ..
rm -rf kwindowsystem
- name: Qt5Ct.
run: |
cd $LibrariesPath
svn checkout https://svn.code.sf.net/p/qt5ct/code/tags/qt5ct-1.5 qt5ct
cd qt5ct
cmake -B build -GNinja -DCMAKE_BUILD_TYPE=Release cmake -B build -GNinja -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel cmake --build build --parallel
cmake --install build cmake --install build
cd .. cd ..
rm -rf qt5ct rm -rf qt6ct
- name: Kvantum. - name: Kvantum.
run: | run: |
cd $LibrariesPath cd $LibrariesPath
git clone -b V0.20.2 --depth=1 $GIT/tsujan/Kvantum.git git clone -b V1.0.0 --depth=1 $GIT/tsujan/Kvantum.git
cd Kvantum/Kvantum cd Kvantum/Kvantum
cmake -B build -GNinja -DCMAKE_BUILD_TYPE=Release cmake -B build -GNinja -DCMAKE_BUILD_TYPE=Release -DENABLE_QT5=OFF
cmake --build build --parallel cmake --build build --parallel
cmake --install build cmake --install build
cd ../.. cd ../..
@ -496,9 +483,9 @@ jobs:
-DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_C_FLAGS="-Werror" \ -DCMAKE_C_FLAGS="-Werror" \
-DCMAKE_CXX_FLAGS="-Werror" \ -DCMAKE_CXX_FLAGS="-Werror" \
-DCMAKE_EXE_LINKER_FLAGS="-s" \
-DTDESKTOP_API_TEST=ON \ -DTDESKTOP_API_TEST=ON \
-DDESKTOP_APP_USE_PACKAGED_LAZY=ON \ -DDESKTOP_APP_USE_PACKAGED_LAZY=ON \
-DDESKTOP_APP_QT6=OFF \
$DEFINE $DEFINE
cmake --build ../out --config Debug --parallel cmake --build ../out --config Debug --parallel
@ -514,7 +501,7 @@ jobs:
AppDir/usr/share/applications/*.desktop \ AppDir/usr/share/applications/*.desktop \
-appimage \ -appimage \
-exclude-libs=libatk-1.0.so.0,libatk-bridge-2.0.so.0,libatspi.so.0,libcairo-gobject.so.2,libcairo.so.2,libgdk-3.so.0,libgdk_pixbuf-2.0.so.0,libgdk-x11-2.0.so.0,libgmodule-2.0.so.0,libgtk-3.so.0,libgtk-x11-2.0.so.0,libpixman-1.so.0,libpng12.so.0 \ -exclude-libs=libatk-1.0.so.0,libatk-bridge-2.0.so.0,libatspi.so.0,libcairo-gobject.so.2,libcairo.so.2,libgdk-3.so.0,libgdk_pixbuf-2.0.so.0,libgdk-x11-2.0.so.0,libgmodule-2.0.so.0,libgtk-3.so.0,libgtk-x11-2.0.so.0,libpixman-1.so.0,libpng12.so.0 \
-extra-plugins=bearer,iconengines,imageformats,platforminputcontexts,platforms/libqwayland-egl.so,platforms/libqwayland-generic.so,platformthemes/libqgtk3.so,platformthemes/libqxdgdesktopportal.so,platformthemes/libqt5ct.so,styles/libqt5ct-style.so,styles/libkvantum.so,wayland-decoration-client,wayland-graphics-integration-client,wayland-shell-integration -extra-plugins=iconengines,imageformats,platforminputcontexts,platforms/libqwayland-egl.so,platforms/libqwayland-generic.so,platformthemes/libqgtk3.so,platformthemes/libqxdgdesktopportal.so,platformthemes/libqt6ct.so,platformthemes/libqt6gtk2.so,styles/libqt6ct-style.so,styles/libqt6gtk2-style.so,styles/libkvantum.so,wayland-decoration-client,wayland-graphics-integration-client,wayland-shell-integration
appimage_name=$(echo Kotatogram_Desktop*.AppImage) appimage_name=$(echo Kotatogram_Desktop*.AppImage)
echo "APPIMAGE_NAME=$appimage_name" >> $GITHUB_ENV echo "APPIMAGE_NAME=$appimage_name" >> $GITHUB_ENV

View file

@ -649,9 +649,11 @@ bool Manager::readCustomFile() {
cSetShowTopBarUserpic(v); cSetShowTopBarUserpic(v);
}); });
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
ReadBoolOption(settings, "qt_scale", [&](auto v) { ReadBoolOption(settings, "qt_scale", [&](auto v) {
cSetQtScale(v); cSetQtScale(v);
}); });
#endif // Qt < 6.0.0
ReadIntOption(settings, "file_dialog_type", [&](auto v) { ReadIntOption(settings, "file_dialog_type", [&](auto v) {
using Platform::FileDialog::ImplementationType; using Platform::FileDialog::ImplementationType;

View file

@ -572,6 +572,7 @@ void SetupKotatoSystem(
AddSkip(container); AddSkip(container);
AddSubsectionTitle(container, rktr("ktg_settings_system")); AddSubsectionTitle(container, rktr("ktg_settings_system"));
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
const auto qtScaleToggled = Ui::CreateChild<rpl::event_stream<bool>>( const auto qtScaleToggled = Ui::CreateChild<rpl::event_stream<bool>>(
container.get()); container.get());
AddButton( AddButton(
@ -598,6 +599,7 @@ void SetupKotatoSystem(
confirmed, confirmed,
cancelled)); cancelled));
}, container->lifetime()); }, container->lifetime());
#endif // Qt < 6.0.0
if (Platform::IsLinux()) { if (Platform::IsLinux()) {
auto fileDialogTypeText = rpl::single( auto fileDialogTypeText = rpl::single(