meson.build (3109B)
1 # This file is in the public domain 2 3 install_data('challenger_db_postgres.conf', install_dir: pkgcfgdir) 4 5 6 sqldir = get_option('datadir') / 'challenger' / 'sql' 7 8 procedures_sql = [ 9 'procedures-prelude.sql', 10 'do_challenge_address.sql', 11 'do_solve_challenge.sql', 12 'commit.sql', 13 ] 14 15 generated_sql = [ 16 ['versioning.sql', ['versioning.sql']], 17 ['drop.sql', ['drop.sql']], 18 ['procedures.sql', procedures_sql], 19 ['challenger-0001.sql', ['challenger-0001.sql']], 20 ['challenger-0002.sql', ['challenger-0002.sql']], 21 ['challenger-0003.sql', ['challenger-0003.sql']], 22 ['challenger-0004.sql', ['challenger-0004.sql']], 23 ['challenger-0005.sql', ['challenger-0005.sql']], 24 ] 25 26 foreach g : generated_sql 27 custom_target( 28 'gen-challengerdb-' + g[0], 29 input: g[1], 30 output: g[0], 31 capture: true, 32 command: ['./amalgamate-sql.sh', '@INPUT@'], 33 install: true, 34 install_dir: sqldir, 35 ) 36 endforeach 37 38 libchallengerdb_SOURCES = [ 39 'get_validation_address.c', 40 'insert_client.c', 41 'update_client.c', 42 'delete_client.c', 43 'get_client.c', 44 'get_client_by_uri.c', 45 'create_tables.c', 46 'drop_tables.c', 47 'gc.c', 48 'get_token.c', 49 'do_insert_token.c', 50 'do_insert_validation.c', 51 'preflight.c', 52 'pg.c', 53 'update_validation.c', 54 'do_challenge_address.c', 55 'do_solve_challenge.c', 56 'get_validation.c', 57 'get_validation_pkce.c', 58 ] 59 libchallengerdb = library( 60 'challengerdb', 61 libchallengerdb_SOURCES, 62 soversion: solibversions['libchallengerdb']['soversion'], 63 version: solibversions['libchallengerdb']['soversion'], 64 install_rpath: rpath_option, 65 dependencies: [ 66 libchallengerutil_dep, 67 talerpq_dep, 68 gnunetutil_dep, 69 gnunetpq_dep, 70 pq_dep, 71 ], 72 include_directories: [incdir, configuration_inc], 73 install: true, 74 install_dir: get_option('libdir'), 75 ) 76 77 libchallengerdb_dep = declare_dependency(link_with: libchallengerdb) 78 pkg.generate( 79 libchallengerdb, 80 url: 'https://taler.net', 81 description: 'GNU Taler challenger DB library', 82 ) 83 84 executable( 85 'challenger-dbinit', 86 ['challenger-dbinit.c'], 87 dependencies: [ 88 libchallengerutil_dep, 89 libchallengerdb_dep, 90 gnunetutil_dep, 91 talerutil_dep, 92 ], 93 include_directories: [incdir, configuration_inc], 94 install: true, 95 ) 96 97 configure_file( 98 input: 'test_challenger_db_postgres.conf', 99 output: 'test_challenger_db_postgres.conf', 100 copy: true, 101 ) 102 103 test_challenger_db_postgres = executable( 104 'test_challenger_db-postgres', 105 ['test_challenger_db.c'], 106 dependencies: [ 107 gnunetutil_dep, 108 libchallengerutil_dep, 109 libchallengerdb_dep, 110 gnunetpq_dep, 111 pq_dep, 112 talerutil_dep, 113 pq_dep, 114 json_dep, 115 ], 116 include_directories: [incdir, configuration_inc], 117 build_by_default: false, 118 install: false, 119 ) 120 test( 121 'test_challenger_db-postgres', 122 test_challenger_db_postgres, 123 workdir: meson.current_build_dir(), 124 suite: ['challengerdb'], 125 is_parallel: false, 126 )