1{
2 buildEnv,
3 postgresql,
4 postgresqlTestExtension,
5 python3,
6}:
7
8let
9 withPackages =
10 f:
11 let
12 python = python3.withPackages f;
13 finalPackage = buildEnv {
14 name = "${postgresql.pname}-plpython3-${postgresql.version}";
15 paths = [ postgresql.plpython3 ];
16 passthru = {
17 inherit withPackages;
18 wrapperArgs = [
19 ''--set PYTHONPATH "${python}/${python.sitePackages}"''
20 ];
21 tests.extension = postgresqlTestExtension {
22 finalPackage = finalPackage.withPackages (ps: [ ps.base58 ]);
23 sql = ''
24 CREATE EXTENSION plpython3u;
25 DO LANGUAGE plpython3u $$
26 import base58
27 $$;
28 '';
29 };
30 };
31 meta = {
32 inherit (postgresql.meta)
33 homepage
34 license
35 changelog
36 teams
37 platforms
38 ;
39 description = "PL/Python - Python Procedural Language";
40 };
41 };
42 in
43 finalPackage;
44in
45withPackages (_: [ ])