diff options
author | Mario Rodas <marsam@users.noreply.github.com> | 2019-09-15 11:38:08 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-15 11:38:08 -0500 |
commit | edc033a6165f4bb8f64799e285edce16700d3d21 (patch) | |
tree | 45b2e03d5cd99c16dd66bd1947a661cbb4011569 /pkgs | |
parent | 3857d3d6f996b53e063dc15a0fc604a1b8582681 (diff) | |
parent | 0e04dfdccb50c3e0a8f43429a638a2239a1e494d (diff) |
Merge pull request #67905 from marsam/add-pgformatter
pgformatter: init at 4.0
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/development/tools/pgformatter/default.nix | 40 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 2 |
2 files changed, 42 insertions, 0 deletions
diff --git a/pkgs/development/tools/pgformatter/default.nix b/pkgs/development/tools/pgformatter/default.nix new file mode 100644 index 0000000000000..5d8376acdb39b --- /dev/null +++ b/pkgs/development/tools/pgformatter/default.nix @@ -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 ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index db16c9d5143fa..f478f638f6336 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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 { }; |