about summary refs log tree commit diff
path: root/pkgs/servers/geospatial/pg_tileserv/default.nix
blob: 80b8c23bee1a818ffe39018a2b02633d088284be (plain) (blame)
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
31
32
33
34
35
36
{ lib, fetchFromGitHub, fetchpatch, buildGoModule }:

buildGoModule rec {
  pname = "pg_tileserv";
  version = "1.0.10";

  src = fetchFromGitHub {
    owner = "CrunchyData";
    repo = "pg_tileserv";
    rev = "v${version}";
    hash = "sha256-Y8GAmWpnXQGmFcy44wFUQGpA8OvT7u1rY1ZGNg1Qwgs=";
  };

  patches = [
    # Without this, we get error messages like:
    # vendor/golang.org/x/sys/unix/syscall.go:83:16: unsafe.Slice requires go1.17 or later (-lang was set to go1.16; check go.mod)
    # The patch was generated by changing "go 1.15" to "go 1.17" and executing `go mod tidy`.
    (fetchpatch {
      url = "https://github.com/CrunchyData/pg_tileserv/commit/d8e01469344895267ead9fa35ee7bdb8f966a710.patch";
      hash = "sha256-1P3dV8h51X+MEH2u1n6RxZvBPXBpQWrZBBCTOoCEWQU=";
    })
  ];

  vendorHash = "sha256-gXJFuvJ2d/e91TAtBzV3p2MwriJtUlIuNRw1+3iXJBA=";

  ldflags = [ "-s" "-w" "-X main.programVersion=${version}" ];

  doCheck = false;

  meta = with lib; {
    description = "A very thin PostGIS-only tile server in Go";
    homepage = "https://github.com/CrunchyData/pg_tileserv";
    license = licenses.asl20;
    maintainers = teams.geospatial.members;
  };
}