Skip to content

Commit

Permalink
tilemaker: fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
sikmir committed Sep 13, 2022
1 parent 29f97be commit 53b7d55
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions pkgs/applications/misc/tilemaker/default.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
{ lib, stdenv, fetchFromGitHub, buildPackages, cmake, installShellFiles
, boost, lua, protobuf, rapidjson, shapelib, sqlite, zlib }:
{ lib, stdenv, fetchFromGitHub, fetchpatch, buildPackages, cmake, installShellFiles
, boost, lua, protobuf, rapidjson, shapelib, sqlite, zlib, testers }:

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "tilemaker";
version = "2.2.0";

src = fetchFromGitHub {
owner = "systemed";
repo = pname;
rev = "v${version}";
repo = "tilemaker";
rev = "v${finalAttrs.version}";
hash = "sha256-st6WDCk1RZ2lbfrudtcD+zenntyTMRHrIXw3nX5FHOU=";
};

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=";
})
];

postPatch = ''
substituteInPlace src/tilemaker.cpp \
--replace "config.json" "$out/share/tilemaker/config-openmaptiles.json" \
Expand All @@ -25,16 +33,23 @@ stdenv.mkDerivation rec {
cmakeFlags = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
"-DPROTOBUF_PROTOC_EXECUTABLE=${buildPackages.protobuf}/bin/protoc";

NIX_CFLAGS_COMPILE = [ "-DTM_VERSION=${finalAttrs.version}" ];

postInstall = ''
installManPage ../docs/man/tilemaker.1
install -Dm644 ../resources/* -t $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/";
license = licenses.free; # FTWPL
maintainers = with maintainers; [ sikmir ];
platforms = platforms.unix;
};
}
})

0 comments on commit 53b7d55

Please sign in to comment.