1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{11..13} )
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}"/${P}-qt680.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}"
docompress -x /usr/share/doc/${PF}/examples
dodoc -r examples
}
|