Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): ldml repertoire test, initial ICU integration 🙀 #8441

Merged
merged 35 commits into from
Apr 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
0693e64
feat(core): ldml repertoire test 🙀
srl295 Mar 15, 2023
ec68f6c
feat(core): ldml repertoire test 🙀
srl295 Mar 16, 2023
ab61467
feat(core): ldml repertoire test 🙀
srl295 Mar 16, 2023
cd47909
feat(core): ldml repertoire test 🙀
srl295 Mar 16, 2023
f33dea2
feat(core): icu integration escapade 🙀
srl295 Mar 30, 2023
f2b8b9b
feat(core): check in icu-minimal.wrap and mesonfiles from wrapdb 🙀
srl295 Mar 31, 2023
fc87334
feat(core): icu integration steps 🙀
srl295 Mar 31, 2023
21cae0b
feat(core): icu integration steps 🙀
srl295 Mar 31, 2023
6d9377f
Merge remote-tracking branch 'upstream/master' into feat/core-8435-re…
srl295 Mar 31, 2023
5895072
fix(resources): hotpatch to jis/abnt 🙀
srl295 Mar 31, 2023
0c9277c
feat(core): icu integration steps 🙀
srl295 Mar 31, 2023
cee27a2
feat(core): icu integration steps 🙀
srl295 Mar 31, 2023
82944c4
Update core/src/kmx/kmx_plus.h
srl295 Apr 5, 2023
6bc70d8
Update core/src/kmx/kmx_plus.h
srl295 Apr 5, 2023
091e962
Merge branch 'master' into feat/core-8435-repertoire-test-epic-ldml
srl295 Apr 5, 2023
f86109f
feat(core): icu integration steps 🙀
srl295 Apr 5, 2023
2826736
feat(core): icu integration steps 🙀
srl295 Apr 5, 2023
8330baf
fix(core): update test to summarize failures 🙀
srl295 Apr 5, 2023
fc34282
fix(core): update repertoire test to use strings properly 🙀
srl295 Apr 6, 2023
e7b4eb4
fix(core): use pkgconfig on linux, else wrap 🙀
srl295 Apr 6, 2023
d357f39
fix(core): add a readme under core/subprojects 🙀
srl295 Apr 6, 2023
9152ab5
Merge branch 'master' into feat/core-8435-repertoire-test-epic-ldml
mcdurdin Apr 10, 2023
05a3043
feat(core): icu integration steps 🙀
srl295 Apr 12, 2023
0d4afa0
feat(core): icu integration steps 🙀
srl295 Apr 12, 2023
458e41c
Merge branch 'master' into feat/core-8435-repertoire-test-epic-ldml
srl295 Apr 12, 2023
028ccbc
feat(core): icu integration steps 🙀
srl295 Apr 12, 2023
c168253
feat(core): icu integration steps 🙀
srl295 Apr 12, 2023
a01e58a
Merge branch 'master' into feat/core-8435-repertoire-test-epic-ldml
srl295 Apr 13, 2023
1a58a59
feat(core): icu to 73.1 🙀
srl295 Apr 13, 2023
ee0c660
Merge branch 'master' into feat/core-8435-repertoire-test-epic-ldml
srl295 Apr 14, 2023
8576484
chore: revert zipfile add
srl295 Apr 21, 2023
489a0ac
Merge branch 'master' into feat/core-8435-repertoire-test-epic-ldml
srl295 Apr 21, 2023
aa1a702
chore(core): icu fixes in comments and linux packaging 🙀
srl295 Apr 24, 2023
4247cad
Merge branch 'master' into feat/core-8435-repertoire-test-epic-ldml
srl295 Apr 24, 2023
d52e932
doc(core): Update core/subprojects/README.md
srl295 Apr 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion core/cross-mac-arm64.build
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ ar = 'ar'
ld = 'ld'
strip = 'strip'
lipo = 'lipo'
ranlib = 'ranlib'
ranlib = 'ranlib'
pkgconfig = 'pkg-config'
3 changes: 2 additions & 1 deletion core/cross-mac-x86_64.build
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ ar = 'ar'
ld = 'ld'
strip = 'strip'
lipo = 'lipo'
ranlib = 'ranlib'
ranlib = 'ranlib'
pkgconfig = 'pkg-config'
2 changes: 1 addition & 1 deletion core/src/debuglog.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ void write_console(KMX_BOOL error, const wchar_t *fmt, ...);

}
}
}
}
12 changes: 11 additions & 1 deletion core/src/kmx/kmx_plus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -670,14 +670,24 @@ COMP_KMXPLUS_KEYS_Helper::getKeys(KMX_DWORD i) const {

const COMP_KMXPLUS_KEYS_KEY*
COMP_KMXPLUS_KEYS_Helper::findKeyByStringId(KMX_DWORD strId, KMX_DWORD &i) const {
for (i = 0; i < key2->keyCount; i++) {
for (; i < key2->keyCount; i++) {
if (keys[i].id == strId) {
return &keys[i];
}
}
return nullptr;
}

const COMP_KMXPLUS_KEYS_KEY*
COMP_KMXPLUS_KEYS_Helper::findKeyByStringTo(KMX_DWORD strId, KMX_DWORD &i) const {
for (; i < key2->keyCount; i++) {
if (keys[i].to == strId) {
return &keys[i];
}
}
return nullptr;
}

const COMP_KMXPLUS_KEYS_FLICK_LIST *
COMP_KMXPLUS_KEYS_Helper::getFlickLists(KMX_DWORD i) const {
if (!valid() || i >= key2->flicksCount) {
Expand Down
9 changes: 8 additions & 1 deletion core/src/kmx/kmx_plus.h
Original file line number Diff line number Diff line change
Expand Up @@ -506,10 +506,17 @@ class COMP_KMXPLUS_KEYS_Helper {
/**
* Search for a key by string id.
* @param strID id to search for
* @param index on exit, index of item if found. Undefined otherwise.
* @param index on entry, id to start with such as 0. On exit, index of item if found. Undefined otherwise.
* @return pointer to key or nullptr
*/
const COMP_KMXPLUS_KEYS_KEY *findKeyByStringId(KMX_DWORD strId, KMX_DWORD &index) const;
/**
* Search for a key by 'to' string id
* @param strID id to search for
* @param index on entry, id to start with such as 0. On exit, index of item if found. Undefined otherwise.
* @return pointer to key or nullptr
*/
const COMP_KMXPLUS_KEYS_KEY *findKeyByStringTo(KMX_DWORD strId, KMX_DWORD &index) const;

private:
const COMP_KMXPLUS_KEYS *key2;
Expand Down
4 changes: 4 additions & 0 deletions core/subprojects/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/icu
/*.zip
/*.tgz
/packagecache
12 changes: 12 additions & 0 deletions core/subprojects/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# core/subprojects

## What's this? What _is_ this?

- These are subprojects accessible to the `core` meson project.

## icu

- When building for Linux, [ICU](https://icu.unicode.org) must already be installed. The system ICU will be used instead of the subproject.
- Patches for icu (i.e. meson build files) are in [`packagefiles/icu`](./packagefiles/icu/)
- It would be preferable to use meson's [wrapdb](https://mesonbuild.com/Wrapdb-projects.html), and in fact the patchfiles here are sourced from that project.
- However, having our own patchfiles allows for slimming down ICU, at least until the wrapdb version is more configurable [mesonbuild/wrapdb#950](https://github.com/mesonbuild/wrapdb/issues/950)
14 changes: 14 additions & 0 deletions core/subprojects/icu-minimal.wrap
srl295 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[wrap-file]
directory = icu
source_url = https://github.com/unicode-org/icu/releases/download/release-73-1/icu4c-73_1-src.tgz
source_filename = icu4c-73_1-src.tgz
source_hash = a457431de164b4aa7eca00ed134d00dfbf88a77c6986a10ae7774fc076bb8c45
## TODO-LDML: Note, need meson 0.55.0 to use patch_directory
patch_directory = icu

# Based on: wrapdb_version = 72.1-3

[provide]
icu-uc = icuuc_dep
# TODO-LDML: not including i18n at present
#icu-i18n = icui18n_dep
19 changes: 19 additions & 0 deletions core/subprojects/packagefiles/icu/LICENSE.meson
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2021 The Meson development team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
98 changes: 98 additions & 0 deletions core/subprojects/packagefiles/icu/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
project(
'icu',
'c',
'cpp',
version: '73.1',
meson_version: '>=0.57.0', # TODO-LDML: Too high for debian
default_options: [ 'cpp_std=c++17' ],
)

U_ICU_VERSION = meson.project_version()
PACKAGE_ICU_DESCRIPTION = 'International Components for Unicode'
PACKAGE_ICU_URL = 'http://icu-project.org'

cpp = meson.get_compiler('cpp')
# cpp_native = meson.get_compiler('cpp', native: true)

have_elf_h = cpp.has_header('elf.h')

if host_machine.system() == 'windows'
add_project_arguments('-DU_PLATFORM_USES_ONLY_WIN32_API', language: 'cpp')
add_project_arguments('-DWIN32', '-DWIN64', '-D_MBCS', language: 'cpp')
add_project_arguments('-DU_PLATFORM_USES_ONLY_WIN32_API', language: 'c')
add_project_arguments('-DWIN32', '-DWIN64', '-D_MBCS', language: 'c')
endif
mcdurdin marked this conversation as resolved.
Show resolved Hide resolved


# per icudefs.mk.in:
# "U_ATTRIBUTE_DEPRECATED is defined to hide warnings about deprecated API warnings."
add_project_arguments('-DU_ATTRIBUTE_DEPRECATED=', '-DUCONFIG_USE_LOCAL=1', language: 'c')

add_project_arguments('-DU_NOEXCEPT=', language: 'c')

uconfig = configuration_data()

uconfig.set('U_ENABLE_DYLOAD', 0) # no DLL
uconfig.set('U_CHECK_DYLOAD', 0) # no DLL
uconfig.set('UCONFIG_NO_FILE_IO', 1)
uconfig.set('UCONFIG_NO_LEGACY_CONVERSION', 1) # turn off file based codepage conversion
uconfig.set('UCONFIG_NO_NORMALIZATION', 1) # TODO-LDML: may want this
uconfig.set('UCONFIG_NO_BREAK_ITERATION', 1) # TODO-LDML: may want this
uconfig.set('UCONFIG_NO_IDNA', 1)
uconfig.set('UCONFIG_NO_COLLATION', 1)
uconfig.set('UCONFIG_NO_FORMATTING', 1)
uconfig.set('UCONFIG_NO_TRANSLITERATION', 1)
uconfig.set('UCONFIG_NO_REGULAR_EXPRESSIONS', 1) # TODO-LDML: Will probably want this for transforms #7375
uconfig.set('UCONFIG_NO_SERVICE', 1)


uconfig_local = configure_file(
configuration : uconfig,
# dir : 'source/common/unicode',
output : 'uconfig_local.h',
)


if cpp.get_argument_syntax() == 'msvc'
# TODO-LDML: cl : Command line error D8016 : '/utf-8' and '/source-charset:utf-8' command-line options are incompatible
# see note in core/meson.build
# add_project_arguments('/utf-8', language: 'cpp')
# add_project_arguments('/utf-8', language: 'c')
endif

# TODO-LDML: skip this check
# if meson.version().version_compare('>= 0.62')
# dl_dep = dependency('dl', required: false)
# dl_native_dep = dependency('dl', required: false, native: true)
# else
# dl_dep = cpp.find_library('dl', required: false)
# dl_native_dep = cpp_native.find_library('dl', required: false, native: true)
# endif

windows = import('windows')
pkg = import('pkgconfig')

# Compiler flags the users of this library must use.
usage_args = []

if get_option('default_library') == 'static'
add_project_arguments('-DU_STATIC_IMPLEMENTATION', language: 'c')
add_project_arguments('-DU_STATIC_IMPLEMENTATION', language: 'cpp')
usage_args = ['-DU_STATIC_IMPLEMENTATION']
if cpp.get_argument_syntax() == 'msvc'
library_prefix = ''
library_suffix = ''
else
library_prefix = 's'
if get_option('buildtype') == 'debug'
library_suffix = 'd'
else
library_suffix = ''
endif
endif
else
library_prefix = ''
library_suffix = ''
endif

subdir('source')