1{ lib, stdenv, fetchFromGitHub, curl, postgresql }:
2
3stdenv.mkDerivation rec {
4 pname = "pgsql-http";
5 version = "1.6.0";
6
7 src = fetchFromGitHub {
8 owner = "pramsey";
9 repo = "pgsql-http";
10 rev = "v${version}";
11 hash = "sha256-CPHfx7vhWfxkXsoKTzyFuTt47BPMvzi/pi1leGcuD60=";
12 };
13
14 buildInputs = [ curl postgresql ];
15
16 installPhase = ''
17 install -D -t $out/lib *${postgresql.dlSuffix}
18 install -D -t $out/share/postgresql/extension *.sql
19 install -D -t $out/share/postgresql/extension *.control
20 '';
21
22 meta = with lib; {
23 description = "HTTP client for PostgreSQL, retrieve a web page from inside the database";
24 homepage = "https://github.com/pramsey/pgsql-http";
25 changelog = "https://github.com/pramsey/pgsql-http/releases/tag/v${version}";
26 maintainers = [ maintainers.marsam ];
27 platforms = postgresql.meta.platforms;
28 license = licenses.mit;
29 };
30}