Merge pull request #67905 from marsam/add-pgformatter

pgformatter: init at 4.0
This commit is contained in:
Mario Rodas 2019-09-15 11:38:08 -05:00 committed by GitHub
commit edc033a616
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,40 @@
{ stdenv, perlPackages, fetchFromGitHub, shortenPerlShebang }:
perlPackages.buildPerlPackage rec {
pname = "pgformatter";
version = "4.0";
src = fetchFromGitHub {
owner = "darold";
repo = "pgFormatter";
rev = "v${version}";
sha256 = "09p242s406mf469p66zp1jmp9pxcim2vk1v6qsxnrbzicchsn5i2";
};
outputs = [ "out" ];
makeMakerFlags = [ "INSTALLDIRS=vendor" ];
# Makefile.PL only accepts DESTDIR and INSTALLDIRS, but we need to set more to make this work for NixOS.
patchPhase = ''
substituteInPlace pg_format \
--replace "#!/usr/bin/env perl" "#!/usr/bin/perl"
substituteInPlace Makefile.PL \
--replace "'DESTDIR' => \$DESTDIR," "'DESTDIR' => '$out/'," \
--replace "'INSTALLDIRS' => \$INSTALLDIRS," "'INSTALLDIRS' => \$INSTALLDIRS, 'INSTALLVENDORLIB' => 'bin/lib', 'INSTALLVENDORBIN' => 'bin', 'INSTALLVENDORSCRIPT' => 'bin', 'INSTALLVENDORMAN1DIR' => 'share/man/man1', 'INSTALLVENDORMAN3DIR' => 'share/man/man3',"
'';
nativeBuildInputs = stdenv.lib.optional stdenv.isDarwin shortenPerlShebang;
postInstall = stdenv.lib.optionalString stdenv.isDarwin ''
shortenPerlShebang $out/bin/pg_format
'';
doCheck = false;
meta = with stdenv.lib; {
description = "A PostgreSQL SQL syntax beautifier that can work as a console program or as a CGI";
homepage = "https://github.com/darold/pgFormatter";
maintainers = [ maintainers.marsam ];
license = [ licenses.postgresql licenses.artistic2 ];
};
}

View File

@ -3677,6 +3677,8 @@ in
pgf_graphics = callPackage ../tools/graphics/pgf { };
pgformatter = callPackage ../development/tools/pgformatter { };
pgloader = callPackage ../development/tools/pgloader { };
pigz = callPackage ../tools/compression/pigz { };