commit:     b536077513190ad751d6638b74f672d006f74a42
Author:     Andrei Sabalenka <mechakotik <AT> gmail <DOT> com>
AuthorDate: Sun Jan 12 09:44:02 2025 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Tue Feb 25 17:45:37 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b5360775

dev-games/tiled: add 1.11.2, fix compiling with Qt 6.8.2

Closes: https://bugs.gentoo.org/949525
Signed-off-by: Andrei Sabalenka <mechakotik <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/40103
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 dev-games/tiled/Manifest                       |  1 +
 dev-games/tiled/files/tiled-1.11-qt6.8.2.patch | 20 ++++++
 dev-games/tiled/metadata.xml                   |  3 +-
 dev-games/tiled/tiled-1.11.2.ebuild            | 93 ++++++++++++++++++++++++++
 4 files changed, 115 insertions(+), 2 deletions(-)

diff --git a/dev-games/tiled/Manifest b/dev-games/tiled/Manifest
index ba18d96e0838..e32e690231d9 100644
--- a/dev-games/tiled/Manifest
+++ b/dev-games/tiled/Manifest
@@ -1 +1,2 @@
 DIST tiled-1.11.0.tar.gz 17458724 BLAKE2B 
3e7ea2ce4a61aa31d60487bf4cd68efb9307be0a753ee1571b9d2a90dff5299fdbbfd432c38eddafbea98cd6a1c59aa338c9ab5337e923e3178456a720e24ed4
 SHA512 
59e7ff38bedb0b897b40b2d3f6231004970de843e3700ef8adfaf78ab9b15c57e291ec27d409ba61094871b84f27238defb33bef5b23e838736f515ec1addf5d
+DIST tiled-1.11.2.tar.gz 17570418 BLAKE2B 
d2abf3e43c107228cccd1b754326487a78a804381c428760a5dd4af92366aee899f8b35623292fb8b541ac7e6ca61a79303be6dde4b772957c0b46a6f942f488
 SHA512 
c8fc3d853b91e1e74bdeb1873912e5dfe6efea49d937803502bac42865b6406adf6845f7f393098dccdf59adba522a5672e48e4a673e22e2fc320fe8c4b43405

diff --git a/dev-games/tiled/files/tiled-1.11-qt6.8.2.patch 
b/dev-games/tiled/files/tiled-1.11-qt6.8.2.patch
new file mode 100644
index 000000000000..29e1eca70753
--- /dev/null
+++ b/dev-games/tiled/files/tiled-1.11-qt6.8.2.patch
@@ -0,0 +1,20 @@
+commit 60388da00ef8e64608c581369b5c68e85162e31d
+Author: Thorbjørn Lindeijer <bj...@lindeijer.nl>
+Date:   Fri Feb 14 20:49:16 2025 +0100
+
+    Fixed compile against Qt 6.8.2
+    
+    A rather smaller change than 776d3b67b011f970a65e8a743795401851684cc9
+    for the 1.11 branch, which keeps compatibility down to Qt 5.12.
+
+diff --git a/src/libtiled/qtcompat_p.h b/src/libtiled/qtcompat_p.h
+index 3b46dc1b..60c089ed 100644
+--- a/src/libtiled/qtcompat_p.h
++++ b/src/libtiled/qtcompat_p.h
+@@ -28,5 +28,5 @@ using ::endl;
+ #endif
+ 
+ #if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
+-using QStringRef = QStringView;
++#define QStringRef QStringView
+ #endif

diff --git a/dev-games/tiled/metadata.xml b/dev-games/tiled/metadata.xml
index d6abd76eacce..7cb2367870ac 100644
--- a/dev-games/tiled/metadata.xml
+++ b/dev-games/tiled/metadata.xml
@@ -13,7 +13,6 @@
                <remote-id type="github">mapeditor/tiled</remote-id>
        </upstream>
        <use>
-               <flag name="minimal">Exclude optional plugins and development 
headers</flag>
+               <flag name="minimal">Exclude optional plugins, development 
headers and examples</flag>
        </use>
 </pkgmetadata>
-

diff --git a/dev-games/tiled/tiled-1.11.2.ebuild 
b/dev-games/tiled/tiled-1.11.2.ebuild
new file mode 100644
index 000000000000..9723a7280592
--- /dev/null
+++ b/dev-games/tiled/tiled-1.11.2.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{{11..13},13t} )
+inherit edo flag-o-matic multiprocessing python-single-r1 toolchain-funcs xdg
+
+DESCRIPTION="A general purpose tile map editor"
+HOMEPAGE="https://www.mapeditor.org/ https://github.com/mapeditor/tiled";
+SRC_URI="https://github.com/mapeditor/tiled/archive/v${PV}/${P}.tar.gz";
+
+LICENSE="BSD BSD-2 GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="minimal python"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+RDEPEND="
+       app-arch/zstd:=
+       dev-qt/qtbase:6[X,dbus,gui,network,opengl,widgets]
+       dev-qt/qtdeclarative:6
+       dev-qt/qtsvg:6
+       sys-libs/zlib
+       python? ( ${PYTHON_DEPS} )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+       dev-util/qbs
+       dev-qt/qtbase:6
+       dev-qt/qttools:6[linguist]
+"
+
+QBS_PRODUCTS="tiled,csv,json"
+
+PATCHES=(
+       "${FILESDIR}/tiled-1.11-qt6.8.2.patch"
+)
+
+pkg_setup() {
+       if use python; then
+               python-single-r1_pkg_setup
+       fi
+}
+
+qbs_format_flags() {
+       local -a array
+       for flag in ${@}; do
+               array+=( "\"${flag}\"" )
+       done
+       echo "[$(IFS=","; echo "${array[*]}")]"
+}
+
+src_configure() {
+       if use python; then
+               QBS_PRODUCTS="${QBS_PRODUCTS},python"
+       fi
+       if ! use minimal; then
+               
QBS_PRODUCTS="${QBS_PRODUCTS},defold,defoldcollection,droidcraft,flare,gmx,json1,lua,replicaisland,rpmap,tbin,tengine,terraingenerator,tmxrasterizer,tmxviewer,tscn,yy"
+       fi
+
+       edo qbs setup-qt /usr/bin/qmake6 qt6
+       edo qbs config defaultProfile qt6
+
+       local toolchain=$(tc-get-compiler-type)
+       edo qbs setup-toolchains ${toolchain} ${toolchain}
+       edo qbs config profiles.qt6.baseProfile ${toolchain}
+
+       edo qbs resolve \
+               --force-probe-execution \
+               qbs.installPrefix:"/usr" \
+               projects.Tiled.useRPaths:false \
+               projects.Tiled.installHeaders:$(usex minimal false true) \
+               project.libDir:$(get_libdir) \
+               modules.cpp.cFlags:$(qbs_format_flags ${CFLAGS}) \
+               modules.cpp.cxxFlags:$(qbs_format_flags ${CXXFLAGS}) \
+               modules.cpp.linkerFlags:$(qbs_format_flags $(raw-ldflags 
${LDFLAGS}))
+}
+
+src_compile() {
+       edo qbs build \
+               -p ${QBS_PRODUCTS} \
+               -j $(get_makeopts_jobs)
+}
+
+src_install() {
+       edo qbs install -p ${QBS_PRODUCTS} --install-root "${D}"
+
+       if ! use minimal; then
+               docompress -x /usr/share/doc/${PF}/examples
+               dodoc -r examples
+       fi
+}

Reply via email to