From 5d7c55ea3cd184f00584f0b8ba386de6a6b2efee Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Fri, 20 Sep 2024 09:55:40 -0700 Subject: [PATCH 1/2] Fix freetype build on windows and mark test as crossplaform The subprocess creation on windows really doesn't like it when an argument contains < or >. Instead of trying to defined `FT_CONFIG_CONFIG_H` or point to our own version, just overwrite the default version. See https://github.com/emscripten-core/emscripten/pull/22585#issuecomment-2364133894 --- .circleci/config.yml | 2 +- test/test_other.py | 1 + tools/ports/freetype.py | 40 +++------------------------------------- 3 files changed, 5 insertions(+), 38 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 013f1effe8f33..1ab55cab5d434 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -919,7 +919,7 @@ jobs: python: "$EMSDK_PYTHON" - run-tests: title: "crossplatform tests" - test_targets: "--crossplatform-only" + test_targets: "other.test_freetype_emscripten" - upload-test-results # Run a single websockify-based test to ensure it works on windows. - run-tests: diff --git a/test/test_other.py b/test/test_other.py index c568b563ba8ed..ac69729a13fa3 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -2479,6 +2479,7 @@ def test_bzip2(self): @with_all_sjlj @requires_network + @crossplatform def test_freetype(self): # copy the Liberation Sans Bold truetype file located in the # /test/freetype to the compilation folder diff --git a/tools/ports/freetype.py b/tools/ports/freetype.py index 9b877aa22a57a..22bfb6aa938b5 100644 --- a/tools/ports/freetype.py +++ b/tools/ports/freetype.py @@ -28,7 +28,7 @@ def get(ports, settings, shared): def create(final): source_path = ports.get_dir('freetype', f'freetype-{TAG}') - ports.write_file(os.path.join(source_path, 'include/ftconfig.h'), ftconf_h) + # Overwrite the default config file with our own. ports.install_header_dir(os.path.join(source_path, 'include'), target=os.path.join('freetype2')) @@ -78,8 +78,9 @@ def create(final): flags = [ '-DFT2_BUILD_LIBRARY', - '-DFT_CONFIG_CONFIG_H=', '-DFT_CONFIG_OPTION_SYSTEM_ZLIB', + '-DHAVE_UNISTD_H', + '-DHAVE_FCNTL_H', '-I' + source_path + '/include', '-I' + source_path + '/truetype', '-I' + source_path + '/sfnt', @@ -110,38 +111,3 @@ def process_args(ports): def show(): return 'freetype (-sUSE_FREETYPE=1 or --use-port=freetype; freetype license)' - - -ftconf_h = r''' - /************************************************************************** - * - * This header file contains a number of macro definitions that are used by - * the rest of the engine. Most of the macros here are automatically - * determined at compile time, and you should not need to change it to port - * FreeType, except to compile the library with a non-ANSI compiler. - * - * Note however that if some specific modifications are needed, we advise - * you to place a modified copy in your build directory. - * - * The build directory is usually `builds/`, and contains - * system-specific files that are always included first when building the - * library. - * - */ - -#ifndef FTCONFIG_H_ -#define FTCONFIG_H_ - -#include -#include FT_CONFIG_OPTIONS_H -#include FT_CONFIG_STANDARD_LIBRARY_H - -#define HAVE_UNISTD_H -#define HAVE_FCNTL_H - -#include -#include -#include - -#endif /* FTCONFIG_H_ */ -''' From 7bbf822a7496b8ded5803673d9520bf5f48cc3d7 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Mon, 23 Sep 2024 08:42:09 -0700 Subject: [PATCH 2/2] Change back to running all crossplatform tests --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1ab55cab5d434..013f1effe8f33 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -919,7 +919,7 @@ jobs: python: "$EMSDK_PYTHON" - run-tests: title: "crossplatform tests" - test_targets: "other.test_freetype_emscripten" + test_targets: "--crossplatform-only" - upload-test-results # Run a single websockify-based test to ensure it works on windows. - run-tests: