This repository has been archived by the owner on Dec 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
80 lines (61 loc) · 2.4 KB
/
meson.build
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
project('rhythmbox-discord-rpc', 'c')
fs = import('fs')
sample_plugin_dir = 'rhythmbox-discord'
sample_sources = [
'rb-discord.c',
]
cashmap_sources = [
'include/c-hashmap/map.c'
]
chashmaplib = shared_library('chashmap',
cashmap_sources,
install: true)
discord_lib = 'discord_game_sdk'
discord_lib_dir = '/usr/lib'
discord_header_dir = './discord_game_sdk/c'
cc = meson.get_compiler('c')
cdata = configuration_data()
discord_dep = cc.find_library(discord_lib, dirs: [discord_lib_dir])
inc_discord = include_directories(discord_header_dir)
libpeas = dependency('libpeas-1.0', version: '>= 0.7.3', required: true)
libpeas_gtk = dependency('libpeas-gtk-1.0', version: '>= 0.7.3', required: true)
rhythmbox_dep = dependency('rhythmbox', required: true)
rhythmboxinc = include_directories('/usr/include/rhythmbox')
pluginsinc = include_directories('/usr/include/rhythmbox/plugins')
libinc = include_directories('/usr/include/rhythmbox/lib')
shellinc = include_directories('/usr/include/rhythmbox/shell')
metadatainc = include_directories('/usr/include/rhythmbox/metadata')
fs.copyfile('./discord_game_sdk/lib/x86_64/discord_game_sdk.so', 'discord_game_sdk.so')
po_dir = meson.project_source_root() / 'po'
# FIXME: Move custom_target to i18n.merge_file when gettext acquires plugin support.
# http://lists.gnu.org/archive/html/bug-gettext/2017-06/msg00001.html
msgfmt_plugin_cmd = [
find_program('msgfmt'),
'--desktop',
'--keyword=Name',
'--keyword=Description',
'--template=@INPUT@',
'-d', po_dir,
'--output=@OUTPUT@'
]
cdata.set('GLIB_VERSION_MIN_REQUIRED', 'GLIB_VERSION_2_66')
cdata.set('GLIB_VERSION_MAX_ALLOWED', 'GLIB_VERSION_2_66')
cdata.set('GETTEXT_PACKAGE', '"rhythmbox"')
cdata.set('PACKAGE', '"rhythmbox"')
cdata.set('VERSION', '@0@'.format(meson.project_version()))
configure_file(input : 'config.h.meson',
output : 'config.h',
configuration : cdata)
shared_module('rhythmbox-discord',
sample_sources,
dependencies: [rhythmbox_dep, discord_dep, libpeas, libpeas_gtk],
link_with: [chashmaplib],
include_directories: [inc_discord, libinc, pluginsinc, shellinc, rhythmboxinc, metadatainc],
install_dir: sample_plugin_dir,
install: true)
sample_plugin_descriptor = custom_target('rhythmbox-discord-plugin-descriptor',
input: 'rhythmbox-discord.plugin.desktop.in',
output: 'rhythmbox-discord.plugin',
command: msgfmt_plugin_cmd,
install: true,
install_dir: sample_plugin_dir)