summaryrefslogtreecommitdiff
path: root/sci-geosciences/merkaartor/merkaartor-0.20.0.ebuild
blob: cf76c71750f4b83b55ff1d430ba998e9bdb7ca32 (plain)
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
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit cmake xdg

if [[ ${PV} != *9999* ]] ; then
	SRC_URI="https://github.com/openstreetmap/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
	KEYWORDS="~amd64 ~x86"
else
	EGIT_REPO_URI="https://github.com/openstreetmap/merkaartor.git"
	inherit git-r3
fi

DESCRIPTION="Qt based map editor for the openstreetmap.org project"
HOMEPAGE="https://www.merkaartor.be https://github.com/openstreetmap/merkaartor"

LICENSE="GPL-2"
SLOT="0"
IUSE="exif gps libproxy webengine zbar"

# bundles qtsingleapplication again, unfortunately
DEPEND="
	dev-libs/protobuf:=
	dev-qt/qt5compat:6
	dev-qt/qtbase:6[concurrent,gui,network,widgets,xml]
	dev-qt/qtnetworkauth:6
	dev-qt/qtsvg:6
	sci-libs/gdal:=
	sci-libs/proj:=
	virtual/zlib:=
	exif? ( media-gfx/exiv2:= )
	gps? ( >=sci-geosciences/gpsd-3.17-r2:= )
	libproxy? ( >=net-libs/libproxy-0.5 )
	webengine? ( dev-qt/qtwebengine:6[widgets] )
	zbar? ( media-gfx/zbar )
"
RDEPEND="${DEPEND}"
BDEPEND="
	dev-qt/qttools:6[linguist]
	virtual/pkgconfig
"

DOCS=( AUTHORS CHANGELOG )

PATCHES=(
	"${FILESDIR}"/${PN}-0.20.0-disable-git.patch # downstream patch
	# pending upstream PR: https://github.com/openstreetmap/merkaartor/pull/291
	"${FILESDIR}"/${PN}-0.20.0-GNUInstallDirs.patch
	"${FILESDIR}"/${PN}-0.20.0-gdal-3.12-fix.patch # backport from master
	"${FILESDIR}"/${PN}-0.20.0-fix-exif-disabled.patch # bug #941962
)

src_prepare() {
	# no Qt5 automagic, please
	sed -e "/^ *find_package.*QT NAMES/s/Qt5 //" -i CMakeLists.txt || die

	if has_version ">=dev-cpp/abseil-cpp-20260107.0"; then
		# needs >=c++20, bug #976275
		sed -e 's/set(CMAKE_CXX_STANDARD 17)/set(CMAKE_CXX_STANDARD 20)/' \
			-i CMakeLists.txt || die
	fi

	cmake_src_prepare
}

src_configure() {
	local mycmakeargs=(
		-DGEOIMAGE=$(usex exif)
		-DGPSD=$(usex gps)
		-DLIBPROXY=$(usex libproxy)
		-DWEBENGINE=$(usex webengine)
		-DZBAR=$(usex zbar)
		-DEXTRA_TESTS=OFF
	)

	cmake_src_configure
}

src_test() {
	local -x QT_QPA_PLATFORM=offscreen
	cmake_src_test
}