donau

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

meson.build (3626B)


      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     'donau_do_insert_submitted_receipts.sql',
     22     'donau_do_insert_issued_receipts.sql',
     23     'donau_do_insert_charity.sql',
     24     'commit.sql',
     25 ]
     26 
     27 generated_sql = [
     28     ['drop.sql', ['drop.sql']],
     29     ['versioning.sql', ['versioning.sql']],
     30     ['procedures.sql', procedures_sql],
     31     ['donau-0001.sql', ['donau-0001.sql']],
     32     ['donau-0002.sql', donau_0002],
     33 ]
     34 
     35 
     36 foreach g : generated_sql
     37     custom_target(
     38         'gen-merchantdb-' + g[0],
     39         input: g[1],
     40         output: g[0],
     41         capture: true,
     42         command: ['./amalgamate-sql.sh', '@INPUT@'],
     43         install: true,
     44         install_dir: sqldir,
     45     )
     46 endforeach
     47 
     48 
     49 
     50 
     51 test_idem = configure_file(
     52     input: 'test_idempotency.sh',
     53     output: 'test_idempotency.sh',
     54     copy: true,
     55 )
     56 
     57 test(
     58     'test_idempotency.sh',
     59     test_idem,
     60     workdir: meson.current_build_dir(),
     61     suite: ['donaudb', 'installcheck'],
     62 )
     63 
     64 
     65 libdonaudb = library(
     66     'donaudb',
     67     [
     68         'plugin_donaudb_postgres.c',
     69         'preflight.c',
     70         'commit.c',
     71         'drop_tables.c',
     72         'create_tables.c',
     73         'event_listen.c',
     74         'event_listen_cancel.c',
     75         'event_notify.c',
     76         'start.c',
     77         'rollback.c',
     78         'start_read_committed.c',
     79         'start_read_only.c',
     80         'insert_signing_key.c',
     81         'lookup_signing_key.c',
     82         'iterate_active_signing_keys.c',
     83         'insert_donation_unit.c',
     84         'iterate_donation_units.c',
     85         'iterate_submitted_receipts.c',
     86         'get_history.c',
     87         'get_charities.c',
     88         'insert_charity.c',
     89         'update_charity.c',
     90         'do_charity_delete.c',
     91         'insert_history_entry.c',
     92         'lookup_charity.c',
     93         'lookup_issued_receipts.c',
     94         'lookup_donation_unit_amount.c',
     95         'insert_issued_receipt.c',
     96         'insert_submitted_receipts.c',
     97     ],
     98     soversion: solibversions['libdonaudb']['soversion'],
     99     version: solibversions['libdonaudb']['soversion'],
    100     install_rpath: rpath_option,
    101     dependencies: [
    102         libdonaupq_dep,
    103         libdonauutil_dep,
    104         talerpq_dep,
    105         talerutil_dep,
    106         gnunetpq_dep,
    107         gnunetutil_dep,
    108         pq_dep,
    109     ],
    110     include_directories: [incdir, configuration_inc],
    111     install: true,
    112     install_dir: get_option('libdir'),
    113 )
    114 
    115 libdonaudb_dep = declare_dependency(link_with: libdonaudb)
    116 pkg.generate(
    117     libdonaudb,
    118     url: 'https://taler.net',
    119     description: 'GNU Taler donau DB library',
    120 )
    121 
    122 
    123 test_donaudb = executable(
    124     'test-donaudb-postgres',
    125     ['test_donaudb.c'],
    126     install_rpath: rpath_option,
    127     dependencies: [
    128         libdonauutil_dep,
    129         libdonaudb_dep,
    130         talerutil_dep,
    131         talerjson_dep,
    132         talerpq_dep,
    133         gnunetutil_dep,
    134         gnunetjson_dep,
    135         pq_dep,
    136         json_dep,
    137     ],
    138     include_directories: [incdir, configuration_inc],
    139     install: false,
    140 )
    141 
    142 test(
    143     'test_donaudb',
    144     test_donaudb,
    145     workdir: meson.current_build_dir(),
    146     suite: ['donaudb'],
    147     is_parallel: false,
    148 )
    149 
    150 configure_file(
    151     input: 'test-donau-db-postgres.conf',
    152     output: 'test-donau-db-postgres.conf',
    153     copy: true,
    154 )