1
0

meson.build 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. # Install script to find processes with gamemode lib in runtime
  48. install_data(
  49. files('gamemodelist'),
  50. install_dir: path_bindir,
  51. install_mode: 'rwxr-xr-x',
  52. )
  53. # Configure and install man pages
  54. gamemoded_manpage = configure_file(
  55. input: files('gamemoded.8.in'),
  56. output: 'gamemoded.8',
  57. configuration: data_conf,
  58. )
  59. install_man(
  60. gamemoded_manpage,
  61. install_dir: join_paths(path_mandir, 'man8')
  62. )
  63. gamemoderun_manpage = configure_file(
  64. input: files('gamemoderun.1.in'),
  65. output: 'gamemoderun.1',
  66. configuration: data_conf,
  67. )
  68. install_man(
  69. gamemoderun_manpage,
  70. install_dir: join_paths(path_mandir, 'man1')
  71. )
  72. gamemodelist_manpage = configure_file(
  73. input: files('gamemodelist.1.in'),
  74. output: 'gamemodelist.1',
  75. configuration: data_conf,
  76. )
  77. install_man(
  78. gamemodelist_manpage,
  79. install_dir: join_paths(path_mandir, 'man1')
  80. )
  81. if with_examples
  82. example_manpage = configure_file(
  83. input: files('gamemode-simulate-game.1.in'),
  84. output: 'gamemode-simulate-game.1',
  85. configuration: data_conf,
  86. )
  87. install_man(
  88. example_manpage,
  89. install_dir: join_paths(path_mandir, 'man1')
  90. )
  91. endif
  92. # Install metainfo
  93. metainfo_file = files('io.github.feralinteractive.gamemode.metainfo.xml')
  94. install_data(
  95. metainfo_file,
  96. install_dir: path_metainfo,
  97. )
  98. # Validate metainfo
  99. appstreamcli = find_program(
  100. 'appstreamcli',
  101. required: false
  102. )
  103. if appstreamcli.found()
  104. test(
  105. 'validate metainfo file',
  106. appstreamcli,
  107. args: ['validate', '--no-net', '--pedantic', metainfo_file],
  108. )
  109. endif