Compare commits
3
Commits
2dfbd29ed1
..
v2.2.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
64b62246d7
|
||
|
|
a9f7d9c770 | ||
|
|
5d85acecf4 |
@@ -1,162 +0,0 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
build-arch:
|
||||
name: Build ArchLinux Package
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Extract Version
|
||||
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
|
||||
|
||||
- name: Generate PKGBUILD
|
||||
run: |
|
||||
TAR_URL="https://git.uyani.de/Uyanide/WallReel/archive/v${{ env.VERSION }}.tar.gz"
|
||||
|
||||
wget -qO source.tar.gz "$TAR_URL"
|
||||
SHA256=$(sha256sum source.tar.gz | awk '{print $1}')
|
||||
|
||||
cat << 'EOF' > PKGBUILD
|
||||
# Maintainer: Uyanide <me@uyani.de>
|
||||
pkgname=wallreel
|
||||
pkgver=${{ env.VERSION }}
|
||||
pkgrel=1
|
||||
pkgdesc="Choose and set desktop wallpapers with customizable themes and actions"
|
||||
arch=('x86_64')
|
||||
url="https://git.uyani.de/Uyanide/WallReel"
|
||||
license=('MIT')
|
||||
depends=('qt6-base' 'qt6-declarative' 'gcc-libs' 'glibc')
|
||||
makedepends=('cmake')
|
||||
options=('!debug')
|
||||
source=("${pkgname}-${pkgver}.tar.gz::https://git.uyani.de/Uyanide/WallReel/archive/v${pkgver}.tar.gz")
|
||||
sha256sums=('INSERT_SHA256_HERE')
|
||||
|
||||
build() {
|
||||
cd "wallreel"
|
||||
cmake -B build -S . \
|
||||
-DCMAKE_BUILD_TYPE='Release' \
|
||||
-DCMAKE_INSTALL_PREFIX='/usr' \
|
||||
-Wno-dev
|
||||
cmake --build build
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "wallreel"
|
||||
DESTDIR="$pkgdir" cmake --install build
|
||||
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
|
||||
}
|
||||
EOF
|
||||
|
||||
sed -i "s/INSERT_SHA256_HERE/$SHA256/" PKGBUILD
|
||||
|
||||
- name: Build and Generate AUR Meta
|
||||
run: |
|
||||
tar -cf - . | docker run --rm -i archlinux:latest /bin/bash -e -c "
|
||||
mkdir -p /workspace && cd /workspace
|
||||
tar -xf -
|
||||
exec 3>&1 1>&2
|
||||
|
||||
pacman-key --init && pacman-key --populate
|
||||
pacman -Sy --noconfirm archlinux-keyring
|
||||
pacman -Su --noconfirm base-devel cmake qt6-base qt6-declarative sudo
|
||||
|
||||
echo 'MAKEFLAGS="-j$(nproc)"' >> /etc/makepkg.conf
|
||||
|
||||
useradd -m builduser
|
||||
chown -R builduser:builduser /workspace
|
||||
echo 'builduser ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
|
||||
|
||||
su - builduser -c 'cd /workspace && makepkg -sf --noconfirm'
|
||||
su - builduser -c 'cd /workspace && makepkg --printsrcinfo' > SRCINFO.txt
|
||||
|
||||
tar -cf - *.pkg.tar.zst PKGBUILD SRCINFO.txt >&3
|
||||
" | tar -xf -
|
||||
|
||||
- name: Upload Arch Artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: arch-artifacts
|
||||
path: |
|
||||
*.pkg.tar.zst
|
||||
PKGBUILD
|
||||
SRCINFO.txt
|
||||
|
||||
publish-gitea:
|
||||
name: Publish to Gitea Release
|
||||
needs: [build-arch]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Extract Version
|
||||
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
|
||||
|
||||
- name: Download Arch Artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: arch-artifacts
|
||||
path: .
|
||||
|
||||
- name: Publish to Gitea Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
name: WallReel ${{ env.VERSION }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
files: "*.pkg.tar.zst"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
publish-aur:
|
||||
name: Publish to AUR
|
||||
needs: [build-arch]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Extract Version
|
||||
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
|
||||
|
||||
- name: Download Arch Artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: arch-artifacts
|
||||
path: .
|
||||
|
||||
- name: Publish to AUR
|
||||
env:
|
||||
AUR_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "$AUR_KEY" > ~/.ssh/aur
|
||||
chmod 600 ~/.ssh/aur
|
||||
ssh-keyscan aur.archlinux.org >> ~/.ssh/known_hosts
|
||||
|
||||
cat <<EOF > ~/.ssh/config
|
||||
Host aur.archlinux.org
|
||||
IdentityFile ~/.ssh/aur
|
||||
User aur
|
||||
EOF
|
||||
|
||||
git config --global user.name "Uyanide"
|
||||
git config --global user.email "me@uyani.de"
|
||||
|
||||
git clone ssh://aur@aur.archlinux.org/wallreel.git aur-repo
|
||||
cp PKGBUILD aur-repo/
|
||||
cp SRCINFO.txt aur-repo/.SRCINFO
|
||||
cd aur-repo
|
||||
|
||||
cat << 'EOF' > LICENSE
|
||||
Copyright (C) 2026 by Uyanide me@uyani.de
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
EOF
|
||||
|
||||
git add PKGBUILD LICENSE .SRCINFO
|
||||
git commit -m "Release v${{ env.VERSION }}"
|
||||
git push origin master
|
||||
@@ -1,4 +1,4 @@
|
||||
Copyright 2026 Uyanide me@uyani.de
|
||||
Copyright 2026 Uyanide pywang0608@foxmail.com
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
|
||||
+31
-3
@@ -1,8 +1,8 @@
|
||||
#include <qobject.h>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QFileInfo>
|
||||
#include <QQmlApplicationEngine>
|
||||
#include <QQmlContext>
|
||||
#include <QQuickStyle>
|
||||
#include <QSocketNotifier>
|
||||
|
||||
extern "C" {
|
||||
@@ -21,6 +21,26 @@ using namespace WallReel::Core;
|
||||
|
||||
WALLREEL_DECLARE_SENDER("Main")
|
||||
|
||||
static QString pickControlsStyle(const QQmlApplicationEngine& engine) {
|
||||
// Respect env
|
||||
if (!qEnvironmentVariableIsEmpty("QT_QUICK_CONTROLS_STYLE"))
|
||||
return {};
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)
|
||||
using namespace Qt::StringLiterals;
|
||||
// Prefer KDE style if available,
|
||||
for (const QString& p : engine.importPathList())
|
||||
if (QFileInfo::exists(p + u"/org/kde/desktop/qmldir"_s))
|
||||
return u"org.kde.desktop"_s;
|
||||
// fallback to Fusion
|
||||
return u"Fusion"_s;
|
||||
#else
|
||||
for (const QString& p : engine.importPathList())
|
||||
if (QFileInfo::exists(p + u"/org/kde/desktop/qmldir"_qs))
|
||||
return u"org.kde.desktop"_qs;
|
||||
return u"Fusion"_qs;
|
||||
#endif
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
// Destruction order after QApplication quits its event loop:
|
||||
// 1. QQmlApplicationEngine (with all QML objects)
|
||||
@@ -46,12 +66,14 @@ int main(int argc, char* argv[]) {
|
||||
QApplication a(argc, argv);
|
||||
a.setApplicationName(APP_NAME);
|
||||
a.setApplicationVersion(APP_VERSION);
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)
|
||||
using namespace Qt::StringLiterals;
|
||||
a.setWindowIcon(QIcon(u":/icon.svg"_s));
|
||||
#else
|
||||
a.setWindowIcon(QIcon(u":/%1.svg"_qs.arg(APP_NAME)));
|
||||
a.setWindowIcon(QIcon(u":/icon.svg"_qs));
|
||||
#endif
|
||||
}
|
||||
|
||||
{
|
||||
Logger::init();
|
||||
@@ -105,6 +127,10 @@ int main(int argc, char* argv[]) {
|
||||
{
|
||||
QQmlApplicationEngine engine;
|
||||
|
||||
if (const QString s = pickControlsStyle(engine); !s.isEmpty()) {
|
||||
QQuickStyle::setStyle(s);
|
||||
}
|
||||
|
||||
QObject::connect(
|
||||
&engine,
|
||||
&QQmlApplicationEngine::objectCreationFailed,
|
||||
@@ -112,6 +138,7 @@ int main(int argc, char* argv[]) {
|
||||
[]() { QCoreApplication::exit(-1); },
|
||||
Qt::QueuedConnection);
|
||||
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
||||
using namespace Qt::StringLiterals;
|
||||
engine.loadFromModule(UIMODULE_URI, u"Main"_s);
|
||||
@@ -119,6 +146,7 @@ int main(int argc, char* argv[]) {
|
||||
engine.addImportPath(u"qrc:/"_qs);
|
||||
engine.load(QUrl(u"qrc:/WallReel/UI/Main.qml"_qs));
|
||||
#endif
|
||||
}
|
||||
|
||||
bootstrap.start();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user