Skip to content

Commit e9fd834

Browse files
build: Add meson build system.
Squashed commits due to rename: * meson: Update reaper default_options (doesn't work) * meson: Generate version information for `ULWGL_VERSIONS.json` * meson: Use meson string interpolation * meson: Add man pages to meson * meson: Use configure_file instead of sed * meson: Use ulwgl version for reaper too * meson: Rename ulwgl to umu
1 parent f9f3a2c commit e9fd834

File tree

9 files changed

+120
-9
lines changed

9 files changed

+120
-9
lines changed

Makefile.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ endif
2929
umu/umu_version.json: umu/umu_version.json.in
3030
$(info :: Updating $(@) )
3131
cp $(<) $(<).tmp
32-
sed 's|##UMU_VERSION##|$(shell git describe --always --long --tags)|g' -i $(<).tmp
33-
sed 's|##REAPER_VERSION##|$(shell git describe --always --long --tags)|g' -i $(<).tmp
32+
sed 's|@UMU_VERSION@|$(shell git describe --always --long --tags)|g' -i $(<).tmp
33+
sed 's|@REAPER_VERSION@|$(shell git describe --always --long --tags)|g' -i $(<).tmp
3434
mv $(<).tmp $(@)
3535

3636
.PHONY: version
@@ -44,7 +44,7 @@ version-install: version
4444

4545
$(OBJDIR)/.build-umu: | $(OBJDIR)
4646
$(info :: Building umu )
47-
sed 's|##INSTALL_PATH##|$(DATADIR)/$(INSTALLDIR)|g' umu/umu-run.in > $(OBJDIR)/umu-run
47+
sed 's|@INSTALL_PATH@|$(DATADIR)/$(INSTALLDIR)|g' umu/umu-run.in > $(OBJDIR)/umu-run
4848
touch $(@)
4949

5050
.PHONY: umu
@@ -88,7 +88,7 @@ umu-install: version-install umu-dist-install umu-docs-install umu-bin-install
8888
# umu-launcher is separate to allow control over installing the bin target
8989
$(OBJDIR)/.build-umu-launcher: | $(OBJDIR)
9090
$(info :: Building umu-launcher )
91-
sed 's|##INSTALL_PATH##|$(DATADIR)/$(INSTALLDIR)|g' umu/umu-launcher/umu-run.in > $(OBJDIR)/umu-launcher-run
91+
sed 's|@INSTALL_PATH@|$(DATADIR)/$(INSTALLDIR)|g' umu/umu-launcher/umu-run.in > $(OBJDIR)/umu-launcher-run
9292
touch $(@)
9393

9494
.PHONY: umu-launcher

docs/meson.build

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
scdoc = find_program('scdoc')
2+
3+
custom_target('man1',
4+
input : 'umu.1.scd',
5+
output : 'umu.1',
6+
command : [ scdoc ],
7+
feed : true,
8+
capture : true,
9+
install : true,
10+
install_dir : get_option('mandir'),
11+
)
12+
13+
custom_target('man5',
14+
input : 'umu.5.scd',
15+
output : 'umu.5',
16+
command : [ scdoc ],
17+
feed : true,
18+
capture : true,
19+
install : true,
20+
install_dir : get_option('mandir'),
21+
)

meson.build

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
project('umu',
2+
['cpp'],
3+
license : 'GPL-3.0-only',
4+
license_files : ['LICENSE'],
5+
)
6+
7+
subproject('reaper',
8+
default_options : [
9+
'prefix=' + get_option('prefix'),
10+
'bindir=' + get_option('prefix') / get_option('datadir') / meson.project_name(),
11+
],
12+
)
13+
14+
subdir('umu')
15+
subdir('docs')

subprojects/reaper.wrap

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

umu/meson.build

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
git = find_program('git')
2+
3+
umu_run_data = configuration_data()
4+
umu_run_data.set('INSTALL_PATH', get_option('prefix') / get_option('datadir') / meson.project_name())
5+
configure_file(
6+
input : 'umu-run.in',
7+
output : 'umu-run',
8+
configuration : umu_run_data,
9+
install : true,
10+
install_dir : get_option('bindir'),
11+
install_mode: 'rwxr-xr-x',
12+
)
13+
14+
install_data(
15+
[
16+
'umu_consts.py',
17+
'umu_dl_util.py',
18+
'umu_log.py',
19+
'umu_plugins.py',
20+
'umu_util.py',
21+
],
22+
install_dir: get_option('datadir') / meson.project_name(),
23+
)
24+
install_data(
25+
[
26+
'umu_run.py',
27+
],
28+
install_dir: get_option('datadir') / meson.project_name(),
29+
install_mode: 'rwxr-xr-x',
30+
)
31+
32+
umu_desc = run_command(
33+
git, '-C', meson.source_root(), 'describe', '--always', '--long', '--tags', check: true
34+
).stdout().strip()
35+
reaper_desc = run_command(
36+
git, '-C', meson.source_root() / 'subprojects/reaper', 'describe', '--always', '--long', '--tags', check: true
37+
).stdout().strip()
38+
umu_version_data = configuration_data()
39+
umu_version_data.set('UMU_VERSION', umu_desc)
40+
umu_version_data.set('REAPER_VERSION', umu_desc)
41+
configure_file(
42+
input : 'umu_version.json.in',
43+
output : 'umu_version.json',
44+
configuration : umu_version_data,
45+
install : true,
46+
install_dir: get_option('datadir') / meson.project_name(),
47+
)
48+
49+
subdir('umu-launcher')

umu/umu-launcher/meson.build

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
fs = import('fs')
2+
3+
configure_file(
4+
input : 'umu-run.in',
5+
output : 'umu-run',
6+
configuration : umu_run_data,
7+
install : false,
8+
install_dir : get_option('datadir') / meson.project_name() / fs.name(meson.current_source_dir()),
9+
install_mode: 'rwxr-xr-x',
10+
)
11+
12+
install_data(
13+
[
14+
'compatibilitytool.vdf',
15+
'toolmanifest.vdf'
16+
],
17+
install_dir: get_option('datadir') / meson.project_name() / fs.name(meson.current_source_dir()),
18+
)

umu/umu-launcher/umu-run.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env sh
2-
##INSTALL_PATH##/umu_run.py "$@"
2+
@INSTALL_PATH@/umu_run.py "$@"
33

umu/umu-run.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env sh
2-
##INSTALL_PATH##/umu_run.py "$@"
2+
@INSTALL_PATH@/umu_run.py "$@"
33

umu/umu_version.json.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"umu": {
33
"versions": {
4-
"launcher": "##UMU_VERSION##",
5-
"runner": "##UMU_VERSION##",
4+
"launcher": "@UMU_VERSION@",
5+
"runner": "@UMU_VERSION@",
66
"runtime_platform": "sniper_platform_0.20240125.75305",
7-
"reaper": "##REAPER_VERSION##",
7+
"reaper": "@REAPER_VERSION@",
88
"pressure_vessel": "v0.20240212.0"
99
}
1010
}

0 commit comments

Comments
 (0)