2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv
|
2020-05-16 11:47:30 +01:00
|
|
|
, mkDerivation
|
|
|
|
, fetchFromGitHub
|
2021-03-13 06:11:54 +00:00
|
|
|
, fetchpatch
|
2020-10-06 18:28:16 +01:00
|
|
|
, substituteAll
|
2020-05-16 11:47:30 +01:00
|
|
|
, gdal
|
|
|
|
, cmake
|
|
|
|
, ninja
|
|
|
|
, proj
|
|
|
|
, clipper
|
|
|
|
, zlib
|
|
|
|
, qttools
|
|
|
|
, qtlocation
|
|
|
|
, qtsensors
|
|
|
|
, qttranslations
|
|
|
|
, doxygen
|
|
|
|
, cups
|
|
|
|
, qtimageformats
|
2018-03-18 12:41:14 +00:00
|
|
|
}:
|
|
|
|
|
2020-05-16 11:47:30 +01:00
|
|
|
mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "OpenOrienteering-Mapper";
|
2021-03-13 06:11:54 +00:00
|
|
|
version = "0.9.5";
|
2018-03-18 12:41:14 +00:00
|
|
|
|
2020-05-16 11:47:30 +01:00
|
|
|
buildInputs = [
|
|
|
|
gdal
|
|
|
|
qtlocation
|
|
|
|
qtimageformats
|
|
|
|
qtsensors
|
|
|
|
clipper
|
|
|
|
zlib
|
|
|
|
proj
|
|
|
|
cups
|
|
|
|
];
|
2018-03-18 12:41:14 +00:00
|
|
|
|
2020-05-16 11:47:30 +01:00
|
|
|
nativeBuildInputs = [ cmake doxygen ninja qttools ];
|
2018-03-18 12:41:14 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "OpenOrienteering";
|
|
|
|
repo = "mapper";
|
|
|
|
rev = "v${version}";
|
2021-03-13 06:11:54 +00:00
|
|
|
sha256 = "1w8ikqpgi0ksrzjal5ihfaik4grc5v3gdnnv79j20xkr2p4yn1h5";
|
2018-03-18 12:41:14 +00:00
|
|
|
};
|
|
|
|
|
2021-03-13 06:11:54 +00:00
|
|
|
patches = [
|
|
|
|
# https://github.com/NixOS/nixpkgs/issues/86054
|
|
|
|
(substituteAll {
|
|
|
|
src = ./fix-qttranslations-path.diff;
|
|
|
|
inherit qttranslations;
|
|
|
|
})
|
|
|
|
# https://github.com/OpenOrienteering/mapper/pull/1907
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/OpenOrienteering/mapper/commit/bc52aa567e90a58d6963b44d5ae1909f3f841508.patch";
|
|
|
|
sha256 = "1bkckapzccn6k0ri6bgrr0nhis9498fnwj7b32s2ysym8zcg0355";
|
|
|
|
})
|
|
|
|
];
|
2020-05-16 11:47:30 +01:00
|
|
|
|
|
|
|
cmakeFlags = [
|
2018-03-18 12:41:14 +00:00
|
|
|
# Building the manual and bundling licenses fails
|
2020-05-16 11:47:30 +01:00
|
|
|
# See https://github.com/NixOS/nixpkgs/issues/85306
|
2018-03-18 12:41:14 +00:00
|
|
|
"-DLICENSING_PROVIDER:BOOL=OFF"
|
|
|
|
"-DMapper_MANUAL_QTHELP:BOOL=OFF"
|
2021-01-15 13:21:58 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
2018-03-18 12:41:14 +00:00
|
|
|
# FindGDAL is broken and always finds /Library/Framework unless this is
|
|
|
|
# specified
|
|
|
|
"-DGDAL_INCLUDE_DIR=${gdal}/include"
|
|
|
|
"-DGDAL_CONFIG=${gdal}/bin/gdal-config"
|
|
|
|
"-DGDAL_LIBRARY=${gdal}/lib/libgdal.dylib"
|
|
|
|
# Don't bundle libraries
|
|
|
|
"-DMapper_PACKAGE_PROJ=0"
|
|
|
|
"-DMapper_PACKAGE_QT=0"
|
|
|
|
"-DMapper_PACKAGE_ASSISTANT=0"
|
|
|
|
"-DMapper_PACKAGE_GDAL=0"
|
2020-05-16 11:47:30 +01:00
|
|
|
];
|
2018-03-18 12:41:14 +00:00
|
|
|
|
2020-05-16 11:47:30 +01:00
|
|
|
postInstall = with stdenv; lib.optionalString isDarwin ''
|
|
|
|
mkdir -p $out/Applications
|
|
|
|
mv $out/Mapper.app $out/Applications
|
2018-03-18 12:41:14 +00:00
|
|
|
# Fixes "This application failed to start because it could not find or load the Qt
|
|
|
|
# platform plugin "cocoa"."
|
2020-05-16 11:47:30 +01:00
|
|
|
wrapQtApp $out/Applications/Mapper.app/Contents/MacOS/Mapper
|
2018-03-18 12:41:14 +00:00
|
|
|
mkdir -p $out/bin
|
2020-05-16 11:47:30 +01:00
|
|
|
ln -s $out/Applications/Mapper.app/Contents/MacOS/Mapper $out/bin/mapper
|
|
|
|
'';
|
2018-03-18 12:41:14 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-03-18 12:41:14 +00:00
|
|
|
description = ''
|
|
|
|
OpenOrienteering Mapper is an orienteering mapmaking program
|
|
|
|
and provides a free alternative to the existing proprietary solution.
|
|
|
|
'';
|
2020-03-15 07:43:24 +00:00
|
|
|
homepage = "https://www.openorienteering.org/apps/mapper/";
|
2021-03-13 06:11:54 +00:00
|
|
|
changelog = "https://github.com/OpenOrienteering/mapper/releases/tag/v${version}";
|
|
|
|
license = licenses.gpl3Plus;
|
2018-04-08 18:27:52 +01:00
|
|
|
platforms = with platforms; linux ++ darwin;
|
2019-09-08 22:48:51 +01:00
|
|
|
maintainers = with maintainers; [ mpickering sikmir ];
|
2018-03-18 12:41:14 +00:00
|
|
|
};
|
|
|
|
}
|