16 stdenv.mkDerivation rec {
17 pname = "OpenOrienteering-Mapper";
20 src = fetchFromGitHub {
21 owner = "OpenOrienteering";
24 hash = "sha256-BQbryRV5diBkOtva9sYuLD8yo3IwFqrkz3qC+C6eEfE=";
28 # https://github.com/OpenOrienteering/mapper/pull/1907
30 url = "https://github.com/OpenOrienteering/mapper/commit/bc52aa567e90a58d6963b44d5ae1909f3f841508.patch";
31 sha256 = "1bkckapzccn6k0ri6bgrr0nhis9498fnwj7b32s2ysym8zcg0355";
36 substituteInPlace CMakeLists.txt \
37 --replace "find_package(ClangTidy" "#find_package(ClangTidy"
38 substituteInPlace packaging/custom_install.cmake.in \
39 --replace "fixup_bundle_portable(" "#fixup_bundle_portable("
62 # Building the manual and bundling licenses fails
63 # See https://github.com/NixOS/nixpkgs/issues/85306
64 (lib.cmakeBool "LICENSING_PROVIDER" false)
65 (lib.cmakeBool "Mapper_MANUAL_QTHELP" false)
66 ] ++ lib.optionals stdenv.isDarwin [
67 # FindGDAL is broken and always finds /Library/Framework unless this is
69 (lib.cmakeFeature "GDAL_INCLUDE_DIR" "${gdal}/include")
70 (lib.cmakeFeature "GDAL_CONFIG" "${gdal}/bin/gdal-config")
71 (lib.cmakeFeature "GDAL_LIBRARY" "${gdal}/lib/libgdal.dylib")
72 # Don't bundle libraries
73 (lib.cmakeBool "Mapper_PACKAGE_PROJ" false)
74 (lib.cmakeBool "Mapper_PACKAGE_QT" false)
75 (lib.cmakeBool "Mapper_PACKAGE_ASSISTANT" false)
76 (lib.cmakeBool "Mapper_PACKAGE_GDAL" false)
79 postInstall = with stdenv; lib.optionalString isDarwin ''
80 mkdir -p $out/{Applications,bin}
81 mv $out/Mapper.app $out/Applications
82 ln -s $out/Applications/Mapper.app/Contents/MacOS/Mapper $out/bin/Mapper
86 homepage = "https://www.openorienteering.org/apps/mapper/";
87 description = "Orienteering mapmaking program";
88 changelog = "https://github.com/OpenOrienteering/mapper/releases/tag/v${version}";
89 license = licenses.gpl3Plus;
90 maintainers = with maintainers; [ mpickering sikmir ];
91 platforms = with platforms; unix;
92 mainProgram = "Mapper";