meson.build 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. actv = find_program(
  2. 'systemd-socket-activate',
  3. 'systemd-activate',
  4. join_paths('/', 'usr', 'lib', 'systemd', 'systemd-activate'),
  5. required: false
  6. )
  7. kgen = find_program(
  8. join_paths(libexecdir, 'tangd-keygen'),
  9. join_paths(get_option('prefix'), get_option('libdir'), 'tangd-keygen'),
  10. join_paths(get_option('prefix'), get_option('libexecdir'), 'tangd-keygen'),
  11. join_paths('/', 'usr', get_option('libdir'), 'tangd-keygen'),
  12. join_paths('/', 'usr', get_option('libexecdir'), 'tangd-keygen'),
  13. required: false
  14. )
  15. updt = find_program(
  16. join_paths(libexecdir, 'tangd-update'),
  17. join_paths(get_option('prefix'), get_option('libdir'), 'tangd-update'),
  18. join_paths(get_option('prefix'), get_option('libexecdir'), 'tangd-update'),
  19. join_paths('/', 'usr', get_option('libdir'), 'tangd-update'),
  20. join_paths('/', 'usr', get_option('libexecdir'), 'tangd-update'),
  21. required: false
  22. )
  23. tang = find_program(
  24. join_paths(libexecdir, 'tangd'),
  25. join_paths(get_option('prefix'), get_option('libdir'), 'tangd'),
  26. join_paths(get_option('prefix'), get_option('libexecdir'), 'tangd'),
  27. join_paths('/', 'usr', get_option('libdir'), 'tangd'),
  28. join_paths('/', 'usr', get_option('libexecdir'), 'tangd'),
  29. required: false
  30. )
  31. curl = find_program('curl', required: false)
  32. if curl.found()
  33. bins += join_paths(meson.current_source_dir(), 'clevis-decrypt-tang')
  34. bins += join_paths(meson.current_source_dir(), 'clevis-encrypt-tang')
  35. mans += join_paths(meson.current_source_dir(), 'clevis-encrypt-tang.1')
  36. if actv.found() and kgen.found() and updt.found() and tang.found()
  37. env = environment()
  38. env.set('SD_ACTIVATE', actv.path())
  39. env.set('TANGD_KEYGEN', kgen.path())
  40. env.set('TANGD_UPDATE', updt.path())
  41. env.set('TANGD', tang.path())
  42. env.prepend('PATH',
  43. join_paths(meson.source_root(), 'src'),
  44. meson.current_source_dir(),
  45. separator: ':'
  46. )
  47. test('pin-tang', find_program('./pin-tang'), env: env)
  48. else
  49. warning('Will not run tang tests due to missing dependencies!')
  50. endif
  51. else
  52. warning('Will not install tang pin due to missing dependencies!')
  53. endif