~ztefn/haguichi/1.4

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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
config = configure_file(
    input: 'config.vala.in',
    output: 'config.vala',
    configuration: conf
)

sources = [
    'bubble.vala',
    'command.vala',
    'connection.vala',
    'controller.vala',
    'debug.vala',
    'dialogs/about.vala',
    'dialogs/add-edit-command.vala',
    'dialogs/attach.vala',
    'dialogs/base.vala',
    'dialogs/change-nick.vala',
    'dialogs/change-password.vala',
    'dialogs/confirm.vala',
    'dialogs/join-create-network.vala',
    'dialogs/message.vala',
    'global-actions.vala',
    'global-events.vala',
    'haguichi.vala',
    'hamachi.vala',
    'headerbar.vala',
    'inhibitor.vala',
    'key.vala',
    'member-event.vala',
    'member.vala',
    'menus/command-menu-item.vala',
    'menus/join-create-menu.vala',
    'menus/member-menu.vala',
    'menus/network-menu.vala',
    'network-view.vala',
    'network.vala',
    'preferences.vala',
    'session.vala',
    'settings.vala',
    'sidebar.vala',
    'status.vala',
    'text.vala',
    'utils.vala',
    'widgets/cell-renderer-node.vala',
    'widgets/command-button.vala',
    'widgets/commands-editor.vala',
    'widgets/commands-editor-row.vala',
    'widgets/message-bar.vala',
    'widgets/message-box.vala',
    'widgets/preferences-box.vala',
    'widgets/preferences-label.vala',
    'widgets/preferences-switch.vala',
    'widgets/sidebar-button.vala',
    'widgets/sidebar-entry.vala',
    'widgets/sidebar-label.vala',
    'window.vala'
]

glib_dep = dependency('glib-2.0', version: '>= 2.48')
gobject_dep = dependency('gobject-2.0')
gtk_dep = dependency('gtk+-3.0', version: '>= 3.18')

deps = [
    dependency('gio-2.0'),
    dependency('gio-unix-2.0'),
    glib_dep,
    gobject_dep,
    gtk_dep
]

gtk_version = gtk_dep.version()

if gtk_version.version_compare('>= 3.20')
    add_project_arguments(
        ['-D', 'GTK_3_20'],
        language: 'vala'
    )
endif

if gtk_version.version_compare('>= 3.22')
    add_project_arguments(
        ['-D', 'GTK_3_22'],
        language: 'vala'
    )
endif

if get_option('enable-appindicator')
    add_project_arguments(
        ['-D', 'ENABLE_APPINDICATOR'],
        language: 'vala'
    )
    appindicator_dep = dependency('appindicator3-0.1', required: false)
    ayatana_dep = dependency('ayatana-appindicator3-0.1', required: false)
    if appindicator_dep.found()
        deps += appindicator_dep
    elif ayatana_dep.found()
        deps += ayatana_dep
    else
        error('No suitable appindicator library found')
    endif
    sources += [
        'indicator.vala',
        'indicator-menu.vala'
    ]
endif

if get_option('for-elementary')
    add_project_arguments(
        ['-D', 'FOR_ELEMENTARY'],
        language: 'vala'
    )
    granite_dep = dependency('granite')
    deps += granite_dep
endif

if get_option('use-libhandy')
    add_project_arguments(
        ['-D', 'USE_LIBHANDY'],
        language: 'vala'
    )
    deps += dependency('libhandy-1')
endif

if get_option('enable-wingpanel-indicator')
    add_project_arguments(
        ['-D', 'ENABLE_WINGPANEL_INDICATOR'],
        language: 'vala'
    )
    wingpanel_dep = dependency('wingpanel')
    shared_module(
        meson.project_name(),
        config,
        'indicator-wingpanel.vala',
        dependencies: [
            glib_dep,
            gobject_dep,
            granite_dep,
            gtk_dep,
            wingpanel_dep
        ],
        install: true,
        install_dir: wingpanel_dep.get_pkgconfig_variable('indicatorsdir')
    )
endif

executable(
    binary_name,
    config,
    sources,
    resources,
    dependencies: deps,
    install: true
)