/+junk/libbreezy

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/%2Bjunk/libbreezy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
api_version = '0.1'

libbreezy_sources = [
  'libbreezy.c',
]

libbreezy_headers = [
  'libbreezy.h',
  'libbreezy_private.h',
  'decls.h',
]

version_split = meson.project_version().split('.')
MAJOR_VERSION = version_split[0]
MINOR_VERSION = version_split[1]
MICRO_VERSION = version_split[2]

version_conf = configuration_data()
version_conf.set('VERSION', meson.project_version())
version_conf.set('MAJOR_VERSION', MAJOR_VERSION)
version_conf.set('MINOR_VERSION', MINOR_VERSION)
version_conf.set('MICRO_VERSION', MICRO_VERSION)

configure_file(
  input: 'libbreezy-version.h.in',
  output: 'libbreezy-version.h',
  configuration: version_conf,
  install: true,
  install_dir: join_paths(get_option('includedir'), 'libbreezy')
)

libbreezy_deps = [
  dependency ('python3-embed', required : true),
]

libbreezy_lib = shared_library('libbreezy-' + api_version,
  libbreezy_sources,
  dependencies: libbreezy_deps,
  install: true,
)

install_headers(libbreezy_headers, subdir: 'libbreezy')

pkg = import('pkgconfig')

pkg.generate(
  description: 'C wrapper for Breezy',
    libraries: libbreezy_lib,
         name: 'libbreezy',
     filebase: 'libbreezy-' + api_version,
      version: meson.project_version(),
      subdirs: 'libbreezy',
     requires: ['python3','breezy'],
  install_dir: join_paths(get_option('libdir'), 'pkgconfig')
)