17 stdenv.mkDerivation rec {
18 pname = "OpenOrienteering-Mapper";
21 src = fetchFromGitHub {
22 owner = "OpenOrienteering";
25 hash = "sha256-BQbryRV5diBkOtva9sYuLD8yo3IwFqrkz3qC+C6eEfE=";
29 # https://github.com/OpenOrienteering/mapper/pull/1907
31 url = "https://github.com/OpenOrienteering/mapper/commit/bc52aa567e90a58d6963b44d5ae1909f3f841508.patch";
32 hash = "sha256-pQzw2EfVay+0GOtIbh1KJOkILcj5LRMzmMYy9q+abK4=";
37 substituteInPlace CMakeLists.txt \
38 --replace "find_package(ClangTidy" "#find_package(ClangTidy"
39 substituteInPlace packaging/custom_install.cmake.in \
40 --replace "fixup_bundle_portable(" "#fixup_bundle_portable("
64 # Building the manual and bundling licenses fails
65 # See https://github.com/NixOS/nixpkgs/issues/85306
66 (lib.cmakeBool "LICENSING_PROVIDER" false)
67 (lib.cmakeBool "Mapper_MANUAL_QTHELP" false)
69 ++ lib.optionals stdenv.hostPlatform.isDarwin [
70 # FindGDAL is broken and always finds /Library/Framework unless this is
72 (lib.cmakeFeature "GDAL_INCLUDE_DIR" "${gdal}/include")
73 (lib.cmakeFeature "GDAL_CONFIG" "${gdal}/bin/gdal-config")
74 (lib.cmakeFeature "GDAL_LIBRARY" "${gdal}/lib/libgdal.dylib")
75 # Don't bundle libraries
76 (lib.cmakeBool "Mapper_PACKAGE_PROJ" false)
77 (lib.cmakeBool "Mapper_PACKAGE_QT" false)
78 (lib.cmakeBool "Mapper_PACKAGE_ASSISTANT" false)
79 (lib.cmakeBool "Mapper_PACKAGE_GDAL" false)
84 lib.optionalString isDarwin ''
85 mkdir -p $out/{Applications,bin}
86 mv $out/Mapper.app $out/Applications
87 ln -s $out/Applications/Mapper.app/Contents/MacOS/Mapper $out/bin/Mapper
91 homepage = "https://www.openorienteering.org/apps/mapper/";
92 description = "Orienteering mapmaking program";
93 changelog = "https://github.com/OpenOrienteering/mapper/releases/tag/v${version}";
94 license = licenses.gpl3Plus;
95 maintainers = with maintainers; [
99 platforms = with platforms; unix;
100 mainProgram = "Mapper";