e0464e4788
In preparation for the deprecation of `stdenv.isX`. These shorthands are not conducive to cross-compilation because they hide the platforms. Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way One example of why this is bad and especially affects compiler packages https://www.github.com/NixOS/nixpkgs/pull/343059 There are too many files to go through manually but a treewide should get users thinking when they see a `hostPlatform.isX` in a place where it doesn't make sense. ``` fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is" fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is" ```
103 lines
2.3 KiB
Nix
103 lines
2.3 KiB
Nix
{ lib
|
|
, stdenv
|
|
, fetchFromGitHub
|
|
, cmake
|
|
, ninja
|
|
, pkg-config
|
|
, which
|
|
, python3
|
|
, rsync
|
|
, wrapQtAppsHook
|
|
, qtbase
|
|
, qtpositioning
|
|
, qtsvg
|
|
, qtwayland
|
|
, libGLU
|
|
, libGL
|
|
, zlib
|
|
, icu
|
|
, freetype
|
|
, pugixml
|
|
, nix-update-script
|
|
}:
|
|
|
|
let
|
|
world_feed_integration_tests_data = fetchFromGitHub {
|
|
owner = "organicmaps";
|
|
repo = "world_feed_integration_tests_data";
|
|
rev = "3b66e59eaae85ebc583ce20baa3bdf27811349c4";
|
|
hash = "sha256-wOZKqwYxJLllyxCr44rAcropKhohLUIVCtsR5tz9TRw=";
|
|
};
|
|
in stdenv.mkDerivation rec {
|
|
pname = "organicmaps";
|
|
version = "2024.09.08-7";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "organicmaps";
|
|
repo = "organicmaps";
|
|
rev = "${version}-android";
|
|
hash = "sha256-X1dmk1IBjqM2AUVkvSDNZyVtV5Ens9ninZvMvsRc334=";
|
|
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
|
|
echo "echo ${lib.replaceStrings ["." "-"] ["" ""] version}" > tools/unix/version.sh
|
|
|
|
# TODO use system boost instead, see https://github.com/organicmaps/organicmaps/issues/5345
|
|
patchShebangs 3party/boost/tools/build/src/engine/build.sh
|
|
|
|
# Prefetch test data, or the build system will try to fetch it with git.
|
|
ln -s ${world_feed_integration_tests_data} data/world_feed_integration_tests_data
|
|
'';
|
|
|
|
nativeBuildInputs = [
|
|
cmake
|
|
ninja
|
|
pkg-config
|
|
which
|
|
python3
|
|
rsync
|
|
wrapQtAppsHook
|
|
];
|
|
|
|
# Most dependencies are vendored
|
|
buildInputs = [
|
|
qtbase
|
|
qtpositioning
|
|
qtsvg
|
|
qtwayland
|
|
libGLU
|
|
libGL
|
|
zlib
|
|
icu
|
|
freetype
|
|
pugixml
|
|
];
|
|
|
|
# Yes, this is PRE configure. The configure phase uses cmake
|
|
preConfigure = ''
|
|
bash ./configure.sh
|
|
'';
|
|
|
|
passthru = {
|
|
updateScript = nix-update-script {
|
|
extraArgs = [ "-vr" "(.*)-android" ];
|
|
};
|
|
};
|
|
|
|
meta = with lib; {
|
|
# darwin: "invalid application of 'sizeof' to a function type"
|
|
broken = stdenv.hostPlatform.isDarwin;
|
|
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";
|
|
};
|
|
}
|