Skip to content

Commit

Permalink
m116-f44dbc40d8
Browse files Browse the repository at this point in the history
  • Loading branch information
tonsky committed Aug 7, 2023
1 parent 48b6820 commit 3ee9e01
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
default: 'false'

env:
version: m109-664500fa93
version: m116-f44dbc40d8

jobs:
macos:
Expand Down Expand Up @@ -52,7 +52,9 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: sudo ./script/prepare_linux.sh
- run: sudo apt-get install g++-9-aarch64-linux-gnu -y
- run: |
sudo apt-get update
sudo apt-get --yes install g\+\+-9-aarch64-linux-gnu
if: ${{ matrix.target_machine == 'arm64' }}
- run: python3 script/check_release.py --version ${{ env.version }} --build-type ${{ matrix.build_type }} --machine ${{ matrix.target_machine }}
if: ${{ github.event.inputs.skip_release != 'true' }}
Expand Down
20 changes: 10 additions & 10 deletions patches/11081_SkLoadICU.cpp.patch
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ index 5b3b153336..8696aaf927 100644

#include "unicode/udata.h"

-static void* win_mmap(const char* dataFile) {
-static void* win_mmap(const wchar_t* dataFile) {
- if (!dataFile) {
- return nullptr;
- }
+static void* win_mmap(const std::string& dataFile, std::ostringstream& buffer) {
+static void* win_mmap(const std::wstring& dataFile, std::ostringstream& buffer) {
struct FCloseWrapper { void operator()(FILE* f) { fclose(f); } };
- std::unique_ptr<FILE, FCloseWrapper> stream(fopen(dataFile, "rb"));
+ std::unique_ptr<FILE, FCloseWrapper> stream(fopen(dataFile.c_str(), "rb"));
- std::unique_ptr<FILE, FCloseWrapper> stream(_wfopen(dataFile, L"rb"));
+ std::unique_ptr<FILE, FCloseWrapper> stream(_wfopen(dataFile, L"rb"));
if (!stream) {
- fprintf(stderr, "SkIcuLoader: datafile missing: %s.\n", dataFile);
- fprintf(stderr, "SkIcuLoader: datafile missing: %ls.\n", dataFile);
+ buffer << "SkLoadICU: datafile '" << dataFile << "' is missing" << std::endl;
return nullptr;
}
Expand Down Expand Up @@ -51,11 +51,11 @@ index 5b3b153336..8696aaf927 100644
}
return addr;
@@ -86,23 +84,20 @@ static std::string executable_directory() {
return end ? std::string(path, end - path) : std::string();
return get_module_path(hModule);
}

-static bool load_from(const std::string& dir) {
- auto sPath = dir + "\\icudtl.dat";
-static bool load_from(const std::wstring& dir) {
- auto sPath = dir + L"\\icudtl.dat";
- if (void* addr = win_mmap(sPath.c_str())) {
- if (init_icu(addr)) {
- return true;
Expand All @@ -71,9 +71,9 @@ index 5b3b153336..8696aaf927 100644
std::call_once(flag, []() {
- good = load_from(executable_directory()) || load_from(library_directory());
+ std::ostringstream buffer;
+ void* addr = win_mmap(library_directory() + "\\icudtl.dat", buffer);
+ void* addr = win_mmap(library_directory() + L"\\icudtl.dat", buffer);
+ if (addr == nullptr)
+ addr = win_mmap(executable_directory() + "\\icudtl.dat", buffer);
+ addr = win_mmap(executable_directory() + L"\\icudtl.dat", buffer);
+ if (addr == nullptr)
+ fputs(buffer.str().c_str(), stderr);
+ if (addr)
Expand Down
1 change: 1 addition & 0 deletions script/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def main():
'modules/sksg/include/*.h',
'modules/skshaper/include/*.h',
'modules/skshaper/src/*.h',
'modules/skunicode/include/*.h',
'modules/svg/include/*.h',
'src/**/*.h',
'third_party/externals/angle2/LICENSE',
Expand Down
2 changes: 0 additions & 2 deletions script/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def main():
args += [
'skia_use_system_freetype2=false',
# 'skia_enable_gpu=true',
# 'skia_use_gl=true',
'skia_use_metal=true',
'extra_cflags_cc=["-frtti"]'
]
Expand All @@ -50,7 +49,6 @@ def main():
args += [
'skia_use_system_freetype2=true',
# 'skia_enable_gpu=true',
# 'skia_use_gl=true',
'extra_cflags_cc=["-frtti"]',
]

Expand Down

0 comments on commit 3ee9e01

Please sign in to comment.