chore(linux): Build with meson instead of autotools 🏗️#8111
chore(linux): Build with meson instead of autotools 🏗️#8111ermshiperete merged 6 commits intomasterfrom
Conversation
User Test ResultsTest specification and instructions User tests are not required |
ea0ac29 to
84c26fb
Compare
This change introduces meson for building ibus-keyman instead of autotools. Closes #5981.
84c26fb to
eb076c0
Compare
|
The changes to core are going to be a little bit fun to merge with epic-ldml! |
mcdurdin
left a comment
There was a problem hiding this comment.
This is looking good, but I think we need to look at how we are using meson throughout the entire repo and avoid referencing files from other projects (i.e. core from linux in this case).
core/src/meson.build
Outdated
| 'km_kbp_processevent_api.cpp', | ||
| 'jsonpp.cpp', | ||
| 'mock/mock_processor.cpp', | ||
| kmxfiles = files( |
There was a problem hiding this comment.
| kmxfiles = files( | |
| kmx_files = files( |
and so on?
linux/ibus-keyman/meson.build
Outdated
| # define some variables. We wouldn't need this if we'd have a meson.build file | ||
| # in the Keyman root directory... | ||
| coredir = '@0@/../../core'.format(meson.current_source_dir()) |
There was a problem hiding this comment.
The problem with putting a meson.build in the root is it impacts all paths, doesn't it?
That said, I'm not all that excited about linux builds listing all the files in core separately -- it undoes a lot of the good of using meson in the first place. I'd prefer to see us building core as a static library and importing it that way.
There was a problem hiding this comment.
Good point. Refactored to create a static library and get rid of the direct references of core file.
There was a problem hiding this comment.
For Core, we need to generate both static library and DLL on Windows -- static library used by Keyman Engine, DLL used by Developer.
linux/ibus-keyman/src/meson.build
Outdated
| utilfiles = files( | ||
| 'keymanutil.c', | ||
| 'keymanutil.h', | ||
| 'kmpdetails.c', | ||
| 'kmpdetails.h', | ||
| ) | ||
|
|
||
| engine_sources = files( | ||
| 'main.c', | ||
| 'engine.c', | ||
| 'engine.h', | ||
| 'keycodes.h', | ||
| 'keyman-service.c', | ||
| 'keyman-service.h', | ||
| ) |
There was a problem hiding this comment.
| utilfiles = files( | |
| 'keymanutil.c', | |
| 'keymanutil.h', | |
| 'kmpdetails.c', | |
| 'kmpdetails.h', | |
| ) | |
| engine_sources = files( | |
| 'main.c', | |
| 'engine.c', | |
| 'engine.h', | |
| 'keycodes.h', | |
| 'keyman-service.c', | |
| 'keyman-service.h', | |
| ) | |
| util_files = files( | |
| 'keymanutil.c', | |
| 'keymanutil.h', | |
| 'kmpdetails.c', | |
| 'kmpdetails.h', | |
| ) | |
| engine_files = files( | |
| 'main.c', | |
| 'engine.c', | |
| 'engine.h', | |
| 'keycodes.h', | |
| 'keyman-service.c', | |
| 'keyman-service.h', | |
| ) |
We should use either _files or _sources consistently.
linux/ibus-keyman/tests/meson.build
Outdated
| @@ -0,0 +1,152 @@ | |||
| sources = [ | |||
There was a problem hiding this comment.
| sources = [ | |
| test_files = [ |
| while IFS= read -r -d '' file; do | ||
| testname=$(basename "$file" .kmx) | ||
| printf "$(basename "$file")\t${testname#k_}\n" | ||
| done < <(find . -name \*.kmx -print0 | sort -z) |
There was a problem hiding this comment.
Yes, the first one is the redirection of input, the second one takes the output of the command.
874aa2b to
00b5f34
Compare
00b5f34 to
c176ebc
Compare
emscripten doesn't support static libraries, so we explicitly build a static library unless we're building for wasm.
d3c5798 to
d39ba17
Compare
|
Latest Developer build failed with: |
mcdurdin
left a comment
There was a problem hiding this comment.
This looks much closer, good work. We just need to avoid changes to Core impacting other platforms
The static library is currently only needed for the ibus-keyman tests, so we only build it on Linux. It can't build with emscripten, and on Windows it'd need some additional work.
mcdurdin
left a comment
There was a problem hiding this comment.
What is our minimum meson version requirement for Linux now? I am seeing conflicting data. We should make it consistent across all meson.build project specs and in our docs.
If we can go 0.49 or higher, then we can use / instead of join_paths() which would be superfantastic.
Apart from that, requesting lots of little tidy-up changes, mostly!
linux/ibus-keyman/meson.build
Outdated
| '@0@/../../core/build/arch/debug/src'.format(meson.current_source_dir()), | ||
| '@0@/../../core/build/arch/release/src'.format(meson.current_source_dir()) |
There was a problem hiding this comment.
It might be better to conditionalize these on whether we are doing a debug build?
And then use core_dir:
core_dir / 'build/arch/debug/src'
core_dir / 'build/arch/release/src'
linux/ibus-keyman/tests/meson.build
Outdated
| env: [ | ||
| 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()), | ||
| 'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()), | ||
| ], |
There was a problem hiding this comment.
| env: [ | |
| 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()), | |
| 'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()), | |
| ], | |
| env: test_env, |
linux/ibus-keyman/tests/meson.build
Outdated
| env: [ | ||
| 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()), | ||
| 'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()), | ||
| ], |
There was a problem hiding this comment.
| env: [ | |
| 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()), | |
| 'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()), | |
| ], | |
| env: test_env, |
linux/ibus-keyman/tests/meson.build
Outdated
| env: [ | ||
| 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()), | ||
| 'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()), | ||
| ], |
There was a problem hiding this comment.
| env: [ | |
| 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()), | |
| 'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()), | |
| ], | |
| env: test_env, |
linux/ibus-keyman/tests/meson.build
Outdated
| env: [ | ||
| 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()), | ||
| 'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()), | ||
| ], |
There was a problem hiding this comment.
| env: [ | |
| 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()), | |
| 'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()), | |
| ], | |
| env: test_env, |
- make use of new meson features - some refactoring
|
Changes in this pull request will be available for download in Keyman version 17.0.43-alpha |
This change introduces meson for building ibus-keyman instead of autotools.
Closes #5981.
@keymanapp-test-bot skip