commit:     f88ca576d21d2a7b970d0686cce2f722be18d3c7
Author:     Huang Rui <vowstar <AT> gmail <DOT> com>
AuthorDate: Tue Oct 17 15:07:19 2023 +0000
Commit:     Rui Huang <vowstar <AT> gmail <DOT> com>
CommitDate: Tue Oct 17 15:07:30 2023 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=f88ca576

sci-electronics/kactus2: add 3.12.0

Closes: https://bugs.gentoo.org/854075
Closes: https://bugs.gentoo.org/854078
Closes: https://bugs.gentoo.org/854081
Signed-off-by: Huang Rui <vowstar <AT> gmail.com>

 sci-electronics/kactus2/Manifest                   |  1 +
 .../files/kactus2-3.12.0-fix-createhelp.patch      | 94 ++++++++++++++++++++++
 sci-electronics/kactus2/kactus2-3.12.0.ebuild      | 94 ++++++++++++++++++++++
 3 files changed, 189 insertions(+)

diff --git a/sci-electronics/kactus2/Manifest b/sci-electronics/kactus2/Manifest
index a78a46fe6c..cab286dc47 100644
--- a/sci-electronics/kactus2/Manifest
+++ b/sci-electronics/kactus2/Manifest
@@ -1 +1,2 @@
 DIST kactus2-3.10.0.tar.gz 27887683 BLAKE2B 
3addb9d2112fcd79891748ad35bd9e1b93acff1d04bcb75612d4e8018f30c6f015e496860e66e0e8ade3397339de31f700e91d35b18f2eccbd2621b8751d477b
 SHA512 
a54396f6e305bbc8f70a1af4a5ca0cdc28fc6a95ea1f44c8f9bcd16b7f4a161ad738edd14840ee2356aba4d7e2f198d6ee3ced1f0e5ef32a5717f2ea61cfb5bd
+DIST kactus2-3.12.0.tar.gz 28154387 BLAKE2B 
c8e0a982343d3a34f9186bca1778b68b4dfdcd977488751f90d9d5372df96c4f7349c90e15203f66778ee1be399e9e2ddb5342dffe1025754e44604c77c16684
 SHA512 
d7cef803314262c9fb0b77db88b5d7935203e1484965f475e954bceb1bc56a31ee9867fe1d73959d62a8454238480226df8fbd2d487442bce44fe7476de6d5bb

diff --git a/sci-electronics/kactus2/files/kactus2-3.12.0-fix-createhelp.patch 
b/sci-electronics/kactus2/files/kactus2-3.12.0-fix-createhelp.patch
new file mode 100644
index 0000000000..41e4bfc268
--- /dev/null
+++ b/sci-electronics/kactus2/files/kactus2-3.12.0-fix-createhelp.patch
@@ -0,0 +1,94 @@
+From d3e5af0dba523303708d30ceb8cd8339eabd4320 Mon Sep 17 00:00:00 2001
+From: Huang Rui <vows...@gmail.com>
+Date: Tue, 17 Oct 2023 19:11:21 +0800
+Subject: [PATCH] [CORRECTIVE] fix build PATH bugs about QT
+
+- Path variables need to be enclosed in double quotes to prevent
+  accidents caused by spaces in the middle.
+- createhelp also needs to do the same processing as configure
+- Fixed build issues under gentoo and archlinux
+
+Signed-off-by: Huang Rui <vows...@gmail.com>
+---
+ configure  | 15 ++++++++++-----
+ createhelp | 25 ++++++++++++++++++++++++-
+ 2 files changed, 34 insertions(+), 6 deletions(-)
+
+diff --git a/configure b/configure
+index 82c7b9060..f74a23ee2 100755
+--- a/configure
++++ b/configure
+@@ -20,27 +20,32 @@ print_success() {
+ }
+ 
+ # Auto search QTBIN_PATH when empty and qmake already installed.
+-if [ -z ${QTBIN_PATH} ]; then
++if [ -z "${QTBIN_PATH}" ]; then
+     if command -v qmake6 >/dev/null 2>&1; then
+         # Default to qmake6, which will exist on some linux distributions.
+-        QTBIN_PATH=$(qmake6 -query QT_INSTALL_BINS)/
++        QTBIN_PATH="$(qmake6 -query QT_INSTALL_BINS)/"
++        QTLIBEXEC_PATH="$(qmake6 -query QT_INSTALL_LIBEXECS)/"
+     elif command -v qmake >/dev/null 2>&1; then
+         # qmake exists on the vast majority of linux distributions.
+-        QTBIN_PATH=$(qmake -query QT_INSTALL_BINS)/
++        QTBIN_PATH="$(qmake -query QT_INSTALL_BINS)/"
++        QTLIBEXEC_PATH="$(qmake -query QT_INSTALL_LIBEXECS)/"
+     fi
+ fi
+ 
+ # Generate compressed help files.
+ echo "Generating compressed help files..."
+ if command -v ${QTBIN_PATH}qhelpgenerator >/dev/null 2>&1; then
+-    ${QTBIN_PATH}qhelpgenerator Help/kactus2help.qhcp -o Help/Kactus2Help.qhc
++    "${QTBIN_PATH}qhelpgenerator" Help/kactus2help.qhcp -o 
Help/Kactus2Help.qhc
++elif command -v ${QTLIBEXEC_PATH}qhelpgenerator >/dev/null 2>&1; then
++    # QT6 put qhelpgenerator at QTLIBEXEC_PATH
++    "${QTLIBEXEC_PATH}qhelpgenerator" Help/kactus2help.qhcp -o 
Help/Kactus2Help.qhc
+ else
+     echo "Qhelpgenerator not found. Please set variable QTBIN_PATH to Qt 
binary files."
+ fi
+ 
+ if command -v ${QTBIN_PATH}qmake >/dev/null 2>&1; then
+    echo "Running qmake..."
+-   ${QTBIN_PATH}qmake Kactus2_Solution.pro
++   "${QTBIN_PATH}qmake" Kactus2_Solution.pro
+    print_success
+ else
+     echo "Qmake not found. Please set variable QTBIN_PATH to Qt binary files."
+diff --git a/createhelp b/createhelp
+index 72299e655..522378331 100755
+--- a/createhelp
++++ b/createhelp
+@@ -1,7 +1,30 @@
+ #!/bin/sh
+ 
++# Change this to your Qt binaries directory.
++QTBIN_PATH=""
++
++# Auto search QTBIN_PATH when empty and qmake already installed.
++if [ -z "${QTBIN_PATH}" ]; then
++    if command -v qmake6 >/dev/null 2>&1; then
++        # Default to qmake6, which will exist on some linux distributions.
++        QTBIN_PATH="$(qmake6 -query QT_INSTALL_BINS)/"
++        QTLIBEXEC_PATH="$(qmake6 -query QT_INSTALL_LIBEXECS)/"
++    elif command -v qmake >/dev/null 2>&1; then
++        # qmake exists on the vast majority of linux distributions.
++        QTBIN_PATH="$(qmake -query QT_INSTALL_BINS)/"
++        QTLIBEXEC_PATH="$(qmake -query QT_INSTALL_LIBEXECS)/"
++    fi
++fi
++
+ if [ ! -f Help/Kactus2Help.qch ] || [ ! -f Help/Kactus2Help.qhc ]; then
+-   qhelpgenerator Help/kactus2help.qhp -o Help/Kactus2Help.qch
++    if command -v ${QTBIN_PATH}qhelpgenerator >/dev/null 2>&1; then
++        "${QTBIN_PATH}qhelpgenerator" Help/kactus2help.qhp -o 
Help/Kactus2Help.qch
++    elif command -v ${QTLIBEXEC_PATH}qhelpgenerator >/dev/null 2>&1; then
++        # QT6 put qhelpgenerator at QTLIBEXEC_PATH
++        "${QTLIBEXEC_PATH}qhelpgenerator" Help/kactus2help.qhp -o 
Help/Kactus2Help.qch
++    else
++        echo "Qhelpgenerator not found. Please set variable QTBIN_PATH to Qt 
binary files."
++    fi
+ fi
+ 
+ rm -R -f executable/Help

diff --git a/sci-electronics/kactus2/kactus2-3.12.0.ebuild 
b/sci-electronics/kactus2/kactus2-3.12.0.ebuild
new file mode 100644
index 0000000000..37a6d83439
--- /dev/null
+++ b/sci-electronics/kactus2/kactus2-3.12.0.ebuild
@@ -0,0 +1,94 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="8"
+
+PYTHON_COMPAT=( python3_{10..12} )
+inherit python-r1 qmake-utils xdg
+
+DESCRIPTION="A open source IP-XACT-based tool"
+HOMEPAGE="
+       https://research.tuni.fi/system-on-chip/tools/
+       https://github.com/kactus2/kactus2dev
+"
+
+if [[ "${PV}" == "9999" ]] ; then
+       inherit git-r3
+       EGIT_REPO_URI="https://github.com/${PN}/${PN}dev.git";
+else
+       SRC_URI="https://github.com/${PN}/${PN}dev/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
+       KEYWORDS="~amd64"
+       S="${WORKDIR}/${PN}dev-${PV}"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="
+       ${PYTHON_DEPS}
+       dev-qt/qtbase:6=[cups,gui,network,opengl,widgets,xml]
+       dev-qt/qtsvg:6
+"
+
+DEPEND="
+       ${RDEPEND}
+"
+
+BDEPEND="
+       dev-lang/swig
+       dev-qt/qttools:6[linguist,qdoc]
+"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-3.12.0-fix-createhelp.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 bug 854081
+       python_setup
+       sed -i -e "s|PYTHON_CONFIG=.*|PYTHON_CONFIG=${EPYTHON}-config|" 
.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 -i -e "s|PYTHON_CONFIG=.*|PYTHON_CONFIG=${EPYTHON}-config|" 
.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
+               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() {
+               pushd "PythonAPI" || die
+               python_domodule _pythonAPI.so
+               python_domodule pythonAPI.py
+               popd
+       }
+       python_foreach_impl run_in_build_dir python_install
+}

Reply via email to