nixpkgs/pkgs/by-name/ti/tilemaker/package.nix

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

66 lines
1.8 KiB
Nix
Raw Normal View History

2024-03-14 14:39:35 +00:00
{ lib
, stdenv
, fetchFromGitHub
, buildPackages
, cmake
, installShellFiles
, boost
, lua
2024-03-14 14:39:43 +00:00
, protobuf_21
2024-03-14 14:39:35 +00:00
, rapidjson
, shapelib
, sqlite
, zlib
, testers
}:
2022-05-06 15:06:52 +00:00
2022-09-13 18:56:56 +00:00
stdenv.mkDerivation (finalAttrs: {
2022-05-06 15:06:52 +00:00
pname = "tilemaker";
2024-01-16 20:54:16 +00:00
version = "3.0.0";
2022-05-06 15:06:52 +00:00
src = fetchFromGitHub {
owner = "systemed";
2022-09-13 18:56:56 +00:00
repo = "tilemaker";
rev = "v${finalAttrs.version}";
2024-01-16 20:54:16 +00:00
hash = "sha256-rB5oP03yaIzklwkGsIeS9ELbHOY9AObwjRrK9HBQFI4=";
2022-05-06 15:06:52 +00:00
};
postPatch = ''
2024-03-14 14:39:35 +00:00
substituteInPlace src/options_parser.cpp \
--replace-fail "config.json" "$out/share/tilemaker/config-openmaptiles.json" \
--replace-fail "process.lua" "$out/share/tilemaker/process-openmaptiles.lua"
substituteInPlace server/server.cpp \
--replace-fail "default_value(\"static\")" "default_value(\"$out/share/tilemaker/static\")"
2022-05-06 15:06:52 +00:00
'';
nativeBuildInputs = [ cmake installShellFiles ];
2024-03-14 14:39:43 +00:00
buildInputs = [ boost lua protobuf_21 rapidjson shapelib sqlite zlib ];
2022-05-06 15:06:52 +00:00
cmakeFlags = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
2024-03-14 14:39:35 +00:00
(lib.cmakeFeature "PROTOBUF_PROTOC_EXECUTABLE" "${buildPackages.protobuf}/bin/protoc");
2022-05-06 15:06:52 +00:00
env.NIX_CFLAGS_COMPILE = toString [ "-DTM_VERSION=${finalAttrs.version}" ];
2022-09-13 18:56:56 +00:00
2022-05-06 15:06:52 +00:00
postInstall = ''
installManPage ../docs/man/tilemaker.1
2024-03-14 14:39:35 +00:00
install -Dm644 ../resources/*.{json,lua} -t $out/share/tilemaker
cp -r ../server/static $out/share/tilemaker
2022-05-06 15:06:52 +00:00
'';
2022-09-13 18:56:56 +00:00
passthru.tests.version = testers.testVersion {
package = finalAttrs.finalPackage;
command = "tilemaker --help";
};
2022-05-06 15:06:52 +00:00
meta = with lib; {
description = "Make OpenStreetMap vector tiles without the stack";
homepage = "https://tilemaker.org/";
2024-04-20 22:31:52 +00:00
changelog = "https://github.com/systemed/tilemaker/blob/v${finalAttrs.version}/CHANGELOG.md";
2022-05-06 15:06:52 +00:00
license = licenses.free; # FTWPL
maintainers = with maintainers; [ sikmir ];
platforms = platforms.unix;
2024-03-14 14:39:35 +00:00
mainProgram = "tilemaker";
2022-05-06 15:06:52 +00:00
};
2022-09-13 18:56:56 +00:00
})