commit: 1a22ea7ceedc2d275c7053ee7242b006b89fa676 Author: Vitaly Zdanevich <zdanevich.vitaly <AT> ya <DOT> ru> AuthorDate: Mon Dec 25 06:02:13 2023 +0000 Commit: Vitaly Zdanevich <zdanevich.vitaly <AT> ya <DOT> ru> CommitDate: Mon Dec 25 06:02:13 2023 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=1a22ea7c
gui-apps/organicmaps: reduce clones The code is from https://github.com/organicmaps/organicmaps/issues/2217#issuecomment-1868159186 Signed-off-by: Vitaly Zdanevich <zdanevich.vitaly <AT> ya.ru> gui-apps/organicmaps/files/more-3party.patch | 46 ++++++++++++++++ .../organicmaps/files/no-dynamic-download.patch | 15 ++++++ gui-apps/organicmaps/organicmaps-9999.ebuild | 63 ++++++++++++++-------- 3 files changed, 101 insertions(+), 23 deletions(-) diff --git a/gui-apps/organicmaps/files/more-3party.patch b/gui-apps/organicmaps/files/more-3party.patch new file mode 100644 index 0000000000..58ccaf7f0e --- /dev/null +++ b/gui-apps/organicmaps/files/more-3party.patch @@ -0,0 +1,46 @@ +From b77c26e242945fe06be94059b87c3c2eebdb78eb Mon Sep 17 00:00:00 2001 +From: Gerion Entrup <[email protected]> +Date: Fri, 8 Dec 2023 23:45:56 +0100 +Subject: [PATCH] cmake: use some internal libraries without external + alternative + +--- + 3party/CMakeLists.txt | 6 +++--- + base/CMakeLists.txt | 4 +--- + 2 files changed, 4 insertions(+), 6 deletions(-) + +diff --git a/3party/CMakeLists.txt b/3party/CMakeLists.txt +index bd44e1b7b8..4f5cb99807 100644 +--- a/3party/CMakeLists.txt ++++ b/3party/CMakeLists.txt +@@ -34,11 +34,11 @@ else() + + # Add pugixml library. + add_subdirectory(pugixml) +- +- # Add protobuf library. +- add_subdirectory(protobuf) + endif() + ++# Add protobuf library. ++add_subdirectory(protobuf) ++ + add_subdirectory(agg) + add_subdirectory(bsdiff-courgette) + +diff --git a/base/CMakeLists.txt b/base/CMakeLists.txt +index 7e762b242a..0d7d6c5d10 100644 +--- a/base/CMakeLists.txt ++++ b/base/CMakeLists.txt +@@ -111,8 +111,6 @@ set(THREADS_PREFER_PTHREAD_FLAG ON) + find_package(Threads REQUIRED) + target_link_libraries(${PROJECT_NAME} INTERFACE Threads::Threads) + +-if (NOT WITH_SYSTEM_PROVIDED_3PARTY) +- target_include_directories(${PROJECT_NAME} PRIVATE "${OMIM_ROOT}/3party/fast_double_parser/include") +-endif() ++target_include_directories(${PROJECT_NAME} PRIVATE "${OMIM_ROOT}/3party/fast_double_parser/include") + + omim_add_test_subdirectory(base_tests) +-- +2.41.0 diff --git a/gui-apps/organicmaps/files/no-dynamic-download.patch b/gui-apps/organicmaps/files/no-dynamic-download.patch new file mode 100644 index 0000000000..eb7d021dd7 --- /dev/null +++ b/gui-apps/organicmaps/files/no-dynamic-download.patch @@ -0,0 +1,15 @@ +diff --git a/transit/world_feed/world_feed_integration_tests/CMakeLists.txt b/transit/world_feed/world_feed_integration_tests/CMakeLists.txt +index 9f945568d4..ec9755ab09 100644 +--- a/transit/world_feed/world_feed_integration_tests/CMakeLists.txt ++++ b/transit/world_feed/world_feed_integration_tests/CMakeLists.txt +@@ -10,7 +10,9 @@ target_link_libraries(${PROJECT_NAME} + ) + + # This test requires additional data from the other repository +-set(TEST_DATA_REPO_URL "https://github.com/organicmaps/world_feed_integration_tests_data.git") ++if(NOT TEST_DATA_REPO_URL) ++ set(TEST_DATA_REPO_URL "https://github.com/organicmaps/world_feed_integration_tests_data.git") ++endif() + set(DESTINATION_FOLDER "${OMIM_DATA_DIR}/world_feed_integration_tests_data/") + + add_custom_command( diff --git a/gui-apps/organicmaps/organicmaps-9999.ebuild b/gui-apps/organicmaps/organicmaps-9999.ebuild index 9245663115..c8e77c24e4 100644 --- a/gui-apps/organicmaps/organicmaps-9999.ebuild +++ b/gui-apps/organicmaps/organicmaps-9999.ebuild @@ -5,6 +5,18 @@ EAPI=8 inherit git-r3 xdg cmake EGIT_REPO_URI="https://github.com/${PN}/${PN}.git" +# this URL is to make the tests compile since organicmaps usually dynamically clones the repo +# maybe a better way would be to skip the test +EGIT_WORLD_FEED_REPO_URI="https://github.com/${PN}/world_feed_integration_tests_data.git" +# organicmaps gets more and more system libraries, we use as many +# as currently possible, use submodules for the rest +EGIT_SUBMODULES=( + 3party/harfbuzz/harfbuzz + 3party/fast_double_parser + 3party/just_gtfs + 3party/protobuf/protobuf # wait for https://github.com/organicmaps/organicmaps/pull/6310 + 3party/fast_obj +) DESCRIPTION="Offline maps and navigation using OpenStreetMap data" HOMEPAGE="https://organicmaps.app" @@ -12,38 +24,43 @@ HOMEPAGE="https://organicmaps.app" LICENSE="Apache-2.0" SLOT="0" -DEPEND="sys-devel/clang - >=dev-util/cmake-3.18.1 - dev-util/ninja - media-libs/freetype - dev-libs/icu - >=dev-qt/qtpositioning-6 - sys-libs/libstdc++-v3 - dev-qt/qtcore - dev-qt/qtsvg +# depend on sys-libs/zlib[minizip] when it is not pulled in as subproject anymore +RDEPEND=" + dev-cpp/gflags dev-db/sqlite - sys-libs/zlib[minizip]" -RDEPEND="" + dev-lang/python + dev-libs/boost + dev-libs/icu + dev-qt/qtpositioning:6 + dev-util/vulkan-headers + media-libs/freetype + sys-libs/zlib +" +DEPEND="${RDEPEND}" + +PATCHES=( "${FILESDIR}"/more-3party.patch "${FILESDIR}"/no-dynamic-download.patch ) -src_prepare() { - eapply_user +WORLD_FEED_TESTS_S="${WORKDIR}/world_feed_integration_tests_data-${PV}" - cmake_src_prepare +src_unpack () { + git-r3_fetch + git-r3_checkout + git-r3_fetch "${EGIT_WORLD_FEED_REPO_URI}" + git-r3_checkout "${EGIT_WORLD_FEED_REPO_URI}" "${WORLD_FEED_TESTS_S}" } src_configure() { - CMAKE_BUILD_TYPE="RelWithDebInfo" + # organicmaps wants a ./configure.sh execution. + # However, this setups mainly stuff for Android and XCode builds that we don't need. + # We need just this line here + cp private_default.h private.h || die + CMAKE_BUILD_TYPE="RelWithDebInfo" local mycmakeargs=( - -DBUILD_SHARED_LIBS=False - -DINSTALL_GTEST=off - -DUNITY_DISABLE=on - -DPLATFORM_DESKTOP=true - -DSKIP_TESTS=on + -DWITH_SYSTEM_PROVIDED_3PARTY=yes + -DBUILD_SHARED_LIBS=off + -DTEST_DATA_REPO_URL="${WORLD_FEED_TESTS_S}" ) - - echo | ./configure.sh - cmake_src_configure }
