diff --git a/.docker/Dockerfile-arch b/.docker/Dockerfile-arch deleted file mode 100644 index 5a52504..0000000 --- a/.docker/Dockerfile-arch +++ /dev/null @@ -1,12 +0,0 @@ -FROM archlinux - -RUN pacman -Sy - -# toolchain -RUN echo -e 'y\ny' | pacman -S util-linux-libs -RUN pacman -S --noconfirm base-devel cmake extra-cmake-modules python util-linux-libs -# kf5 and qt5 libraries -RUN pacman -S --noconfirm plasma-framework - -# required by tests -RUN pacman -S --noconfirm xorg-server-xvfb diff --git a/.docker/Dockerfile-ubuntu-amd64 b/.docker/Dockerfile-ubuntu-amd64 deleted file mode 100644 index adf9dfa..0000000 --- a/.docker/Dockerfile-ubuntu-amd64 +++ /dev/null @@ -1,14 +0,0 @@ -FROM ubuntu:focal - -ENV DEBIAN_FRONTEND=noninteractive - -RUN apt-get update -# toolchain -RUN apt-get install -yq cmake extra-cmake-modules g++ git gettext -# kf5 and qt5 libraries -RUN apt-get install -yq libkf5i18n-dev libkf5notifications-dev libkf5service-dev \ - libkf5windowsystem-dev libkf5plasma-dev qtbase5-dev qtdeclarative5-dev \ - plasma-framework - -# required by tests -RUN apt-get install -yq xvfb diff --git a/.docker/build-arch.sh b/.docker/build-arch.sh deleted file mode 100755 index 5308d77..0000000 --- a/.docker/build-arch.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -set -e - -rm -rf build-arch -mkdir build-arch - -# build -cd build-arch -cmake -DKDE_INSTALL_USE_QT_SYS_PATHS=ON -DCMAKE_BUILD_TYPE=Optimization -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_FUTURE=ON -DBUILD_TESTING=ON ../sources -make - -# tests -xvfb-run -a make test diff --git a/.docker/build-ubuntu-package.sh b/.docker/build-ubuntu-package.sh deleted file mode 100755 index e3a29d2..0000000 --- a/.docker/build-ubuntu-package.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -set -e - -rm -rf build-ubuntu -mkdir build-ubuntu - -# patches -git apply patches/qt5.14-splitbehavior-and-qset.patch - -# build -cd build-ubuntu -cmake -DKDE_INSTALL_USE_QT_SYS_PATHS=ON -DCMAKE_BUILD_TYPE=Optimization -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_FUTURE=ON -DBUILD_DEB_PACKAGE=ON ../sources -make package - diff --git a/.docker/build-ubuntu.sh b/.docker/build-ubuntu.sh deleted file mode 100755 index 9b5e97a..0000000 --- a/.docker/build-ubuntu.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -set -e - -rm -rf build-ubuntu -mkdir build-ubuntu - -# patches -git apply patches/qt5.14-splitbehavior-and-qset.patch - -# build -cd build-ubuntu -cmake -DKDE_INSTALL_USE_QT_SYS_PATHS=ON -DCMAKE_BUILD_TYPE=Optimization -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_FUTURE=ON -DBUILD_TESTING=ON ../sources -make - -# tests -xvfb-run -a make test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..159ae81 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,51 @@ +name: release + +on: + push: + tags: + - '*' + +jobs: + make-release: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: create changelog + id: changelog + uses: jaywcjlove/changelog-generator@main + with: + token: ${{ secrets.GITHUB_TOKEN }} + filter: 'Release \d+\.\d+\.\d+' + + - name: create archive + run: bash create_archive.sh + env: + VERSION: ${{ steps.version.outputs.VERSION }} + + - name: build debian package + run: > + apt update && \ + apt install -yq cmake extra-cmake-modules g++ git gettext && + apt install -yq libkf5i18n-dev libkf5notifications-dev libkf5service-dev + libkf5windowsystem-dev libkf5plasma-dev qtbase5-dev qtdeclarative5-dev + plasma-workspace-dev && + cmake -B build-deb -DKDE_INSTALL_USE_QT_SYS_PATHS=ON -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Optimization -DBUILD_FUTURE=ON -DBUILD_DEB_PACKAGE=ON sources && + cd build-deb && + make package && + cd .. + + - name: release + uses: softprops/action-gh-release@v1 + with: + body: | + ${{ steps.changelog.outputs.compareurl }} + ${{ steps.changelog.outputs.changelog }} + files: | + awesome-widgets-*-src.tar.xz + build-deb/awesome-widgets-*.deb + fail_on_unmatched_files: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 80fdc9a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -sudo: required -language: generic - -env: - - DOCKER_TAG_ARCH="arcan1s/awesome-widgets-arch" - -services: - - docker - -before_install: - - docker build --tag="${DOCKER_TAG_ARCH}" -f ".docker/Dockerfile-arch" ".docker" - -script: - - docker run --rm -v "$(pwd):/opt/build" -w /opt/build "${DOCKER_TAG_ARCH}" sh -c ".docker/build-arch.sh" diff --git a/README.md b/README.md index 47741f7..2dd11df 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ awesome-widgets (ex-pytextmonitor) ================================== -[![Build Status](https://travis-ci.org/arcan1s/awesome-widgets.svg?branch=development)](https://travis-ci.org/arcan1s/awesome-widgets) +[![build & tests](https://github.com/arcan1s/awesome-widgets/actions/workflows/build.yml/badge.svg)](https://github.com/arcan1s/awesome-widgets/actions/workflows/build.yml) [![Coverity Scan Build Status](https://scan.coverity.com/projects/8254/badge.svg)](https://scan.coverity.com/projects/awesome-widgets) Information @@ -62,10 +62,6 @@ Installation **NOTE** on Plasma 5 it very likely requires `-DKDE_INSTALL_USE_QT_SYS_PATHS=ON` flag - **NOTE** if you are going to build from git, you need to init submodules first, e.g.: - - git submodule update --init --recursive - Additional information ====================== diff --git a/create_archive.sh b/create_archive.sh index 28ddf7b..ba5b1e9 100755 --- a/create_archive.sh +++ b/create_archive.sh @@ -1,32 +1,20 @@ #!/bin/bash SRCDIR="sources" -MAJOR=$(grep -m1 PROJECT_VERSION_MAJOR sources/CMakeLists.txt | awk '{print $2}' | sed 's/^.\(.*\)..$/\1/') -MINOR=$(grep -m1 PROJECT_VERSION_MINOR sources/CMakeLists.txt | awk '{print $2}' | sed 's/^.\(.*\)..$/\1/') -PATCH=$(grep -m1 PROJECT_VERSION_PATCH sources/CMakeLists.txt | awk '{print $2}' | sed 's/^.\(.*\)..$/\1/') -VERSION="${MAJOR}.${MINOR}.${PATCH}" - -# update submodules -git submodule update --init --recursive +VERSION="$(git describe --tags --abbrev=0)" # build widget ARCHIVE="awesome-widgets" -FILES="AUTHORS CHANGELOG COPYING packages patches" +FILES="AUTHORS CHANGELOG COPYING packages patches sources" IGNORELIST="build usr .kdev4 *.kdev4 .idea packages/*src.tar.xz" # create archive [[ -e ${ARCHIVE}-${VERSION}-src.tar.xz ]] && rm -f "${ARCHIVE}-${VERSION}-src.tar.xz" [[ -d ${ARCHIVE} ]] && rm -rf "${ARCHIVE}" + cp -r "${SRCDIR}" "${ARCHIVE}" for FILE in ${FILES[*]}; do cp -r "$FILE" "${ARCHIVE}"; done for FILE in ${IGNORELIST[*]}; do rm -rf "${ARCHIVE}/${FILE}"; done -tar cJf "${ARCHIVE}-${VERSION}-src.tar.xz" "${ARCHIVE}" -ln -sf "../${ARCHIVE}-${VERSION}-src.tar.xz" packages -rm -rf "${ARCHIVE}" -# update md5sum -MD5SUMS=$(md5sum ${ARCHIVE}-${VERSION}-src.tar.xz | awk '{print $1}') -sed -i "/md5sums=('[0-9A-Fa-f]*/s/[^'][^)]*/md5sums=('${MD5SUMS}'/" packages/PKGBUILD -sed -i "s/pkgver=[0-9.]*/pkgver=${VERSION}/" packages/PKGBUILD -# clear -find . -type f -name '*src.tar.xz' -not -name "*${VERSION}-src.tar.xz" -exec rm -rf {} \; -find packages -type l -xtype l -exec rm -rf {} \; +tar cJf "${ARCHIVE}-${VERSION}-src.tar.xz" "${ARCHIVE}" + +rm -rf "${ARCHIVE}" diff --git a/packages/build-requirements.deb.txt b/packages/build-requirements.deb.txt deleted file mode 100644 index fb3c335..0000000 --- a/packages/build-requirements.deb.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake -extra-cmake-modules -g++ -git -libkf5i18n-dev -libkf5notifications-dev -libkf5service-dev -libkf5windowsystem-dev -plasma-framework-dev -qtbase5-dev -qtdeclarative5-dev diff --git a/packages/build-requirements.rpm.txt b/packages/build-requirements.rpm.txt deleted file mode 100644 index e69de29..0000000 diff --git a/patches/qt5.14-splitbehavior-and-qset.patch b/patches/qt5.14-splitbehavior-and-qset.patch deleted file mode 100644 index de2d300..0000000 --- a/patches/qt5.14-splitbehavior-and-qset.patch +++ /dev/null @@ -1,255 +0,0 @@ -diff --git a/sources/awdebug.cpp b/sources/awdebug.cpp -index 7135db6..a2870ec 100644 ---- a/sources/awdebug.cpp -+++ b/sources/awdebug.cpp -@@ -67,7 +67,7 @@ QString AWDebug::getAboutText(const QString &_type) - translator = QString("
  • %1
  • ").arg(translator); - text = i18n("Translators:") + ""; - } else if (_type == "3rdparty") { -- QStringList trdPartyList = QString(TRDPARTY_LICENSE).split(';', Qt::SkipEmptyParts); -+ QStringList trdPartyList = QString(TRDPARTY_LICENSE).split(';', QString::SkipEmptyParts); - for (int i = 0; i < trdPartyList.count(); i++) - trdPartyList[i] = QString("
  • %1 (%2 license)
  • ") - .arg(trdPartyList.at(i).split(',')[0]) -@@ -75,7 +75,7 @@ QString AWDebug::getAboutText(const QString &_type) - .arg(trdPartyList.at(i).split(',')[2]); - text = i18n("This software uses:") + ""; - } else if (_type == "thanks") { -- QStringList thanks = QString(SPECIAL_THANKS).split(';', Qt::SkipEmptyParts); -+ QStringList thanks = QString(SPECIAL_THANKS).split(';', QString::SkipEmptyParts); - for (int i = 0; i < thanks.count(); i++) - thanks[i] = QString("
  • %1
  • ") - .arg(thanks.at(i).split(',')[0]) -diff --git a/sources/awesome-widget/plugin/awabstractpairhelper.cpp b/sources/awesome-widget/plugin/awabstractpairhelper.cpp -index 55a4e91..f7c2969 100644 ---- a/sources/awesome-widget/plugin/awabstractpairhelper.cpp -+++ b/sources/awesome-widget/plugin/awabstractpairhelper.cpp -@@ -61,7 +61,7 @@ QStringList AWAbstractPairHelper::values() const - QSet AWAbstractPairHelper::valuesSet() const - { - auto values = m_pairs.values(); -- return QSet(values.cbegin(), values.cend()); -+ return QSet::fromList(values); - } - - -@@ -138,4 +138,4 @@ bool AWAbstractPairHelper::removeUnusedKeys(const QStringList &_keys) const - settings.sync(); - - return (settings.status() == QSettings::NoError); --} -\ No newline at end of file -+} -diff --git a/sources/awesome-widget/plugin/awkeycache.cpp b/sources/awesome-widget/plugin/awkeycache.cpp -index 15aab94..54b47b3 100644 ---- a/sources/awesome-widget/plugin/awkeycache.cpp -+++ b/sources/awesome-widget/plugin/awkeycache.cpp -@@ -83,9 +83,9 @@ QStringList AWKeyCache::getRequiredKeys(const QStringList &_keys, const QStringL - << _tooltip; - - // initial copy -- QSet used(_keys.cbegin(), _keys.cend()); -- used.unite(QSet(_bars.cbegin(), _bars.cend())); -- used.unite(QSet(_userKeys.cbegin(), _userKeys.cend())); -+ auto used = QSet::fromList(_keys); -+ used.unite(QSet::fromList(_bars)); -+ used.unite(QSet::fromList(_userKeys)); - // insert keys from tooltip - for (auto &key : _tooltip.keys()) { - if ((key.endsWith("Tooltip")) && (_tooltip[key].toBool())) { -diff --git a/sources/awesomewidgets/awjsonformatter.cpp b/sources/awesomewidgets/awjsonformatter.cpp -index bbdd7ce..8a1c5e0 100644 ---- a/sources/awesomewidgets/awjsonformatter.cpp -+++ b/sources/awesomewidgets/awjsonformatter.cpp -@@ -178,7 +178,7 @@ QVariant AWJsonFormatter::getFromMap(const QVariant &_value, const QString &_key - void AWJsonFormatter::initPath() - { - m_splittedPath.clear(); -- QStringList splittedByDot = m_path.split('.', Qt::SkipEmptyParts); -+ QStringList splittedByDot = m_path.split('.', QString::SkipEmptyParts); - - for (auto &element : splittedByDot) { - bool ok; -diff --git a/sources/awesomewidgets/extscript.cpp b/sources/awesomewidgets/extscript.cpp -index 3017dac..da009f9 100644 ---- a/sources/awesomewidgets/extscript.cpp -+++ b/sources/awesomewidgets/extscript.cpp -@@ -218,7 +218,7 @@ void ExtScript::readConfiguration() - setExecutable(settings.value("Exec", executable()).toString()); - setStrRedirect(settings.value("X-AW-Redirect", strRedirect()).toString()); - // api == 3 -- setFilters(settings.value("X-AW-Filters", filters()).toString().split(',', Qt::SkipEmptyParts)); -+ setFilters(settings.value("X-AW-Filters", filters()).toString().split(',', QString::SkipEmptyParts)); - settings.endGroup(); - - bumpApi(AW_EXTSCRIPT_API); -diff --git a/sources/awesomewidgets/extupgrade.cpp b/sources/awesomewidgets/extupgrade.cpp -index 0195779..0081cc9 100644 ---- a/sources/awesomewidgets/extupgrade.cpp -+++ b/sources/awesomewidgets/extupgrade.cpp -@@ -219,8 +219,8 @@ void ExtUpgrade::updateValue() - = QTextCodec::codecForMib(106)->toUnicode(m_process->readAllStandardOutput()).trimmed(); - m_values[tag("pkgcount")] = [this](const QString &output) { - return filter().isEmpty() -- ? output.split('\n', Qt::SkipEmptyParts).count() - null() -- : output.split('\n', Qt::SkipEmptyParts).filter(QRegExp(filter())).count(); -+ ? output.split('\n', QString::SkipEmptyParts).count() - null() -+ : output.split('\n', QString::SkipEmptyParts).filter(QRegExp(filter())).count(); - }(qoutput); - - emit(dataReceived(m_values)); -diff --git a/sources/awesomewidgets/qcronscheduler.cpp b/sources/awesomewidgets/qcronscheduler.cpp -index 6f67590..c72abc9 100644 ---- a/sources/awesomewidgets/qcronscheduler.cpp -+++ b/sources/awesomewidgets/qcronscheduler.cpp -@@ -87,7 +87,7 @@ QList QCronScheduler::parseField(const QString &_value, const int _min, con - parsedField.fromRange(field.split('/').first(), _min, _max); - if (field.contains('/')) { - bool status; -- parsedField.div = field.split('/', Qt::SkipEmptyParts).at(1).toInt(&status); -+ parsedField.div = field.split('/', QString::SkipEmptyParts).at(1).toInt(&status); - if (!status) - parsedField.div = 1; - } -@@ -107,7 +107,7 @@ void QCronScheduler::QCronField::fromRange(const QString &_range, const int _min - minValue = _min; - maxValue = _max; - } else if (_range.contains("-")) { -- auto interval = _range.split('-', Qt::SkipEmptyParts); -+ auto interval = _range.split('-', QString::SkipEmptyParts); - if (interval.count() != 2) - return; - bool status; -diff --git a/sources/extsysmon/extsysmon.cpp b/sources/extsysmon/extsysmon.cpp -index 88b6e39..5bdc7f3 100644 ---- a/sources/extsysmon/extsysmon.cpp -+++ b/sources/extsysmon/extsysmon.cpp -@@ -126,7 +126,7 @@ QHash ExtendedSysMon::updateConfiguration(QHash")) - continue; - auto load = str.remove("").remove("").remove('%'); -@@ -140,10 +140,10 @@ void GPULoadSource::updateValue() - break; - } - } else if (m_device == "ati") { -- for (auto &str : qoutput.split('\n', Qt::SkipEmptyParts)) { -+ for (auto &str : qoutput.split('\n', QString::SkipEmptyParts)) { - if (!str.contains("load")) - continue; -- QString load = str.split(' ', Qt::SkipEmptyParts)[3].remove('%'); -+ QString load = str.split(' ', QString::SkipEmptyParts)[3].remove('%'); - m_values["gpu/load"] = load.toFloat(); - break; - } -diff --git a/sources/extsysmonsources/gputempsource.cpp b/sources/extsysmonsources/gputempsource.cpp -index 55fbadc..dce0c6e 100644 ---- a/sources/extsysmonsources/gputempsource.cpp -+++ b/sources/extsysmonsources/gputempsource.cpp -@@ -112,7 +112,7 @@ void GPUTemperatureSource::updateValue() - qCInfo(LOG_ESS) << "Output" << qoutput; - - if (m_device == "nvidia") { -- for (auto &str : qoutput.split('\n', Qt::SkipEmptyParts)) { -+ for (auto &str : qoutput.split('\n', QString::SkipEmptyParts)) { - if (!str.contains("")) - continue; - QString temp = str.remove("").remove("C"); -@@ -120,10 +120,10 @@ void GPUTemperatureSource::updateValue() - break; - } - } else if (m_device == "ati") { -- for (auto &str : qoutput.split('\n', Qt::SkipEmptyParts)) { -+ for (auto &str : qoutput.split('\n', QString::SkipEmptyParts)) { - if (!str.contains("Temperature")) - continue; -- QString temp = str.split(' ', Qt::SkipEmptyParts).at(4); -+ QString temp = str.split(' ', QString::SkipEmptyParts).at(4); - m_values["gpu/temperature"] = temp.toFloat(); - break; - } -diff --git a/sources/extsysmonsources/hddtempsource.cpp b/sources/extsysmonsources/hddtempsource.cpp -index efaae08..dad47a3 100644 ---- a/sources/extsysmonsources/hddtempsource.cpp -+++ b/sources/extsysmonsources/hddtempsource.cpp -@@ -31,7 +31,7 @@ HDDTemperatureSource::HDDTemperatureSource(QObject *_parent, const QStringList & - Q_ASSERT(_args.count() == 2); - qCDebug(LOG_ESS) << __PRETTY_FUNCTION__; - -- m_devices = _args.at(0).split(',', Qt::SkipEmptyParts); -+ m_devices = _args.at(0).split(',', QString::SkipEmptyParts); - m_cmd = _args.at(1).split(' '); // lets hope no one put cmd with spaces here lol - - m_smartctl = m_cmd.contains("smartctl"); -@@ -131,17 +131,17 @@ void HDDTemperatureSource::updateValue(const QString &_device) - - // parse - if (m_smartctl) { -- QStringList lines = qoutput.split('\n', Qt::SkipEmptyParts); -+ QStringList lines = qoutput.split('\n', QString::SkipEmptyParts); - for (auto &str : lines) { - if (!str.startsWith("194")) - continue; -- if (str.split(' ', Qt::SkipEmptyParts).count() < 9) -+ if (str.split(' ', QString::SkipEmptyParts).count() < 9) - continue; -- m_values[_device] = str.split(' ', Qt::SkipEmptyParts).at(9).toFloat(); -+ m_values[_device] = str.split(' ', QString::SkipEmptyParts).at(9).toFloat(); - break; - } - } else { -- QStringList lines = qoutput.split(':', Qt::SkipEmptyParts); -+ QStringList lines = qoutput.split(':', QString::SkipEmptyParts); - if (lines.count() >= 3) { - QString temp = lines.at(2); - temp.remove(QChar(0260)).remove('C'); -diff --git a/sources/extsysmonsources/playersource.cpp b/sources/extsysmonsources/playersource.cpp -index aaca22f..e127a05 100644 ---- a/sources/extsysmonsources/playersource.cpp -+++ b/sources/extsysmonsources/playersource.cpp -@@ -256,11 +256,11 @@ void PlayerSource::mpdSocketReadyRead() - qCInfo(LOG_ESS) << "Output" << qoutput; - - // parse -- for (auto &str : qoutput.split('\n', Qt::SkipEmptyParts)) { -- if (str.split(": ", Qt::SkipEmptyParts).count() == 2) { -+ for (auto &str : qoutput.split('\n', QString::SkipEmptyParts)) { -+ if (str.split(": ", QString::SkipEmptyParts).count() == 2) { - // "Metadata: data" -- QString metadata = str.split(": ", Qt::SkipEmptyParts).first().toLower(); -- QString data = str.split(": ", Qt::SkipEmptyParts).last().trimmed(); -+ QString metadata = str.split(": ", QString::SkipEmptyParts).first().toLower(); -+ QString data = str.split(": ", QString::SkipEmptyParts).last().trimmed(); - // there are one more time... - if ((metadata == "time") && (data.contains(':'))) { - QStringList times = data.split(':'); -diff --git a/sources/test/testawtelemetryhandler.cpp b/sources/test/testawtelemetryhandler.cpp -index ffb0e79..b4181e0 100644 ---- a/sources/test/testawtelemetryhandler.cpp -+++ b/sources/test/testawtelemetryhandler.cpp -@@ -51,7 +51,7 @@ void TestAWTelemetryHandler::test_get() - QStringList output = plugin->get(telemetryGroup); - - QVERIFY(!output.isEmpty()); -- QCOMPARE(QSet(output.cbegin(), output.cend()).count(), output.count()); -+ QCOMPARE(QSet::fromList(output).count(), output.count()); - QVERIFY(output.contains(telemetryData)); - } - diff --git a/sources/desktop-panel/plugin/dpadds.cpp b/sources/desktop-panel/plugin/dpadds.cpp index f73b6c6..2815425 100644 --- a/sources/desktop-panel/plugin/dpadds.cpp +++ b/sources/desktop-panel/plugin/dpadds.cpp @@ -59,8 +59,8 @@ DPAdds::~DPAdds() { qCDebug(LOG_DP) << __PRETTY_FUNCTION__; - delete m_vdi; - delete m_taskModel; + m_vdi->deleteLater(); + m_taskModel->deleteLater(); } diff --git a/sources/extsysmonsources/desktopsource.cpp b/sources/extsysmonsources/desktopsource.cpp index a4dc824..778e022 100644 --- a/sources/extsysmonsources/desktopsource.cpp +++ b/sources/extsysmonsources/desktopsource.cpp @@ -38,7 +38,7 @@ DesktopSource::~DesktopSource() { qCDebug(LOG_ESS) << __PRETTY_FUNCTION__; - delete m_vdi; + m_vdi->deleteLater(); }