2020-11-21 19:51:51 +00:00
|
|
|
{ lib, fetchFromGitHub, buildGoModule }:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "pg_featureserv";
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "1.3.1";
|
2020-11-21 19:51:51 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "CrunchyData";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2024-02-29 20:09:43 +00:00
|
|
|
sha256 = "sha256-GsloUZFgrOrJc23vKv+8iSeyIEKblaukPSCpZGRtSL4=";
|
2020-11-21 19:51:51 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
vendorHash = "sha256-BHiEVyi3FXPovYy3iDP8q+y+LgfI4ElDPVZexd7nnuo=";
|
2020-11-21 19:51:51 +00:00
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
postPatch = ''
|
|
|
|
# fix default configuration file location
|
|
|
|
substituteInPlace \
|
|
|
|
internal/conf/config.go \
|
|
|
|
--replace-fail "viper.AddConfigPath(\"/etc\")" "viper.AddConfigPath(\"$out/share/config\")"
|
|
|
|
|
|
|
|
# fix assets location in configuration file
|
|
|
|
substituteInPlace \
|
|
|
|
config/pg_featureserv.toml.example \
|
|
|
|
--replace-fail "AssetsPath = \"./assets\"" "AssetsPath = \"$out/share/assets\""
|
|
|
|
'';
|
|
|
|
|
2021-08-27 14:25:00 +00:00
|
|
|
ldflags = [ "-s" "-w" "-X github.com/CrunchyData/pg_featureserv/conf.setVersion=${version}" ];
|
2020-12-07 07:45:13 +00:00
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/share
|
|
|
|
cp -r assets $out/share
|
|
|
|
|
|
|
|
mkdir -p $out/share/config
|
|
|
|
cp config/pg_featureserv.toml.example $out/share/config/pg_featureserv.toml
|
|
|
|
'';
|
|
|
|
|
2020-11-21 19:51:51 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Lightweight RESTful Geospatial Feature Server for PostGIS in Go";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "pg_featureserv";
|
2020-11-21 19:51:51 +00:00
|
|
|
homepage = "https://github.com/CrunchyData/pg_featureserv";
|
|
|
|
license = licenses.asl20;
|
2024-01-02 11:29:13 +00:00
|
|
|
maintainers = teams.geospatial.members;
|
2020-11-21 19:51:51 +00:00
|
|
|
};
|
|
|
|
}
|