Skip to content

Commit c276e4b

Browse files
gui-apps/organicmaps: fix compilation
Signed-off-by: Vitaly Zdanevich <zdanevich.vitaly@ya.ru>
1 parent 6ba10ec commit c276e4b

6 files changed

Lines changed: 154 additions & 93 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
commit 905b161487865a200ce4a43fb2c1d96ecb38e102
2+
Author: Gerion Entrup <gerion.entrup@flump.de>
3+
Date: Thu Apr 25 10:14:41 2024 +0200
4+
5+
CMakeLists: import jansson with pkgconfig
6+
7+
Upstream jansson offers compiling with autotools and CMake.
8+
If it is compiled with autotools (the recommended way) it does only
9+
provide a pkgconfig file and not a cmake file.
10+
This is also the way most distributions provide jansson, so this commit
11+
changes the behavior to use pkgconfig, too.
12+
13+
Signed-off-by: Gerion Entrup <gerion.entrup@flump.de>
14+
15+
diff --git a/CMakeLists.txt b/CMakeLists.txt
16+
index 1902f0e618..975a402f8a 100644
17+
--- a/CMakeLists.txt
18+
+++ b/CMakeLists.txt
19+
@@ -320,8 +320,11 @@ if (WITH_SYSTEM_PROVIDED_3PARTY)
20+
set(GFLAGS_USE_TARGET_NAMESPACE ON)
21+
find_package(gflags REQUIRED)
22+
23+
+ find_package(PkgConfig)
24+
+ pkg_check_modules(jansson REQUIRED IMPORTED_TARGET jansson)
25+
+ add_library(jansson::jansson ALIAS PkgConfig::jansson)
26+
+
27+
find_package(expat CONFIG REQUIRED)
28+
- find_package(jansson CONFIG REQUIRED)
29+
find_package(pugixml REQUIRED)
30+
find_package(utf8cpp REQUIRED)
31+
endif()

gui-apps/organicmaps/files/more-3party.patch

Lines changed: 0 additions & 46 deletions
This file was deleted.

gui-apps/organicmaps/files/no-dynamic-download.patch

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
diff --git i/3party/CMakeLists.txt w/3party/CMakeLists.txt
2+
index dd851d7db2..1b4e3ed3c8 100644
3+
--- i/3party/CMakeLists.txt
4+
+++ w/3party/CMakeLists.txt
5+
@@ -34,34 +34,34 @@ if (NOT WITH_SYSTEM_PROVIDED_3PARTY)
6+
7+
# Add gflags library.
8+
set(GFLAGS_BUILD_TESTING OFF)
9+
set(GFLAGS_BUILD_PACKAGING OFF)
10+
add_subdirectory(gflags)
11+
target_compile_options(gflags_nothreads_static PRIVATE $<$<CXX_COMPILER_ID:GNU>:-Wno-subobject-linkage>)
12+
13+
# Add pugixml library.
14+
add_subdirectory(pugixml)
15+
16+
- # Add protobuf library.
17+
- add_subdirectory(protobuf)
18+
-
19+
if (NOT PLATFORM_LINUX)
20+
add_subdirectory(freetype)
21+
add_subdirectory(icu)
22+
add_subdirectory(harfbuzz)
23+
endif()
24+
25+
add_library(utf8cpp INTERFACE)
26+
add_library(utf8cpp::utf8cpp ALIAS utf8cpp)
27+
target_include_directories(utf8cpp INTERFACE "${OMIM_ROOT}/3party/utfcpp/source")
28+
endif()
29+
30+
+# Add protobuf library.
31+
+add_subdirectory(protobuf)
32+
+
33+
add_subdirectory(agg)
34+
add_subdirectory(bsdiff-courgette)
35+
add_subdirectory(glaze)
36+
add_subdirectory(minizip)
37+
add_subdirectory(open-location-code)
38+
add_subdirectory(opening_hours)
39+
add_subdirectory(stb_image)
40+
add_subdirectory(succinct)
41+
42+
add_subdirectory(vulkan_wrapper)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
--- a/CMakeLists.txt
2+
+++ b/CMakeLists.txt
3+
@@ -114,12 +114,12 @@
4+
find_program(LLD_FOUND ld.lld)
5+
if (LLD_FOUND)
6+
message(STATUS "Using ld.lld linker")
7+
- set(CMAKE_EXE_LINKER_FLAGS "-fuse-ld=lld")
8+
+ string(APPEND CMAKE_EXE_LINKER_FLAGS " -fuse-ld=lld")
9+
else()
10+
find_program(GOLD_FOUND ld.gold)
11+
if (GOLD_FOUND)
12+
message(STATUS "Using ld.gold")
13+
- set(CMAKE_EXE_LINKER_FLAGS "-fuse-ld=gold")
14+
+ string(APPEND CMAKE_EXE_LINKER_FLAGS " -fuse-ld=gold")
15+
endif()
16+
endif()
17+
endif()

gui-apps/organicmaps/organicmaps-9999.ebuild

Lines changed: 64 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,110 @@
1-
# Copyright 1999-2023 Gentoo Authors
1+
# Copyright 1999-2025 Gentoo Authors
22
# Distributed under the terms of the GNU General Public License v2
33

44
EAPI=8
55

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
88
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+
1110
EGIT_WORLD_FEED_REPO_URI="https://github.com/${PN}/world_feed_integration_tests_data.git"
11+
1212
# organicmaps gets more and more system libraries, we use as many
1313
# as currently possible, use submodules for the rest
1414
EGIT_SUBMODULES=(
15+
3party/fast_obj
16+
3party/glaze
17+
3party/glfw
1518
3party/harfbuzz/harfbuzz
16-
3party/fast_double_parser
19+
3party/imgui/imgui
1720
3party/just_gtfs
1821
3party/protobuf/protobuf # wait for https://github.com/organicmaps/organicmaps/pull/6310
19-
3party/fast_obj
2022
)
2123

2224
DESCRIPTION="Offline maps and navigation using OpenStreetMap data"
2325
HOMEPAGE="https://organicmaps.app"
2426

2527
LICENSE="Apache-2.0"
28+
2629
SLOT="0"
2730

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+
"
2940

3041
# depend on sys-libs/zlib[minizip] when it is not pulled in as subproject anymore
3142
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
3849
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:=
4555
"
46-
DEPEND="${RDEPEND}"
4756

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 )
4960

5061
WORLD_FEED_TESTS_S="${WORKDIR}/world_feed_integration_tests_data-${PV}"
5162

5263
src_unpack () {
5364
git-r3_fetch
5465
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
5771
}
5872

5973
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"
6674
local mycmakeargs=(
6775
-DWITH_SYSTEM_PROVIDED_3PARTY=yes
6876
-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)"
7079
)
7180
cmake_src_configure
7281
}
7382

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+
74106
pkg_postinst() {
75-
xdg_icon_cache_update
107+
xdg_pkg_postinst
76108

77109
einfo "For dark mode type in search ?dark"
78110
einfo "For light mode type in search ?light"

0 commit comments

Comments
 (0)