meson.build 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. data_conf = configuration_data()
  2. data_conf.set('BINDIR', path_bindir)
  3. data_conf.set('LIBEXECDIR', path_libexecdir)
  4. data_conf.set('SYSCONFDIR', path_sysconfdir)
  5. data_conf.set('GAMEMODE_PREFIX', path_prefix)
  6. data_conf.set('GAMEMODE_VERSION', meson.project_version())
  7. # Pull in the example config
  8. config_example = run_command(
  9. 'cat',
  10. join_paths(meson.source_root(), 'example', 'gamemode.ini')
  11. ).stdout().strip()
  12. data_conf.set('GAMEMODE_EXAMPLE_CONFIG', config_example)
  13. if sd_bus_provider == 'systemd'
  14. # Install systemd user unit
  15. configure_file(
  16. input: 'gamemoded.service.in',
  17. output: 'gamemoded.service',
  18. configuration: data_conf,
  19. install_dir: path_systemd_unit_dir,
  20. )
  21. # Install the sysusers.d file
  22. install_data(
  23. files('gamemode.conf'),
  24. install_dir: path_systemd_sysusers_dir,
  25. )
  26. endif
  27. # Install the D-BUS service file
  28. configure_file(
  29. input: 'com.feralinteractive.GameMode.service.in',
  30. output: 'com.feralinteractive.GameMode.service',
  31. configuration: data_conf,
  32. install_dir: path_dbus_service_dir,
  33. )
  34. # Install the Polkit action file in all cases
  35. configure_file(
  36. input: 'com.feralinteractive.GameMode.policy.in',
  37. output: 'com.feralinteractive.GameMode.policy',
  38. configuration: data_conf,
  39. install_dir: path_polkit_action_dir,
  40. )
  41. # Install the helper run script
  42. install_data(
  43. files('gamemoderun'),
  44. install_dir: path_bindir,
  45. install_mode: 'rwxr-xr-x',
  46. )
  47. # Configure and install man pages
  48. gamemoded_manpage = configure_file(
  49. input: files('gamemoded.8.in'),
  50. output: 'gamemoded.8',
  51. configuration: data_conf,
  52. )
  53. install_man(
  54. gamemoded_manpage,
  55. install_dir: join_paths(path_mandir, 'man8')
  56. )
  57. gamemoderun_manpage = configure_file(
  58. input: files('gamemoderun.1.in'),
  59. output: 'gamemoderun.1',
  60. configuration: data_conf,
  61. )
  62. install_man(
  63. gamemoderun_manpage,
  64. install_dir: join_paths(path_mandir, 'man1')
  65. )
  66. if with_examples
  67. example_manpage = configure_file(
  68. input: files('gamemode-simulate-game.1.in'),
  69. output: 'gamemode-simulate-game.1',
  70. configuration: data_conf,
  71. )
  72. install_man(
  73. example_manpage,
  74. install_dir: join_paths(path_mandir, 'man1')
  75. )
  76. endif
  77. # Install metainfo
  78. metainfo_file = files('io.github.feralinteractive.gamemode.metainfo.xml')
  79. install_data(
  80. metainfo_file,
  81. install_dir: path_metainfo,
  82. )
  83. # Validate metainfo
  84. appstreamcli = find_program(
  85. 'appstreamcli',
  86. required: false
  87. )
  88. if appstreamcli.found()
  89. test(
  90. 'validate metainfo file',
  91. appstreamcli,
  92. args: ['validate', '--no-net', '--pedantic', metainfo_file],
  93. )
  94. endif