sci-electronics/qelectrotech: Add Qt6/cmake based 0.90_pre20250820 snapshot

Taken from upstream qt6-cmake branch, heavily patched to get it to build
in the first place (which is necessary in any case). This is the only way
to keep it in the repository.

See also:
https://github.com/qelectrotech/qelectrotech-source-mirror/issues/402

Closes: https://bugs.gentoo.org/954004
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
This commit is contained in:
Andreas Sturmlechner
2025-04-18 21:29:20 +02:00
parent 576a5b85b9
commit dd277c6d9a
3 changed files with 367 additions and 0 deletions

View File

@@ -1 +1,3 @@
DIST SingleApplication-3.5.3.tar.gz 25361 BLAKE2B 907f0f3c18e09602c12d76eb27e33c20055dbe4b955c4d76d8790aef4106abb835d34217c78a036107cf3d27fc8858ae8d2164533ccab70d44feee40231ba8f9 SHA512 917761ab167df7b1a4e3cceb343ed407b098c530be922e9981633af9e01122fc41cc5d9cab4c0a951b5179a1710ae9c54a5160fb9a76f3db99d8f05326cfe1f7
DIST qelectrotech-0.80.tar.gz 13835653 BLAKE2B 1efb22c9683c01c3cc449a3c1deef1990825b16f11dc15d93e2d7c0afd026486ee9772e0d8637efcb576fb20a8dc79235cdcabc94d293b9bf8c2028818645734 SHA512 732101130e77849ed0a56bcc7b519a1ca032e8f203951a50e1dd5fd488e96f1ab69ed0854176604f1947636b3d8fda1ac8aebbcfe01e63dfa263d8f646224f53
DIST qelectrotech-0.90_pre20250820-411fb3c4.tar.gz 11652911 BLAKE2B 73c33ba1c5fa7f51dbc3a85e8a6cc7ce97fbaa7d18e9752d3a7bb084efb5141ba64ab45c02638d7bd842fac4fe4f61c06615f09ce5f8dbc45c1aa84644fb6086 SHA512 4427ed6b029def32171a36b7936db59be4ea37b19668f8ce3adf8b58194428dbd3f3853ad190c33648c645bdf7686112c1e13f19cec3255a9f921310c717452c

View File

@@ -0,0 +1,283 @@
From fb5024b3cc07c63e347d2ba1b63ef87b96f1a7dc Mon Sep 17 00:00:00 2001
From: Andreas Sturmlechner <asturm@gentoo.org>
Date: Wed, 30 Apr 2025 22:56:56 +0200
Subject: [PATCH 1/6] Properly find pugixml, fix includes and drop cmake refs
of bundled dir
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
---
CMakeLists.txt | 3 +--
cmake/qet_compilation_vars.cmake | 4 ----
sources/ElementsCollection/elementslocation.h | 2 +-
sources/NameList/nameslist.h | 2 +-
sources/diagramcontext.h | 2 +-
5 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 71cc5a530..8473c4591 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -49,7 +49,7 @@ include(cmake/git_update_submodules.cmake)
include(cmake/git_last_commit_sha.cmake)
include(cmake/fetch_kdeaddons.cmake)
include(cmake/fetch_singleapplication.cmake)
-include(cmake/fetch_pugixml.cmake)
+find_package(pugixml CONFIG REQUIRED)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
@@ -118,7 +118,6 @@ target_include_directories(
${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
diff --git a/cmake/qet_compilation_vars.cmake b/cmake/qet_compilation_vars.cmake
index 1783dce0e..1b664610d 100644
--- a/cmake/qet_compilation_vars.cmake
+++ b/cmake/qet_compilation_vars.cmake
@@ -421,10 +421,6 @@ set(QET_SRC_FILES
${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
diff --git a/sources/ElementsCollection/elementslocation.h b/sources/ElementsCollection/elementslocation.h
index 92fd2ea87..7e1246463 100644
--- 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>
diff --git a/sources/NameList/nameslist.h b/sources/NameList/nameslist.h
index c316a79c7..e495bf8b3 100644
--- 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>
/**
diff --git a/sources/diagramcontext.h b/sources/diagramcontext.h
index d04104345..dbaf170c1 100644
--- 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>
--
2.51.0
From 27a3f9767bb1c0262cad58513393274af3b64eae Mon Sep 17 00:00:00 2001
From: Andreas Sturmlechner <asturm@gentoo.org>
Date: Sat, 30 Aug 2025 18:43:14 +0200
Subject: [PATCH 2/6] Properly find KF6
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
---
CMakeLists.txt | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8473c4591..1203a76d9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -47,7 +47,13 @@ include(cmake/start_options.cmake)
include(cmake/developer_options.cmake)
include(cmake/git_update_submodules.cmake)
include(cmake/git_last_commit_sha.cmake)
-include(cmake/fetch_kdeaddons.cmake)
+if(BUILD_WITH_KF6)
+ find_package(ECM 6.8.0 REQUIRED NO_MODULE)
+ list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
+ find_package(KF6CoreAddons CONFIG REQUIRED)
+ find_package(KF6WidgetsAddons CONFIG REQUIRED)
+ set(KF6_PRIVATE_LIBRARIES KF6::CoreAddons KF6::WidgetsAddons)
+endif()
include(cmake/fetch_singleapplication.cmake)
find_package(pugixml CONFIG REQUIRED)
--
2.51.0
From ebd9c295052ea85d0f1f8ad8b860f79aa1f37ec0 Mon Sep 17 00:00:00 2001
From: Andreas Sturmlechner <asturm@gentoo.org>
Date: Sat, 30 Aug 2025 19:08:44 +0200
Subject: [PATCH 3/6] Fix paths ...
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
---
cmake/paths_compilation_installation.cmake | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/cmake/paths_compilation_installation.cmake b/cmake/paths_compilation_installation.cmake
index 33fbc29d5..ab742f8c9 100644
--- a/cmake/paths_compilation_installation.cmake
+++ b/cmake/paths_compilation_installation.cmake
@@ -20,19 +20,19 @@ message(" - paths_compilation_installation")
if(UNIX AND NOT APPLE)
# for Linux, BSD, Solaris, Minix
- set(COMPIL_PREFIX "/usr/local/")
- set(INSTALL_PREFIX "/usr/local/")
+ set(COMPIL_PREFIX "/usr/")
+ set(INSTALL_PREFIX "/usr/")
set(QET_BINARY_PATH "bin/")
set(QET_COMMON_COLLECTION_PATH "share/qelectrotech/elements/")
set(QET_COMMON_TBT_PATH "share/qelectrotech/titleblocks/")
set(QET_LANG_PATH "share/qelectrotech/lang/")
set(QET_EXAMPLES_PATH "share/qelectrotech/examples/")
- set(QET_LICENSE_PATH "doc/qelectrotech/")
- set(QET_MIME_PACKAGE_PATH "../share/mime/packages/")
+ set(QET_LICENSE_PATH "share/doc/qelectrotech/")
+ set(QET_MIME_PACKAGE_PATH "share/mime/packages/")
set(QET_DESKTOP_PATH "share/applications/")
set(QET_ICONS_PATH "share/icons/hicolor/")
- set(QET_MAN_PATH "man/")
- set(QET_APPDATA_PATH "share/appdata")
+ set(QET_MAN_PATH "share/man/")
+ set(QET_APPDATA_PATH "share/metainfo")
endif()
if(APPLE)
--
2.51.0
From 5498b1e0910dee7affe3e92a0be7e6b0d70dfa16 Mon Sep 17 00:00:00 2001
From: Andreas Sturmlechner <asturm@gentoo.org>
Date: Sat, 30 Aug 2025 19:10:56 +0200
Subject: [PATCH 4/6] Don't install small files (README, ChangeLog, CREDIT) [to
wrong location]
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1203a76d9..37d3c82e1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -143,7 +143,7 @@ install(DIRECTORY ico/breeze-icons/256x256 DESTINATION ${QET_ICONS_PATH})
install(DIRECTORY elements DESTINATION share/qelectrotech)
install(DIRECTORY examples DESTINATION share/qelectrotech)
install(DIRECTORY titleblocks DESTINATION share/qelectrotech)
-install(FILES LICENSE ELEMENTS.LICENSE CREDIT README ChangeLog DESTINATION share/doc/qelectrotech)
+# install(FILES LICENSE ELEMENTS.LICENSE CREDIT README ChangeLog DESTINATION share/doc/qelectrotech)
install(FILES misc/org.qelectrotech.qelectrotech.desktop DESTINATION share/applications)
install(FILES misc/qelectrotech.xml DESTINATION share/mime/packages)
install(FILES misc/qelectrotech.appdata.xml DESTINATION ${QET_APPDATA_PATH})
--
2.51.0
From a28051bb1c19fb09a34f20db0df6322e2ed7d4d7 Mon Sep 17 00:00:00 2001
From: Andreas Sturmlechner <asturm@gentoo.org>
Date: Sat, 30 Aug 2025 19:20:08 +0200
Subject: [PATCH 5/6] DO NOT update submodules, do not try and detect git
commit sha
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
---
CMakeLists.txt | 2 +-
cmake/git_last_commit_sha.cmake | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 37d3c82e1..94456bb32 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -45,7 +45,7 @@ endif()
include(cmake/paths_compilation_installation.cmake)
include(cmake/start_options.cmake)
include(cmake/developer_options.cmake)
-include(cmake/git_update_submodules.cmake)
+# include(cmake/git_update_submodules.cmake)
include(cmake/git_last_commit_sha.cmake)
if(BUILD_WITH_KF6)
find_package(ECM 6.8.0 REQUIRED NO_MODULE)
diff --git a/cmake/git_last_commit_sha.cmake b/cmake/git_last_commit_sha.cmake
index 0e8164121..e5e5f81e6 100644
--- a/cmake/git_last_commit_sha.cmake
+++ b/cmake/git_last_commit_sha.cmake
@@ -16,6 +16,7 @@
message(" - git_last_commit_sha")
+if(NOT GIT_COMMIT_SHA)
find_package(Git QUIET)
if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
@@ -36,6 +37,7 @@ if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
", please check")
endif()
endif()
+endif()
# This adds to definitions => .cpp
add_definitions(-DGIT_COMMIT_SHA="${GIT_COMMIT_SHA}")
--
2.51.0
From 53cc4e666757e4dbb8f8e216b9cf17877dfc0845 Mon Sep 17 00:00:00 2001
From: Andreas Sturmlechner <asturm@gentoo.org>
Date: Sat, 30 Aug 2025 20:33:00 +0200
Subject: [PATCH 6/6] Work around build error
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
sources/machine_info.cpp:137:42: error: ‘autosaveDir’ is not a member of ‘QETApp’
137 | qInfo()<< " Autosave:"<< QETApp::autosaveDir() % "/autosave";
| ^~~~~~~~~~~
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
---
sources/machine_info.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sources/machine_info.cpp b/sources/machine_info.cpp
index c53ed455e..734d42e9d 100644
--- a/sources/machine_info.cpp
+++ b/sources/machine_info.cpp
@@ -133,8 +133,8 @@ void MachineInfo::send_info_to_debug()
qInfo()<< " App Config Location:"<< QETApp::configDir();
qInfo()<< " For data-files (user-/company-collections, titleblocks, etc.):";
qInfo()<< " App Data Location:"<< QETApp::dataDir();
- qInfo()<< " Directory for project's autosave files (stalefiles):";
- qInfo()<< " Autosave:"<< QETApp::autosaveDir() % "/autosave";
+ //qInfo()<< " Directory for project's autosave files (stalefiles):";
+ //qInfo()<< " Autosave:"<< QETApp::autosaveDir() % "/autosave";
// qInfo()<< " App Local DataLocation:"<< QStandardPaths::writableLocation(QStandardPaths::ApplicationsLocation);
// qInfo()<< " Home Location:"<< QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
// qInfo()<< " Runtime Location:"<< QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation);
--
2.51.0

View File

@@ -0,0 +1,82 @@
# Copyright 2001-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
COMMIT=411fb3c4dc54b6aaea00f034d6c5396de5daa474
MY_PN=${PN}-source-mirror
SIAPP_PN=SingleApplication
SIAPP_PV=3.5.3
SIAPP_P=${SIAPP_PN}-${SIAPP_PV}
inherit cmake qmake-utils xdg
DESCRIPTION="Qt application to design electric diagrams"
HOMEPAGE="https://qelectrotech.org/"
if [[ ${PV} == *9999* ]]; then
EGIT_BRANCH="qt6-cmake" # TODO: Track upstream for merging this to git master!
EGIT_REPO_URI="https://github.com/qelectrotech/qelectrotech-source-mirror"
inherit git-r3
elif [[ -n ${COMMIT} ]]; then
SRC_URI="https://github.com/${PN}/${MY_PN}/archive/${COMMIT}.tar.gz -> ${P}-${COMMIT:0:8}.tar.gz"
S="${WORKDIR}/${MY_PN}-${COMMIT}"
else
MY_PV=${PV/%0/.0}
SRC_URI="https://github.com/${PN}/${MY_PN}/archive/refs/tags/${MY_PV}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/qet-${MY_PV}"
fi
SRC_URI+=" https://github.com/itay-grudev/${SIAPP_PN}/archive/refs/tags/v${SIAPP_PV}.tar.gz -> ${SIAPP_P}.tar.gz"
LICENSE="CC-BY-3.0 GPL-2+"
SLOT="0"
if [[ ${PV} == *9999* ]]; then
KEYWORDS="~amd64 ~arm64 ~x86"
fi
IUSE="doc"
RDEPEND="
dev-db/sqlite:3
dev-qt/qtbase:6[concurrent,gui,network,sql,sqlite,widgets,xml]
dev-qt/qtsvg:6
kde-frameworks/kcoreaddons:6
kde-frameworks/kwidgetsaddons:6
"
DEPEND="${RDEPEND}"
BDEPEND="
virtual/pkgconfig
doc? (
app-text/doxygen[dot]
dev-qt/qttools:6[assistant]
)
"
DOCS=( CREDIT ChangeLog README )
PATCHES=(
"${FILESDIR}"/${PN}-0.90_pre20250820-cmake.patch
)
src_prepare() {
cmake_src_prepare
sed -e "/QHG_LOCATION/s:\".*\":""$(qt6_get_bindir)/../libexec/qhelpgenerator"":" -i Doxyfile || die
}
src_configure() {
local mycmakeargs=(
-DPACKAGE_TESTS=OFF
-DGIT_COMMIT_SHA=${COMMIT}
-DFETCHCONTENT_SOURCE_DIR_SINGLEAPPLICATION="${WORKDIR}/${SIAPP_P}"
)
cmake_src_configure
}
src_install() {
cmake_src_install
if use doc; then
doxygen Doxyfile || die
local HTML_DOCS=( doc/html/. )
fi
einstalldocs
}