summaryrefslogtreecommitdiff
path: root/src/meson.build
blob: 2227075164d01a84503cb35e558d65cdea5ebdee (plain)
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
version_split = meson.project_version().split('.')
api_version = version_split[0] + '.' + version_split[1]
astal_gir = 'Astal-' + api_version + '.gir'
astal_typelib = 'Astal-' + api_version + '.typelib'
astal_so = 'libastal.so.' + meson.project_version()

deps = [
  dependency('glib-2.0'),
  dependency('gio-unix-2.0'),
  dependency('gobject-2.0'),
  dependency('gio-2.0'),
  dependency('gtk+-3.0'),
  dependency('gdk-pixbuf-2.0'),
  dependency('gtk-layer-shell-0'),
]

sources = files(
  'widget/box.vala',
  'widget/button.vala',
  'widget/centerbox.vala',
  'widget/eventbox.vala',
  'widget/icon.vala',
  # 'widget/circularprogress.vala', # TODO: math lib -X -lm
  'widget/widget.vala',
  'widget/window.vala',
  'astal.vala',
  'process.vala',
  'time.vala',
  'variable.vala',
)

libastal = library(
  meson.project_name(),
  sources,
  dependencies: deps,
  vala_header: meson.project_name() + '.h',
  vala_vapi: meson.project_name() + '.vapi',
  vala_gir: astal_gir,
  version: meson.project_version(),
  install: true,
  install_dir: [true, true, true, true],
)

import('pkgconfig').generate(
  description: 'libastal',
  libraries: libastal,
  name: meson.project_name(),
  filebase: meson.project_name() + '-' + api_version,
  version: meson.project_version(),
  subdirs: meson.project_name(),
  requires: 'gio-2.0',
  install_dir: get_option('libdir') / 'pkgconfig',
)

if get_option('typelib')
  custom_target(
    astal_typelib,
    command: [
      find_program('g-ir-compiler'),
      '--output', '@OUTPUT@',
      '--shared-library', get_option('prefix') / get_option('libdir') / '@PLAINNAME@',
      meson.current_build_dir() / astal_gir,
    ],
    input: libastal,
    output: astal_typelib,
    depends: libastal,
    install: true,
    install_dir: get_option('libdir') / 'girepository-1.0',
  )
endif

if get_option('cli_client')
  executable(
    meson.project_name(),
    configure_file(
      input: 'client.vala.in',
      output: 'client.vala',
      configuration: {
        'VERSION': meson.project_version(),
      },
    ),
    dependencies: deps,
    install: true,
  )
endif