comaps: init at 2025.08.13-8

+163
+106
pkgs/by-name/co/comaps/package.nix
···
··· 1 + { 2 + lib, 3 + organicmaps, 4 + fetchurl, 5 + fetchFromGitea, 6 + boost, 7 + gtest, 8 + glm, 9 + gflags, 10 + imgui, 11 + jansson, 12 + python3, 13 + optipng, 14 + utf8cpp, 15 + nix-update-script, 16 + }: 17 + let 18 + mapRev = 250804; 19 + 20 + worldMap = fetchurl { 21 + url = "https://cdn-fi-1.comaps.app/maps/${toString mapRev}/World.mwm"; 22 + hash = "sha256-xYMH3y0Y6sSXYUTpy+A5YCyb+n5YChOXhyDvUFqXxZ0="; 23 + }; 24 + 25 + worldCoasts = fetchurl { 26 + url = "https://cdn-fi-1.comaps.app/maps/${toString mapRev}/WorldCoasts.mwm"; 27 + hash = "sha256-2vc4kkNX9bRTqXYlALfwVwOlvr122kvUk7pUyM91vjc="; 28 + }; 29 + in 30 + organicmaps.overrideAttrs (oldAttrs: rec { 31 + pname = "comaps"; 32 + version = "2025.08.13-8"; 33 + 34 + src = fetchFromGitea { 35 + domain = "codeberg.org"; 36 + owner = "comaps"; 37 + repo = "comaps"; 38 + tag = "v${version}"; 39 + hash = "sha256-kvE3H+siV/8v4WgsG1Ifd4gMMwGLqz28oXf1hB9gQ2Q="; 40 + fetchSubmodules = true; 41 + }; 42 + 43 + patches = [ 44 + ./remove-lto.patch 45 + ./use-vendored-protobuf.patch 46 + ]; 47 + 48 + postPatch = (oldAttrs.postPatch or "") + '' 49 + rm -f 3party/boost/b2 50 + ''; 51 + 52 + nativeBuildInputs = (builtins.filter (x: x != python3) oldAttrs.nativeBuildInputs or [ ]) ++ [ 53 + (python3.withPackages ( 54 + ps: with ps; [ 55 + protobuf 56 + ] 57 + )) 58 + optipng 59 + ]; 60 + 61 + buildInputs = (oldAttrs.buildInputs or [ ]) ++ [ 62 + boost 63 + gtest 64 + gflags 65 + glm 66 + imgui 67 + jansson 68 + utf8cpp 69 + ]; 70 + 71 + preConfigure = '' 72 + bash ./configure.sh --skip-map-download 73 + ''; 74 + 75 + cmakeFlags = [ 76 + (lib.cmakeBool "WITH_SYSTEM_PROVIDED_3PARTY" true) 77 + ]; 78 + 79 + env = { 80 + NIX_CFLAGS_COMPILE = toString [ 81 + "-I/build/source/3party/fast_double_parser/include" 82 + ]; 83 + PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION = "python"; 84 + }; 85 + 86 + postInstall = '' 87 + install -Dm644 ${worldMap} $out/share/comaps/data/World.mwm 88 + install -Dm644 ${worldCoasts} $out/share/comaps/data/WorldCoasts.mwm 89 + ln -s $out/bin/CoMaps $out/bin/comaps 90 + ''; 91 + 92 + passthru.updateScript = nix-update-script { 93 + extraArgs = [ 94 + "-vr" 95 + "v(.*)" 96 + ]; 97 + }; 98 + 99 + meta = oldAttrs.meta // { 100 + description = "Community-led fork of Organic Maps"; 101 + homepage = "https://comaps.app"; 102 + changelog = "https://codeberg.org/comaps/comaps/releases/tag/v${version}"; 103 + maintainers = [ lib.maintainers.ryand56 ]; 104 + mainProgram = "comaps"; 105 + }; 106 + })
+33
pkgs/by-name/co/comaps/remove-lto.patch
···
··· 1 + diff --git a/CMakeLists.txt b/CMakeLists.txt 2 + index c559bf5..42ed617 100644 3 + --- a/CMakeLists.txt 4 + +++ b/CMakeLists.txt 5 + @@ -106,7 +106,7 @@ if (${CMAKE_BUILD_TYPE} STREQUAL "Debug") 6 + elseif (${CMAKE_BUILD_TYPE} MATCHES "Rel") 7 + add_definitions(-DRELEASE) 8 + if (NOT MSVC) 9 + - add_compile_options(-O3 $<$<CXX_COMPILER_ID:GNU>:-flto=auto>) 10 + + add_compile_options(-O3) 11 + endif() 12 + else() 13 + message(FATAL_ERROR "Unknown build type: " ${CMAKE_BUILD_TYPE}) 14 + @@ -116,19 +116,6 @@ if (${CMAKE_BUILD_TYPE} STREQUAL "RelWithDebInfo") 15 + add_compile_options(-fno-omit-frame-pointer) 16 + endif() 17 + 18 + -# Linux GCC LTO plugin fix. 19 + -if (PLATFORM_LINUX AND (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_BUILD_TYPE MATCHES "^Rel")) 20 + - # To force errors if LTO was not enabled. 21 + - add_compile_options(-fno-fat-lto-objects) 22 + - # To fix ar and ranlib "plugin needed to handle lto object". 23 + - string(REGEX MATCH "[0-9]+" GCC_MAJOR_VERSION ${CMAKE_CXX_COMPILER_VERSION}) 24 + - file(GLOB_RECURSE plugin /usr/lib/gcc/*/${GCC_MAJOR_VERSION}/liblto_plugin.so) 25 + - set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> --plugin ${plugin} qcs <TARGET> <OBJECTS>") 26 + - set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> --plugin ${plugin} <TARGET>") 27 + - set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> --plugin ${plugin} qcs <TARGET> <OBJECTS>") 28 + - set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> --plugin ${plugin} <TARGET>") 29 + -endif() 30 + - 31 + message(STATUS "Build type: " ${CMAKE_BUILD_TYPE}) 32 + 33 + if (PLATFORM_LINUX OR PLATFORM_ANDROID)
+24
pkgs/by-name/co/comaps/use-vendored-protobuf.patch
···
··· 1 + diff --git a/3party/CMakeLists.txt b/3party/CMakeLists.txt 2 + index 5178ae0..abe103f 100644 3 + --- a/3party/CMakeLists.txt 4 + +++ b/3party/CMakeLists.txt 5 + @@ -41,9 +41,6 @@ if (NOT WITH_SYSTEM_PROVIDED_3PARTY) 6 + # Add pugixml library. 7 + add_subdirectory(pugixml) 8 + 9 + - # Add protobuf library. 10 + - add_subdirectory(protobuf) 11 + - 12 + if (NOT PLATFORM_LINUX) 13 + add_subdirectory(freetype) 14 + add_subdirectory(icu) 15 + @@ -55,6 +52,9 @@ if (NOT WITH_SYSTEM_PROVIDED_3PARTY) 16 + target_include_directories(utf8cpp INTERFACE "${OMIM_ROOT}/3party/utfcpp/source") 17 + endif() 18 + 19 + +# Add protobuf library. 20 + +add_subdirectory(protobuf) 21 + + 22 + add_subdirectory(agg) 23 + add_subdirectory(bsdiff-courgette) 24 + add_subdirectory(minizip)