From e5c526b403f10cd5c402ec6f643f61041182e7b2 Mon Sep 17 00:00:00 2001 From: Nikolay Korotkiy Date: Thu, 14 Mar 2024 18:39:35 +0400 Subject: [PATCH 1/2] tilemaker: install assets --- pkgs/applications/misc/tilemaker/default.nix | 31 +++++++++++++++----- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/misc/tilemaker/default.nix b/pkgs/applications/misc/tilemaker/default.nix index af4944ea8ba1..9bfc4d88a062 100644 --- a/pkgs/applications/misc/tilemaker/default.nix +++ b/pkgs/applications/misc/tilemaker/default.nix @@ -1,5 +1,18 @@ -{ lib, stdenv, fetchFromGitHub, fetchpatch, buildPackages, cmake, installShellFiles -, boost, lua, protobuf, rapidjson, shapelib, sqlite, zlib, testers }: +{ lib +, stdenv +, fetchFromGitHub +, buildPackages +, cmake +, installShellFiles +, boost +, lua +, protobuf +, rapidjson +, shapelib +, sqlite +, zlib +, testers +}: stdenv.mkDerivation (finalAttrs: { pname = "tilemaker"; @@ -13,9 +26,11 @@ stdenv.mkDerivation (finalAttrs: { }; postPatch = '' - substituteInPlace src/tilemaker.cpp \ - --replace "config.json" "$out/share/tilemaker/config-openmaptiles.json" \ - --replace "process.lua" "$out/share/tilemaker/process-openmaptiles.lua" + 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 ]; @@ -23,13 +38,14 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ boost lua protobuf rapidjson shapelib sqlite zlib ]; cmakeFlags = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) - "-DPROTOBUF_PROTOC_EXECUTABLE=${buildPackages.protobuf}/bin/protoc"; + (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/* -t $out/share/tilemaker + install -Dm644 ../resources/*.{json,lua} -t $out/share/tilemaker + cp -r ../server/static $out/share/tilemaker ''; passthru.tests.version = testers.testVersion { @@ -44,5 +60,6 @@ stdenv.mkDerivation (finalAttrs: { license = licenses.free; # FTWPL maintainers = with maintainers; [ sikmir ]; platforms = platforms.unix; + mainProgram = "tilemaker"; }; }) From ec4b6bd72daeaa1e5904551b738d1d79709a1895 Mon Sep 17 00:00:00 2001 From: Nikolay Korotkiy Date: Thu, 14 Mar 2024 18:39:43 +0400 Subject: [PATCH 2/2] tilemaker: migrate to by-name --- .../default.nix => by-name/ti/tilemaker/package.nix} | 4 ++-- pkgs/top-level/all-packages.nix | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) rename pkgs/{applications/misc/tilemaker/default.nix => by-name/ti/tilemaker/package.nix} (95%) diff --git a/pkgs/applications/misc/tilemaker/default.nix b/pkgs/by-name/ti/tilemaker/package.nix similarity index 95% rename from pkgs/applications/misc/tilemaker/default.nix rename to pkgs/by-name/ti/tilemaker/package.nix index 9bfc4d88a062..6a06e17f1fdd 100644 --- a/pkgs/applications/misc/tilemaker/default.nix +++ b/pkgs/by-name/ti/tilemaker/package.nix @@ -6,7 +6,7 @@ , installShellFiles , boost , lua -, protobuf +, protobuf_21 , rapidjson , shapelib , sqlite @@ -35,7 +35,7 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ cmake installShellFiles ]; - buildInputs = [ boost lua protobuf rapidjson shapelib sqlite zlib ]; + 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"); diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 415d13fadd87..3098737025b2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -35387,10 +35387,6 @@ with pkgs; tijolo = callPackage ../applications/editors/tijolo { }; - tilemaker = callPackage ../applications/misc/tilemaker { - protobuf = protobuf_21; - }; - timbreid = callPackage ../applications/audio/pd-plugins/timbreid { fftw = fftwSinglePrec; };