Skip to content

Commit 28ca0d5

Browse files
Generate version information for ULWGL_VERSIONS.json
1 parent 576540a commit 28ca0d5

File tree

3 files changed

+42
-13
lines changed

3 files changed

+42
-13
lines changed

ULWGL/meson.build

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,26 @@
1+
sed = find_program('sed')
2+
git = find_program('git')
3+
4+
ulwgl_run = custom_target('ulwgl_run',
5+
input : 'ulwgl-run.in',
6+
output : 'ulwgl-run',
7+
command : [
8+
sed,
9+
'-e', 's|##INSTALL_PATH##|' + get_option('prefix') / get_option('datadir') / meson.project_name() + '|g',
10+
'@INPUT@'
11+
],
12+
capture : true,
13+
install : true,
14+
install_dir : get_option('bindir'),
15+
)
16+
117
install_data(
218
[
319
'ulwgl_consts.py',
420
'ulwgl_dl_util.py',
521
'ulwgl_log.py',
622
'ulwgl_plugins.py',
723
'ulwgl_util.py',
8-
'ULWGL_VERSION.json',
924
],
1025
install_dir: get_option('datadir') / meson.project_name(),
1126
)
@@ -16,14 +31,25 @@ install_data(
1631
install_dir: get_option('datadir') / meson.project_name(),
1732
install_mode: 'rwxr-xr-x',
1833
)
19-
sed = find_program('sed')
20-
ulwgl_run = custom_target('ulwgl_run',
21-
input : 'ulwgl-run.in',
22-
output : 'ulwgl-run',
23-
command : [sed, 's|##INSTALL_PATH##|' + get_option('prefix') / get_option('datadir') / meson.project_name() + '|g', '@INPUT@'],
34+
35+
ulwgl_desc = run_command(
36+
git, '-C', meson.source_root(), 'describe', '--always', '--long', '--tags', check: true
37+
).stdout().strip()
38+
reaper_desc = run_command(
39+
git, '-C', meson.source_root() / 'subprojects/reaper', 'describe', '--always', '--long', '--tags', check: true
40+
).stdout().strip()
41+
ulwgl_version = custom_target(
42+
input : 'ULWGL_VERSION.json.in',
43+
output : 'ULWGL_VERSION.json',
44+
command : [
45+
sed,
46+
'-e', 's|##ULWGL_VERSION##|' + ulwgl_desc + '|g',
47+
'-e', 's|##REAPER_VERSION##|' + reaper_desc + '|g',
48+
'@INPUT@'
49+
],
2450
capture : true,
2551
install : true,
26-
install_dir : get_option('bindir'),
52+
install_dir: get_option('datadir') / meson.project_name(),
2753
)
2854

2955
subdir('ULWGL-Launcher')

meson.build

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
project('ulwgl',
22
['cpp'],
3-
license : 'GPL-3.0-only'
3+
license : 'GPL-3.0-only',
4+
license_files : ['LICENSE'],
45
)
56

6-
reaper_options = [
7-
'prefix=' + get_option('prefix'),
8-
'bindir=' + get_option('prefix') / get_option('datadir') / meson.project_name(),
9-
]
107
reaper = subproject('reaper',
11-
default_options : reaper_options
8+
default_options : [
9+
'prefix=' + get_option('prefix'),
10+
'bindir=' + get_option('prefix') / get_option('datadir') / meson.project_name(),
11+
],
1212
)
1313

1414
subdir('ULWGL')

subprojects/reaper.wrap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ directory = reaper
33
url = https://github.com/Plagman/reaper.git
44
revision = head
55
depth = 1
6+
7+
[provide]
8+
program_names = reaper

0 commit comments

Comments
 (0)