comaps: init at 2025.08.13-8 (#419820)
This commit is contained in:
@@ -0,0 +1,106 @@
|
||||
{
|
||||
lib,
|
||||
organicmaps,
|
||||
fetchurl,
|
||||
fetchFromGitea,
|
||||
boost,
|
||||
gtest,
|
||||
glm,
|
||||
gflags,
|
||||
imgui,
|
||||
jansson,
|
||||
python3,
|
||||
optipng,
|
||||
utf8cpp,
|
||||
nix-update-script,
|
||||
}:
|
||||
let
|
||||
mapRev = 250804;
|
||||
|
||||
worldMap = fetchurl {
|
||||
url = "https://cdn-fi-1.comaps.app/maps/${toString mapRev}/World.mwm";
|
||||
hash = "sha256-xYMH3y0Y6sSXYUTpy+A5YCyb+n5YChOXhyDvUFqXxZ0=";
|
||||
};
|
||||
|
||||
worldCoasts = fetchurl {
|
||||
url = "https://cdn-fi-1.comaps.app/maps/${toString mapRev}/WorldCoasts.mwm";
|
||||
hash = "sha256-2vc4kkNX9bRTqXYlALfwVwOlvr122kvUk7pUyM91vjc=";
|
||||
};
|
||||
in
|
||||
organicmaps.overrideAttrs (oldAttrs: rec {
|
||||
pname = "comaps";
|
||||
version = "2025.08.13-8";
|
||||
|
||||
src = fetchFromGitea {
|
||||
domain = "codeberg.org";
|
||||
owner = "comaps";
|
||||
repo = "comaps";
|
||||
tag = "v${version}";
|
||||
hash = "sha256-kvE3H+siV/8v4WgsG1Ifd4gMMwGLqz28oXf1hB9gQ2Q=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
patches = [
|
||||
./remove-lto.patch
|
||||
./use-vendored-protobuf.patch
|
||||
];
|
||||
|
||||
postPatch = (oldAttrs.postPatch or "") + ''
|
||||
rm -f 3party/boost/b2
|
||||
'';
|
||||
|
||||
nativeBuildInputs = (builtins.filter (x: x != python3) oldAttrs.nativeBuildInputs or [ ]) ++ [
|
||||
(python3.withPackages (
|
||||
ps: with ps; [
|
||||
protobuf
|
||||
]
|
||||
))
|
||||
optipng
|
||||
];
|
||||
|
||||
buildInputs = (oldAttrs.buildInputs or [ ]) ++ [
|
||||
boost
|
||||
gtest
|
||||
gflags
|
||||
glm
|
||||
imgui
|
||||
jansson
|
||||
utf8cpp
|
||||
];
|
||||
|
||||
preConfigure = ''
|
||||
bash ./configure.sh --skip-map-download
|
||||
'';
|
||||
|
||||
cmakeFlags = [
|
||||
(lib.cmakeBool "WITH_SYSTEM_PROVIDED_3PARTY" true)
|
||||
];
|
||||
|
||||
env = {
|
||||
NIX_CFLAGS_COMPILE = toString [
|
||||
"-I/build/source/3party/fast_double_parser/include"
|
||||
];
|
||||
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION = "python";
|
||||
};
|
||||
|
||||
postInstall = ''
|
||||
install -Dm644 ${worldMap} $out/share/comaps/data/World.mwm
|
||||
install -Dm644 ${worldCoasts} $out/share/comaps/data/WorldCoasts.mwm
|
||||
ln -s $out/bin/CoMaps $out/bin/comaps
|
||||
'';
|
||||
|
||||
passthru.updateScript = nix-update-script {
|
||||
extraArgs = [
|
||||
"-vr"
|
||||
"v(.*)"
|
||||
];
|
||||
};
|
||||
|
||||
meta = oldAttrs.meta // {
|
||||
description = "Community-led fork of Organic Maps";
|
||||
homepage = "https://comaps.app";
|
||||
changelog = "https://codeberg.org/comaps/comaps/releases/tag/v${version}";
|
||||
maintainers = [ lib.maintainers.ryand56 ];
|
||||
mainProgram = "comaps";
|
||||
};
|
||||
})
|
||||
@@ -0,0 +1,33 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index c559bf5..42ed617 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -106,7 +106,7 @@ if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
|
||||
elseif (${CMAKE_BUILD_TYPE} MATCHES "Rel")
|
||||
add_definitions(-DRELEASE)
|
||||
if (NOT MSVC)
|
||||
- add_compile_options(-O3 $<$<CXX_COMPILER_ID:GNU>:-flto=auto>)
|
||||
+ add_compile_options(-O3)
|
||||
endif()
|
||||
else()
|
||||
message(FATAL_ERROR "Unknown build type: " ${CMAKE_BUILD_TYPE})
|
||||
@@ -116,19 +116,6 @@ if (${CMAKE_BUILD_TYPE} STREQUAL "RelWithDebInfo")
|
||||
add_compile_options(-fno-omit-frame-pointer)
|
||||
endif()
|
||||
|
||||
-# Linux GCC LTO plugin fix.
|
||||
-if (PLATFORM_LINUX AND (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_BUILD_TYPE MATCHES "^Rel"))
|
||||
- # To force errors if LTO was not enabled.
|
||||
- add_compile_options(-fno-fat-lto-objects)
|
||||
- # To fix ar and ranlib "plugin needed to handle lto object".
|
||||
- string(REGEX MATCH "[0-9]+" GCC_MAJOR_VERSION ${CMAKE_CXX_COMPILER_VERSION})
|
||||
- file(GLOB_RECURSE plugin /usr/lib/gcc/*/${GCC_MAJOR_VERSION}/liblto_plugin.so)
|
||||
- set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> --plugin ${plugin} qcs <TARGET> <OBJECTS>")
|
||||
- set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> --plugin ${plugin} <TARGET>")
|
||||
- set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> --plugin ${plugin} qcs <TARGET> <OBJECTS>")
|
||||
- set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> --plugin ${plugin} <TARGET>")
|
||||
-endif()
|
||||
-
|
||||
message(STATUS "Build type: " ${CMAKE_BUILD_TYPE})
|
||||
|
||||
if (PLATFORM_LINUX OR PLATFORM_ANDROID)
|
||||
@@ -0,0 +1,24 @@
|
||||
diff --git a/3party/CMakeLists.txt b/3party/CMakeLists.txt
|
||||
index 5178ae0..abe103f 100644
|
||||
--- a/3party/CMakeLists.txt
|
||||
+++ b/3party/CMakeLists.txt
|
||||
@@ -41,9 +41,6 @@ if (NOT WITH_SYSTEM_PROVIDED_3PARTY)
|
||||
# Add pugixml library.
|
||||
add_subdirectory(pugixml)
|
||||
|
||||
- # Add protobuf library.
|
||||
- add_subdirectory(protobuf)
|
||||
-
|
||||
if (NOT PLATFORM_LINUX)
|
||||
add_subdirectory(freetype)
|
||||
add_subdirectory(icu)
|
||||
@@ -55,6 +52,9 @@ if (NOT WITH_SYSTEM_PROVIDED_3PARTY)
|
||||
target_include_directories(utf8cpp INTERFACE "${OMIM_ROOT}/3party/utfcpp/source")
|
||||
endif()
|
||||
|
||||
+# Add protobuf library.
|
||||
+add_subdirectory(protobuf)
|
||||
+
|
||||
add_subdirectory(agg)
|
||||
add_subdirectory(bsdiff-courgette)
|
||||
add_subdirectory(minizip)
|
||||
Reference in New Issue
Block a user