sci-electronics/kactus2: fix build with qt6/6.6.0

- fix build problem with qt6/6.6.0, add missing QSharedPointer header
- improve ebuild and follow @ceamac 's suggestions, thanks

Signed-off-by: Huang Rui <vowstar@gmail.com>
This commit is contained in:
Huang Rui
2023-10-21 00:47:54 +08:00
parent 4866421356
commit 7d626fa317
3 changed files with 155 additions and 20 deletions

View File

@@ -0,0 +1,117 @@
From 1fd0d3cc8a3530a04491e736a673b9fc5092daeb Mon Sep 17 00:00:00 2001
From: Huang Rui <vowstar@gmail.com>
Date: Fri, 20 Oct 2023 23:41:51 +0800
Subject: [PATCH] [CORRECTIVE] add missing <QSharedPointer> include to fix
QT6.6.0 build
- add missing #include <QSharedPointer> to fix incomplete type about QSharedPointer
Closes: https://github.com/kactus2/kactus2dev/issues/85
Signed-off-by: Huang Rui <vowstar@gmail.com>
---
editors/HWDesign/undoCommands/HWComponentAddCommand.h | 5 +++--
.../SystemDesign/UndoCommands/ApiConnectionDeleteCommand.h | 3 ++-
.../SystemDesign/UndoCommands/ComConnectionDeleteCommand.h | 3 ++-
editors/SystemDesign/UndoCommands/SWInterfaceDeleteCommand.h | 3 ++-
.../SystemDesign/UndoCommands/SystemComponentDeleteCommand.h | 3 ++-
editors/SystemDesign/UndoCommands/SystemDeleteCommands.h | 3 ++-
6 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/editors/HWDesign/undoCommands/HWComponentAddCommand.h b/editors/HWDesign/undoCommands/HWComponentAddCommand.h
index fe53209d6..c131ada50 100644
--- a/editors/HWDesign/undoCommands/HWComponentAddCommand.h
+++ b/editors/HWDesign/undoCommands/HWComponentAddCommand.h
@@ -12,10 +12,11 @@
#ifndef HWCOMPONENTADDCOMMAND_H
#define HWCOMPONENTADDCOMMAND_H
-#include <QUndoCommand>
#include <QGraphicsScene>
-#include <QString>
#include <QObject>
+#include <QSharedPointer>
+#include <QString>
+#include <QUndoCommand>
class IGraphicsItemStack;
class ComponentItem;
diff --git a/editors/SystemDesign/UndoCommands/ApiConnectionDeleteCommand.h b/editors/SystemDesign/UndoCommands/ApiConnectionDeleteCommand.h
index 02aaea2c1..7173b9dd9 100644
--- a/editors/SystemDesign/UndoCommands/ApiConnectionDeleteCommand.h
+++ b/editors/SystemDesign/UndoCommands/ApiConnectionDeleteCommand.h
@@ -12,9 +12,10 @@
#ifndef APICONNECTIONDELETECOMMAND_H
#define APICONNECTIONDELETECOMMAND_H
-#include <QUndoCommand>
#include <QGraphicsScene>
#include <QObject>
+#include <QSharedPointer>
+#include <QUndoCommand>
class ApiGraphicsConnection;
diff --git a/editors/SystemDesign/UndoCommands/ComConnectionDeleteCommand.h b/editors/SystemDesign/UndoCommands/ComConnectionDeleteCommand.h
index 5e86dbdf1..e0676b2ca 100644
--- a/editors/SystemDesign/UndoCommands/ComConnectionDeleteCommand.h
+++ b/editors/SystemDesign/UndoCommands/ComConnectionDeleteCommand.h
@@ -12,9 +12,10 @@
#ifndef COMCONNECTIONDELETECOMMAND_H
#define COMCONNECTIONDELETECOMMAND_H
-#include <QUndoCommand>
#include <QGraphicsScene>
#include <QObject>
+#include <QSharedPointer>
+#include <QUndoCommand>
class ComGraphicsConnection;
diff --git a/editors/SystemDesign/UndoCommands/SWInterfaceDeleteCommand.h b/editors/SystemDesign/UndoCommands/SWInterfaceDeleteCommand.h
index d05d3750d..72a1128fd 100644
--- a/editors/SystemDesign/UndoCommands/SWInterfaceDeleteCommand.h
+++ b/editors/SystemDesign/UndoCommands/SWInterfaceDeleteCommand.h
@@ -12,9 +12,10 @@
#ifndef SWINTERFACEDELETECOMMAND_H
#define SWINTERFACEDELETECOMMAND_H
-#include <QUndoCommand>
#include <QGraphicsScene>
#include <QObject>
+#include <QSharedPointer>
+#include <QUndoCommand>
class IGraphicsItemStack;
class SWInterfaceItem;
diff --git a/editors/SystemDesign/UndoCommands/SystemComponentDeleteCommand.h b/editors/SystemDesign/UndoCommands/SystemComponentDeleteCommand.h
index 36abdda6f..ecfcef7db 100644
--- a/editors/SystemDesign/UndoCommands/SystemComponentDeleteCommand.h
+++ b/editors/SystemDesign/UndoCommands/SystemComponentDeleteCommand.h
@@ -12,9 +12,10 @@
#ifndef SYSTEMCOMPONENTDELETECOMMAND_H
#define SYSTEMCOMPONENTDELETECOMMAND_H
-#include <QUndoCommand>
#include <QGraphicsScene>
#include <QObject>
+#include <QSharedPointer>
+#include <QUndoCommand>
class ComponentItem;
class IGraphicsItemStack;
diff --git a/editors/SystemDesign/UndoCommands/SystemDeleteCommands.h b/editors/SystemDesign/UndoCommands/SystemDeleteCommands.h
index 7eb0ed694..a3c1748e6 100644
--- a/editors/SystemDesign/UndoCommands/SystemDeleteCommands.h
+++ b/editors/SystemDesign/UndoCommands/SystemDeleteCommands.h
@@ -12,9 +12,10 @@
#ifndef SYSTEMDELETECOMMANDS_H
#define SYSTEMDELETECOMMANDS_H
-#include <QUndoCommand>
#include <QGraphicsScene>
#include <QObject>
+#include <QSharedPointer>
+#include <QUndoCommand>
class GraphicsConnection;
class GraphicsColumnLayout;

View File

@@ -42,17 +42,16 @@ BDEPEND="
PATCHES=(
"${FILESDIR}"/${PN}-3.12.0-fix-createhelp.patch
"${FILESDIR}"/${PN}-3.12.0-fix-missing-qsharedpointer.patch
)
src_prepare() {
default
# Fix QA pre-stripped warnings, bug 781674
while IFS= read -r -d '' i; do
echo "CONFIG+=nostrip" >> "${i}" || die
done < <(find . -type f '(' -name "*.pro" ')' -print0)
find . -type f -name \*.pro -exec sed -e '$a\\nCONFIG+=nostrip' -i '{}' + || die
# Fix bug 854081
python_setup
sed -i -e "s|PYTHON_CONFIG=.*|PYTHON_CONFIG=${EPYTHON}-config|" .qmake.conf || die
sed -e "s|PYTHON_CONFIG=.*|PYTHON_CONFIG=${EPYTHON}-config|" -i .qmake.conf || die
}
src_configure() {
@@ -68,14 +67,14 @@ src_compile() {
cp -TR "${S}/" "${BUILD_DIR}/" || die
# Fix bug 854081
python_setup
sed -i -e "s|PYTHON_CONFIG=.*|PYTHON_CONFIG=${EPYTHON}-config|" .qmake.conf || die
sed -e "s|PYTHON_CONFIG=.*|PYTHON_CONFIG=${EPYTHON}-config|" -i .qmake.conf || die
export PYTHON_C_FLAGS="$(python_get_CFLAGS)"
export PYTHON_LIBS="$(python_get_LIBS)"
pushd "PythonAPI" || die
eqmake6 PREFIX="$(python_get_library_path)"
emake
rm -rf _pythonAPI.so || die
cp -rf libPythonAPI.so.1.0.0 _pythonAPI.so || die
rm _pythonAPI.so || die
cp libPythonAPI.so.1.0.0 _pythonAPI.so || die
popd
}
python_foreach_impl run_in_build_dir python_compile

View File

@@ -42,33 +42,52 @@ BDEPEND="
PATCHES=(
"${FILESDIR}"/${PN}-3.12.0-fix-createhelp.patch
"${FILESDIR}"/${PN}-3.12.0-fix-missing-qsharedpointer.patch
)
src_prepare() {
default
# Fix QA pre-stripped warnings, bug 781674
while IFS= read -r -d '' i; do
echo "CONFIG+=nostrip" >> "${i}" || die
done < <(find . -type f '(' -name "*.pro" ')' -print0)
# # Fix QTBIN_PATH
# sed -i -e "s|QTBIN_PATH=.*|QTBIN_PATH=\"$(qt6_get_bindir)/\"|" configure || die
find . -type f -name \*.pro -exec sed -e '$a\\nCONFIG+=nostrip' -i '{}' + || die
# Fix bug 854081
python_setup
sed -e "s|PYTHON_CONFIG=.*|PYTHON_CONFIG=${EPYTHON}-config|" -i .qmake.conf || die
}
src_configure() {
default
# Fix bug 854075
# Fix bug 854078
eqmake6 Kactus2.pro
}
src_compile() {
default
python_compile() {
cp -TR "${S}/" "${BUILD_DIR}/" || die
# Fix bug 854081
python_setup
sed -e "s|PYTHON_CONFIG=.*|PYTHON_CONFIG=${EPYTHON}-config|" -i .qmake.conf || die
export PYTHON_C_FLAGS="$(python_get_CFLAGS)"
export PYTHON_LIBS="$(python_get_LIBS)"
pushd "PythonAPI" || die
eqmake6 PREFIX="$(python_get_library_path)"
emake
rm _pythonAPI.so || die
cp libPythonAPI.so.1.0.0 _pythonAPI.so || die
popd
}
python_foreach_impl run_in_build_dir python_compile
}
src_install() {
# Can't use default, set INSTALL_ROOT and workaround parallel install bug
emake -j1 INSTALL_ROOT="${D}" install
python_install() {
export PYTHON_C_FLAGS="$(python_get_CFLAGS)"
export PYTHON_LIBS="$(python_get_LIBS)"
pushd "PythonAPI" || die
emake clean
eqmake5 PREFIX="$(python_get_library_path)"
emake
rm -rf _pythonAPI.so || die
cp -rf libPythonAPI.so.1.0.0 _pythonAPI.so || die
python_domodule _pythonAPI.so
python_domodule pythonAPI.py
popd
}
python_foreach_impl python_install
python_foreach_impl run_in_build_dir python_install
}