@@ -0,0 +1,32 @@
1+{ stdenv, fetchFromGitHub, postgresql, perl, perlPackages, which }:
2+
3+stdenv.mkDerivation rec {
4+ name = "pgtap-${version}";
5+ version = "0.97.0";
6+
7+ src = fetchFromGitHub {
8+ owner = "theory";
9+ repo = "pgtap";
10+ rev = "v${version}";
11+ sha256 = "1vzc8pxzi0rbywmrvx7i5awngsvzcz75i4jl9bk2vqr223chax6f";
12+ };
13+
14+ nativeBuildInputs = [ postgresql perl perlPackages.TAPParserSourceHandlerpgTAP which ];
15+
16+ installPhase = ''
17+ install -D {sql/pgtap--${version}.sql,pgtap.control} -t $out/share/extension
18+ '';
19+
20+ meta = with stdenv.lib; {
21+ description = "pgTAP is a unit testing framework for PostgreSQL";
22+ longDescription = ''
23+ pgTAP is a unit testing framework for PostgreSQL written in PL/pgSQL and PL/SQL.
24+ It includes a comprehensive collection of TAP-emitting assertion functions,
25+ as well as the ability to integrate with other TAP-emitting test frameworks.
26+ It can also be used in the xUnit testing style.
27+ '';
28+ maintainers = with maintainers; [ willibutz ];
29+ homepage = http://pgtap.org;
30+ inherit (postgresql.meta) platforms;
31+ };
32+}