setup.py 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #!/usr/bin/env python3
  2. # Copyright 2016 The Meson development team
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. # http://www.apache.org/licenses/LICENSE-2.0
  7. # Unless required by applicable law or agreed to in writing, software
  8. # distributed under the License is distributed on an "AS IS" BASIS,
  9. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. # See the License for the specific language governing permissions and
  11. # limitations under the License.
  12. import sys
  13. if sys.version_info < (3, 5, 2):
  14. raise SystemExit('ERROR: Tried to install Meson with an unsupported Python version: \n{}'
  15. '\nMeson requires Python 3.5.2 or greater'.format(sys.version))
  16. from mesonbuild.coredata import version
  17. from setuptools import setup
  18. # On windows, will create Scripts/meson.exe and Scripts/meson-script.py
  19. # Other platforms will create bin/meson
  20. entries = {'console_scripts': ['meson=mesonbuild.mesonmain:main']}
  21. packages = ['mesonbuild',
  22. 'mesonbuild.ast',
  23. 'mesonbuild.backend',
  24. 'mesonbuild.cmake',
  25. 'mesonbuild.compilers',
  26. 'mesonbuild.compilers.mixins',
  27. 'mesonbuild.dependencies',
  28. 'mesonbuild.modules',
  29. 'mesonbuild.scripts',
  30. 'mesonbuild.templates',
  31. 'mesonbuild.wrap']
  32. package_data = {
  33. 'mesonbuild.dependencies': ['data/CMakeLists.txt', 'data/CMakeListsLLVM.txt', 'data/CMakePathInfo.txt'],
  34. 'mesonbuild.cmake': ['data/run_ctgt.py', 'data/preload.cmake'],
  35. }
  36. data_files = []
  37. if sys.platform != 'win32':
  38. # Only useful on UNIX-like systems
  39. data_files = [('share/man/man1', ['man/meson.1']),
  40. ('share/polkit-1/actions', ['data/com.mesonbuild.install.policy'])]
  41. if __name__ == '__main__':
  42. setup(name='meson',
  43. version=version,
  44. packages=packages,
  45. package_data=package_data,
  46. entry_points=entries,
  47. data_files=data_files,)