2021-02-25 20:12:25 +01:00
|
|
|
{ mkDerivation
|
|
|
|
, lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, qmake
|
|
|
|
, qttools
|
|
|
|
, qttranslations
|
|
|
|
, gdal
|
|
|
|
, proj
|
|
|
|
, qtsvg
|
|
|
|
, qtwebkit
|
|
|
|
, withGeoimage ? true, exiv2
|
|
|
|
, withGpsdlib ? (!stdenv.isDarwin), gpsd
|
|
|
|
, withLibproxy ? false, libproxy
|
|
|
|
, withZbar ? false, zbar
|
|
|
|
}:
|
2010-06-13 21:32:04 +02:00
|
|
|
|
2020-12-12 12:25:00 +01:00
|
|
|
mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "merkaartor";
|
2020-12-12 12:25:00 +01:00
|
|
|
version = "0.18.4";
|
2016-06-26 09:03:58 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "openstreetmap";
|
|
|
|
repo = "merkaartor";
|
2020-12-12 12:25:00 +01:00
|
|
|
rev = version;
|
|
|
|
sha256 = "vwO4/a7YF9KbpxcFGTFCdG6SfwEyhISlEtcA+rMebUA=";
|
2010-06-13 21:32:04 +02:00
|
|
|
};
|
|
|
|
|
2020-12-12 12:25:00 +01:00
|
|
|
patches = [
|
2021-02-25 20:12:25 +01:00
|
|
|
# Fix build with Qt 5.15 (missing QPainterPath include)
|
2020-12-12 12:25:00 +01:00
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/openstreetmap/merkaartor/commit/e72553a7ea2c7ba0634cc3afcd27a9f7cfef089c.patch";
|
|
|
|
sha256 = "NAisplnS3xHSlRpX+fH15NpbaD+uM57OCsTYGKlIR7U=";
|
|
|
|
})
|
2021-02-25 20:12:25 +01:00
|
|
|
# Added a condition to use the new timespec_t on gpsd APIs >= 9
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/openstreetmap/merkaartor/commit/13b358fa7899bb34e277b32a4c0d92833050f2c6.patch";
|
|
|
|
sha256 = "129fpjm7illz7ngx3shps5ivrxwf14apw55842xhskwwb0rf5szb";
|
|
|
|
})
|
2020-12-12 12:25:00 +01:00
|
|
|
];
|
|
|
|
|
2021-02-25 20:12:25 +01:00
|
|
|
nativeBuildInputs = [ qmake qttools ];
|
|
|
|
|
|
|
|
buildInputs = [ gdal proj qtsvg qtwebkit ]
|
|
|
|
++ lib.optional withGeoimage exiv2
|
|
|
|
++ lib.optional withGpsdlib gpsd
|
|
|
|
++ lib.optional withLibproxy libproxy
|
|
|
|
++ lib.optional withZbar zbar;
|
2010-06-13 21:32:04 +02:00
|
|
|
|
2021-02-25 20:12:25 +01:00
|
|
|
preConfigure = ''
|
|
|
|
lrelease src/src.pro
|
|
|
|
'';
|
2016-04-17 01:33:35 +02:00
|
|
|
|
2021-02-25 20:12:25 +01:00
|
|
|
qmakeFlags = [ "TRANSDIR_SYSTEM=${qttranslations}/translations" ]
|
|
|
|
++ lib.optional withGeoimage "GEOIMAGE=1"
|
|
|
|
++ lib.optional withGpsdlib "GPSDLIB=1"
|
|
|
|
++ lib.optional withLibproxy "LIBPROXY=1"
|
|
|
|
++ lib.optional withZbar "ZBAR=1";
|
2017-10-01 03:22:41 +02:00
|
|
|
|
2021-02-25 20:12:25 +01:00
|
|
|
postInstall = lib.optionalString stdenv.isDarwin ''
|
|
|
|
mkdir -p $out/Applications
|
|
|
|
mv binaries/bin/merkaartor.app $out/Applications
|
|
|
|
mv binaries/bin/plugins $out/Applications/merkaartor.app/Contents
|
|
|
|
wrapQtApp $out/Applications/merkaartor.app/Contents/MacOS/merkaartor
|
|
|
|
'';
|
2019-07-11 13:58:46 +02:00
|
|
|
|
2020-12-12 12:25:00 +01:00
|
|
|
meta = with lib; {
|
2017-10-01 03:22:41 +02:00
|
|
|
description = "OpenStreetMap editor";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "http://merkaartor.be/";
|
2017-10-01 03:22:41 +02:00
|
|
|
license = licenses.gpl2Plus;
|
2021-02-25 20:12:25 +01:00
|
|
|
maintainers = with maintainers; [ sikmir ];
|
|
|
|
platforms = platforms.unix;
|
2010-06-13 21:32:04 +02:00
|
|
|
};
|
|
|
|
}
|