meson.build (2787B)
1 # This build file is in the public domain 2 install_data('sync_db_postgres.conf', install_dir: pkgcfgdir) 3 4 sqldir = get_option('datadir') / 'sync' / 'sql' 5 6 # FIXME possibly provide this output in the tgz through dist script 7 run_command('make', '-f', 'Makefile.sql', 'all', check: true) 8 9 sqlfiles = ['versioning.sql', 'procedures.sql', 'sync-0001.sql', 'sync-0002.sql', 'drop.sql'] 10 11 install_data(sources: sqlfiles, install_dir: sqldir) 12 13 # This makes meson copy the files into the build directory for testing 14 foreach f : sqlfiles 15 configure_file(input: f, output: f, copy: true) 16 endforeach 17 18 19 libsyncdb_SOURCES = [ 20 'syncdb_pg.c', 21 'syncdb_drop_tables.c', 22 'syncdb_create_tables.c', 23 'syncdb_preflight.c', 24 'syncdb_gc.c', 25 'syncdb_append_block_TR.c', 26 'syncdb_delete_block_TR.c', 27 'syncdb_update_block_TR.c', 28 'syncdb_lookup_account_TR.c', 29 'syncdb_lookup_block_range_TR.c', 30 'syncdb_lookup_block_hashes_TR.c', 31 'syncdb_lookup_block_TR.c', 32 'syncdb_increment_lifetime_TR.c', 33 'syncdb_lookup_pending_payments_by_account.c', 34 'syncdb_store_payment_TR.c', 35 'syncdb_store_object_TR.c', 36 'syncdb_lookup_object.c', 37 'syncdb_lookup_object_uid.c', 38 ] 39 libsyncdb = library( 40 'syncdb', 41 libsyncdb_SOURCES, 42 soversion: solibversions['libsyncdb']['soversion'], 43 version: solibversions['libsyncdb']['soversion'], 44 install_rpath: rpath_option, 45 dependencies: [ 46 libsyncutil_dep, 47 talerpq_dep, 48 talerutil_dep, 49 gnunetutil_dep, 50 gnunetpq_dep, 51 pq_dep, 52 ], 53 include_directories: [incdir, configuration_inc], 54 install: true, 55 install_dir: get_option('libdir'), 56 ) 57 58 libsyncdb_dep = declare_dependency(link_with: libsyncdb) 59 pkg.generate( 60 libsyncdb, 61 url: 'https://taler.net', 62 description: 'GNU Taler sync DB library', 63 ) 64 65 executable( 66 'sync-dbinit', 67 ['sync-dbinit.c'], 68 dependencies: [ 69 libsyncutil_dep, 70 talerutil_dep, 71 libsyncdb_dep, 72 talerpq_dep, 73 gnunetutil_dep, 74 gnunetpq_dep, 75 pq_dep, 76 gcrypt_dep, 77 ], 78 include_directories: [incdir, configuration_inc], 79 install: true, 80 ) 81 82 83 test_syncdb_postgres = executable( 84 'test-syncdb-postgres', 85 ['test_sync_db.c'], 86 install_rpath: rpath_option, 87 dependencies: [ 88 libsyncdb_dep, 89 libsyncutil_dep, 90 talerutil_dep, 91 gnunetutil_dep, 92 gnunetpq_dep, 93 ], 94 include_directories: [incdir, configuration_inc], 95 install: false, 96 ) 97 test( 98 'test-syncdb-postgres', 99 test_syncdb_postgres, 100 workdir: meson.current_build_dir(), 101 suite: ['syncdb', 'installcheck'], 102 is_parallel: false, 103 ) 104 configure_file( 105 input: 'test_sync_db_postgres.conf', 106 output: 'test_sync_db_postgres.conf', 107 copy: true, 108 )