2020-06-18 07:06:33 +00:00
|
|
|
{ stdenv
|
|
|
|
, mkDerivation
|
|
|
|
, fetchFromGitHub
|
|
|
|
, gdal
|
|
|
|
, cmake
|
|
|
|
, ninja
|
|
|
|
, proj
|
|
|
|
, clipper
|
|
|
|
, zlib
|
|
|
|
, qttools
|
|
|
|
, qtlocation
|
|
|
|
, qtsensors
|
|
|
|
, qttranslations
|
|
|
|
, doxygen
|
|
|
|
, cups
|
|
|
|
, qtimageformats
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2020-06-18 07:06:33 +00:00
|
|
|
mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "OpenOrienteering-Mapper";
|
2020-06-18 07:06:33 +00:00
|
|
|
version = "0.9.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-06-18 07:06:33 +00:00
|
|
|
buildInputs = [
|
|
|
|
gdal
|
|
|
|
qtlocation
|
|
|
|
qtimageformats
|
|
|
|
qtsensors
|
|
|
|
clipper
|
|
|
|
zlib
|
|
|
|
proj
|
|
|
|
cups
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-06-18 07:06:33 +00:00
|
|
|
nativeBuildInputs = [ cmake doxygen ninja qttools ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "OpenOrienteering";
|
|
|
|
repo = "mapper";
|
|
|
|
rev = "v${version}";
|
2020-06-18 07:06:33 +00:00
|
|
|
sha256 = "05bliglpc8170px6k9lfrp9ylpnb2zf47gnjns9b2bif8dv8zq0l";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-06-18 07:06:33 +00:00
|
|
|
patches = [
|
|
|
|
# See https://github.com/NixOS/nixpkgs/issues/86054
|
|
|
|
./fix-qttranslations-path.diff
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/util/translation_util.cpp \
|
|
|
|
--subst-var-by qttranslations ${qttranslations}
|
|
|
|
'';
|
|
|
|
|
|
|
|
cmakeFlags = [
|
2020-04-24 23:36:52 +00:00
|
|
|
# Building the manual and bundling licenses fails
|
2020-06-18 07:06:33 +00:00
|
|
|
# See https://github.com/NixOS/nixpkgs/issues/85306
|
2020-04-24 23:36:52 +00:00
|
|
|
"-DLICENSING_PROVIDER:BOOL=OFF"
|
|
|
|
"-DMapper_MANUAL_QTHELP:BOOL=OFF"
|
2020-06-18 07:06:33 +00:00
|
|
|
] ++ stdenv.lib.optionals stdenv.isDarwin [
|
2020-04-24 23:36:52 +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-06-18 07:06:33 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-06-18 07:06:33 +00:00
|
|
|
postInstall = with stdenv; lib.optionalString isDarwin ''
|
|
|
|
mkdir -p $out/Applications
|
|
|
|
mv $out/Mapper.app $out/Applications
|
2020-04-24 23:36:52 +00:00
|
|
|
# Fixes "This application failed to start because it could not find or load the Qt
|
|
|
|
# platform plugin "cocoa"."
|
2020-06-18 07:06:33 +00:00
|
|
|
wrapQtApp $out/Applications/Mapper.app/Contents/MacOS/Mapper
|
2020-04-24 23:36:52 +00:00
|
|
|
mkdir -p $out/bin
|
2020-06-18 07:06:33 +00:00
|
|
|
ln -s $out/Applications/Mapper.app/Contents/MacOS/Mapper $out/bin/mapper
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = ''
|
|
|
|
OpenOrienteering Mapper is an orienteering mapmaking program
|
|
|
|
and provides a free alternative to the existing proprietary solution.
|
|
|
|
'';
|
|
|
|
homepage = "https://www.openorienteering.org/apps/mapper/";
|
|
|
|
license = licenses.gpl3;
|
|
|
|
platforms = with platforms; linux ++ darwin;
|
|
|
|
maintainers = with maintainers; [ mpickering sikmir ];
|
|
|
|
};
|
|
|
|
}
|