commit:     4b08a0d1079f28b3181a6a4de6a5a18410fd4489
Author:     Nicolas PARLANT <nicolas.parlant <AT> parhuet <DOT> fr>
AuthorDate: Fri Mar 28 09:07:15 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Mar 28 17:23:58 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4b08a0d1

x11-libs/libQGLViewer: add 2.9.1, qt6

bump EAPI8

project uses now cmake for main lib
qmake is still used for designerplugin and examples binaries

switch to qt6 only

no subslot as upstream uses only soname qt5/qt6
version restriction may be sufficient here

move examples binaries in /usr/share instead of a /usr/bin subdirectory

Closes: https://bugs.gentoo.org/949089
Signed-off-by: Nicolas PARLANT <nicolas.parlant <AT> parhuet.fr>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 x11-libs/libQGLViewer/Manifest                     |  1 +
 .../libQGLViewer-2.9.1-fix_designer_plugin.patch   | 14 ++++
 .../files/libQGLViewer-2.9.1-rm_rpath.patch        | 18 +++++
 x11-libs/libQGLViewer/libQGLViewer-2.9.1.ebuild    | 85 ++++++++++++++++++++++
 4 files changed, 118 insertions(+)

diff --git a/x11-libs/libQGLViewer/Manifest b/x11-libs/libQGLViewer/Manifest
index 13145d9bff75..a66a55e8fee8 100644
--- a/x11-libs/libQGLViewer/Manifest
+++ b/x11-libs/libQGLViewer/Manifest
@@ -1 +1,2 @@
 DIST libQGLViewer-2.7.2.tar.gz 3135146 BLAKE2B 
a46df06a135821fcb7895d4d037ee422cd9041695c57601cb7dccad3e1c4905ccbcacad91e47a79aa4adc85550db572adbb2311b1254d8779aba12d8fb36b255
 SHA512 
888695e413aa42b62d029efd1313f8aa101b4529f51edcea6416b58f6281715f8cdf27289d8f60cf1b0cdceba204e43e8477d30166350f8d3e090e6a93d8d595
+DIST libQGLViewer-2.9.1.tar.gz 2499763 BLAKE2B 
19717964c0edf9f816e550b4dd6daf5040cca72a20525db78dd3e3c1a84fe8730a3f74f4b3065be0d4d905c10577f2948e993696427cdcc2f4add9f497eb0d86
 SHA512 
09bfc5c0f07e51625a9af0094b83f40f84ead55a67c6e492c9702521f58c6b461bc840382fb73b64d16ad71a0a2a75d04aa12a77a78ced0a19e0e784e8d36bd7

diff --git 
a/x11-libs/libQGLViewer/files/libQGLViewer-2.9.1-fix_designer_plugin.patch 
b/x11-libs/libQGLViewer/files/libQGLViewer-2.9.1-fix_designer_plugin.patch
new file mode 100644
index 000000000000..534a08f2977f
--- /dev/null
+++ b/x11-libs/libQGLViewer/files/libQGLViewer-2.9.1-fix_designer_plugin.patch
@@ -0,0 +1,14 @@
+Set compat Qt6
+diff --git a/designerPlugin/designerPlugin.pro 
b/designerPlugin/designerPlugin.pro
+index 0bc3714..e8e2fec 100644
+--- a/designerPlugin/designerPlugin.pro
++++ b/designerPlugin/designerPlugin.pro
+@@ -26,7 +26,7 @@ INSTALLS += target
+ HEADERS = qglviewerPlugin.h
+ SOURCES = qglviewerPlugin.cpp
+ 
+-equals (QT_MAJOR_VERSION, 5) {
++greaterThan (QT_MAJOR_VERSION, 5) {
+   QT *= designer
+   CONFIG *= release
+   OTHER_FILES += designerplugindescription.json

diff --git a/x11-libs/libQGLViewer/files/libQGLViewer-2.9.1-rm_rpath.patch 
b/x11-libs/libQGLViewer/files/libQGLViewer-2.9.1-rm_rpath.patch
new file mode 100644
index 000000000000..ac99d89ed551
--- /dev/null
+++ b/x11-libs/libQGLViewer/files/libQGLViewer-2.9.1-rm_rpath.patch
@@ -0,0 +1,18 @@
+rm rpath
+diff --git a/examples/examples.pri b/examples/examples.pri
+index 5b0a6d0..6dfefb7 100644
+--- a/examples/examples.pri
++++ b/examples/examples.pri
+@@ -66,12 +66,6 @@ unix {
+                     LIB_NAME = QGLViewer-qt6
+                 }
+             }
+-
+-                      isEmpty(QMAKE_LFLAGS_RPATH) {
+-                              !plugin:QMAKE_LFLAGS += 
-Wl,-rpath,$${LIB_DIR_ABSOLUTE_PATH}
+-                      } else {
+-                              !plugin:QMAKE_RPATHDIR *= 
$${LIB_DIR_ABSOLUTE_PATH}
+-                      }
+                       LIBS *= -L$${LIB_DIR} -l$${LIB_NAME}
+               }
+       } else {

diff --git a/x11-libs/libQGLViewer/libQGLViewer-2.9.1.ebuild 
b/x11-libs/libQGLViewer/libQGLViewer-2.9.1.ebuild
new file mode 100644
index 000000000000..0c3c69d45c9a
--- /dev/null
+++ b/x11-libs/libQGLViewer/libQGLViewer-2.9.1.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake qmake-utils
+
+DESCRIPTION="C++ library based on Qt that eases the creation of OpenGL 3D 
viewers"
+HOMEPAGE="https://github.com/GillesDebunne/libQGLViewer";
+SRC_URI="https://github.com/GillesDebunne/libQGLViewer/archive/refs/tags/v${PV}.tar.gz
 -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm"
+IUSE="designer examples"
+
+RDEPEND="
+       dev-qt/qtbase:6[gui,opengl,widgets,xml]
+       virtual/glu
+       virtual/opengl
+"
+DEPEND="${RDEPEND}
+       designer? ( dev-qt/qttools[designer] )
+"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-2.9.1-fix_designer_plugin.patch
+       "${FILESDIR}"/${PN}-2.9.1-rm_rpath.patch
+)
+
+src_prepare() {
+       cmake_src_prepare
+
+       # copy srcdir to use as docdir after
+       if use examples; then
+               cp -R "${S}"/examples "${S}"/examples-src || die
+       fi
+}
+
+src_configure() {
+       cmake_src_configure
+
+       if use designer; then
+               pushd designerPlugin || die
+                       eqmake6 designerPlugin.pro \
+                               LIB_NAME="QGLViewer" \
+                               LIBS="-L${BUILD_DIR}" \
+                               NO_QT_VERSION_SUFFIX="yes"
+               popd || die
+       fi
+
+       if use examples; then
+               pushd examples || die
+                       eqmake6 examples.pro \
+                               LIB_NAME="QGLViewer" \
+                               LIBS="-L${BUILD_DIR}" \
+                               NO_QT_VERSION_SUFFIX="yes"
+               popd || die
+       fi
+}
+
+src_compile() {
+       cmake_src_compile
+
+       use designer && emake -C designerPlugin
+
+       use examples && emake -C examples
+}
+
+src_install() {
+       local HTML_DOCS=( doc )
+
+       use designer && emake -C designerPlugin INSTALL_ROOT="${D}" install
+
+       if use examples; then
+               exeinto /usr/share/${PN}/examples/bin
+               doexe $(find "${S}"/examples -type f -executable ! -name 
'*.vcproj' ! -name 'make*')
+
+               docinto examples
+               dodoc -r "${S}"/examples-src/.
+               docompress -x /usr/share/doc/${PF}/examples
+       fi
+
+       cmake_src_install
+}

Reply via email to