pgformatter: init at 4.0
This commit is contained in:
parent
c2fc61c5f7
commit
0e04dfdccb
2 changed files with 42 additions and 0 deletions
40
pkgs/development/tools/pgformatter/default.nix
Normal file
40
pkgs/development/tools/pgformatter/default.nix
Normal 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 ];
|
||||
};
|
||||
}
|
|
@ -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 { };
|
||||
|
|
Loading…
Reference in a new issue