nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 cmake,
6 ninja,
7 pkg-config,
8 which,
9 python3,
10 rsync,
11 wrapQtAppsHook,
12 qtbase,
13 qtpositioning,
14 qtsvg,
15 qtwayland,
16 libGLU,
17 libGL,
18 zlib,
19 icu,
20 freetype,
21 pugixml,
22 xorg,
23 nix-update-script,
24}:
25
26let
27 world_feed_integration_tests_data = fetchFromGitHub {
28 owner = "organicmaps";
29 repo = "world_feed_integration_tests_data";
30 rev = "30ecb0b3fe694a582edfacc2a7425b6f01f9fec6";
31 hash = "sha256-1FF658OhKg8a5kKX/7TVmsxZ9amimn4lB6bX9i7pnI4=";
32 };
33in
34stdenv.mkDerivation (finalAttrs: {
35 pname = "organicmaps";
36 version = "2025.07.13-9";
37
38 src = fetchFromGitHub {
39 owner = "organicmaps";
40 repo = "organicmaps";
41 tag = "${finalAttrs.version}-android";
42 hash = "sha256-cEQmghS5qg5HTyWfDIB4G/Arh9BpM3iz1tToRWY8KrE=";
43 fetchSubmodules = true;
44 };
45
46 postPatch = ''
47 # Disable certificate check. It's dependent on time
48 echo "exit 0" > tools/unix/check_cert.sh
49
50 # crude fix for https://github.com/organicmaps/organicmaps/issues/1862
51 echo "echo ${lib.replaceStrings [ "." "-" ] [ "" "" ] finalAttrs.version}" > tools/unix/version.sh
52
53 # TODO use system boost instead, see https://github.com/organicmaps/organicmaps/issues/5345
54 patchShebangs 3party/boost/tools/build/src/engine/build.sh
55
56 # Prefetch test data, or the build system will try to fetch it with git.
57 ln -s ${world_feed_integration_tests_data} data/test_data/world_feed_integration_tests_data
58 '';
59
60 nativeBuildInputs = [
61 cmake
62 ninja
63 pkg-config
64 which
65 python3
66 rsync
67 wrapQtAppsHook
68 ];
69
70 # Most dependencies are vendored
71 buildInputs = [
72 qtbase
73 qtpositioning
74 qtsvg
75 qtwayland
76 libGLU
77 libGL
78 zlib
79 icu
80 freetype
81 pugixml
82 xorg.libXrandr
83 xorg.libXinerama
84 xorg.libXcursor
85 ];
86
87 # Yes, this is PRE configure. The configure phase uses cmake
88 preConfigure = ''
89 bash ./configure.sh
90 '';
91
92 passthru = {
93 updateScript = nix-update-script {
94 extraArgs = [
95 "-vr"
96 "(.*)-android"
97 ];
98 };
99 };
100
101 meta = {
102 # darwin: "invalid application of 'sizeof' to a function type"
103 broken = stdenv.hostPlatform.isDarwin;
104 homepage = "https://organicmaps.app/";
105 description = "Detailed Offline Maps for Travellers, Tourists, Hikers and Cyclists";
106 license = lib.licenses.asl20;
107 maintainers = with lib.maintainers; [ fgaz ];
108 platforms = lib.platforms.all;
109 mainProgram = "OMaps";
110 };
111})