pgformatter: init at 4.0

This commit is contained in:
Mario Rodas 2019-09-01 16:20:00 -05:00
parent c2fc61c5f7
commit 0e04dfdccb
No known key found for this signature in database
GPG key ID: 4C4BEFD7B18DC5E8
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

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