nixpkgs/pkgs/applications/misc/tilemaker/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
1.6 KiB
Nix
Raw Normal View History

2022-09-13 20:56:56 +02:00
{ lib, stdenv, fetchFromGitHub, fetchpatch, buildPackages, cmake, installShellFiles
, boost, lua, protobuf, rapidjson, shapelib, sqlite, zlib, testers }:
2022-05-06 17:06:52 +02:00
2022-09-13 20:56:56 +02:00
stdenv.mkDerivation (finalAttrs: {
2022-05-06 17:06:52 +02:00
pname = "tilemaker";
2023-03-31 18:24:13 +02:00
version = "2.4.0";
2022-05-06 17:06:52 +02:00
src = fetchFromGitHub {
owner = "systemed";
2022-09-13 20:56:56 +02:00
repo = "tilemaker";
rev = "v${finalAttrs.version}";
2023-03-31 18:24:13 +02:00
hash = "sha256-xpOF/0qFuvTUWQ1I8x/gy5qSLKzSgcQahS47PG+bTRA=";
2022-05-06 17:06:52 +02: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";
env.NIX_CFLAGS_COMPILE = toString [ "-DTM_VERSION=${finalAttrs.version}" ];
2022-09-13 20:56:56 +02:00
2022-05-06 17:06:52 +02:00
postInstall = ''
installManPage ../docs/man/tilemaker.1
install -Dm644 ../resources/* -t $out/share/tilemaker
'';
2022-09-13 20:56:56 +02:00
passthru.tests.version = testers.testVersion {
package = finalAttrs.finalPackage;
command = "tilemaker --help";
};
2022-05-06 17:06:52 +02:00
meta = with lib; {
description = "Make OpenStreetMap vector tiles without the stack";
homepage = "https://tilemaker.org/";
2023-03-08 10:20:12 +01:00
changelog = "https://github.com/systemed/tilemaker/blob/v${version}/CHANGELOG.md";
2022-05-06 17:06:52 +02:00
license = licenses.free; # FTWPL
maintainers = with maintainers; [ sikmir ];
platforms = platforms.unix;
};
2022-09-13 20:56:56 +02:00
})