# This file is in the public domain
install_data('paths.conf', install_dir: pkgcfgdir)

libanastasisutil_SOURCES = ['anastasis_crypto.c', 'os_installation.c', 'pin.c']

libanastasisutil = library(
    'anastasisutil',
    libanastasisutil_SOURCES,
    soversion: solibversions['libanastasisutil']['soversion'],
    version: solibversions['libanastasisutil']['soversion'],
    install_rpath: rpath_option,
    dependencies: [
        gnunetutil_dep,
        gnunetjson_dep,
        gcrypt_dep,
        talerutil_dep,
        sodium_dep,
        json_dep,
    ],
    include_directories: [incdir, configuration_inc],
    install: true,
    install_dir: get_option('libdir'),
)

libanastasisutil_dep = declare_dependency(link_with: libanastasisutil)
pkg.generate(
    libanastasisutil,
    url: 'https://taler.net',
    description: 'GNU Taler anastasis utilities library',
)

executable(
    'anastasis-config',
    ['anastasis-config.c'],
    dependencies: [libanastasisutil_dep, gnunetutil_dep],
    include_directories: [incdir, configuration_inc],
    install: true,
)


test_anastasis_crypto = executable(
    'test_anastasis_crypto',
    ['test_anastasis_crypto.c'],
    dependencies: [
        gnunetutil_dep,
        talerutil_dep,
        libanastasisutil_dep,
        json_dep,
    ],
    include_directories: [incdir, configuration_inc],
    build_by_default: false,
    install: false,
)
test(
    'test_anastasis_crypto',
    test_anastasis_crypto,
    workdir: meson.current_build_dir(),
    suite: ['util'],
    is_parallel: false,
)

executable(
    'anastasis-crypto-tvg',
    ['anastasis-crypto-tvg.c'],
    dependencies: [
        libanastasisutil_dep,
        gnunetutil_dep,
        gnunetjson_dep,
        json_dep,
        talerutil_dep,
        talerjson_dep,
    ],
    include_directories: [incdir, configuration_inc],
    install: true,
)
