Skip to content

Commit

Permalink
Merge pull request #11334 from keymanapp/feat/mac/mcompile_mac
Browse files Browse the repository at this point in the history
feat(mac): mnemonic layout support 🐘
  • Loading branch information
SabineSIL authored Oct 25, 2024
2 parents 504c20b + 960bbdc commit f9e7db1
Show file tree
Hide file tree
Showing 16 changed files with 3,187 additions and 39 deletions.
2 changes: 1 addition & 1 deletion VERSION.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.0.126
18.0.126
3 changes: 0 additions & 3 deletions common/include/km_types.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#pragma once
#include <stdint.h>

#include <stdint.h>

/*
#if defined(_WIN32) || defined(_WIN64)
#define snprintf _snprintf
Expand Down
40 changes: 5 additions & 35 deletions linux/mcompile/keymap/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# adjust relative paths as necessary
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
. "${THIS_SCRIPT%/*}/../../../resources/build/builder.inc.sh"
. "${THIS_SCRIPT%/*}/../../../resources/build/meson-utils.inc.sh"
## END STANDARD BUILD SCRIPT INCLUDE

#. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh"
Expand All @@ -26,38 +27,7 @@ builder_describe_outputs \

TARGET_PATH="$THIS_SCRIPT_PATH/build"

do_clean() {
rm -rf "$THIS_SCRIPT_PATH/resources"
rm -rf "$TARGET_PATH"
}

do_configure() {
# Import our standard compiler defines; this is copied from
# /resources/build/meson/standard.meson.build by build.sh, because meson doesn't
# allow us to reference a file outside its root
mkdir -p "$THIS_SCRIPT_PATH/resources"
cp "$KEYMAN_ROOT/resources/build/meson/standard.meson.build" "$THIS_SCRIPT_PATH/resources/meson.build"

pushd "$THIS_SCRIPT_PATH" > /dev/null
# Additional arguments are used by Linux build, e.g. -Dprefix=${INSTALLDIR}
meson setup build --buildtype $BUILDER_CONFIGURATION "${builder_extra_params[@]}"
popd > /dev/null

}

do_build() {
pushd "$TARGET_PATH" > /dev/null
ninja
popd > /dev/null
}

do_test() {
pushd "$TARGET_PATH" > /dev/null
meson test "${builder_extra_params[@]}"
popd > /dev/null
}

builder_run_action clean do_clean
builder_run_action configure do_configure
builder_run_action build do_build
builder_run_action test do_test
builder_run_action clean do_meson_clean
builder_run_action configure do_meson_configure
builder_run_action build do_meson_build
builder_run_action test do_meson_test
1 change: 1 addition & 0 deletions mac/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ builder_describe "Builds Keyman for macOS." \
"install Installs result of Keyman4MacIM locally." \
":engine KeymanEngine4Mac" \
":app Keyman4MacIM" \
":mcompile mnemonic layout recompiler- mac" \
":testapp Keyman4Mac (test harness)" \
"--quick,-q Bypasses notarization for $(builder_term install)"

Expand Down
2 changes: 2 additions & 0 deletions mac/mcompile/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
resources/
build/
31 changes: 31 additions & 0 deletions mac/mcompile/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash

## START STANDARD BUILD SCRIPT INCLUDE
# adjust relative paths as necessary
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
. "${THIS_SCRIPT%/*}/../../resources/build/builder.inc.sh"
. "${THIS_SCRIPT%/*}/../../resources/build/meson-utils.inc.sh"
## END STANDARD BUILD SCRIPT INCLUDE

################################ Main script ################################

builder_describe \
"Mnemonic layout recompiler for macOS" \
"@/common/include" \
"clean" \
"configure" \
"build" \
"test"

builder_parse "$@"

builder_describe_outputs \
configure build/build.ninja \
build build/mcompile

TARGET_PATH="$THIS_SCRIPT_PATH/build"

builder_run_action clean do_meson_clean
builder_run_action configure do_meson_configure
builder_run_action build do_meson_build
builder_run_action test do_meson_test
Loading

0 comments on commit f9e7db1

Please sign in to comment.