diff --git a/Makefile.in b/Makefile.in index 6e7b323d7..3d8c83354 100644 --- a/Makefile.in +++ b/Makefile.in @@ -34,8 +34,8 @@ endif umu/umu_version.json: umu/umu_version.json.in $(info :: Updating $(@) ) cp $(<) $(<).tmp - sed 's|##UMU_VERSION##|$(shell git describe --always --long --tags)|g' -i $(<).tmp - sed 's|##REAPER_VERSION##|$(shell git describe --always --long --tags)|g' -i $(<).tmp + sed 's|@UMU_VERSION@|$(shell git describe --always --long --tags)|g' -i $(<).tmp + sed 's|@REAPER_VERSION@|$(shell git describe --always --long --tags)|g' -i $(<).tmp mv $(<).tmp $(@) .PHONY: version @@ -47,9 +47,11 @@ version-install: version install -Dm 644 umu/umu_version.json -t $(DESTDIR)$(DATADIR)/$(INSTALLDIR) +UMU_RUN_COMMAND = $(DATADIR)/$(INSTALLDIR)/umu_run.py + $(OBJDIR)/.build-umu: | $(OBJDIR) $(info :: Building umu ) - sed 's|##INSTALL_PATH##|$(DATADIR)/$(INSTALLDIR)|g' umu/umu-run.in > $(OBJDIR)/umu-run + sed 's|@INSTALL_PATH@|$(UMU_RUN_COMMAND)|g' umu/umu-run.in > $(OBJDIR)/umu-run touch $(@) .PHONY: umu @@ -93,16 +95,17 @@ else umu-install: version-install umu-dist-install umu-docs-install umu-bin-install endif + ifeq ($(FLATPAK), xtrue) UMU_LAUNCHER_COMMAND = org.openwinecomponents.umu.launcher else -UMU_LAUNCHER_COMMAND = $(DATADIR)/$(INSTALLDIR)/umu_run.py +UMU_LAUNCHER_COMMAND = $(UMU_RUN_COMMAND) endif # umu-launcher is separate to allow control over installing the bin target $(OBJDIR)/.build-umu-launcher: | $(OBJDIR) $(info :: Building umu-launcher ) - sed 's|##INSTALL_PATH##|$(UMU_LAUNCHER_COMMAND)|g' umu/umu-launcher/umu-run.in > $(OBJDIR)/umu-launcher-run + sed 's|@INSTALL_PATH@|$(UMU_LAUNCHER_COMMAND)|g' umu/umu-launcher/umu-run.in > $(OBJDIR)/umu-launcher-run touch $(@) .PHONY: umu-launcher diff --git a/docs/meson.build b/docs/meson.build new file mode 100644 index 000000000..9e19158ae --- /dev/null +++ b/docs/meson.build @@ -0,0 +1,20 @@ +scdoc = find_program('scdoc') + +man_1 = custom_target('man1', + input : 'umu.1.scd', + output : 'umu.1', + command : [ scdoc ], + feed : true, + capture : true, +) + +man_5 = custom_target('man5', + input : 'umu.5.scd', + output : 'umu.5', + command : [ scdoc ], + feed : true, + capture : true, +) + +install_man(man_1.full_path()) +install_man(man_5.full_path()) diff --git a/meson.build b/meson.build new file mode 100644 index 000000000..bc28d3bbb --- /dev/null +++ b/meson.build @@ -0,0 +1,20 @@ +project('umu', + ['cpp'], + license : 'GPL-3.0-only', + license_files : ['LICENSE'], +) + +# 'libdir' is likely a more conformant target directory than 'datadir' +umu_install_path = get_option('datadir') / meson.project_name() + +subproject('reaper', + default_options : [ + 'prefix=' + get_option('prefix'), + 'bindir=' + get_option('prefix') / umu_install_path, + ], +) + +subdir('umu') +if not get_option('flatpak') + subdir('docs') +endif diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 000000000..0501737b5 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,2 @@ +option('flatpak', type : 'boolean', value : false, description: 'Build for Flatpak distribution') +#option('user_install', type : 'boolean', value : false, description: 'Install under current user\'s home directory') diff --git a/subprojects/reaper.wrap b/subprojects/reaper.wrap new file mode 100644 index 000000000..1b456d6cc --- /dev/null +++ b/subprojects/reaper.wrap @@ -0,0 +1,8 @@ +[wrap-git] +directory = reaper +url = https://github.com/Plagman/reaper.git +revision = head +depth = 1 + +[provide] +program_names = reaper diff --git a/umu/meson.build b/umu/meson.build new file mode 100644 index 000000000..6245101bd --- /dev/null +++ b/umu/meson.build @@ -0,0 +1,49 @@ +git = find_program('git') + +umu_run_cfg = configuration_data() +umu_run_cfg.set('INSTALL_PATH', get_option('prefix') / umu_install_path / 'umu_run.py') +configure_file( + input : 'umu-run.in', + output : 'umu-run', + configuration : umu_run_cfg, + install : true, + install_dir : get_option('bindir'), + install_mode: 'rwxr-xr-x', +) + +install_data( + [ + 'umu_consts.py', + 'umu_dl_util.py', + 'umu_log.py', + 'umu_plugins.py', + 'umu_util.py', + ], + install_dir: umu_install_path, +) +install_data( + [ + 'umu_run.py', + ], + install_dir: umu_install_path, + install_mode: 'rwxr-xr-x', +) + +umu_desc = run_command( + git, '-C', meson.source_root(), 'describe', '--always', '--long', '--tags', check: true +).stdout().strip() +reaper_desc = run_command( + git, '-C', meson.source_root() / 'subprojects/reaper', 'describe', '--always', '--long', '--tags', check: true +).stdout().strip() +umu_version_data = configuration_data() +umu_version_data.set('UMU_VERSION', umu_desc) +umu_version_data.set('REAPER_VERSION', umu_desc) +configure_file( + input : 'umu_version.json.in', + output : 'umu_version.json', + configuration : umu_version_data, + install : true, + install_dir: umu_install_path, +) + +subdir('umu-launcher') diff --git a/umu/umu-launcher/meson.build b/umu/umu-launcher/meson.build new file mode 100644 index 000000000..585cb57d8 --- /dev/null +++ b/umu/umu-launcher/meson.build @@ -0,0 +1,25 @@ +fs = import('fs') + +umu_run_launcher_cfg = configuration_data() +if get_option('flatpak') + umu_run_launcher_cfg.set('INSTALL_PATH', 'org.openwinecomponents.umu.launcher') +else + umu_run_launcher_cfg.set('INSTALL_PATH', umu_run_cfg.get('INSTALL_PATH')) +endif + +configure_file( + input : 'umu-run.in', + output : 'umu-run', + configuration : umu_run_launcher_cfg, + install : true, + install_dir : umu_install_path / fs.name(meson.current_source_dir()), + install_mode: 'rwxr-xr-x', +) + +install_data( + [ + 'compatibilitytool.vdf', + 'toolmanifest.vdf' + ], + install_dir: umu_install_path / fs.name(meson.current_source_dir()), +) diff --git a/umu/umu-launcher/umu-run.in b/umu/umu-launcher/umu-run.in index 604799d72..9a2cb8a82 100755 --- a/umu/umu-launcher/umu-run.in +++ b/umu/umu-launcher/umu-run.in @@ -1,3 +1,2 @@ #!/usr/bin/env sh -##INSTALL_PATH## "$@" - +@INSTALL_PATH@ "$@" diff --git a/umu/umu-run.in b/umu/umu-run.in index ed92c1405..9a2cb8a82 100755 --- a/umu/umu-run.in +++ b/umu/umu-run.in @@ -1,3 +1,2 @@ #!/usr/bin/env sh -##INSTALL_PATH##/umu_run.py "$@" - +@INSTALL_PATH@ "$@" diff --git a/umu/umu_version.json.in b/umu/umu_version.json.in index 473089e11..4a5ef790e 100644 --- a/umu/umu_version.json.in +++ b/umu/umu_version.json.in @@ -1,10 +1,10 @@ { "umu": { "versions": { - "launcher": "##UMU_VERSION##", - "runner": "##UMU_VERSION##", + "launcher": "@UMU_VERSION@", + "runner": "@UMU_VERSION@", "runtime_platform": "sniper_platform_0.20240125.75305", - "reaper": "##REAPER_VERSION##", + "reaper": "@REAPER_VERSION@", "pressure_vessel": "v0.20240212.0" } }