Merge pull request #191104 from sikmir/tilemaker

tilemaker: fix build
This commit is contained in:
Christian Kögler 2022-09-14 07:36:45 +02:00 committed by GitHub
commit 0eefefc231
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,17 +1,25 @@
{ lib, stdenv, fetchFromGitHub, buildPackages, cmake, installShellFiles { lib, stdenv, fetchFromGitHub, fetchpatch, buildPackages, cmake, installShellFiles
, boost, lua, protobuf, rapidjson, shapelib, sqlite, zlib }: , boost, lua, protobuf, rapidjson, shapelib, sqlite, zlib, testers }:
stdenv.mkDerivation rec { stdenv.mkDerivation (finalAttrs: {
pname = "tilemaker"; pname = "tilemaker";
version = "2.2.0"; version = "2.2.0";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "systemed"; owner = "systemed";
repo = pname; repo = "tilemaker";
rev = "v${version}"; rev = "v${finalAttrs.version}";
hash = "sha256-st6WDCk1RZ2lbfrudtcD+zenntyTMRHrIXw3nX5FHOU="; 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 = '' postPatch = ''
substituteInPlace src/tilemaker.cpp \ substituteInPlace src/tilemaker.cpp \
--replace "config.json" "$out/share/tilemaker/config-openmaptiles.json" \ --replace "config.json" "$out/share/tilemaker/config-openmaptiles.json" \
@ -25,11 +33,18 @@ stdenv.mkDerivation rec {
cmakeFlags = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) cmakeFlags = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
"-DPROTOBUF_PROTOC_EXECUTABLE=${buildPackages.protobuf}/bin/protoc"; "-DPROTOBUF_PROTOC_EXECUTABLE=${buildPackages.protobuf}/bin/protoc";
NIX_CFLAGS_COMPILE = [ "-DTM_VERSION=${finalAttrs.version}" ];
postInstall = '' postInstall = ''
installManPage ../docs/man/tilemaker.1 installManPage ../docs/man/tilemaker.1
install -Dm644 ../resources/* -t $out/share/tilemaker install -Dm644 ../resources/* -t $out/share/tilemaker
''; '';
passthru.tests.version = testers.testVersion {
package = finalAttrs.finalPackage;
command = "tilemaker --help";
};
meta = with lib; { meta = with lib; {
description = "Make OpenStreetMap vector tiles without the stack"; description = "Make OpenStreetMap vector tiles without the stack";
homepage = "https://tilemaker.org/"; homepage = "https://tilemaker.org/";
@ -37,4 +52,4 @@ stdenv.mkDerivation rec {
maintainers = with maintainers; [ sikmir ]; maintainers = with maintainers; [ sikmir ];
platforms = platforms.unix; platforms = platforms.unix;
}; };
} })