1
0

meson.build 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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. data_conf.set('GAMEMODE_PRIVILEGED_GROUP', with_privileged_group)
  8. # Pull in the example config
  9. config_example = run_command(
  10. 'cat',
  11. join_paths(meson.source_root(), 'example', 'gamemode.ini'),
  12. check: true,
  13. ).stdout().strip()
  14. data_conf.set('GAMEMODE_EXAMPLE_CONFIG', config_example)
  15. if sd_bus_provider == 'systemd'
  16. if with_systemd_unit
  17. # Install systemd user unit
  18. configure_file(
  19. input: 'systemd/user/gamemoded.service.in',
  20. output: 'gamemoded.service',
  21. configuration: data_conf,
  22. install_dir: path_systemd_unit_dir,
  23. )
  24. endif
  25. if with_systemd_group
  26. # Install the sysusers.d file
  27. configure_file(
  28. input: 'systemd/sysusers.d/gamemode.conf.in',
  29. output: 'gamemode.conf',
  30. configuration: data_conf,
  31. install_dir: path_systemd_group_dir,
  32. )
  33. endif
  34. endif
  35. if with_pam_renicing
  36. # Install the limits.d configuration file
  37. configure_file(
  38. input: 'pam_limits/10-gamemode.conf.in',
  39. output: '10-gamemode.conf',
  40. configuration: data_conf,
  41. install_dir: path_pam_limits_dir,
  42. )
  43. endif
  44. # Install the D-BUS service file
  45. configure_file(
  46. input: 'dbus/com.feralinteractive.GameMode.service.in',
  47. output: 'com.feralinteractive.GameMode.service',
  48. configuration: data_conf,
  49. install_dir: path_dbus_service_dir,
  50. )
  51. # Install the Polkit action & rule files for the privileged gamemode group
  52. if with_privileged_group != ''
  53. configure_file(
  54. input: 'polkit/actions/com.feralinteractive.GameMode.policy.in',
  55. output: 'com.feralinteractive.GameMode.policy',
  56. configuration: data_conf,
  57. install_dir: path_polkit_action_dir,
  58. )
  59. configure_file(
  60. input: 'polkit/rules.d/gamemode.rules.in',
  61. output: 'gamemode.rules',
  62. configuration: data_conf,
  63. install_dir: path_polkit_rule_dir,
  64. )
  65. endif
  66. # Install the helper run script and man page
  67. if get_option('default_library') == 'static'
  68. warning('gamemoderun will not be installed as a shared libgamemodeauto library is required')
  69. else
  70. install_data(
  71. files('gamemoderun'),
  72. install_dir: path_bindir,
  73. install_mode: 'rwxr-xr-x',
  74. )
  75. gamemoderun_manpage = configure_file(
  76. input: files('gamemoderun.1.in'),
  77. output: 'gamemoderun.1',
  78. configuration: data_conf,
  79. )
  80. install_man(
  81. gamemoderun_manpage,
  82. install_dir: join_paths(path_mandir, 'man1')
  83. )
  84. endif
  85. # Install script to find processes with gamemode lib in runtime
  86. install_data(
  87. files('gamemodelist'),
  88. install_dir: path_bindir,
  89. install_mode: 'rwxr-xr-x',
  90. )
  91. # Configure and install man pages
  92. gamemoded_manpage = configure_file(
  93. input: files('gamemoded.8.in'),
  94. output: 'gamemoded.8',
  95. configuration: data_conf,
  96. )
  97. install_man(
  98. gamemoded_manpage,
  99. install_dir: join_paths(path_mandir, 'man8')
  100. )
  101. gamemodelist_manpage = configure_file(
  102. input: files('gamemodelist.1.in'),
  103. output: 'gamemodelist.1',
  104. configuration: data_conf,
  105. )
  106. install_man(
  107. gamemodelist_manpage,
  108. install_dir: join_paths(path_mandir, 'man1')
  109. )
  110. if with_examples
  111. example_manpage = configure_file(
  112. input: files('gamemode-simulate-game.1.in'),
  113. output: 'gamemode-simulate-game.1',
  114. configuration: data_conf,
  115. )
  116. install_man(
  117. example_manpage,
  118. install_dir: join_paths(path_mandir, 'man1')
  119. )
  120. endif
  121. # Install metainfo
  122. metainfo_file = files('io.github.feralinteractive.gamemode.metainfo.xml')
  123. install_data(
  124. metainfo_file,
  125. install_dir: path_metainfo,
  126. )
  127. # Validate metainfo
  128. appstreamcli = find_program(
  129. 'appstreamcli',
  130. required: false
  131. )
  132. if appstreamcli.found()
  133. test(
  134. 'validate metainfo file',
  135. appstreamcli,
  136. args: ['validate', '--no-net', '--pedantic', metainfo_file],
  137. )
  138. endif