qelectrotech: 0.9.0 -> 0.100, switch to cmake build, drop KF5 dependencies

This commit is contained in:
K900
2026-05-08 09:34:20 +03:00
parent c6da58f2b3
commit 2635810a68
2 changed files with 90 additions and 21 deletions
+33 -21
View File
@@ -4,51 +4,63 @@
fetchFromGitHub,
installShellFiles,
pkg-config,
qmake,
cmake,
qtbase,
kcoreaddons,
kwidgetsaddons,
qtsvg,
wrapQtAppsHook,
qttools,
pugixml,
}:
let
singleApplication = fetchFromGitHub {
owner = "itay-grudev";
repo = "SingleApplication";
tag = "v3.2.0";
hash = "sha256-qjpPYPe1Oism6TetD/dMvTo1qyZKOsOPW+MzzNpJf3A=";
};
in
stdenv.mkDerivation rec {
pname = "qelectrotech";
version = "0.9.0";
version = "0.100";
src = fetchFromGitHub {
owner = "qelectrotech";
repo = "qelectrotech-source-mirror";
tag = "0.9";
hash = "sha256-tj8q+mRVtdeDXbpiv4retdbNiIfvAFlutXn7BmjqFYU=";
tag = version;
hash = "sha256-ElkqRiIHSXavXEw1ioFKL1cGnaBb2GXZuxgl98O4WuI=";
};
patches = [
# stripped down version of https://codeberg.org/gentoo/gentoo/src/branch/master/sci-electronics/qelectrotech/files/qelectrotech-0.90_pre20250820-cmake.patch
./system-pugixml.patch
];
# fix wrong cmake conditional
postPatch = ''
substituteInPlace qelectrotech.pro \
--replace-fail 'GIT_COMMIT_SHA="\\\"$(shell git -C \""$$_PRO_FILE_PWD_"\" rev-parse --verify HEAD)\\\""' \
'GIT_COMMIT_SHA="\\\"${version}\\\""' \
--replace-fail "COMPIL_PREFIX = '/usr/local/'" \
"COMPIL_PREFIX = '$out/'" \
--replace-fail "INSTALL_PREFIX = '/usr/local/'" \
"INSTALL_PREFIX = '$out/'"
substituteInPlace cmake/fetch_kdeaddons.cmake \
--replace-fail "DEFINED BUILD_WITH_KF5" "BUILD_WITH_KF5"
'';
cmakeFlags = [
"-DBUILD_WITH_KF5=OFF"
# relies on vendored catch2
"-DPACKAGE_TESTS=OFF"
"-DFETCHCONTENT_SOURCE_DIR_SINGLEAPPLICATION=${singleApplication}"
"-DBUILD_PUGIXML=OFF"
];
nativeBuildInputs = [
installShellFiles
pkg-config
qmake
cmake
wrapQtAppsHook
qttools
];
buildInputs = [
kcoreaddons
kwidgetsaddons
qtbase
qtsvg
];
qmakeFlags = [
"INSTALLROOT=$(out)"
pugixml
];
installPhase = ''
@@ -0,0 +1,57 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -121,7 +121,6 @@
${QET_DIR}/sources/NameList
${QET_DIR}/sources/NameList/ui
${QET_DIR}/sources/utils
- ${QET_DIR}/pugixml/src
${QET_DIR}/sources/dataBase
${QET_DIR}/sources/dataBase/ui
${QET_DIR}/sources/factory/ui
--- a/cmake/qet_compilation_vars.cmake
+++ b/cmake/qet_compilation_vars.cmake
@@ -421,10 +421,6 @@
${QET_DIR}/sources/PropertiesEditor/propertieseditorwidget.cpp
${QET_DIR}/sources/PropertiesEditor/propertieseditorwidget.h
- ${QET_DIR}/pugixml/src/pugiconfig.hpp
- ${QET_DIR}/pugixml/src/pugixml.cpp
- ${QET_DIR}/pugixml/src/pugixml.hpp
-
${QET_DIR}/sources/qetgraphicsitem/conductor.cpp
${QET_DIR}/sources/qetgraphicsitem/conductor.h
${QET_DIR}/sources/qetgraphicsitem/conductortextitem.cpp
--- a/sources/diagramcontext.h
+++ b/sources/diagramcontext.h
@@ -17,7 +17,7 @@
*/
#ifndef DIAGRAM_CONTEXT_H
#define DIAGRAM_CONTEXT_H
-#include "pugixml/src/pugixml.hpp"
+#include <pugixml.hpp>
#include <QDomElement>
#include <QHash>
--- a/sources/ElementsCollection/elementslocation.h
+++ b/sources/ElementsCollection/elementslocation.h
@@ -20,7 +20,7 @@
#include "../NameList/nameslist.h"
#include "../diagramcontext.h"
-#include "pugixml/src/pugixml.hpp"
+#include <pugixml.hpp>
#include <QIcon>
#include <QString>
--- a/sources/NameList/nameslist.h
+++ b/sources/NameList/nameslist.h
@@ -17,7 +17,7 @@
*/
#ifndef NAMES_LIST_H
#define NAMES_LIST_H
-#include "pugixml/src/pugixml.hpp"
+#include <pugixml.hpp>
#include <QtXml>
/**