1{ lib, stdenv, pg-dump-anon, postgresql, runtimeShell, jitSupport, llvm }:
2
3stdenv.mkDerivation (finalAttrs: {
4 pname = "postgresql_anonymizer";
5
6 inherit (pg-dump-anon) version src passthru;
7
8 buildInputs = [ postgresql ];
9 nativeBuildInputs = [ postgresql ] ++ lib.optional jitSupport llvm;
10
11 strictDeps = true;
12
13 makeFlags = [
14 "BINDIR=${placeholder "out"}/bin"
15 "datadir=${placeholder "out"}/share/postgresql"
16 "pkglibdir=${placeholder "out"}/lib"
17 "DESTDIR="
18 ];
19
20 postInstall = ''
21 cat >$out/bin/pg_dump_anon.sh <<'EOF'
22 #!${runtimeShell}
23 echo "This script is deprecated by upstream. To use the new script,"
24 echo "please install pkgs.pg-dump-anon."
25 exit 1
26 EOF
27 '';
28
29 meta = lib.getAttrs [ "homepage" "maintainers" "license" ] pg-dump-anon.meta // {
30 description = "Extension to mask or replace personally identifiable information (PII) or commercially sensitive data from a PostgreSQL database";
31 };
32})