summaryrefslogtreecommitdiffstats
path: root/src/pl/plpython/meson.build
blob: 98b7d7c7af7a14a13b8d9f5aede77be29dc88c6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# Copyright (c) 2022-2023, PostgreSQL Global Development Group

if not python3_dep.found()
  subdir_done()
endif

plpython_sources = files(
  'plpy_cursorobject.c',
  'plpy_elog.c',
  'plpy_exec.c',
  'plpy_main.c',
  'plpy_planobject.c',
  'plpy_plpymodule.c',
  'plpy_procedure.c',
  'plpy_resultobject.c',
  'plpy_spi.c',
  'plpy_subxactobject.c',
  'plpy_typeio.c',
  'plpy_util.c',
)

plpython_sources += custom_target('spiexceptions.h',
  input: files('../../backend/utils/errcodes.txt'),
  output: 'spiexceptions.h',
  command: [perl, files('generate-spiexceptions.pl'), '@INPUT@'],
  capture: true,
)


# FIXME: need to duplicate import library ugliness?
plpython_inc = include_directories('.')

if host_system == 'windows'
  plpython_sources += rc_lib_gen.process(win32ver_rc, extra_args: [
    '--NAME', 'plpython3',
    '--FILEDESC', 'PL/Python - procedural language',])
endif

plpython = shared_module('plpython3',
  plpython_sources,
  c_pch: pch_postgres_h,
  include_directories: [plpython_inc, postgres_inc],
  kwargs: pg_mod_args + {
    'dependencies': [python3_dep, pg_mod_args['dependencies']],
  },
)
pl_targets += plpython

# FIXME: Only install the relevant versions
install_data(
  'plpython3u.control',
  'plpython3u--1.0.sql',
  install_dir: dir_data_extension,
)

install_headers(
  'plpy_cursorobject.h',
  'plpy_elog.h',
  'plpy_exec.h',
  'plpy_main.h',
  'plpy_planobject.h',
  'plpy_plpymodule.h',
  'plpy_procedure.h',
  'plpy_resultobject.h',
  'plpy_spi.h',
  'plpy_subxactobject.h',
  'plpy_typeio.h',
  'plpy_util.h',
  'plpython.h',
  'plpython_system.h',
  install_dir: dir_include_server,
)

plpython_regress = [
  'plpython_schema',
  'plpython_populate',
  'plpython_test',
  'plpython_do',
  'plpython_global',
  'plpython_import',
  'plpython_spi',
  'plpython_newline',
  'plpython_void',
  'plpython_call',
  'plpython_params',
  'plpython_setof',
  'plpython_record',
  'plpython_trigger',
  'plpython_types',
  'plpython_error',
  'plpython_ereport',
  'plpython_unicode',
  'plpython_quote',
  'plpython_composite',
  'plpython_subtransaction',
  'plpython_transaction',
  'plpython_drop',
]

tests += {
  'name': 'plpython',
  'sd': meson.current_source_dir(),
  'bd': meson.current_build_dir(),
  'regress': {
    'sql': plpython_regress,
  },
}

subdir('po', if_found: libintl)