summaryrefslogtreecommitdiffstats
path: root/pkgs/servers/mbtileserver/default.nix
blob: 9b6467ede9bbbe2f50d584f39e01aed2510555b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{ lib, stdenv, buildGoModule, fetchFromGitHub }:

buildGoModule rec {
  pname = "mbtileserver";
  version = "0.8.0";

  src = fetchFromGitHub {
    owner = "consbio";
    repo = pname;
    rev = "v${version}";
    sha256 = "sha256-0wSc2DIfK6o3kSiH2sSQcYRR5dHnQbnJC6SX6DwVk1c=";
  };

  # https://github.com/consbio/mbtileserver/issues/130
  postPatch = lib.optionalString stdenv.isAarch64 ''
    substituteInPlace handlers/tile_test.go \
      --replace "Test_CalcScaleResolution" "Skip_CalcScaleResolution"
  '';

  vendorSha256 = "sha256-36tUTZud0hxH9oZlnKxeK/xzoEzfw3xFMnd/r0srw6U=";

  meta = with lib; {
    description = "A simple Go-based server for map tiles stored in mbtiles format";
    homepage = "https://github.com/consbio/mbtileserver";
    changelog = "https://github.com/consbio/mbtileserver/blob/v${version}/CHANGELOG.md";
    license = licenses.isc;
    maintainers = with maintainers; [ sikmir ];
    platforms = platforms.unix;
  };
}