2022-09-14 18:05:37 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch, buildPackages, cmake, installShellFiles
|
|
|
|
, boost, lua, protobuf, rapidjson, shapelib, sqlite, zlib, testers }:
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2022-09-14 18:05:37 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2022-06-16 17:23:12 +00:00
|
|
|
pname = "tilemaker";
|
|
|
|
version = "2.2.0";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "systemed";
|
2022-09-14 18:05:37 +00:00
|
|
|
repo = "tilemaker";
|
|
|
|
rev = "v${finalAttrs.version}";
|
2022-06-16 17:23:12 +00:00
|
|
|
hash = "sha256-st6WDCk1RZ2lbfrudtcD+zenntyTMRHrIXw3nX5FHOU=";
|
|
|
|
};
|
|
|
|
|
2022-09-14 18:05:37 +00:00
|
|
|
patches = [
|
|
|
|
# Fix build with Boost >= 1.79, remove on next upstream release
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/systemed/tilemaker/commit/252e7f2ad8938e38d51783d1596307dcd27ed269.patch";
|
|
|
|
hash = "sha256-YSkhmpzEYk/mxVPSDYdwZclooB3zKRjDPzqamv6Nvyc=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/tilemaker.cpp \
|
|
|
|
--replace "config.json" "$out/share/tilemaker/config-openmaptiles.json" \
|
|
|
|
--replace "process.lua" "$out/share/tilemaker/process-openmaptiles.lua"
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake installShellFiles ];
|
|
|
|
|
|
|
|
buildInputs = [ boost lua protobuf rapidjson shapelib sqlite zlib ];
|
|
|
|
|
|
|
|
cmakeFlags = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
|
|
|
|
"-DPROTOBUF_PROTOC_EXECUTABLE=${buildPackages.protobuf}/bin/protoc";
|
|
|
|
|
2022-09-14 18:05:37 +00:00
|
|
|
NIX_CFLAGS_COMPILE = [ "-DTM_VERSION=${finalAttrs.version}" ];
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
postInstall = ''
|
|
|
|
installManPage ../docs/man/tilemaker.1
|
|
|
|
install -Dm644 ../resources/* -t $out/share/tilemaker
|
|
|
|
'';
|
|
|
|
|
2022-09-14 18:05:37 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = finalAttrs.finalPackage;
|
|
|
|
command = "tilemaker --help";
|
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Make OpenStreetMap vector tiles without the stack";
|
|
|
|
homepage = "https://tilemaker.org/";
|
|
|
|
license = licenses.free; # FTWPL
|
|
|
|
maintainers = with maintainers; [ sikmir ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
2022-09-14 18:05:37 +00:00
|
|
|
})
|