{ lib, stdenv, fetchFromGitHub, postgresql, postgresqlTestExtension }: stdenv.mkDerivation (finalAttrs: { pname = "plpgsql-check"; version = "2.7.5"; src = fetchFromGitHub { owner = "okbob"; repo = "plpgsql_check"; rev = "v${finalAttrs.version}"; hash = "sha256-CD/G/wX6o+mC6gowlpFe1DdJWyh3cB9wxSsW2GXrENE="; }; buildInputs = [ postgresql ]; installPhase = '' install -D -t $out/lib *${postgresql.dlSuffix} install -D -t $out/share/postgresql/extension *.sql install -D -t $out/share/postgresql/extension *.control ''; passthru.tests.extension = postgresqlTestExtension { inherit (finalAttrs) finalPackage; sql = "CREATE EXTENSION plpgsql_check;"; }; meta = with lib; { description = "Linter tool for language PL/pgSQL"; homepage = "https://github.com/okbob/plpgsql_check"; changelog = "https://github.com/okbob/plpgsql_check/releases/tag/v${finalAttrs.version}"; platforms = postgresql.meta.platforms; license = licenses.mit; maintainers = [ ]; }; })