fork
Configure Feed
Select the types of activity you want to include in your feed.
nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
fork
Configure Feed
Select the types of activity you want to include in your feed.
1{ lib, stdenv, perlPackages, fetchFromGitHub, shortenPerlShebang }:
2
3perlPackages.buildPerlPackage rec {
4 pname = "pgformatter";
5 version = "5.1";
6
7 src = fetchFromGitHub {
8 owner = "darold";
9 repo = "pgFormatter";
10 rev = "v${version}";
11 sha256 = "1a6rmph96s7c8lpmpkizcvdf0x4jlsr5iqi7qjprxqsf6zak2rfg";
12 };
13
14 outputs = [ "out" ];
15
16 makeMakerFlags = [ "INSTALLDIRS=vendor" ];
17
18 # Avoid creating perllocal.pod, which contains a timestamp
19 installTargets = [ "pure_install" ];
20
21 # Makefile.PL only accepts DESTDIR and INSTALLDIRS, but we need to set more to make this work for NixOS.
22 patchPhase = ''
23 substituteInPlace pg_format \
24 --replace "#!/usr/bin/env perl" "#!/usr/bin/perl"
25 substituteInPlace Makefile.PL \
26 --replace "'DESTDIR' => \$DESTDIR," "'DESTDIR' => '$out/'," \
27 --replace "'INSTALLDIRS' => \$INSTALLDIRS," "'INSTALLDIRS' => \$INSTALLDIRS, 'INSTALLVENDORLIB' => 'bin/lib', 'INSTALLVENDORBIN' => 'bin', 'INSTALLVENDORSCRIPT' => 'bin', 'INSTALLVENDORMAN1DIR' => 'share/man/man1', 'INSTALLVENDORMAN3DIR' => 'share/man/man3',"
28 '';
29
30 nativeBuildInputs = lib.optional stdenv.isDarwin shortenPerlShebang;
31 postInstall = lib.optionalString stdenv.isDarwin ''
32 shortenPerlShebang $out/bin/pg_format
33 '';
34
35 doCheck = false;
36
37 meta = with lib; {
38 description = "A PostgreSQL SQL syntax beautifier that can work as a console program or as a CGI";
39 homepage = "https://github.com/darold/pgFormatter";
40 changelog = "https://github.com/darold/pgFormatter/releases/tag/v${version}";
41 maintainers = [ maintainers.marsam ];
42 license = [ licenses.postgresql licenses.artistic2 ];
43 };
44}