diff options
author | Nikolay Korotkiy <sikmir@disroot.org> | 2024-03-14 18:39:43 +0400 |
---|---|---|
committer | Nikolay Korotkiy <sikmir@disroot.org> | 2024-03-14 18:39:43 +0400 |
commit | ec4b6bd72daeaa1e5904551b738d1d79709a1895 (patch) | |
tree | 18fc07674d6b43c2ec73cc88c9086a521d74f0a4 /pkgs/by-name/ti | |
parent | e5c526b403f10cd5c402ec6f643f61041182e7b2 (diff) |
tilemaker: migrate to by-name
Diffstat (limited to 'pkgs/by-name/ti')
-rw-r--r-- | pkgs/by-name/ti/tilemaker/package.nix | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/pkgs/by-name/ti/tilemaker/package.nix b/pkgs/by-name/ti/tilemaker/package.nix new file mode 100644 index 0000000000000..6a06e17f1fdda --- /dev/null +++ b/pkgs/by-name/ti/tilemaker/package.nix @@ -0,0 +1,65 @@ +{ lib +, stdenv +, fetchFromGitHub +, buildPackages +, cmake +, installShellFiles +, boost +, lua +, protobuf_21 +, rapidjson +, shapelib +, sqlite +, zlib +, testers +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "tilemaker"; + version = "3.0.0"; + + src = fetchFromGitHub { + owner = "systemed"; + repo = "tilemaker"; + rev = "v${finalAttrs.version}"; + hash = "sha256-rB5oP03yaIzklwkGsIeS9ELbHOY9AObwjRrK9HBQFI4="; + }; + + postPatch = '' + 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\")" + ''; + + nativeBuildInputs = [ cmake installShellFiles ]; + + buildInputs = [ boost lua protobuf_21 rapidjson shapelib sqlite zlib ]; + + cmakeFlags = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) + (lib.cmakeFeature "PROTOBUF_PROTOC_EXECUTABLE" "${buildPackages.protobuf}/bin/protoc"); + + env.NIX_CFLAGS_COMPILE = toString [ "-DTM_VERSION=${finalAttrs.version}" ]; + + postInstall = '' + installManPage ../docs/man/tilemaker.1 + install -Dm644 ../resources/*.{json,lua} -t $out/share/tilemaker + cp -r ../server/static $out/share/tilemaker + ''; + + passthru.tests.version = testers.testVersion { + package = finalAttrs.finalPackage; + command = "tilemaker --help"; + }; + + meta = with lib; { + description = "Make OpenStreetMap vector tiles without the stack"; + homepage = "https://tilemaker.org/"; + changelog = "https://github.com/systemed/tilemaker/blob/v${version}/CHANGELOG.md"; + license = licenses.free; # FTWPL + maintainers = with maintainers; [ sikmir ]; + platforms = platforms.unix; + mainProgram = "tilemaker"; + }; +}) |