| 1 |
# Copyright (c) 2022-2025, PostgreSQL Global Development Group |
| 2 |
|
| 3 |
if not ssl.found() |
| 4 |
subdir_done() |
| 5 |
endif |
| 6 |
|
| 7 |
pgcrypto_sources = files( |
| 8 |
'crypt-blowfish.c', |
| 9 |
'crypt-des.c', |
| 10 |
'crypt-gensalt.c', |
| 11 |
'crypt-md5.c', |
| 12 |
'crypt-sha.c', |
| 13 |
'mbuf.c', |
| 14 |
'pgcrypto.c', |
| 15 |
'pgp-armor.c', |
| 16 |
'pgp-cfb.c', |
| 17 |
'pgp-compress.c', |
| 18 |
'pgp-decrypt.c', |
| 19 |
'pgp-encrypt.c', |
| 20 |
'pgp-info.c', |
| 21 |
'pgp-mpi.c', |
| 22 |
'pgp-pgsql.c', |
| 23 |
'pgp-pubdec.c', |
| 24 |
'pgp-pubenc.c', |
| 25 |
'pgp-pubkey.c', |
| 26 |
'pgp-s2k.c', |
| 27 |
'pgp.c', |
| 28 |
'px-crypt.c', |
| 29 |
'px-hmac.c', |
| 30 |
'px.c', |
| 31 |
) |
| 32 |
|
| 33 |
pgcrypto_regress = [ |
| 34 |
'init', |
| 35 |
'md5', |
| 36 |
'sha1', |
| 37 |
'hmac-md5', |
| 38 |
'hmac-sha1', |
| 39 |
'blowfish', |
| 40 |
'rijndael', |
| 41 |
'sha2', |
| 42 |
'des', |
| 43 |
'3des', |
| 44 |
'cast5', |
| 45 |
'crypt-des', |
| 46 |
'crypt-md5', |
| 47 |
'crypt-blowfish', |
| 48 |
'crypt-xdes', |
| 49 |
'pgp-armor', |
| 50 |
'pgp-decrypt', |
| 51 |
'pgp-encrypt', |
| 52 |
'pgp-encrypt-md5', |
| 53 |
'pgp-pubkey-decrypt', |
| 54 |
'pgp-pubkey-encrypt', |
| 55 |
'pgp-pubkey-session', |
| 56 |
'pgp-info', |
| 57 |
'crypt-shacrypt' |
| 58 |
] |
| 59 |
|
| 60 |
pgcrypto_openssl_sources = files( |
| 61 |
'openssl.c', |
| 62 |
'pgp-mpi-openssl.c', |
| 63 |
) |
| 64 |
|
| 65 |
pgcrypto_deps = [] |
| 66 |
pgcrypto_link_with = [] |
| 67 |
|
| 68 |
pgcrypto_deps += ssl |
| 69 |
pgcrypto_sources += pgcrypto_openssl_sources |
| 70 |
|
| 71 |
if zlib.found() |
| 72 |
pgcrypto_deps += zlib |
| 73 |
pgcrypto_regress += 'pgp-compression' |
| 74 |
else |
| 75 |
pgcrypto_regress += 'pgp-zlib-DISABLED' |
| 76 |
endif |
| 77 |
|
| 78 |
if host_system == 'windows' |
| 79 |
pgcrypto_sources += rc_lib_gen.process(win32ver_rc, extra_args: [ |
| 80 |
'--NAME', 'pgcrypto', |
| 81 |
'--FILEDESC', 'pgcrypto - cryptographic functions',]) |
| 82 |
endif |
| 83 |
|
| 84 |
pgcrypto = shared_module('pgcrypto', |
| 85 |
pgcrypto_sources, |
| 86 |
link_with: pgcrypto_link_with, |
| 87 |
c_pch: pch_postgres_h, |
| 88 |
kwargs: contrib_mod_args + { |
| 89 |
'dependencies': [pgcrypto_deps, contrib_mod_args['dependencies']] |
| 90 |
}, |
| 91 |
) |
| 92 |
contrib_targets += pgcrypto |
| 93 |
|
| 94 |
install_data( |
| 95 |
'pgcrypto--1.0--1.1.sql', |
| 96 |
'pgcrypto--1.1--1.2.sql', |
| 97 |
'pgcrypto--1.2--1.3.sql', |
| 98 |
'pgcrypto--1.3.sql', |
| 99 |
'pgcrypto--1.3--1.4.sql', |
| 100 |
'pgcrypto.control', |
| 101 |
kwargs: contrib_data_args, |
| 102 |
) |
| 103 |
|
| 104 |
|
| 105 |
tests += { |
| 106 |
'name': 'pgcrypto', |
| 107 |
'sd': meson.current_source_dir(), |
| 108 |
'bd': meson.current_build_dir(), |
| 109 |
'regress': { |
| 110 |
'sql': [ |
| 111 |
pgcrypto_regress, |
| 112 |
], |
| 113 |
}, |
| 114 |
} |