2022-03-27 12:15:15 +02:00
|
|
|
{ lib
|
|
|
|
, mkDerivation
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
, which
|
|
|
|
, python3
|
|
|
|
, rsync
|
|
|
|
, makeWrapper
|
|
|
|
, qtbase
|
|
|
|
, qtsvg
|
|
|
|
, libGLU
|
|
|
|
, libGL
|
|
|
|
, zlib
|
|
|
|
, icu
|
|
|
|
, freetype
|
|
|
|
}:
|
|
|
|
|
|
|
|
mkDerivation rec {
|
|
|
|
pname = "organicmaps";
|
2022-04-27 08:44:21 +02:00
|
|
|
version = "2022.04.27-2";
|
2022-03-27 12:15:15 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "organicmaps";
|
|
|
|
repo = "organicmaps";
|
2022-04-27 08:44:21 +02:00
|
|
|
rev = "${version}-android";
|
|
|
|
sha256 = "sha256-HsskddXne5xClBZoT3aXP+51VRQQJhlUPda/M20SrH0=";
|
2022-03-27 12:15:15 +02:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# Disable certificate check. It's dependent on time
|
|
|
|
echo "exit 0" > tools/unix/check_cert.sh
|
|
|
|
|
|
|
|
# crude fix for https://github.com/organicmaps/organicmaps/issues/1862
|
2022-04-27 08:44:21 +02:00
|
|
|
echo "echo ${lib.replaceStrings ["." "-"] ["" ""] version}" > tools/unix/version.sh
|
2022-03-27 12:15:15 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
which
|
|
|
|
python3
|
|
|
|
rsync
|
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
|
|
|
|
# Most dependencies are vendored
|
|
|
|
buildInputs = [
|
|
|
|
qtbase
|
|
|
|
qtsvg
|
|
|
|
libGLU
|
|
|
|
libGL
|
|
|
|
zlib
|
|
|
|
icu
|
|
|
|
freetype
|
|
|
|
];
|
|
|
|
|
|
|
|
# Yes, this is PRE configure. The configure phase uses cmake
|
|
|
|
preConfigure = ''
|
|
|
|
bash ./configure.sh
|
|
|
|
'';
|
|
|
|
|
2022-04-27 08:44:21 +02:00
|
|
|
# Tell the program that the read-only and the read-write data locations
|
|
|
|
# are different, and create the read-write one.
|
|
|
|
# https://github.com/organicmaps/organicmaps/issues/2387
|
2022-03-27 12:15:15 +02:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/OMaps \
|
|
|
|
--add-flags "-resources_path $out/share/organicmaps/data" \
|
|
|
|
--add-flags '-data_path "''${XDG_DATA_HOME:-''${HOME}/.local/share}/OMaps"' \
|
|
|
|
--run 'mkdir -p "''${XDG_DATA_HOME:-''${HOME}/.local/share}/OMaps"'
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://organicmaps.app/";
|
|
|
|
description = "Detailed Offline Maps for Travellers, Tourists, Hikers and Cyclists";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ fgaz ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
mainProgram = "OMaps";
|
|
|
|
broken = stdenv.isDarwin; # "invalid application of 'sizeof' to a function type"
|
|
|
|
};
|
|
|
|
}
|