meson.build (4194B)
1 # This Makefile.am is in the public domain 2 3 plugindir = get_option('libdir') / 'anastasis' 4 sqldir = get_option('datadir') / 'anastasis' / 'sql' 5 6 install_data( 7 'versioning.sql', 8 'stasis-0001.sql', 9 'stasis-0002.sql', 10 'stasis-0003.sql', 11 'stasis-0004.sql', 12 'drop.sql', 13 install_dir: sqldir, 14 ) 15 16 # Stored procedures are not schema: they are dropped and recreated on every 17 # anastasis-dbinit, so fixing one does not need a new migration. Keep the 18 # list in the same order as libanastasisdb_SOURCES. 19 procedures_sql = [ 20 'procedures-prelude.sql', 21 'do_gc.sql', 22 'do_insert_recdoc_payment.sql', 23 'do_update_account_lifetime.sql', 24 'commit.sql', 25 ] 26 27 custom_target( 28 'gen-stasis-procedures.sql', 29 input: procedures_sql, 30 output: 'procedures.sql', 31 capture: true, 32 command: ['./amalgamate-sql.sh', '@INPUT@'], 33 install: true, 34 install_dir: sqldir, 35 ) 36 37 install_data('stasis-postgres.conf', install_dir: pkgcfgdir) 38 39 libanastasisdb_SOURCES = [ 40 'anastasis-db_pg.c', 41 'preflight.c', 42 'create_tables.c', 43 'drop_tables.c', 44 'do_gc.c', 45 'get_challenge_payment.c', 46 'get_recdoc_payment.c', 47 'get_truth_payment.c', 48 'insert_challenge_code.c', 49 'get_truth.c', 50 'get_truth_key_share.c', 51 'get_last_auth_iban_in_row.c', 52 'get_latest_recovery_document.c', 53 'get_recovery_document.c', 54 'iterate_recovery_meta_data.c', 55 'get_account.c', 56 'get_pending_challenge_payment.c', 57 'update_to_challenge_code_satisfied.c', 58 'update_totp_counter.c', 59 'update_auth_iban_in_currency.c', 60 'update_to_challenge_code_sent.c', 61 'insert_auth_iban_in.c', 62 'insert_challenge_payment.c', 63 'update_to_challenge_payment_refunded.c', 64 'do_insert_recdoc_payment.c', 65 'insert_truth_payment.c', 66 'do_insert_recovery_document.c', 67 'insert_truth.c', 68 'iterate_auth_iban_transfers.c', 69 'get_exists_challenge_code_satisfied.c', 70 'update_to_challenge_payment_paid.c', 71 'do_update_account_lifetime.c', 72 'do_verify_challenge_code.c', 73 ] 74 75 libanastasisdb = library( 76 'anastasisdb', 77 libanastasisdb_SOURCES, 78 soversion: solibversions['libanastasisdb']['soversion'], 79 version: solibversions['libanastasisdb']['soversion'], 80 install_rpath: rpath_option, 81 dependencies: [ 82 gnunetutil_dep, 83 gnunetpq_dep, 84 pq_dep, 85 talerpq_dep, 86 talerutil_dep, 87 libanastasisutil_dep, 88 ], 89 include_directories: [incdir, configuration_inc], 90 install: true, 91 install_dir: get_option('libdir'), 92 ) 93 94 libanastasisdb_dep = declare_dependency(link_with: libanastasisdb) 95 pkg.generate( 96 libanastasisdb, 97 url: 'https://taler.net', 98 description: 'GNU Taler anastasis DB utilities library', 99 ) 100 101 102 executable( 103 'anastasis-dbinit', 104 ['anastasis-dbinit.c'], 105 dependencies: [ 106 libanastasisutil_dep, 107 libanastasisdb_dep, 108 gnunetutil_dep, 109 gcrypt_dep, 110 talerutil_dep, 111 talerpq_dep, 112 ], 113 include_directories: [incdir, configuration_inc], 114 install: true, 115 ) 116 117 test_anastasis_db_postgres = executable( 118 'test_anastasis_db-postgres', 119 ['test_anastasis_db.c'], 120 dependencies: [ 121 libanastasisutil_dep, 122 libanastasisdb_dep, 123 gnunetutil_dep, 124 talerutil_dep, 125 talerpq_dep, 126 gnunetpq_dep, 127 json_dep, 128 ], 129 include_directories: [incdir, configuration_inc], 130 build_by_default: false, 131 install: false, 132 ) 133 test( 134 'test_anastasis_db_postgres', 135 test_anastasis_db_postgres, 136 workdir: meson.current_build_dir(), 137 suite: ['stasis'], 138 is_parallel: false, 139 ) 140 141 142 configure_file( 143 input: 'test_anastasis_db_postgres.conf', 144 output: 'test_anastasis_db_postgres.conf', 145 copy: true, 146 ) 147 148 149 # Enforce the database layer naming convention (see contrib/check-db-naming.py 150 # and the rules it implements). Needs no database, only the sources. 151 python3_bin = find_program('python3', required: false) 152 if python3_bin.found() 153 test( 154 'check_db_naming', 155 python3_bin, 156 args: [meson.project_source_root() / 'contrib' / 'check-db-naming.py'], 157 workdir: meson.project_source_root(), 158 suite: ['stasis'], 159 ) 160 endif