hyprpaper: 0.7.3 -> 0.7.4 (#376464)
[NixPkgs.git] / pkgs / by-name / ti / tilemaker / package.nix
blob02316a1b9a0c65155fa87872f41be69e6cd28e33
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   buildPackages,
6   cmake,
7   installShellFiles,
8   boost,
9   lua,
10   protobuf_21,
11   rapidjson,
12   shapelib,
13   sqlite,
14   zlib,
15   testers,
18 stdenv.mkDerivation (finalAttrs: {
19   pname = "tilemaker";
20   version = "3.0.0";
22   src = fetchFromGitHub {
23     owner = "systemed";
24     repo = "tilemaker";
25     rev = "v${finalAttrs.version}";
26     hash = "sha256-rB5oP03yaIzklwkGsIeS9ELbHOY9AObwjRrK9HBQFI4=";
27   };
29   postPatch = ''
30     substituteInPlace src/options_parser.cpp \
31       --replace-fail "config.json" "$out/share/tilemaker/config-openmaptiles.json" \
32       --replace-fail "process.lua" "$out/share/tilemaker/process-openmaptiles.lua"
33     substituteInPlace server/server.cpp \
34       --replace-fail "default_value(\"static\")" "default_value(\"$out/share/tilemaker/static\")"
35   '';
37   nativeBuildInputs = [
38     cmake
39     installShellFiles
40   ];
42   buildInputs = [
43     boost
44     lua
45     protobuf_21
46     rapidjson
47     shapelib
48     sqlite
49     zlib
50   ];
52   cmakeFlags = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) (
53     lib.cmakeFeature "PROTOBUF_PROTOC_EXECUTABLE" "${buildPackages.protobuf}/bin/protoc"
54   );
56   env.NIX_CFLAGS_COMPILE = toString [ "-DTM_VERSION=${finalAttrs.version}" ];
58   postInstall = ''
59     installManPage ../docs/man/tilemaker.1
60     install -Dm644 ../resources/*.{json,lua} -t $out/share/tilemaker
61     cp -r ../server/static $out/share/tilemaker
62   '';
64   passthru.tests.version = testers.testVersion {
65     package = finalAttrs.finalPackage;
66     command = "tilemaker --help";
67   };
69   meta = with lib; {
70     description = "Make OpenStreetMap vector tiles without the stack";
71     homepage = "https://tilemaker.org/";
72     changelog = "https://github.com/systemed/tilemaker/blob/v${finalAttrs.version}/CHANGELOG.md";
73     license = licenses.free; # FTWPL
74     maintainers = with maintainers; [ sikmir ];
75     platforms = platforms.unix;
76     mainProgram = "tilemaker";
77   };