1{ lib, stdenv, fetchFromGitHub, qmake, qtbase, protobuf }: 2 3stdenv.mkDerivation rec { 4 pname = "qtpbfimageplugin"; 5 version = "2.6"; 6 7 src = fetchFromGitHub { 8 owner = "tumic0"; 9 repo = "QtPBFImagePlugin"; 10 rev = version; 11 sha256 = "sha256-tTpCbHiZTb/xmm3oRXsYAUWl1sYyAlGP9ss4xVQgPVo="; 12 }; 13 14 nativeBuildInputs = [ qmake ]; 15 buildInputs = [ qtbase protobuf ]; 16 17 dontWrapQtApps = true; 18 19 postPatch = '' 20 # Fix plugin dir 21 substituteInPlace pbfplugin.pro \ 22 --replace "\$\$[QT_INSTALL_PLUGINS]" "$out/$qtPluginPrefix" 23 '' + lib.optionalString stdenv.isDarwin '' 24 # Fix darwin build 25 substituteInPlace pbfplugin.pro \ 26 --replace '$$PROTOBUF/include' '${protobuf}/include' \ 27 --replace '$$PROTOBUF/lib/libprotobuf-lite.a' '${protobuf}/lib/libprotobuf-lite.dylib' 28 ''; 29 30 meta = with lib; { 31 description = "Qt image plugin for displaying Mapbox vector tiles"; 32 longDescription = '' 33 QtPBFImagePlugin is a Qt image plugin that enables applications capable of 34 displaying raster MBTiles maps or raster XYZ online maps to also display PBF 35 vector tiles without (almost) any application modifications. 36 ''; 37 homepage = "https://github.com/tumic0/QtPBFImagePlugin"; 38 license = licenses.lgpl3Only; 39 maintainers = with maintainers; [ sikmir ]; 40 platforms = platforms.unix; 41 }; 42}