diff --git a/.github/scripts/install-dependencies-macos.sh b/.github/scripts/install-dependencies-macos.sh index 879f8ad..ca153ba 100755 --- a/.github/scripts/install-dependencies-macos.sh +++ b/.github/scripts/install-dependencies-macos.sh @@ -11,6 +11,7 @@ brew install \ hidapi \ doxygen \ cmocka \ - meson + meson \ + inih exit 0 diff --git a/.github/scripts/install-dependencies-ubuntu.sh b/.github/scripts/install-dependencies-ubuntu.sh index f6365fd..8c2e95c 100755 --- a/.github/scripts/install-dependencies-ubuntu.sh +++ b/.github/scripts/install-dependencies-ubuntu.sh @@ -15,6 +15,7 @@ sudo apt-get install -y \ doxygen \ libcmocka-dev \ faketime \ - meson + meson \ + libinih-dev exit 0 diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..98d24fe --- /dev/null +++ b/meson.build @@ -0,0 +1,40 @@ +project('libx52', 'C', + license: 'GPL-2.0-only WITH Classpath-exception-2.0', + license_files: ['LICENSE'], + version: 'Version') + +# Internationalization +i18n = import('i18n') +# define GETTEXT_PACKAGE +add_project_arguments('-DGETTEXT_PACKAGE="libx52"', language:'C') +i18n.gettext(meson.project_name()) + +dep_systemd = dependency('systemd', required: false) +dep_libusb = dependency('libusb-1.0', required: true) +dep_evdev = dependency('libevdev', required: false) +dep_hidapi = dependency('hidapi-hidraw', 'hidapi', required: true) +dep_udev = dependency('udev', required: false) + +doxygen_program = find_program('doxygen', required: false) + +# Python 3.5 or greater is needed +pymod = import('python') +pyinstall = pymod.find_installation('python3') +pyversion = pyinstall.language_version().split('.') +assert(pyversion[1].to_int() >= 5, 'Require Python >= 3.5') + +####################################################################### +# Internal dependencies +####################################################################### + +# pinelog +sub_pinelog = subproject('pinelog', required: true) +dep_pinelog = sub_pinelog.get_variable('libpinelog_dep') + +# inih +# Try to use system inih, otherwise fallback to using Git +dep_inih = dependency('inih', required: false) +if not dep_inih.found() + sub_inih = subproject('inih', required: true) + dep_inih = sub_inih.get_variable('inih_dep') +endif