1
0

meson.build 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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. check: true,
  12. ).stdout().strip()
  13. data_conf.set('GAMEMODE_EXAMPLE_CONFIG', config_example)
  14. if sd_bus_provider == 'systemd'
  15. if with_systemd_unit
  16. # Install systemd user unit
  17. configure_file(
  18. input: 'gamemoded.service.in',
  19. output: 'gamemoded.service',
  20. configuration: data_conf,
  21. install_dir: path_systemd_unit_dir,
  22. )
  23. endif
  24. if with_systemd_group
  25. # Install the sysusers.d file
  26. install_data(
  27. files('gamemode.conf'),
  28. install_dir: path_systemd_group_dir,
  29. )
  30. endif
  31. endif
  32. # Install the D-BUS service file
  33. configure_file(
  34. input: 'com.feralinteractive.GameMode.service.in',
  35. output: 'com.feralinteractive.GameMode.service',
  36. configuration: data_conf,
  37. install_dir: path_dbus_service_dir,
  38. )
  39. # Install the Polkit action file in all cases
  40. configure_file(
  41. input: 'com.feralinteractive.GameMode.policy.in',
  42. output: 'com.feralinteractive.GameMode.policy',
  43. configuration: data_conf,
  44. install_dir: path_polkit_action_dir,
  45. )
  46. # Install the helper run script
  47. install_data(
  48. files('gamemoderun'),
  49. install_dir: path_bindir,
  50. install_mode: 'rwxr-xr-x',
  51. )
  52. # Install script to find processes with gamemode lib in runtime
  53. install_data(
  54. files('gamemodelist'),
  55. install_dir: path_bindir,
  56. install_mode: 'rwxr-xr-x',
  57. )
  58. # Configure and install man pages
  59. gamemoded_manpage = configure_file(
  60. input: files('gamemoded.8.in'),
  61. output: 'gamemoded.8',
  62. configuration: data_conf,
  63. )
  64. install_man(
  65. gamemoded_manpage,
  66. install_dir: join_paths(path_mandir, 'man8')
  67. )
  68. gamemoderun_manpage = configure_file(
  69. input: files('gamemoderun.1.in'),
  70. output: 'gamemoderun.1',
  71. configuration: data_conf,
  72. )
  73. install_man(
  74. gamemoderun_manpage,
  75. install_dir: join_paths(path_mandir, 'man1')
  76. )
  77. gamemodelist_manpage = configure_file(
  78. input: files('gamemodelist.1.in'),
  79. output: 'gamemodelist.1',
  80. configuration: data_conf,
  81. )
  82. install_man(
  83. gamemodelist_manpage,
  84. install_dir: join_paths(path_mandir, 'man1')
  85. )
  86. if with_examples
  87. example_manpage = configure_file(
  88. input: files('gamemode-simulate-game.1.in'),
  89. output: 'gamemode-simulate-game.1',
  90. configuration: data_conf,
  91. )
  92. install_man(
  93. example_manpage,
  94. install_dir: join_paths(path_mandir, 'man1')
  95. )
  96. endif
  97. # Install metainfo
  98. metainfo_file = files('io.github.feralinteractive.gamemode.metainfo.xml')
  99. install_data(
  100. metainfo_file,
  101. install_dir: path_metainfo,
  102. )
  103. # Validate metainfo
  104. appstreamcli = find_program(
  105. 'appstreamcli',
  106. required: false
  107. )
  108. if appstreamcli.found()
  109. test(
  110. 'validate metainfo file',
  111. appstreamcli,
  112. args: ['validate', '--no-net', '--pedantic', metainfo_file],
  113. )
  114. endif