slackdump: 3.0.3 -> 3.0.5 (#379390)
[NixPkgs.git] / pkgs / by-name / op / openorienteering-mapper / package.nix
blobb4a1fe22911d3f65c9186c5a330816378050f03a
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   fetchpatch,
6   clipper,
7   cmake,
8   cups,
9   doxygen,
10   gdal,
11   ninja,
12   proj,
13   qt5,
14   zlib,
17 stdenv.mkDerivation rec {
18   pname = "OpenOrienteering-Mapper";
19   version = "0.9.5";
21   src = fetchFromGitHub {
22     owner = "OpenOrienteering";
23     repo = "mapper";
24     rev = "v${version}";
25     hash = "sha256-BQbryRV5diBkOtva9sYuLD8yo3IwFqrkz3qC+C6eEfE=";
26   };
28   patches = [
29     # https://github.com/OpenOrienteering/mapper/pull/1907
30     (fetchpatch {
31       url = "https://github.com/OpenOrienteering/mapper/commit/bc52aa567e90a58d6963b44d5ae1909f3f841508.patch";
32       hash = "sha256-pQzw2EfVay+0GOtIbh1KJOkILcj5LRMzmMYy9q+abK4=";
33     })
34   ];
36   postPatch = ''
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("
41   '';
43   nativeBuildInputs = [
44     cmake
45     doxygen
46     ninja
47     qt5.qttools
48     qt5.wrapQtAppsHook
49   ];
51   buildInputs = [
52     clipper
53     cups
54     gdal
55     proj
56     qt5.qtimageformats
57     qt5.qtlocation
58     qt5.qtsensors
59     zlib
60   ];
62   cmakeFlags =
63     [
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)
68     ]
69     ++ lib.optionals stdenv.hostPlatform.isDarwin [
70       # FindGDAL is broken and always finds /Library/Framework unless this is
71       # specified
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)
80     ];
82   postInstall =
83     with stdenv;
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
88     '';
90   meta = with lib; {
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; [
96       mpickering
97       sikmir
98     ];
99     platforms = with platforms; unix;
100     mainProgram = "Mapper";
101   };