donau

Donation authority for GNU Taler (experimental)
Log | Files | Refs | Submodules | README | LICENSE

meson.build (3712B)


      1 # This build file is in the public domain
      2 
      3 install_data('donaudb.conf', 'donaudb-postgres.conf', install_dir: pkgcfgdir)
      4 
      5 sqldir = get_option('datadir') / 'donau' / 'sql'
      6 
      7 donau_0002 = [
      8     '0002-preamble.sql',
      9     '0002-donation_units.sql',
     10     '0002-donau_charities.sql',
     11     '0002-donau_history.sql',
     12     '0002-donau_receipts_issued.sql',
     13     '0002-donau_receipts_submitted.sql',
     14     '0002-donau_sign_keys.sql',
     15     'commit.sql',
     16 ]
     17 
     18 procedures_sql = [
     19     'procedures-preamble.sql',
     20     'donau_do_amount_specific.sql',
     21     'insert_receipts_submitted.sql',
     22     'do_insert_receipt_issued.sql',
     23     'insert_charity.sql',
     24     'update_charity.sql',
     25     'delete_charity.sql',
     26     'commit.sql',
     27 ]
     28 
     29 generated_sql = [
     30     ['drop.sql', ['drop.sql']],
     31     ['versioning.sql', ['versioning.sql']],
     32     ['procedures.sql', procedures_sql],
     33     ['donau-0001.sql', ['donau-0001.sql']],
     34     ['donau-0002.sql', donau_0002],
     35     ['donau-0003.sql', ['donau-0003.sql']],
     36 ]
     37 
     38 
     39 foreach g : generated_sql
     40     custom_target(
     41         'gen-merchantdb-' + g[0],
     42         input: g[1],
     43         output: g[0],
     44         capture: true,
     45         command: ['./amalgamate-sql.sh', '@INPUT@'],
     46         install: true,
     47         install_dir: sqldir,
     48     )
     49 endforeach
     50 
     51 
     52 
     53 
     54 test_idem = configure_file(
     55     input: 'test_idempotency.sh',
     56     output: 'test_idempotency.sh',
     57     copy: true,
     58 )
     59 
     60 test(
     61     'test_idempotency.sh',
     62     test_idem,
     63     workdir: meson.current_build_dir(),
     64     suite: ['donaudb', 'installcheck'],
     65 )
     66 
     67 
     68 libdonaudb = library(
     69     'donaudb',
     70     [
     71         'plugin_donaudb_postgres.c',
     72         'preflight.c',
     73         'commit.c',
     74         'drop_tables.c',
     75         'create_tables.c',
     76         'event_listen.c',
     77         'event_listen_cancel.c',
     78         'event_notify.c',
     79         'start.c',
     80         'rollback.c',
     81         'start_read_committed.c',
     82         'start_read_only.c',
     83         'insert_signkey.c',
     84         'get_signkey.c',
     85         'iterate_active_signkeys.c',
     86         'insert_donation_unit.c',
     87         'iterate_donation_units.c',
     88         'get_receipts_submitted_total.c',
     89         'iterate_history_entries.c',
     90         'iterate_charities.c',
     91         'insert_charity.c',
     92         'update_charity.c',
     93         'delete_charity.c',
     94         'insert_history_entry.c',
     95         'get_charity.c',
     96         'get_receipt_issued.c',
     97         'get_donation_unit_amount.c',
     98         'do_insert_receipt_issued.c',
     99         'insert_receipts_submitted.c',
    100     ],
    101     soversion: solibversions['libdonaudb']['soversion'],
    102     version: solibversions['libdonaudb']['soversion'],
    103     install_rpath: rpath_option,
    104     dependencies: [
    105         libdonaupq_dep,
    106         libdonauutil_dep,
    107         talerpq_dep,
    108         talerutil_dep,
    109         gnunetpq_dep,
    110         gnunetutil_dep,
    111         pq_dep,
    112     ],
    113     include_directories: [incdir, configuration_inc],
    114     install: true,
    115     install_dir: get_option('libdir'),
    116 )
    117 
    118 libdonaudb_dep = declare_dependency(link_with: libdonaudb)
    119 pkg.generate(
    120     libdonaudb,
    121     url: 'https://taler.net',
    122     description: 'GNU Taler donau DB library',
    123 )
    124 
    125 
    126 test_donaudb = executable(
    127     'test-donaudb-postgres',
    128     ['test_donaudb.c'],
    129     install_rpath: rpath_option,
    130     dependencies: [
    131         libdonauutil_dep,
    132         libdonaudb_dep,
    133         talerutil_dep,
    134         talerjson_dep,
    135         talerpq_dep,
    136         gnunetutil_dep,
    137         gnunetjson_dep,
    138         gnunetpq_dep,
    139         pq_dep,
    140         json_dep,
    141     ],
    142     include_directories: [incdir, configuration_inc],
    143     install: false,
    144 )
    145 
    146 test(
    147     'test_donaudb',
    148     test_donaudb,
    149     workdir: meson.current_build_dir(),
    150     suite: ['donaudb'],
    151     is_parallel: false,
    152 )
    153 
    154 configure_file(
    155     input: 'test-donau-db-postgres.conf',
    156     output: 'test-donau-db-postgres.conf',
    157     copy: true,
    158 )