|
1 | | -# Copyright 1999-2023 Gentoo Authors |
| 1 | +# Copyright 1999-2025 Gentoo Authors |
2 | 2 | # Distributed under the terms of the GNU General Public License v2 |
3 | 3 |
|
4 | 4 | EAPI=8 |
5 | 5 |
|
6 | | -PYTHON_COMPAT=( python3_{11..12} ) |
7 | | -inherit git-r3 python-r1 xdg cmake |
| 6 | +PYTHON_COMPAT=( python3_{11..14} ) |
| 7 | +inherit git-r3 python-any-r1 xdg cmake desktop |
8 | 8 | EGIT_REPO_URI="https://github.com/${PN}/${PN}.git" |
9 | | -# this URL is to make the tests compile since organicmaps usually dynamically clones the repo |
10 | | -# maybe a better way would be to skip the test |
| 9 | + |
11 | 10 | EGIT_WORLD_FEED_REPO_URI="https://github.com/${PN}/world_feed_integration_tests_data.git" |
| 11 | + |
12 | 12 | # organicmaps gets more and more system libraries, we use as many |
13 | 13 | # as currently possible, use submodules for the rest |
14 | 14 | EGIT_SUBMODULES=( |
| 15 | + 3party/fast_obj |
| 16 | + 3party/glaze |
| 17 | + 3party/glfw |
15 | 18 | 3party/harfbuzz/harfbuzz |
16 | | - 3party/fast_double_parser |
| 19 | + 3party/imgui/imgui |
17 | 20 | 3party/just_gtfs |
18 | 21 | 3party/protobuf/protobuf # wait for https://github.com/organicmaps/organicmaps/pull/6310 |
19 | | - 3party/fast_obj |
20 | 22 | ) |
21 | 23 |
|
22 | 24 | DESCRIPTION="Offline maps and navigation using OpenStreetMap data" |
23 | 25 | HOMEPAGE="https://organicmaps.app" |
24 | 26 |
|
25 | 27 | LICENSE="Apache-2.0" |
| 28 | + |
26 | 29 | SLOT="0" |
27 | 30 |
|
28 | | -REQUIRED_USE="${PYTHON_REQUIRED_USE}" |
| 31 | +IUSE="test" |
| 32 | +RESTRICT="!test? ( test )" |
| 33 | + |
| 34 | +BDEPEND=" |
| 35 | + dev-util/vulkan-headers |
| 36 | + dev-cpp/fast_double_parser |
| 37 | + ${PYTHON_DEPS} |
| 38 | + test? ( dev-cpp/gtest ) |
| 39 | +" |
29 | 40 |
|
30 | 41 | # depend on sys-libs/zlib[minizip] when it is not pulled in as subproject anymore |
31 | 42 | RDEPEND=" |
32 | | - dev-cpp/gflags |
33 | | - dev-db/sqlite |
34 | | - dev-lang/python |
35 | | - dev-libs/boost |
36 | | - dev-libs/icu |
37 | | - dev-libs/jansson |
| 43 | + dev-cpp/gflags:= |
| 44 | + dev-db/sqlite:= |
| 45 | + dev-libs/boost:= |
| 46 | + dev-libs/icu:= |
| 47 | + dev-libs/jansson:= |
| 48 | + dev-libs/pugixml |
38 | 49 | dev-libs/utfcpp |
39 | | - dev-qt/qtpositioning:6 |
40 | | - dev-qt/qtsvg:6 |
41 | | - dev-util/vulkan-headers |
42 | | - media-libs/freetype |
43 | | - sys-libs/zlib |
44 | | - ${PYTHON_DEPS} |
| 50 | + dev-qt/qtbase:=[gui,network,opengl,widgets] |
| 51 | + dev-qt/qtpositioning:= |
| 52 | + dev-qt/qtsvg:= |
| 53 | + media-libs/freetype:= |
| 54 | + sys-libs/zlib:= |
45 | 55 | " |
46 | | -DEPEND="${RDEPEND}" |
47 | 56 |
|
48 | | -PATCHES=( "${FILESDIR}"/more-3party.patch "${FILESDIR}"/no-dynamic-download.patch ) |
| 57 | +DEPEND="media-libs/glm" |
| 58 | + |
| 59 | +PATCHES=( "${FILESDIR}"/fix-jansson.patch "${FILESDIR}"/protobuf.patch "${FILESDIR}"/respect-ldflags.patch ) |
49 | 60 |
|
50 | 61 | WORLD_FEED_TESTS_S="${WORKDIR}/world_feed_integration_tests_data-${PV}" |
51 | 62 |
|
52 | 63 | src_unpack () { |
53 | 64 | git-r3_fetch |
54 | 65 | git-r3_checkout |
55 | | - git-r3_fetch "${EGIT_WORLD_FEED_REPO_URI}" |
56 | | - git-r3_checkout "${EGIT_WORLD_FEED_REPO_URI}" "${WORLD_FEED_TESTS_S}" |
| 66 | + |
| 67 | + if use test; then |
| 68 | + git-r3_fetch "${EGIT_WORLD_FEED_REPO_URI}" |
| 69 | + git-r3_checkout "${EGIT_WORLD_FEED_REPO_URI}" "${WORLD_FEED_TESTS_S}" |
| 70 | + fi |
57 | 71 | } |
58 | 72 |
|
59 | 73 | src_configure() { |
60 | | - # organicmaps wants a ./configure.sh execution. |
61 | | - # However, this setups mainly stuff for Android and XCode builds that we don't need. |
62 | | - # We need just this line here |
63 | | - cp private_default.h private.h || die |
64 | | - |
65 | | - CMAKE_BUILD_TYPE="RelWithDebInfo" |
66 | 74 | local mycmakeargs=( |
67 | 75 | -DWITH_SYSTEM_PROVIDED_3PARTY=yes |
68 | 76 | -DBUILD_SHARED_LIBS=off |
69 | | - -DTEST_DATA_REPO_URL="${WORLD_FEED_TESTS_S}" |
| 77 | + -DTEST_DATA_REPO_URL="$(usex test "${WORLD_FEED_TESTS_S}" "")" |
| 78 | + -DSKIP_TESTS="$(usex !test)" |
70 | 79 | ) |
71 | 80 | cmake_src_configure |
72 | 81 | } |
73 | 82 |
|
| 83 | +src_compile() { |
| 84 | + cmake_src_compile desktop |
| 85 | + use test && cmake_src_compile |
| 86 | +} |
| 87 | + |
| 88 | +src_test() { |
| 89 | + cmake_src_test |
| 90 | +} |
| 91 | + |
| 92 | +src_install() { |
| 93 | + dobin "${BUILD_DIR}"/OMaps |
| 94 | + |
| 95 | + insinto /usr/share/organicmaps |
| 96 | + doins -r data |
| 97 | + |
| 98 | + insinto /usr/share/metainfo |
| 99 | + doins packaging/app.organicmaps.desktop.metainfo.xml |
| 100 | + domenu qt/res/linux/app.organicmaps.desktop.desktop |
| 101 | + newicon -s 512 qt/res/logo.png organicmaps.png |
| 102 | + |
| 103 | + rm -rf "${ED}"/usr/share/${PN}/data/world_feed_integration_tests_data || die |
| 104 | +} |
| 105 | + |
74 | 106 | pkg_postinst() { |
75 | | - xdg_icon_cache_update |
| 107 | + xdg_pkg_postinst |
76 | 108 |
|
77 | 109 | einfo "For dark mode type in search ?dark" |
78 | 110 | einfo "For light mode type in search ?light" |
|
0 commit comments