From 6db16be7501d2491cdeb2997ca5b8dabc1f7c46c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Fri, 17 Apr 2026 19:35:48 +0200 Subject: [PATCH 01/80] feature: Prototype for all 3rd-party builder --- Common/3dParty/build_3rdparty.py | 44 +++++++ Common/3dParty/icu/nc-build-cygwin.sh | 36 ++++++ Common/3dParty/icu/nc-build.bat | 68 +++++++++++ Common/3dParty/icu/nc-build.py | 168 ++++++++++++++++++++++++++ 4 files changed, 316 insertions(+) create mode 100644 Common/3dParty/build_3rdparty.py create mode 100644 Common/3dParty/icu/nc-build-cygwin.sh create mode 100644 Common/3dParty/icu/nc-build.bat create mode 100644 Common/3dParty/icu/nc-build.py diff --git a/Common/3dParty/build_3rdparty.py b/Common/3dParty/build_3rdparty.py new file mode 100644 index 0000000000..3769c79ed8 --- /dev/null +++ b/Common/3dParty/build_3rdparty.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python3 + +# import os +import sys +import subprocess +from pathlib import Path + +script_path = Path(sys.argv[0]).resolve() +script_dir = script_path.parent + +work_dir = Path( sys.argv[1] ) +install_dir = Path( sys.argv[2] ) + +subfolders = [ + # 'apple', + # 'brotli', + # 'harfbuzz', + # 'html', + # 'hyphen' + 'icu' + # 'md', + # 'openssl', + # 'socket-io' +] + +for subfolder in subfolders: + print( f"Working on {subfolder}..." ) + print( f" Invoking {str(Path( script_dir / subfolder / "nc-build.py" ))}" ) + sub_script = Path( script_dir / subfolder / "nc-build.py" ) + if sub_script.exists(): + try: + subprocess.run( + [sys.executable, sub_script, work_dir / subfolder, install_dir / subfolder], + check=True, + text=True + ) + except subprocess.CalledProcessError as e: + print(f"\n❌ {subfolder} failed with code {e.returncode}") + sys.exit(e.returncode) + + print( f"✅ {subfolder} ready" ) + + else: + print( "Not good" ) diff --git a/Common/3dParty/icu/nc-build-cygwin.sh b/Common/3dParty/icu/nc-build-cygwin.sh new file mode 100644 index 0000000000..49023013fd --- /dev/null +++ b/Common/3dParty/icu/nc-build-cygwin.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +install_dir="$1" + +# If the install dir comes from wsl, convert that to cygwin path +if [[ $install_dir == /mnt/* ]]; then + install_dir="/cygdrive/${install_dir#/mnt/}" +fi + +export PATH="$PATH:/usr/bin" +export PYTHON=/usr/bin/python3 + +abort_op() +{ + echo "ICU-CygWin aborted: $1" >&2 + exit 1 +} + +if [ ! -f "./runConfigureICU" ] +then + abort_op "This script has to be run from the icu/source directory (cannot find runConfigureICU)" +fi + +if [ ! -d "$install_dir" ] +then + mkdir -p "$install_dir" || abort_op "Failed to create install dir" +fi + +"./runConfigureICU" Cygwin/MSVC \ + --prefix="$install_dir" \ + --enable-shared \ + --disable-static || abort_op "Configuration failed" + +# Build and install +make -j$(nproc) || abort_op "Build failed" +make install || abort_op "Install failed" diff --git a/Common/3dParty/icu/nc-build.bat b/Common/3dParty/icu/nc-build.bat new file mode 100644 index 0000000000..c4f0b9f7a4 --- /dev/null +++ b/Common/3dParty/icu/nc-build.bat @@ -0,0 +1,68 @@ +@REM @echo off +@REM set PATH=C:\cygwin64\bin;%PATH% +@REM call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsx86_amd64.bat" + +@REM cd /D C:\Users\adaor\Repos\eo-core\build\icu\work\icu\source + +@REM bash /cygdrive/c/Users/adaor/Repos/eo-core/core/Common/3dParty/icu/nc-cygwin.sh + + +@echo off +setlocal + +REM ---- defaults ---- +set "CYGWIN_BIN=%~1" +if "%CYGWIN_BIN%"=="" set "CYGWIN_BIN=C:\cygwin64\bin" + +set "VCVARS=%~2" +if "%VCVARS%"=="" set "VCVARS=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsx86_amd64.bat" + +REM ---- required args ---- +set "ICU_SOURCE=%~3" +set "ICU_INSTALL=%~4" + +if "%ICU_SOURCE%"=="" goto :usage +if "%ICU_INSTALL%"=="" goto :usage + +REM ---- PATH ORDER: MSVC first, Cygwin second ---- +set "PATH=%CYGWIN_BIN%;%PATH%" +call "%VCVARS%" || exit /b 1 + +echo "------------- DBG 1" + +REM ---- run build ---- +cd /D "%ICU_SOURCE%" || exit /b 1 + +echo "------------- DBG 2" + +for /f %%i in ('cygpath "%~dp0"') do set SCRIPT_DIR=%%i + +for /f %%i in ('cygpath "%ICU_INSTALL%"') do set INSTALL_DIR=%%i + +echo "Script dir : %SCRIPT_DIR%" +echo "Install dir: %INSTALL_DIR%" +@REM exit 0 + +%CYGWIN_BIN%\bash.exe "%SCRIPT_DIR%nc-build-cygwin.sh" "%INSTALL_DIR%" + +exit /b %errorlevel% + +:usage +echo. +echo Usage: +echo %~nx0 [cygwin_bin] [vcvars_bat] ^ ^ +echo. +echo Arguments: +echo 1. cygwin_bin Optional. Default: C:\cygwin64\bin +echo 2. vcvars_bat Optional. Default: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsx86_amd64.bat +echo 3. icu_source Required. Path of the ICU sources dir, e.g. +echo C:\Users\superdev\Repos\icu\source +echo 4. icu_install Required. Path of the ICU output/install dir, e.g. +echo C:\Users\superdev\icu_install +echo. +echo Example: +echo %~nx0 "" "" ^ +echo C:\Users\superdev\Repos\icu\source ^ +echo C:\Users\superdev\icu_install +echo. +exit /b 2 diff --git a/Common/3dParty/icu/nc-build.py b/Common/3dParty/icu/nc-build.py new file mode 100644 index 0000000000..e70c6cc8f6 --- /dev/null +++ b/Common/3dParty/icu/nc-build.py @@ -0,0 +1,168 @@ +#!/usr/bin/env python3 + +import sys +import shutil +import subprocess +import os +from pathlib import Path + +work_dir = Path( sys.argv[1] ) +install_dir = Path( sys.argv[2] ) +force_redo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" + +script_path = Path(sys.argv[0]).resolve() +script_dir = script_path.parent +icu_major = "74" +icu_minor = "2" +debug_mode = True +dep_name = "ICU" + +def abort_op( message : str, keep_work : bool = False ): + print( f"Aboring {dep_name}: {message}", file = sys.stderr ) + if not debug_mode: + try: + if not keep_work: + shutil.rmtree( work_dir ) + shutil.rmtree( install_dir ) + except FileNotFoundError: + pass + sys.exit( 1 ) + +def work_dir_looks_ok() -> bool: + return Path( work_dir / "ok_marker" ).exists() + +def install_dir_looks_ok() -> bool: + return Path( install_dir / "ok_marker" ).exists() + +def fetch_and_patch(): + # If exists and needed, remove work dir + if work_dir.exists() and ( force_redo or not work_dir_looks_ok() ): + try: + shutil.rmtree( work_dir ) + except FileNotFoundError: + pass + + # Create work dir (if needed) + if not work_dir.exists(): + try: + work_dir.mkdir( parents = True ) + except OSError: + abort_op( "Failed to create work dir" ) + + # Check out the git repo + git_cmd = [ + "git", + "-c", "core.autocrlf=false", "-c", "core.eol=lf", + "clone", + "--depth", "1", + "--branch", f"release-{icu_major}-{icu_minor}", + "https://github.com/unicode-org/icu.git", + str(work_dir / "icu2"), + ] + + try: + _ = subprocess.run( git_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True ) + except subprocess.CalledProcessError as e: + abort_op( f"git clone failed: {e.stderr.strip() or e.stdout.strip() or e}" ) + + try: + shutil.copytree( + work_dir / "icu2" / "icu4c", + work_dir / "icu", + copy_function=shutil.copy2 + ) + except Exception as e: + abort_op( f"Copy failed: {e}" ) + + try: + shutil.copy2( work_dir / "icu2" / "LICENSE", work_dir / "LICENSE" ) + except Exception as e: + abort_op( f"License copy failed: {e}" ) + + # Create ok marker + Path( work_dir / "ok_marker" ).touch() + + print( "Fetch & patch completed" ) + +def build_and_install(): + # If exists and needed, remove install dir + if install_dir.exists() and ( force_redo or not install_dir_looks_ok() ): + try: + shutil.rmtree( install_dir ) + except FileNotFoundError: + pass + + # Create install dir (if needed) + if not install_dir.exists(): + try: + install_dir.mkdir( parents = True ) + except OSError: + abort_op( "Failed to create install dir" ) + + + if sys.platform.startswith("linux"): + # Configure + configure_cmd = [ + "configure", + f"--prefix={install_dir}", + "--enable-rpath", + "CC=gcc", + "CXX=g++", + "AR=ar", + "RANLIB=ranlib", + "CXXFLAGS='-static-libstdc++ -static-libgcc'", + "LDFLAGS='-Wl,-rpath,$$ORIGIN'" + ] + try: + _ = subprocess.run( configure_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, cwd = work_dir / "icu" / "source" ) + except subprocess.CalledProcessError as e: + abort_op( f"Configure failed: {e.stderr.strip() or e.stdout.strip() or e}" ) + + # Build + build_cmd = [ "make", f"-j{os.cpu_count()}" ] + try: + _ = subprocess.run( build_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, cwd = work_dir ) + except subprocess.CalledProcessError as e: + abort_op( f"Build failed: {e.stderr.strip() or e.stdout.strip() or e}" ) + + # Install + install_cmd = [ "make", "install" ] + try: + _ = subprocess.run( install_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, cwd = work_dir ) + except subprocess.CalledProcessError as e: + abort_op( f"Install failed: {e.stderr.strip() or e.stdout.strip() or e}" ) + + elif sys.platform == "win32": + icu_source_dir = work_dir / "icu" / "source" + bat_path = script_dir / "nc-build.bat" + build_cmd = [ + "cmd.exe", + "/c", + "call", + str(bat_path), + "", "", + str(icu_source_dir), + str(install_dir) + ] + + try: + _ = subprocess.run( build_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, cwd = work_dir / "icu" / "source" ) + except subprocess.CalledProcessError as e: + abort_op( f"Windows build failed: {e.stderr.strip() or e.stdout.strip() or e}" ) + + else: + abort_op( f"Unkown target platform: {sys.platform}" ) + + # Create ok marker + Path( install_dir / "ok_marker" ).touch() + + sys.stdout.reconfigure(encoding='utf-8') + if sys.platform == 'win32': + os.system('chcp 65001 >nul') + print( "Build and install completed" ) + +if not work_dir_looks_ok(): + fetch_and_patch() + +if not install_dir_looks_ok(): + build_and_install() From d4e76d9cde5b305e3c6069a8a385d6a5f90caba4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Fri, 17 Apr 2026 22:15:33 +0200 Subject: [PATCH 02/80] fix(icu): Fixing script for linux build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Common/3dParty/icu/nc-build.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Common/3dParty/icu/nc-build.py b/Common/3dParty/icu/nc-build.py index e70c6cc8f6..d8fe3d0189 100644 --- a/Common/3dParty/icu/nc-build.py +++ b/Common/3dParty/icu/nc-build.py @@ -103,15 +103,15 @@ def build_and_install(): if sys.platform.startswith("linux"): # Configure configure_cmd = [ - "configure", + "./configure", f"--prefix={install_dir}", "--enable-rpath", "CC=gcc", "CXX=g++", "AR=ar", "RANLIB=ranlib", - "CXXFLAGS='-static-libstdc++ -static-libgcc'", - "LDFLAGS='-Wl,-rpath,$$ORIGIN'" + "CXXFLAGS=-static-libstdc++ -static-libgcc -std=c++11", + "LDFLAGS=-Wl,-rpath,$ORIGIN" ] try: _ = subprocess.run( configure_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, cwd = work_dir / "icu" / "source" ) @@ -121,14 +121,14 @@ def build_and_install(): # Build build_cmd = [ "make", f"-j{os.cpu_count()}" ] try: - _ = subprocess.run( build_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, cwd = work_dir ) + _ = subprocess.run( build_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, cwd = work_dir / "icu" / "source" ) except subprocess.CalledProcessError as e: abort_op( f"Build failed: {e.stderr.strip() or e.stdout.strip() or e}" ) # Install install_cmd = [ "make", "install" ] try: - _ = subprocess.run( install_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, cwd = work_dir ) + _ = subprocess.run( install_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, cwd = work_dir / "icu" / "source" ) except subprocess.CalledProcessError as e: abort_op( f"Install failed: {e.stderr.strip() or e.stdout.strip() or e}" ) From 32cb3f7dcf4c95a6f928f689048f937658090cc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Fri, 17 Apr 2026 22:16:11 +0200 Subject: [PATCH 03/80] feature: Adding args count check on build script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Common/3dParty/build_3rdparty.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Common/3dParty/build_3rdparty.py b/Common/3dParty/build_3rdparty.py index 3769c79ed8..3d1efbdb04 100644 --- a/Common/3dParty/build_3rdparty.py +++ b/Common/3dParty/build_3rdparty.py @@ -8,6 +8,10 @@ script_path = Path(sys.argv[0]).resolve() script_dir = script_path.parent +if len( sys.argv ) < 3: + print( "Needs 2 arguments: work_dir_abs install_dir_abs" ) + sys.exit(1) + work_dir = Path( sys.argv[1] ) install_dir = Path( sys.argv[2] ) From dc0f009dda8b146711dff3bedeccdad38708b7df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Tue, 21 Apr 2026 12:59:07 +0200 Subject: [PATCH 04/80] feature: Adding python script for openssl --- Common/3dParty/build_3rdparty.py | 15 ++- Common/3dParty/openssl/nc-build.py | 171 +++++++++++++++++++++++++++++ 2 files changed, 182 insertions(+), 4 deletions(-) create mode 100644 Common/3dParty/openssl/nc-build.py diff --git a/Common/3dParty/build_3rdparty.py b/Common/3dParty/build_3rdparty.py index 3d1efbdb04..e61fd27dc3 100644 --- a/Common/3dParty/build_3rdparty.py +++ b/Common/3dParty/build_3rdparty.py @@ -3,6 +3,7 @@ # import os import sys import subprocess +import shutil from pathlib import Path script_path = Path(sys.argv[0]).resolve() @@ -15,16 +16,22 @@ work_dir = Path( sys.argv[1] ) install_dir = Path( sys.argv[2] ) +if sys.platform == "win32" and shutil.which("nmake") is None: + raise RuntimeError( + "MSVC environment is not set up: 'nmake' not found in PATH.\n" + "Run 'vcvarsx86_amd64.bat' or use 'x64 Native Tools Command Prompt'." + ) + subfolders = [ # 'apple', # 'brotli', # 'harfbuzz', # 'html', - # 'hyphen' - 'icu' + # 'hyphen', + 'icu', # 'md', - # 'openssl', - # 'socket-io' + 'openssl', + # 'socket-io', ] for subfolder in subfolders: diff --git a/Common/3dParty/openssl/nc-build.py b/Common/3dParty/openssl/nc-build.py new file mode 100644 index 0000000000..d249d75bbb --- /dev/null +++ b/Common/3dParty/openssl/nc-build.py @@ -0,0 +1,171 @@ +#!/usr/bin/env python3 + +import sys +import shutil +import subprocess +import os +from pathlib import Path + +work_dir = Path( sys.argv[1] ) +install_dir = Path( sys.argv[2] ) +force_redo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" + +script_path = Path(sys.argv[0]).resolve() +script_dir = script_path.parent +debug_mode = True +dep_name = "OpenSSL" + +def abort_op( message : str, keep_work : bool = False ): + print( f"Aboring {dep_name}: {message}", file = sys.stderr ) + if not debug_mode: + try: + if not keep_work: + shutil.rmtree( work_dir ) + shutil.rmtree( install_dir ) + except FileNotFoundError: + pass + sys.exit( 1 ) + +def work_dir_looks_ok() -> bool: + return Path( work_dir / "ok_marker" ).exists() + +def install_dir_looks_ok() -> bool: + return Path( install_dir / "ok_marker" ).exists() + +def fetch_and_patch(): + # If exists and needed, remove work dir + if work_dir.exists() and ( force_redo or not work_dir_looks_ok() ): + try: + shutil.rmtree( work_dir ) + except FileNotFoundError: + pass + + # Create work dir (if needed) + if not work_dir.exists(): + try: + work_dir.mkdir( parents = True ) + except OSError: + abort_op( "Failed to create work dir" ) + + # Check out the git repo + git_cmd = [ + "git", + "-c", "core.autocrlf=false", "-c", "core.eol=lf", + "clone", + "--depth", "1", + "--branch", "OpenSSL_1_1_1f", + "https://github.com/openssl/openssl.git", + str(work_dir), + ] + + try: + _ = subprocess.run( git_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True ) + except subprocess.CalledProcessError as e: + abort_op( f"git clone failed: {e.stderr.strip() or e.stdout.strip() or e}" ) + + # Create ok marker + Path( work_dir / "ok_marker" ).touch() + + print( "Fetch & patch completed" ) + +def build_and_install(): + if shutil.which("nmake") is None: + raise RuntimeError( + "MSVC environment is not set up: 'nmake' not found in PATH.\n" + "Run 'vcvarsx86_amd64.bat' or use 'x64 Native Tools Command Prompt'." + ) + + # If exists and needed, remove install dir + if install_dir.exists() and ( force_redo or not install_dir_looks_ok() ): + try: + shutil.rmtree( install_dir ) + except FileNotFoundError: + pass + + # Create install dir (if needed) + if not install_dir.exists(): + try: + install_dir.mkdir( parents = True ) + except OSError: + abort_op( "Failed to create install dir" ) + + + if sys.platform.startswith("linux"): + # Configure + configure_cmd = [ + "./config", + f"--prefix={install_dir}", + f"--openssldir={install_dir}", + "enable-md2", + "no-shared", + "no-asm", + ] + try: + _ = subprocess.run( configure_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, cwd = work_dir ) + except subprocess.CalledProcessError as e: + abort_op( f"Configure failed: {e.stderr.strip() or e.stdout.strip() or e}" ) + + # Build + build_cmd = [ "make", f"-j{os.cpu_count()}" ] + try: + _ = subprocess.run( build_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, cwd = work_dir ) + except subprocess.CalledProcessError as e: + abort_op( f"Build failed: {e.stderr.strip() or e.stdout.strip() or e}" ) + + # Install + install_cmd = [ "make", "install" ] + try: + _ = subprocess.run( install_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, cwd = work_dir ) + except subprocess.CalledProcessError as e: + abort_op( f"Install failed: {e.stderr.strip() or e.stdout.strip() or e}" ) + + elif sys.platform == "win32": + + configure_cmd = [ + shutil.which("perl"), + "Configure", + "VC-WIN64A", + f"--prefix={install_dir}", + f"--openssldir={install_dir}", + "enable-md2", + "no-shared", + "no-asm", + ] + + try: + _ = subprocess.run( configure_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, cwd = work_dir ) + except subprocess.CalledProcessError as e: + abort_op( f"Configure failed: {e.stderr.strip() or e.stdout.strip() or e}" ) + + # Build + build_cmd = [ "nmake" ] + + try: + # _ = subprocess.run( build_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, cwd = work_dir ) + _ = subprocess.run( build_cmd, check=True, text=True, cwd = work_dir ) + except subprocess.CalledProcessError as e: + abort_op( f"Build failed: {e.stderr.strip() or e.stdout.strip() or e}" ) + + # Install + install_cmd = [ "nmake", "install" ] + try: + _ = subprocess.run( install_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, cwd = work_dir ) + except subprocess.CalledProcessError as e: + abort_op( f"Install failed: {e.stderr.strip() or e.stdout.strip() or e}" ) + + else: + abort_op( f"Unkown target platform: {sys.platform}" ) + + # Create ok marker + Path( install_dir / "ok_marker" ).touch() + + sys.stdout.reconfigure(encoding='utf-8') + if sys.platform == 'win32': + os.system('chcp 65001 >nul') + print( "Build and install completed" ) + +if not work_dir_looks_ok(): + fetch_and_patch() + +if not install_dir_looks_ok(): + build_and_install() From aa1d51b5c5403e03812dc5382e87c82b9b1e42f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Tue, 21 Apr 2026 14:02:19 +0200 Subject: [PATCH 05/80] fix: Openssl build fix for linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Common/3dParty/openssl/nc-build.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Common/3dParty/openssl/nc-build.py b/Common/3dParty/openssl/nc-build.py index d249d75bbb..f8d25aa5bd 100644 --- a/Common/3dParty/openssl/nc-build.py +++ b/Common/3dParty/openssl/nc-build.py @@ -69,12 +69,6 @@ def fetch_and_patch(): print( "Fetch & patch completed" ) def build_and_install(): - if shutil.which("nmake") is None: - raise RuntimeError( - "MSVC environment is not set up: 'nmake' not found in PATH.\n" - "Run 'vcvarsx86_amd64.bat' or use 'x64 Native Tools Command Prompt'." - ) - # If exists and needed, remove install dir if install_dir.exists() and ( force_redo or not install_dir_looks_ok() ): try: @@ -168,4 +162,9 @@ def build_and_install(): fetch_and_patch() if not install_dir_looks_ok(): + if sys.platform == "win32" and shutil.which("nmake") is None: + raise RuntimeError( + "MSVC environment is not set up: 'nmake' not found in PATH.\n" + "Run 'vcvarsx86_amd64.bat' or use 'x64 Native Tools Command Prompt'." + ) build_and_install() From 8a04d5fbf638d6e19bbc3aa001f36967673725ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Tue, 21 Apr 2026 14:45:38 +0200 Subject: [PATCH 06/80] feature: Adding python script for socketio MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Common/3dParty/build_3rdparty.py | 2 +- Common/3dParty/socketio/nc-build.py | 199 ++++++++++++++++++++++++++++ 2 files changed, 200 insertions(+), 1 deletion(-) create mode 100644 Common/3dParty/socketio/nc-build.py diff --git a/Common/3dParty/build_3rdparty.py b/Common/3dParty/build_3rdparty.py index e61fd27dc3..0176607d7e 100644 --- a/Common/3dParty/build_3rdparty.py +++ b/Common/3dParty/build_3rdparty.py @@ -31,7 +31,7 @@ 'icu', # 'md', 'openssl', - # 'socket-io', + 'socketio', ] for subfolder in subfolders: diff --git a/Common/3dParty/socketio/nc-build.py b/Common/3dParty/socketio/nc-build.py new file mode 100644 index 0000000000..e696fa0b04 --- /dev/null +++ b/Common/3dParty/socketio/nc-build.py @@ -0,0 +1,199 @@ +#!/usr/bin/env python3 + +import sys +import shutil +import subprocess +import os +from pathlib import Path + +work_dir = Path( sys.argv[1] ) +install_dir = Path( sys.argv[2] ) +work_dir = install_dir +force_redo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" + +script_path = Path(sys.argv[0]).resolve() +script_dir = script_path.parent +patches_dir = script_dir / "patches" / "proper_patches" +debug_mode = True +dep_name = "SocketIO" + +def abort_op( message : str, keep_work : bool = False ): + print( f"Aboring {dep_name}: {message}", file = sys.stderr ) + if not debug_mode: + try: + if not keep_work: + shutil.rmtree( work_dir ) + shutil.rmtree( install_dir ) + except FileNotFoundError: + pass + sys.exit( 1 ) + +def work_dir_looks_ok() -> bool: + return Path( work_dir / "ok_marker" ).exists() + +def fetch_and_patch(): + # If exists and needed, remove work dir + if work_dir.exists() and ( force_redo or not work_dir_looks_ok() ): + try: + shutil.rmtree( work_dir ) + except FileNotFoundError: + pass + + # Create work dir (if needed) + if not work_dir.exists(): + try: + work_dir.mkdir( parents = True ) + except OSError: + abort_op( "Failed to create work dir" ) + + # Init empty git repo + git_cmd = [ + "git", "init", + ] + try: + _ = subprocess.run( + git_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, + cwd=work_dir + ) + except subprocess.CalledProcessError as e: + abort_op( f"git init failed: {e.stderr.strip() or e.stdout.strip() or e}" ) + + + # Add remote + git_cmd = [ + "git", "remote", "add", "origin", + "https://github.com/socketio/socket.io-client-cpp.git", + ] + try: + _ = subprocess.run( + git_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, + cwd=work_dir + ) + except subprocess.CalledProcessError as e: + abort_op( f"Failed to add remote: {e.stderr.strip() or e.stdout.strip() or e}" ) + + + # Fetch + git_cmd = [ + "git", "fetch", + "--depth", "1", + "origin", + "da779141a7379cc30c870d48295033bc16a23c66", + ] + try: + _ = subprocess.run( + git_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, + cwd=work_dir + ) + except subprocess.CalledProcessError as e: + abort_op( f"Fetch failed: {e.stderr.strip() or e.stdout.strip() or e}" ) + + + + # Checkout + git_cmd = [ + "git", "checkout", "FETCH_HEAD", + ] + try: + _ = subprocess.run( + git_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, + cwd=work_dir + ) + except subprocess.CalledProcessError as e: + abort_op( f"Checkout failed: {e.stderr.strip() or e.stdout.strip() or e}" ) + + + + # Update submodules + git_cmd = [ + "git", "submodule", "update", + "--init", "--recursive" + ] + try: + _ = subprocess.run( + git_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, + cwd=work_dir + ) + except subprocess.CalledProcessError as e: + abort_op( f"Submodule update failed: {e.stderr.strip() or e.stdout.strip() or e}" ) + + + # ASIO checkout + git_cmd = [ + "git", "checkout", "230c0d2ae035c5ce1292233fcab03cea0d341264", + ] + try: + _ = subprocess.run( + git_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, + cwd=work_dir/"lib"/"asio" + ) + except subprocess.CalledProcessError as e: + abort_op( f"ASIO checkout failed: {e.stderr.strip() or e.stdout.strip() or e}" ) + + + # WebSocketPP checkout + git_cmd = [ + "git", "checkout", "56123c87598f8b1dd471be83ca841ceae07f95ba", + ] + try: + _ = subprocess.run( + git_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, + cwd=work_dir/"lib"/"websocketpp" + ) + except subprocess.CalledProcessError as e: + abort_op( f"WebSocketPP checkout failed: {e.stderr.strip() or e.stdout.strip() or e}" ) + + + # Patch websocket + patch_cmd = [ + "git", "apply", patches_dir / "websocketpp.patch", + ] + try: + _ = subprocess.run( + patch_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, + cwd=work_dir/"lib"/"websocketpp" + ) + except subprocess.CalledProcessError as e: + abort_op( f"WebSocketPP patch failed: {e.stderr.strip() or e.stdout.strip() or e}" ) + + + # Patch internals + patch_cmds = [ + [ "git", "apply", patches_dir / "sio_client_impl_fail.patch" ], + [ "git", "apply", patches_dir / "sio_client_impl_open.patch" ], + [ "git", "apply", patches_dir / "sio_client_impl_close_timeout.patch" ], + ] + for i, patch_cmd in enumerate( patch_cmds ): + try: + _ = subprocess.run( + patch_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, + cwd=work_dir/"src"/"internal" + ) + except subprocess.CalledProcessError as e: + abort_op( f"Internals patch {i} failed: {e.stderr.strip() or e.stdout.strip() or e}" ) + + + # Create no_tls version + try: + shutil.copytree( work_dir / "src", work_dir / "src_no_tls" ) + except Exception as e: + abort_op( f"No TLS copy failed: {e.stderr.strip() or e.stdout.strip() or e}" ) + + patch_cmd = [ + "git", "apply", patches_dir / "no_tls.patch", + ] + try: + _ = subprocess.run( + patch_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, + cwd=work_dir + ) + except subprocess.CalledProcessError as e: + abort_op( f"No TLS patch failed: {e.stderr.strip() or e.stdout.strip() or e}" ) + + # Create ok marker + Path( work_dir / "ok_marker" ).touch() + + print( "Fetch & patch completed" ) + +if not work_dir_looks_ok(): + fetch_and_patch() From 3d3cd0839cadb9e930644e071e647440700675fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Tue, 21 Apr 2026 20:44:09 +0200 Subject: [PATCH 07/80] feature: Lifting common python functions to separate modul MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Common/3dParty/build_3rdparty.py | 4 +- Common/3dParty/build_3rdparty_common.py | 87 +++++++++ Common/3dParty/icu/nc-build.py | 205 ++++++++------------ Common/3dParty/openssl/nc-build.py | 222 ++++++++-------------- Common/3dParty/socketio/nc-build.py | 242 +++++++----------------- 5 files changed, 319 insertions(+), 441 deletions(-) create mode 100644 Common/3dParty/build_3rdparty_common.py diff --git a/Common/3dParty/build_3rdparty.py b/Common/3dParty/build_3rdparty.py index 0176607d7e..5819de2e11 100644 --- a/Common/3dParty/build_3rdparty.py +++ b/Common/3dParty/build_3rdparty.py @@ -43,7 +43,9 @@ subprocess.run( [sys.executable, sub_script, work_dir / subfolder, install_dir / subfolder], check=True, - text=True + text=True, + stdout=None, + stderr=None, ) except subprocess.CalledProcessError as e: print(f"\n❌ {subfolder} failed with code {e.returncode}") diff --git a/Common/3dParty/build_3rdparty_common.py b/Common/3dParty/build_3rdparty_common.py new file mode 100644 index 0000000000..2ee53bc935 --- /dev/null +++ b/Common/3dParty/build_3rdparty_common.py @@ -0,0 +1,87 @@ +import sys +import shutil +import subprocess +import os +from pathlib import Path + +dep_name = None +debug_mode = False +work_dir = None +install_dir = None +force_redo = False + +def abort_op( message : str, keep_work : bool = False ): + print( f"Aboring {dep_name}: {message}", file = sys.stderr ) + if not debug_mode: + try: + if not keep_work: + shutil.rmtree( work_dir ) + shutil.rmtree( install_dir ) + except FileNotFoundError: + pass + sys.exit( 1 ) + +def is_linux() -> bool: + return sys.platform.startswith("linux") + +def is_windows() -> bool: + return sys.platform == "win32" + +def work_dir_looks_ok() -> bool: + return Path( work_dir / "ok_marker" ).exists() + +def install_dir_looks_ok() -> bool: + return Path( install_dir / "ok_marker" ).exists() + +def create_work_dir_ok_marker(): + Path( work_dir / "ok_marker" ).touch() + +def create_install_dir_ok_marker(): + Path( install_dir / "ok_marker" ).touch() + +def create_workdir(): + # If exists and needed, remove work dir + if work_dir.exists() and ( force_redo or not work_dir_looks_ok() ): + try: + shutil.rmtree( work_dir ) + except FileNotFoundError: + pass + + # Create work dir (if needed) + if not work_dir.exists(): + try: + work_dir.mkdir( parents = True ) + except OSError: + abort_op( "Failed to create work dir" ) + +def create_install_dir(): + # If exists and needed, remove install dir + if install_dir.exists() and ( force_redo or not install_dir_looks_ok() ): + try: + shutil.rmtree( install_dir ) + except FileNotFoundError: + pass + + # Create install dir (if needed) + if not install_dir.exists(): + try: + install_dir.mkdir( parents = True ) + except OSError: + abort_op( "Failed to create install dir" ) + +def run_command( cmd : list[str], description : str, cwd : Path | None = None, verbose : bool = False ): + cwd = (cwd or Path.cwd()).resolve() + output_pipe = None if verbose else subprocess.PIPE + + try: + _ = subprocess.run( cmd, check=True, stdout=output_pipe, stderr=output_pipe, text=True, cwd=cwd ) + except subprocess.CalledProcessError as e: + if verbose: + abort_op( f"{description} failed" ) + else: + abort_op( f"{description} failed: {e.stderr.strip() or e.stdout.strip() or e}" ) + +def fix_terminal_encoding(): + sys.stdout.reconfigure( encoding='utf-8' ) + if is_windows(): + os.system( 'chcp 65001 >nul' ) diff --git a/Common/3dParty/icu/nc-build.py b/Common/3dParty/icu/nc-build.py index d8fe3d0189..7bc560ee14 100644 --- a/Common/3dParty/icu/nc-build.py +++ b/Common/3dParty/icu/nc-build.py @@ -2,167 +2,110 @@ import sys import shutil -import subprocess import os from pathlib import Path -work_dir = Path( sys.argv[1] ) -install_dir = Path( sys.argv[2] ) -force_redo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" - script_path = Path(sys.argv[0]).resolve() script_dir = script_path.parent icu_major = "74" icu_minor = "2" -debug_mode = True -dep_name = "ICU" - -def abort_op( message : str, keep_work : bool = False ): - print( f"Aboring {dep_name}: {message}", file = sys.stderr ) - if not debug_mode: - try: - if not keep_work: - shutil.rmtree( work_dir ) - shutil.rmtree( install_dir ) - except FileNotFoundError: - pass - sys.exit( 1 ) - -def work_dir_looks_ok() -> bool: - return Path( work_dir / "ok_marker" ).exists() - -def install_dir_looks_ok() -> bool: - return Path( install_dir / "ok_marker" ).exists() -def fetch_and_patch(): - # If exists and needed, remove work dir - if work_dir.exists() and ( force_redo or not work_dir_looks_ok() ): - try: - shutil.rmtree( work_dir ) - except FileNotFoundError: - pass - - # Create work dir (if needed) - if not work_dir.exists(): - try: - work_dir.mkdir( parents = True ) - except OSError: - abort_op( "Failed to create work dir" ) - - # Check out the git repo - git_cmd = [ - "git", - "-c", "core.autocrlf=false", "-c", "core.eol=lf", - "clone", - "--depth", "1", - "--branch", f"release-{icu_major}-{icu_minor}", - "https://github.com/unicode-org/icu.git", - str(work_dir / "icu2"), - ] +third_party_root = ( script_dir / ".." ).resolve() +if str( third_party_root ) not in sys.path: + sys.path.insert( 0, str( third_party_root ) ) +import build_3rdparty_common as nc - try: - _ = subprocess.run( git_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True ) - except subprocess.CalledProcessError as e: - abort_op( f"git clone failed: {e.stderr.strip() or e.stdout.strip() or e}" ) +nc.work_dir = Path( sys.argv[1] ) +nc.install_dir = Path( sys.argv[2] ) +nc.force_redo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" +nc.dep_name = "ICU" +nc.debug_mode = True + +def fetch_and_patch(): + nc.create_workdir() + + nc.run_command( + [ "git", "-c", "core.autocrlf=false", "-c", "core.eol=lf", "clone", + "--depth", "1", "--branch", f"release-{icu_major}-{icu_minor}", + "https://github.com/unicode-org/icu.git", str(nc.work_dir / "icu2") + ], + "Checkout git repo", + ) try: shutil.copytree( - work_dir / "icu2" / "icu4c", - work_dir / "icu", + nc.work_dir / "icu2" / "icu4c", + nc.work_dir / "icu", copy_function=shutil.copy2 ) except Exception as e: - abort_op( f"Copy failed: {e}" ) + nc.abort_op( f"Copy failed: {e}" ) try: - shutil.copy2( work_dir / "icu2" / "LICENSE", work_dir / "LICENSE" ) + shutil.copy2( nc.work_dir / "icu2" / "LICENSE", nc.work_dir / "LICENSE" ) except Exception as e: - abort_op( f"License copy failed: {e}" ) + nc.abort_op( f"License copy failed: {e}" ) - # Create ok marker - Path( work_dir / "ok_marker" ).touch() + nc.create_work_dir_ok_marker() print( "Fetch & patch completed" ) def build_and_install(): - # If exists and needed, remove install dir - if install_dir.exists() and ( force_redo or not install_dir_looks_ok() ): - try: - shutil.rmtree( install_dir ) - except FileNotFoundError: - pass - - # Create install dir (if needed) - if not install_dir.exists(): - try: - install_dir.mkdir( parents = True ) - except OSError: - abort_op( "Failed to create install dir" ) - - - if sys.platform.startswith("linux"): - # Configure - configure_cmd = [ - "./configure", - f"--prefix={install_dir}", - "--enable-rpath", - "CC=gcc", - "CXX=g++", - "AR=ar", - "RANLIB=ranlib", - "CXXFLAGS=-static-libstdc++ -static-libgcc -std=c++11", - "LDFLAGS=-Wl,-rpath,$ORIGIN" - ] - try: - _ = subprocess.run( configure_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, cwd = work_dir / "icu" / "source" ) - except subprocess.CalledProcessError as e: - abort_op( f"Configure failed: {e.stderr.strip() or e.stdout.strip() or e}" ) - - # Build - build_cmd = [ "make", f"-j{os.cpu_count()}" ] - try: - _ = subprocess.run( build_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, cwd = work_dir / "icu" / "source" ) - except subprocess.CalledProcessError as e: - abort_op( f"Build failed: {e.stderr.strip() or e.stdout.strip() or e}" ) - - # Install - install_cmd = [ "make", "install" ] - try: - _ = subprocess.run( install_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, cwd = work_dir / "icu" / "source" ) - except subprocess.CalledProcessError as e: - abort_op( f"Install failed: {e.stderr.strip() or e.stdout.strip() or e}" ) - - elif sys.platform == "win32": - icu_source_dir = work_dir / "icu" / "source" + nc.create_install_dir() + + if nc.is_linux(): + nc.run_command( + [ "./configure", + f"--prefix={nc.install_dir}", + "--enable-rpath", + "CC=gcc", + "CXX=g++", + "AR=ar", + "RANLIB=ranlib", + "CXXFLAGS=-static-libstdc++ -static-libgcc -std=c++11", + "LDFLAGS=-Wl,-rpath,$ORIGIN" + ], + "Configure", + nc.work_dir / "icu" / "source" + ) + + nc.run_command( + [ "make", f"-j{os.cpu_count()}" ], + "Build", + nc.work_dir / "icu" / "source" + ) + + nc.run_command( + [ "make", "install" ], + "Install", + nc.work_dir / "icu" / "source" + ) + + elif nc.is_windows(): + icu_source_dir = nc.work_dir / "icu" / "source" bat_path = script_dir / "nc-build.bat" - build_cmd = [ - "cmd.exe", - "/c", - "call", - str(bat_path), - "", "", - str(icu_source_dir), - str(install_dir) - ] - - try: - _ = subprocess.run( build_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, cwd = work_dir / "icu" / "source" ) - except subprocess.CalledProcessError as e: - abort_op( f"Windows build failed: {e.stderr.strip() or e.stdout.strip() or e}" ) + nc.run_command( + [ "cmd.exe", + "/c", + "call", + str(bat_path), + "", "", + str(icu_source_dir), + str(install_dir) + ], + "Cygwin build", + nc.work_dir / "icu" / "source" + ) else: abort_op( f"Unkown target platform: {sys.platform}" ) - # Create ok marker - Path( install_dir / "ok_marker" ).touch() - - sys.stdout.reconfigure(encoding='utf-8') - if sys.platform == 'win32': - os.system('chcp 65001 >nul') + nc.create_install_dir_ok_marker() + nc.fix_terminal_encoding() print( "Build and install completed" ) -if not work_dir_looks_ok(): +if not nc.work_dir_looks_ok(): fetch_and_patch() -if not install_dir_looks_ok(): +if not nc.install_dir_looks_ok(): build_and_install() diff --git a/Common/3dParty/openssl/nc-build.py b/Common/3dParty/openssl/nc-build.py index f8d25aa5bd..02cf9a56bf 100644 --- a/Common/3dParty/openssl/nc-build.py +++ b/Common/3dParty/openssl/nc-build.py @@ -2,167 +2,109 @@ import sys import shutil -import subprocess import os from pathlib import Path -work_dir = Path( sys.argv[1] ) -install_dir = Path( sys.argv[2] ) -force_redo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" - script_path = Path(sys.argv[0]).resolve() script_dir = script_path.parent -debug_mode = True -dep_name = "OpenSSL" - -def abort_op( message : str, keep_work : bool = False ): - print( f"Aboring {dep_name}: {message}", file = sys.stderr ) - if not debug_mode: - try: - if not keep_work: - shutil.rmtree( work_dir ) - shutil.rmtree( install_dir ) - except FileNotFoundError: - pass - sys.exit( 1 ) - -def work_dir_looks_ok() -> bool: - return Path( work_dir / "ok_marker" ).exists() - -def install_dir_looks_ok() -> bool: - return Path( install_dir / "ok_marker" ).exists() + +third_party_root = ( script_dir / ".." ).resolve() +if str( third_party_root ) not in sys.path: + sys.path.insert( 0, str( third_party_root ) ) +import build_3rdparty_common as nc + +nc.work_dir = Path( sys.argv[1] ) +nc.install_dir = Path( sys.argv[2] ) +nc.force_redo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" +nc.dep_name = "OpenSSL" +nc.debug_mode = True def fetch_and_patch(): - # If exists and needed, remove work dir - if work_dir.exists() and ( force_redo or not work_dir_looks_ok() ): - try: - shutil.rmtree( work_dir ) - except FileNotFoundError: - pass - - # Create work dir (if needed) - if not work_dir.exists(): - try: - work_dir.mkdir( parents = True ) - except OSError: - abort_op( "Failed to create work dir" ) - - # Check out the git repo - git_cmd = [ - "git", - "-c", "core.autocrlf=false", "-c", "core.eol=lf", - "clone", - "--depth", "1", - "--branch", "OpenSSL_1_1_1f", - "https://github.com/openssl/openssl.git", - str(work_dir), - ] - - try: - _ = subprocess.run( git_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True ) - except subprocess.CalledProcessError as e: - abort_op( f"git clone failed: {e.stderr.strip() or e.stdout.strip() or e}" ) - - # Create ok marker - Path( work_dir / "ok_marker" ).touch() + + nc.create_workdir() + + nc.run_command( + [ "git", "-c", "core.autocrlf=false", "-c", "core.eol=lf", + "clone", "--depth", "1", + "--branch", "OpenSSL_1_1_1f", + "https://github.com/openssl/openssl.git", + str(nc.work_dir) + ], + "Clone repo" + ) + + nc.create_work_dir_ok_marker() print( "Fetch & patch completed" ) def build_and_install(): - # If exists and needed, remove install dir - if install_dir.exists() and ( force_redo or not install_dir_looks_ok() ): - try: - shutil.rmtree( install_dir ) - except FileNotFoundError: - pass - - # Create install dir (if needed) - if not install_dir.exists(): - try: - install_dir.mkdir( parents = True ) - except OSError: - abort_op( "Failed to create install dir" ) - - - if sys.platform.startswith("linux"): - # Configure - configure_cmd = [ - "./config", - f"--prefix={install_dir}", - f"--openssldir={install_dir}", - "enable-md2", - "no-shared", - "no-asm", - ] - try: - _ = subprocess.run( configure_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, cwd = work_dir ) - except subprocess.CalledProcessError as e: - abort_op( f"Configure failed: {e.stderr.strip() or e.stdout.strip() or e}" ) - - # Build - build_cmd = [ "make", f"-j{os.cpu_count()}" ] - try: - _ = subprocess.run( build_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, cwd = work_dir ) - except subprocess.CalledProcessError as e: - abort_op( f"Build failed: {e.stderr.strip() or e.stdout.strip() or e}" ) - - # Install - install_cmd = [ "make", "install" ] - try: - _ = subprocess.run( install_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, cwd = work_dir ) - except subprocess.CalledProcessError as e: - abort_op( f"Install failed: {e.stderr.strip() or e.stdout.strip() or e}" ) - - elif sys.platform == "win32": + nc.create_install_dir() + + if nc.is_linux(): + nc.run_command( + [ "./config", + f"--prefix={nc.install_dir}", + f"--openssldir={nc.install_dir}", + "enable-md2", + "no-shared", + "no-asm", + ], + "Configure", + nc.work_dir + ) + + nc.run_command( + [ "make", f"-j{os.cpu_count()}" ], + "Build", + nc.work_dir + ) + + nc.run_command( + [ "make", "install" ], + "Install", + nc.work_dir + ) + + elif nc.is_windows(): - configure_cmd = [ - shutil.which("perl"), + nc.run_command( + [ shutil.which("perl"), + "Configure", + "VC-WIN64A", + f"--prefix={install_dir}", + f"--openssldir={install_dir}", + "enable-md2", + "no-shared", + "no-asm", + ], "Configure", - "VC-WIN64A", - f"--prefix={install_dir}", - f"--openssldir={install_dir}", - "enable-md2", - "no-shared", - "no-asm", - ] - - try: - _ = subprocess.run( configure_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, cwd = work_dir ) - except subprocess.CalledProcessError as e: - abort_op( f"Configure failed: {e.stderr.strip() or e.stdout.strip() or e}" ) - - # Build - build_cmd = [ "nmake" ] - - try: - # _ = subprocess.run( build_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, cwd = work_dir ) - _ = subprocess.run( build_cmd, check=True, text=True, cwd = work_dir ) - except subprocess.CalledProcessError as e: - abort_op( f"Build failed: {e.stderr.strip() or e.stdout.strip() or e}" ) - - # Install - install_cmd = [ "nmake", "install" ] - try: - _ = subprocess.run( install_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, cwd = work_dir ) - except subprocess.CalledProcessError as e: - abort_op( f"Install failed: {e.stderr.strip() or e.stdout.strip() or e}" ) + nc.work_dir + ) + + nc.run_command( + [ "nmake" ], + "Build", + nc.work_dir + ) + + nc.run_command( + [ "nmake", "install" ], + "Install", + nc.work_dir + ) else: abort_op( f"Unkown target platform: {sys.platform}" ) - # Create ok marker - Path( install_dir / "ok_marker" ).touch() - - sys.stdout.reconfigure(encoding='utf-8') - if sys.platform == 'win32': - os.system('chcp 65001 >nul') + nc.create_install_dir_ok_marker() + print( "Build and install completed" ) -if not work_dir_looks_ok(): +if not nc.work_dir_looks_ok(): fetch_and_patch() -if not install_dir_looks_ok(): - if sys.platform == "win32" and shutil.which("nmake") is None: +if not nc.install_dir_looks_ok(): + if nc.is_windows() and shutil.which("nmake") is None: raise RuntimeError( "MSVC environment is not set up: 'nmake' not found in PATH.\n" "Run 'vcvarsx86_amd64.bat' or use 'x64 Native Tools Command Prompt'." diff --git a/Common/3dParty/socketio/nc-build.py b/Common/3dParty/socketio/nc-build.py index e696fa0b04..278b0dcb75 100644 --- a/Common/3dParty/socketio/nc-build.py +++ b/Common/3dParty/socketio/nc-build.py @@ -2,198 +2,102 @@ import sys import shutil -import subprocess -import os from pathlib import Path -work_dir = Path( sys.argv[1] ) -install_dir = Path( sys.argv[2] ) -work_dir = install_dir -force_redo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" - script_path = Path(sys.argv[0]).resolve() script_dir = script_path.parent patches_dir = script_dir / "patches" / "proper_patches" -debug_mode = True -dep_name = "SocketIO" - -def abort_op( message : str, keep_work : bool = False ): - print( f"Aboring {dep_name}: {message}", file = sys.stderr ) - if not debug_mode: - try: - if not keep_work: - shutil.rmtree( work_dir ) - shutil.rmtree( install_dir ) - except FileNotFoundError: - pass - sys.exit( 1 ) - -def work_dir_looks_ok() -> bool: - return Path( work_dir / "ok_marker" ).exists() - -def fetch_and_patch(): - # If exists and needed, remove work dir - if work_dir.exists() and ( force_redo or not work_dir_looks_ok() ): - try: - shutil.rmtree( work_dir ) - except FileNotFoundError: - pass - - # Create work dir (if needed) - if not work_dir.exists(): - try: - work_dir.mkdir( parents = True ) - except OSError: - abort_op( "Failed to create work dir" ) - - # Init empty git repo - git_cmd = [ - "git", "init", - ] - try: - _ = subprocess.run( - git_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, - cwd=work_dir - ) - except subprocess.CalledProcessError as e: - abort_op( f"git init failed: {e.stderr.strip() or e.stdout.strip() or e}" ) +third_party_root = ( script_dir / ".." ).resolve() +if str( third_party_root ) not in sys.path: + sys.path.insert( 0, str( third_party_root ) ) +import build_3rdparty_common as nc - # Add remote - git_cmd = [ - "git", "remote", "add", "origin", - "https://github.com/socketio/socket.io-client-cpp.git", - ] - try: - _ = subprocess.run( - git_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, - cwd=work_dir - ) - except subprocess.CalledProcessError as e: - abort_op( f"Failed to add remote: {e.stderr.strip() or e.stdout.strip() or e}" ) - - - # Fetch - git_cmd = [ - "git", "fetch", - "--depth", "1", - "origin", - "da779141a7379cc30c870d48295033bc16a23c66", - ] - try: - _ = subprocess.run( - git_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, - cwd=work_dir - ) - except subprocess.CalledProcessError as e: - abort_op( f"Fetch failed: {e.stderr.strip() or e.stdout.strip() or e}" ) - - - - # Checkout - git_cmd = [ - "git", "checkout", "FETCH_HEAD", - ] - try: - _ = subprocess.run( - git_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, - cwd=work_dir - ) - except subprocess.CalledProcessError as e: - abort_op( f"Checkout failed: {e.stderr.strip() or e.stdout.strip() or e}" ) - +nc.work_dir = Path( sys.argv[1] ) +nc.install_dir = Path( sys.argv[2] ) +nc.work_dir = nc.install_dir +nc.force_redo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" +nc.dep_name = "SocketIO" +nc.debug_mode = True +def fetch_and_patch(): + nc.create_workdir() + + nc.run_command( + [ "git", "init" ], + "Git init", + nc.work_dir + ) + + nc.run_command( + [ "git", "remote", "add", "origin", "https://github.com/socketio/socket.io-client-cpp.git" ], + "Add remote", + nc.work_dir + ) - # Update submodules - git_cmd = [ - "git", "submodule", "update", - "--init", "--recursive" - ] - try: - _ = subprocess.run( - git_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, - cwd=work_dir - ) - except subprocess.CalledProcessError as e: - abort_op( f"Submodule update failed: {e.stderr.strip() or e.stdout.strip() or e}" ) - - - # ASIO checkout - git_cmd = [ - "git", "checkout", "230c0d2ae035c5ce1292233fcab03cea0d341264", - ] - try: - _ = subprocess.run( - git_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, - cwd=work_dir/"lib"/"asio" - ) - except subprocess.CalledProcessError as e: - abort_op( f"ASIO checkout failed: {e.stderr.strip() or e.stdout.strip() or e}" ) - - - # WebSocketPP checkout - git_cmd = [ - "git", "checkout", "56123c87598f8b1dd471be83ca841ceae07f95ba", - ] - try: - _ = subprocess.run( - git_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, - cwd=work_dir/"lib"/"websocketpp" - ) - except subprocess.CalledProcessError as e: - abort_op( f"WebSocketPP checkout failed: {e.stderr.strip() or e.stdout.strip() or e}" ) + nc.run_command( + [ "git", "fetch", "--depth", "1", "origin", "da779141a7379cc30c870d48295033bc16a23c66" ], + "Fetch", + nc.work_dir + ) + + nc.run_command( + [ "git", "checkout", "FETCH_HEAD" ], + "Checkout", + nc.work_dir + ) + + nc.run_command( + [ "git", "submodule", "update", "--init", "--recursive" ], + "Init submodules", + nc.work_dir + ) + + nc.run_command( + [ "git", "checkout", "230c0d2ae035c5ce1292233fcab03cea0d341264" ], + "Checkout ASIO", + nc.work_dir / "lib" / "asio" + ) + + nc.run_command( + [ "git", "checkout", "56123c87598f8b1dd471be83ca841ceae07f95ba" ], + "Checkout WebSocketPP", + nc.work_dir / "lib" / "websocketpp" + ) + + nc.run_command( + [ "git", "apply", patches_dir / "websocketpp.patch" ], + "Patch WebSocketPP", + nc.work_dir / "lib" / "websocketpp" + ) - - # Patch websocket - patch_cmd = [ - "git", "apply", patches_dir / "websocketpp.patch", - ] - try: - _ = subprocess.run( - patch_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, - cwd=work_dir/"lib"/"websocketpp" - ) - except subprocess.CalledProcessError as e: - abort_op( f"WebSocketPP patch failed: {e.stderr.strip() or e.stdout.strip() or e}" ) - - - # Patch internals patch_cmds = [ [ "git", "apply", patches_dir / "sio_client_impl_fail.patch" ], [ "git", "apply", patches_dir / "sio_client_impl_open.patch" ], [ "git", "apply", patches_dir / "sio_client_impl_close_timeout.patch" ], ] for i, patch_cmd in enumerate( patch_cmds ): - try: - _ = subprocess.run( - patch_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, - cwd=work_dir/"src"/"internal" - ) - except subprocess.CalledProcessError as e: - abort_op( f"Internals patch {i} failed: {e.stderr.strip() or e.stdout.strip() or e}" ) - + nc.run_command( + patch_cmd, + f"Internals patch {i+1}", + nc.work_dir / "src" / "internal" + ) # Create no_tls version try: - shutil.copytree( work_dir / "src", work_dir / "src_no_tls" ) + shutil.copytree( nc.work_dir / "src", nc.work_dir / "src_no_tls" ) except Exception as e: - abort_op( f"No TLS copy failed: {e.stderr.strip() or e.stdout.strip() or e}" ) + nc.abort_op( f"No TLS copy failed: {e.stderr.strip() or e.stdout.strip() or e}" ) - patch_cmd = [ - "git", "apply", patches_dir / "no_tls.patch", - ] - try: - _ = subprocess.run( - patch_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, - cwd=work_dir - ) - except subprocess.CalledProcessError as e: - abort_op( f"No TLS patch failed: {e.stderr.strip() or e.stdout.strip() or e}" ) + nc.run_command( + [ "git", "apply", patches_dir / "no_tls.patch" ], + "Patch no TLS version", + nc.work_dir + ) - # Create ok marker - Path( work_dir / "ok_marker" ).touch() + nc.create_work_dir_ok_marker() print( "Fetch & patch completed" ) -if not work_dir_looks_ok(): +if not nc.work_dir_looks_ok(): fetch_and_patch() From 330bf8b431f54d499c1255ef93fc4cd048d00964 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Tue, 21 Apr 2026 16:04:42 +0200 Subject: [PATCH 08/80] fix: Fix common py module usage on Windows --- Common/3dParty/icu/nc-build.py | 2 +- Common/3dParty/openssl/nc-build.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Common/3dParty/icu/nc-build.py b/Common/3dParty/icu/nc-build.py index 7bc560ee14..5ea4f49c2b 100644 --- a/Common/3dParty/icu/nc-build.py +++ b/Common/3dParty/icu/nc-build.py @@ -91,7 +91,7 @@ def build_and_install(): str(bat_path), "", "", str(icu_source_dir), - str(install_dir) + str(nc.install_dir) ], "Cygwin build", nc.work_dir / "icu" / "source" diff --git a/Common/3dParty/openssl/nc-build.py b/Common/3dParty/openssl/nc-build.py index 02cf9a56bf..9a4fc25294 100644 --- a/Common/3dParty/openssl/nc-build.py +++ b/Common/3dParty/openssl/nc-build.py @@ -71,8 +71,8 @@ def build_and_install(): [ shutil.which("perl"), "Configure", "VC-WIN64A", - f"--prefix={install_dir}", - f"--openssldir={install_dir}", + f"--prefix={nc.install_dir}", + f"--openssldir={nc.install_dir}", "enable-md2", "no-shared", "no-asm", From fafcc2d06bac31ffb8d45ec9b8d8070d350bb8b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Wed, 22 Apr 2026 09:55:06 +0200 Subject: [PATCH 09/80] feature: Adding python script for md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Common/3dParty/build_3rdparty.py | 2 +- Common/3dParty/md/nc-build.py | 41 ++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 Common/3dParty/md/nc-build.py diff --git a/Common/3dParty/build_3rdparty.py b/Common/3dParty/build_3rdparty.py index 5819de2e11..d6660ec78c 100644 --- a/Common/3dParty/build_3rdparty.py +++ b/Common/3dParty/build_3rdparty.py @@ -29,7 +29,7 @@ # 'html', # 'hyphen', 'icu', - # 'md', + 'md', 'openssl', 'socketio', ] diff --git a/Common/3dParty/md/nc-build.py b/Common/3dParty/md/nc-build.py new file mode 100644 index 0000000000..243906178f --- /dev/null +++ b/Common/3dParty/md/nc-build.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python3 + +import sys +import shutil +from pathlib import Path + +script_path = Path(sys.argv[0]).resolve() +script_dir = script_path.parent + +third_party_root = ( script_dir / ".." ).resolve() +if str( third_party_root ) not in sys.path: + sys.path.insert( 0, str( third_party_root ) ) +import build_3rdparty_common as nc + +nc.work_dir = Path( sys.argv[1] ) +nc.install_dir = Path( sys.argv[2] ) +nc.work_dir = nc.install_dir +nc.force_redo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" +nc.dep_name = "MD" +nc.debug_mode = True + +def fetch_and_patch(): + nc.create_install_dir() + + nc.run_command( + [ "git", "clone", "https://github.com/mity/md4c.git", nc.install_dir ], + "Git clone", + ) + + nc.run_command( + [ "git", "checkout", "481fbfbdf72daab2912380d62bb5f2187d438408" ], + "Checkout commit", + nc.install_dir + ) + + nc.create_install_dir_ok_marker() + + print( "Fetch & patch completed" ) + +if not nc.install_dir_looks_ok(): + fetch_and_patch() From cb2f64456f5086a11f786138fc6b7c7af491a085 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Wed, 22 Apr 2026 09:57:38 +0200 Subject: [PATCH 10/80] feature: Adding python script for hyphen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Common/3dParty/build_3rdparty.py | 2 +- Common/3dParty/hyphen/nc-build.py | 35 +++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 Common/3dParty/hyphen/nc-build.py diff --git a/Common/3dParty/build_3rdparty.py b/Common/3dParty/build_3rdparty.py index d6660ec78c..242b7a6f66 100644 --- a/Common/3dParty/build_3rdparty.py +++ b/Common/3dParty/build_3rdparty.py @@ -27,7 +27,7 @@ # 'brotli', # 'harfbuzz', # 'html', - # 'hyphen', + 'hyphen', 'icu', 'md', 'openssl', diff --git a/Common/3dParty/hyphen/nc-build.py b/Common/3dParty/hyphen/nc-build.py new file mode 100644 index 0000000000..532f7f19f7 --- /dev/null +++ b/Common/3dParty/hyphen/nc-build.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python3 + +import sys +import shutil +from pathlib import Path + +script_path = Path(sys.argv[0]).resolve() +script_dir = script_path.parent + +third_party_root = ( script_dir / ".." ).resolve() +if str( third_party_root ) not in sys.path: + sys.path.insert( 0, str( third_party_root ) ) +import build_3rdparty_common as nc + +nc.work_dir = Path( sys.argv[1] ) +nc.install_dir = Path( sys.argv[2] ) +nc.work_dir = nc.install_dir +nc.force_redo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" +nc.dep_name = "Hyphen" +nc.debug_mode = True + +def fetch_and_patch(): + nc.create_install_dir() + + nc.run_command( + [ "git", "clone", "https://github.com/hunspell/hyphen", nc.install_dir ], + "Git clone", + ) + + nc.create_install_dir_ok_marker() + + print( "Fetch & patch completed" ) + +if not nc.install_dir_looks_ok(): + fetch_and_patch() From 29b86af1126f4eaf3a322c244781e4f1fab86b1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Wed, 22 Apr 2026 12:58:47 +0200 Subject: [PATCH 11/80] feature: Adding python script for harfbuzz and brotli MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Common/3dParty/brotli/nc-build.py | 54 +++++++++++++++++++++++++ Common/3dParty/build_3rdparty.py | 5 ++- Common/3dParty/harfbuzz/nc-build.py | 61 +++++++++++++++++++++++++++++ 3 files changed, 118 insertions(+), 2 deletions(-) create mode 100644 Common/3dParty/brotli/nc-build.py create mode 100644 Common/3dParty/harfbuzz/nc-build.py diff --git a/Common/3dParty/brotli/nc-build.py b/Common/3dParty/brotli/nc-build.py new file mode 100644 index 0000000000..7179dd21b6 --- /dev/null +++ b/Common/3dParty/brotli/nc-build.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python3 + +import sys +import shutil +from pathlib import Path + +script_path = Path(sys.argv[0]).resolve() +script_dir = script_path.parent + +third_party_root = ( script_dir / ".." ).resolve() +if str( third_party_root ) not in sys.path: + sys.path.insert( 0, str( third_party_root ) ) +import build_3rdparty_common as nc + +nc.work_dir = Path( sys.argv[1] ) +nc.install_dir = Path( sys.argv[2] ) +nc.work_dir = nc.install_dir +nc.force_redo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" +nc.dep_name = "Brotli" +nc.debug_mode = True + +def fetch_and_patch(): + nc.create_install_dir() + + nc.run_command( + [ "git", "init" ], + "Git init", + nc.install_dir + ) + + nc.run_command( + [ "git", "remote", "add", "origin", "https://github.com/google/brotli.git" ], + "Add origin", + nc.install_dir + ) + + nc.run_command( + [ "git", "fetch", "--depth", "1", "origin", "a47d7475063eb223c87632eed806c0070e70da29" ], + "Fetch commit", + nc.install_dir + ) + + nc.run_command( + [ "git", "checkout", "FETCH_HEAD" ], + "Checkout head", + nc.install_dir + ) + + nc.create_install_dir_ok_marker() + + print( "Fetch & patch completed" ) + +if not nc.install_dir_looks_ok(): + fetch_and_patch() diff --git a/Common/3dParty/build_3rdparty.py b/Common/3dParty/build_3rdparty.py index 242b7a6f66..b12ea32544 100644 --- a/Common/3dParty/build_3rdparty.py +++ b/Common/3dParty/build_3rdparty.py @@ -24,14 +24,15 @@ subfolders = [ # 'apple', - # 'brotli', - # 'harfbuzz', + 'brotli', + 'harfbuzz', # 'html', 'hyphen', 'icu', 'md', 'openssl', 'socketio', + # 'v8', ] for subfolder in subfolders: diff --git a/Common/3dParty/harfbuzz/nc-build.py b/Common/3dParty/harfbuzz/nc-build.py new file mode 100644 index 0000000000..2bc806ac5f --- /dev/null +++ b/Common/3dParty/harfbuzz/nc-build.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python3 + +import sys +import shutil +from pathlib import Path + +script_path = Path(sys.argv[0]).resolve() +script_dir = script_path.parent +patches_dir = script_dir / "patch" + +third_party_root = ( script_dir / ".." ).resolve() +if str( third_party_root ) not in sys.path: + sys.path.insert( 0, str( third_party_root ) ) +import build_3rdparty_common as nc + +nc.work_dir = Path( sys.argv[1] ) +nc.install_dir = Path( sys.argv[2] ) +nc.work_dir = nc.install_dir +nc.force_redo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" +nc.dep_name = "Harfbuzz" +nc.debug_mode = True + +def fetch_and_patch(): + nc.create_install_dir() + + nc.run_command( + [ "git", "init" ], + "Git init", + nc.install_dir + ) + + nc.run_command( + [ "git", "remote", "add", "origin", "https://github.com/harfbuzz/harfbuzz.git" ], + "Add origin", + nc.install_dir + ) + + nc.run_command( + [ "git", "fetch", "--depth", "1", "origin", "894a1f72ee93a1fd8dc1d9218cb3fd8f048be29a" ], + "Fetch commit", + nc.install_dir + ) + + nc.run_command( + [ "git", "checkout", "FETCH_HEAD" ], + "Checkout head", + nc.install_dir + ) + + nc.run_command( + [ "git", "apply", f"{ patches_dir / "harfbuzz.patch" }" ], + "Apply Harfbuzz patch", + nc.install_dir + ) + + nc.create_install_dir_ok_marker() + + print( "Fetch & patch completed" ) + +if not nc.install_dir_looks_ok(): + fetch_and_patch() From 1527afa354973bdff92a859752c130d7b50f334a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Wed, 22 Apr 2026 16:26:34 +0200 Subject: [PATCH 12/80] feature: Adding python script for apple deps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Common/3dParty/apple/nc-build.py | 59 +++++++++++++++++++++++++ Common/3dParty/build_3rdparty.py | 2 +- Common/3dParty/build_3rdparty_common.py | 38 ++++++++++++++++ 3 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 Common/3dParty/apple/nc-build.py diff --git a/Common/3dParty/apple/nc-build.py b/Common/3dParty/apple/nc-build.py new file mode 100644 index 0000000000..dd0a18b18f --- /dev/null +++ b/Common/3dParty/apple/nc-build.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python3 + +import sys +import shutil +from pathlib import Path + +script_path = Path(sys.argv[0]).resolve() +script_dir = script_path.parent +patches_dir = script_dir + +third_party_root = ( script_dir / ".." ).resolve() +if str( third_party_root ) not in sys.path: + sys.path.insert( 0, str( third_party_root ) ) +import build_3rdparty_common as nc + +nc.work_dir = Path( sys.argv[1] ) +nc.install_dir = Path( sys.argv[2] ) +nc.work_dir = nc.install_dir +nc.force_redo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" +nc.dep_name = "Apple" +nc.debug_mode = True + +def fetch_and_patch(): + nc.create_install_dir() + + repos = [ + { "name": "glm", "url": "https://github.com/g-truc/glm.git", "commit": "33b4a621a697a305bc3a7610d290677b96beb181" }, + { "name": "mdds", "url": "https://github.com/kohei-us/mdds.git", "commit": "0783158939c6ce4b0b1b89e345ab983ccb0f0ad0" }, + { "name": "librevenge", "url": "https://github.com/Distrotech/librevenge.git", "commit": "becd044b519ab83893ad6398e3cbb499a7f0aaf4" }, + { "name": "libodfgen", "url": "https://github.com/Distrotech/libodfgen.git", "commit": "8ef8c171ebe3c5daebdce80ee422cf7bb96aa3bc" }, + { "name": "libetonyek", "url": "https://github.com/LibreOffice/libetonyek.git", "commit": "cb396b4a9453a457469b62a740d8fb933c9442c3" }, + ] + for repo in repos: + nc.shallow_checkout( nc.install_dir / repo[ "name" ], repo[ "url" ], repo[ "commit" ] ) + + nc.run_command( + [ "git", "apply", patches_dir / "mdds.patch" ], + "Patching mdds", + nc.install_dir / "mdds" + ) + + nc.run_command( + [ "git", "apply", patches_dir / "librevenge.patch" ], + "Patching librevenge", + nc.install_dir / "librevenge" + ) + + nc.run_command( + [ "git", "apply", patches_dir / "libetonyek.patch" ], + "Patching libetonyek", + nc.install_dir / "libetonyek" + ) + + nc.create_install_dir_ok_marker() + + print( "Fetch & patch completed" ) + +if not nc.install_dir_looks_ok(): + fetch_and_patch() diff --git a/Common/3dParty/build_3rdparty.py b/Common/3dParty/build_3rdparty.py index b12ea32544..9a86bd03f3 100644 --- a/Common/3dParty/build_3rdparty.py +++ b/Common/3dParty/build_3rdparty.py @@ -23,7 +23,7 @@ ) subfolders = [ - # 'apple', + 'apple', 'brotli', 'harfbuzz', # 'html', diff --git a/Common/3dParty/build_3rdparty_common.py b/Common/3dParty/build_3rdparty_common.py index 2ee53bc935..76bbab711d 100644 --- a/Common/3dParty/build_3rdparty_common.py +++ b/Common/3dParty/build_3rdparty_common.py @@ -85,3 +85,41 @@ def fix_terminal_encoding(): sys.stdout.reconfigure( encoding='utf-8' ) if is_windows(): os.system( 'chcp 65001 >nul' ) + +def shallow_checkout( repo_dir : Path, repo_url : str, commit : str ): + if repo_dir.exists(): + try: + shutil.rmtree( repo_dir ) + except FileNotFoundError: + pass + + # Create work dir (if needed) + if not repo_dir.exists(): + try: + repo_dir.mkdir( parents = True ) + except OSError: + abort_op( "Failed to create repo dir" ) + + run_command( + [ "git", "init" ], + f"Git init ({repo_dir.name})", + repo_dir + ) + + run_command( + [ "git", "remote", "add", "origin", repo_url ], + f"Add origin ({repo_dir.name})", + repo_dir + ) + + run_command( + [ "git", "fetch", "--depth", "1", "origin", commit ], + f"Fetch commit ({repo_dir.name})", + repo_dir + ) + + run_command( + [ "git", "checkout", "FETCH_HEAD" ], + f"Checkout head ({repo_dir.name})", + repo_dir + ) From cae3e76012d941947bed1e14ce921f6d62fafbd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Wed, 22 Apr 2026 16:33:03 +0200 Subject: [PATCH 13/80] feature: Utilize shallow_copy() function in python scripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Common/3dParty/brotli/nc-build.py | 24 +----------------------- Common/3dParty/harfbuzz/nc-build.py | 24 +----------------------- Common/3dParty/socketio/nc-build.py | 24 +----------------------- 3 files changed, 3 insertions(+), 69 deletions(-) diff --git a/Common/3dParty/brotli/nc-build.py b/Common/3dParty/brotli/nc-build.py index 7179dd21b6..3bab97a98d 100644 --- a/Common/3dParty/brotli/nc-build.py +++ b/Common/3dParty/brotli/nc-build.py @@ -22,29 +22,7 @@ def fetch_and_patch(): nc.create_install_dir() - nc.run_command( - [ "git", "init" ], - "Git init", - nc.install_dir - ) - - nc.run_command( - [ "git", "remote", "add", "origin", "https://github.com/google/brotli.git" ], - "Add origin", - nc.install_dir - ) - - nc.run_command( - [ "git", "fetch", "--depth", "1", "origin", "a47d7475063eb223c87632eed806c0070e70da29" ], - "Fetch commit", - nc.install_dir - ) - - nc.run_command( - [ "git", "checkout", "FETCH_HEAD" ], - "Checkout head", - nc.install_dir - ) + nc.shallow_checkout( nc.install_dir, "https://github.com/google/brotli.git", "a47d7475063eb223c87632eed806c0070e70da29" ) nc.create_install_dir_ok_marker() diff --git a/Common/3dParty/harfbuzz/nc-build.py b/Common/3dParty/harfbuzz/nc-build.py index 2bc806ac5f..fd82df3001 100644 --- a/Common/3dParty/harfbuzz/nc-build.py +++ b/Common/3dParty/harfbuzz/nc-build.py @@ -23,29 +23,7 @@ def fetch_and_patch(): nc.create_install_dir() - nc.run_command( - [ "git", "init" ], - "Git init", - nc.install_dir - ) - - nc.run_command( - [ "git", "remote", "add", "origin", "https://github.com/harfbuzz/harfbuzz.git" ], - "Add origin", - nc.install_dir - ) - - nc.run_command( - [ "git", "fetch", "--depth", "1", "origin", "894a1f72ee93a1fd8dc1d9218cb3fd8f048be29a" ], - "Fetch commit", - nc.install_dir - ) - - nc.run_command( - [ "git", "checkout", "FETCH_HEAD" ], - "Checkout head", - nc.install_dir - ) + nc.shallow_checkout( nc.install_dir, "https://github.com/harfbuzz/harfbuzz.git", "894a1f72ee93a1fd8dc1d9218cb3fd8f048be29a" ) nc.run_command( [ "git", "apply", f"{ patches_dir / "harfbuzz.patch" }" ], diff --git a/Common/3dParty/socketio/nc-build.py b/Common/3dParty/socketio/nc-build.py index 278b0dcb75..79c00adefa 100644 --- a/Common/3dParty/socketio/nc-build.py +++ b/Common/3dParty/socketio/nc-build.py @@ -23,29 +23,7 @@ def fetch_and_patch(): nc.create_workdir() - nc.run_command( - [ "git", "init" ], - "Git init", - nc.work_dir - ) - - nc.run_command( - [ "git", "remote", "add", "origin", "https://github.com/socketio/socket.io-client-cpp.git" ], - "Add remote", - nc.work_dir - ) - - nc.run_command( - [ "git", "fetch", "--depth", "1", "origin", "da779141a7379cc30c870d48295033bc16a23c66" ], - "Fetch", - nc.work_dir - ) - - nc.run_command( - [ "git", "checkout", "FETCH_HEAD" ], - "Checkout", - nc.work_dir - ) + nc.shallow_checkout( nc.work_dir, "https://github.com/socketio/socket.io-client-cpp.git", "da779141a7379cc30c870d48295033bc16a23c66" ) nc.run_command( [ "git", "submodule", "update", "--init", "--recursive" ], From 27c7379596ad8c559ad3f6a7421c29e2de62a021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Wed, 22 Apr 2026 16:52:24 +0200 Subject: [PATCH 14/80] featrue: Adding python script for html deps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Common/3dParty/build_3rdparty.py | 2 +- Common/3dParty/html/nc-build.py | 46 ++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 Common/3dParty/html/nc-build.py diff --git a/Common/3dParty/build_3rdparty.py b/Common/3dParty/build_3rdparty.py index 9a86bd03f3..937de52616 100644 --- a/Common/3dParty/build_3rdparty.py +++ b/Common/3dParty/build_3rdparty.py @@ -26,7 +26,7 @@ 'apple', 'brotli', 'harfbuzz', - # 'html', + 'html', 'hyphen', 'icu', 'md', diff --git a/Common/3dParty/html/nc-build.py b/Common/3dParty/html/nc-build.py new file mode 100644 index 0000000000..e08809a299 --- /dev/null +++ b/Common/3dParty/html/nc-build.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python3 + +import sys +import shutil +from pathlib import Path + +script_path = Path(sys.argv[0]).resolve() +script_dir = script_path.parent +patches_dir = script_dir + +third_party_root = ( script_dir / ".." ).resolve() +if str( third_party_root ) not in sys.path: + sys.path.insert( 0, str( third_party_root ) ) +import build_3rdparty_common as nc + +nc.work_dir = Path( sys.argv[1] ) +nc.install_dir = Path( sys.argv[2] ) +nc.work_dir = nc.install_dir +nc.force_redo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" +nc.dep_name = "SocketIO" +nc.debug_mode = True + +def fetch_and_patch(): + nc.create_workdir() + + nc.shallow_checkout( nc.work_dir / "katana-parser", "https://github.com/jasenhuang/katana-parser.git", "be6df458d4540eee375c513958dcb862a391cdd1" ) + nc.shallow_checkout( nc.work_dir / "gumbo-parser", "https://github.com/google/gumbo-parser.git", "aa91b27b02c0c80c482e24348a457ed7c3c088e0" ) + + nc.run_command( + [ "git", "apply", patches_dir / "katana.patch" ], + "Patch katana-parser", + nc.work_dir / "katana-parser" + ) + + nc.run_command( + [ "git", "apply", patches_dir / "gumbo.patch" ], + "Patch gumbo-parser", + nc.work_dir / "gumbo-parser" + ) + + nc.create_work_dir_ok_marker() + + print( "Fetch & patch completed" ) + +if not nc.work_dir_looks_ok(): + fetch_and_patch() From 58321831c6b79716287e7b49300c4a5316419a65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Wed, 22 Apr 2026 21:05:02 +0200 Subject: [PATCH 15/80] feature: Adding python script for hunspell MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Common/3dParty/build_3rdparty.py | 1 + Common/3dParty/hunspell/nc-build.py | 50 +++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 Common/3dParty/hunspell/nc-build.py diff --git a/Common/3dParty/build_3rdparty.py b/Common/3dParty/build_3rdparty.py index 937de52616..dfe405e6ef 100644 --- a/Common/3dParty/build_3rdparty.py +++ b/Common/3dParty/build_3rdparty.py @@ -32,6 +32,7 @@ 'md', 'openssl', 'socketio', + 'hunspell', # 'v8', ] diff --git a/Common/3dParty/hunspell/nc-build.py b/Common/3dParty/hunspell/nc-build.py new file mode 100644 index 0000000000..d7e57302d5 --- /dev/null +++ b/Common/3dParty/hunspell/nc-build.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python3 + +import sys +import shutil +from pathlib import Path + +script_path = Path(sys.argv[0]).resolve() +script_dir = script_path.parent +patches_dir = script_dir / "patches" + +third_party_root = ( script_dir / ".." ).resolve() +if str( third_party_root ) not in sys.path: + sys.path.insert( 0, str( third_party_root ) ) +import build_3rdparty_common as nc + +nc.work_dir = Path( sys.argv[1] ) +nc.install_dir = Path( sys.argv[2] ) +nc.work_dir = nc.install_dir +nc.force_redo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" +nc.dep_name = "Hunspell" +nc.debug_mode = True + +def fetch_and_patch(): + nc.create_workdir() + + nc.run_command( + [ "git", "clone", "--depth", "1", "--branch", "v1.7.2", + "https://github.com/hunspell/hunspell.git", nc.work_dir / "hunspell" + ], + "Clone hunspell" + ) + + # Create wasm version + try: + shutil.copytree( nc.work_dir / "hunspell", nc.work_dir / "hunspell-wasm" ) + except Exception as e: + nc.abort_op( f"No TLS copy failed: {e.stderr.strip() or e.stdout.strip() or e}" ) + + nc.run_command( + [ "git", "apply", patches_dir / "fix-wasm-hunspell.patch" ], + "Patch hunspell-wasm", + nc.work_dir / "hunspell-wasm" + ) + + nc.create_work_dir_ok_marker() + + print( "Fetch & patch completed" ) + +if not nc.work_dir_looks_ok(): + fetch_and_patch() From 66ab59d75fc7d1c7fdd4a3273f9835154709e911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Tue, 28 Apr 2026 11:24:28 +0200 Subject: [PATCH 16/80] feature: Adding python script for v8 (pt1 WIP) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Common/3dParty/build_3rdparty.py | 2 +- Common/3dParty/build_3rdparty_common.py | 39 ++- Common/3dParty/v8/nc-build.py | 359 ++++++++++++++++++++++++ 3 files changed, 386 insertions(+), 14 deletions(-) create mode 100644 Common/3dParty/v8/nc-build.py diff --git a/Common/3dParty/build_3rdparty.py b/Common/3dParty/build_3rdparty.py index dfe405e6ef..fac2446a1c 100644 --- a/Common/3dParty/build_3rdparty.py +++ b/Common/3dParty/build_3rdparty.py @@ -33,7 +33,7 @@ 'openssl', 'socketio', 'hunspell', - # 'v8', + 'v8', ] for subfolder in subfolders: diff --git a/Common/3dParty/build_3rdparty_common.py b/Common/3dParty/build_3rdparty_common.py index 76bbab711d..0561a542c5 100644 --- a/Common/3dParty/build_3rdparty_common.py +++ b/Common/3dParty/build_3rdparty_common.py @@ -10,16 +10,17 @@ install_dir = None force_redo = False -def abort_op( message : str, keep_work : bool = False ): +def abort_op( message : str, keep_work : bool = False, error_is_fatal : bool = True ): print( f"Aboring {dep_name}: {message}", file = sys.stderr ) - if not debug_mode: - try: - if not keep_work: - shutil.rmtree( work_dir ) - shutil.rmtree( install_dir ) - except FileNotFoundError: - pass - sys.exit( 1 ) + if error_is_fatal: + if not debug_mode: + try: + if not keep_work: + shutil.rmtree( work_dir ) + shutil.rmtree( install_dir ) + except FileNotFoundError: + pass + sys.exit( 1 ) def is_linux() -> bool: return sys.platform.startswith("linux") @@ -69,17 +70,29 @@ def create_install_dir(): except OSError: abort_op( "Failed to create install dir" ) -def run_command( cmd : list[str], description : str, cwd : Path | None = None, verbose : bool = False ): +def ensure_directory_exists( dir : Path ): + if not dir.exists(): + dir.mkdir( parents = True ) + +def run_command( + cmd : list[str], + description : str, cwd : Path | None = None, + verbose : bool = False, + error_is_fatal : bool = True, + env : dict[ str, str ] | None = None + ): + cwd = (cwd or Path.cwd()).resolve() output_pipe = None if verbose else subprocess.PIPE + final_env = os.environ.copy() | ( {} if env is None else env ) try: - _ = subprocess.run( cmd, check=True, stdout=output_pipe, stderr=output_pipe, text=True, cwd=cwd ) + _ = subprocess.run( cmd, check=True, stdout=output_pipe, stderr=output_pipe, text=True, cwd=cwd, env = final_env ) except subprocess.CalledProcessError as e: if verbose: - abort_op( f"{description} failed" ) + abort_op( f"{description} failed", error_is_fatal=error_is_fatal ) else: - abort_op( f"{description} failed: {e.stderr.strip() or e.stdout.strip() or e}" ) + abort_op( f"{description} failed: {e.stderr.strip() or e.stdout.strip() or e}", error_is_fatal=error_is_fatal ) def fix_terminal_encoding(): sys.stdout.reconfigure( encoding='utf-8' ) diff --git a/Common/3dParty/v8/nc-build.py b/Common/3dParty/v8/nc-build.py new file mode 100644 index 0000000000..44a27590f3 --- /dev/null +++ b/Common/3dParty/v8/nc-build.py @@ -0,0 +1,359 @@ +#!/usr/bin/env python3 + +import sys +import shutil +import os +from pathlib import Path + +script_path = Path(sys.argv[0]).resolve() +script_dir = script_path.parent + +third_party_root = ( script_dir / ".." ).resolve() +if str( third_party_root ) not in sys.path: + sys.path.insert( 0, str( third_party_root ) ) +import build_3rdparty_common as nc + +nc.work_dir = Path( sys.argv[1] ) +nc.install_dir = Path( sys.argv[2] ) +nc.force_redo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" +nc.dep_name = "V8" +nc.debug_mode = True + +depot_tools_path = nc.work_dir / "depot_tools" +v8_root_path = nc.work_dir / "v8" +v8_src_path = v8_root_path / "v8" + +gn_source_path = nc.work_dir / "gn-source" + +def check_prequisites(): + for tool in [ "git", "python3", "clang", "ninja" ]: + if shutil.which( tool ) is None: + abort_op( f"Tool not found: {tool}" ) + +def apply_patches(): + patches_dir = script_dir / "tools" / "8.9" / "x64-linux-dynamic" + + patches = [ + { "name": "gclient_paths.patch", "dir": depot_tools_path }, + { "name": "jinja2.patch", "dir": v8_src_path / "third_party" / "jinja2" }, + { "name": "buildgn.patch", "dir": v8_src_path }, + ] + + for patch in patches: + if patch[ "dir" ].is_dir(): + nc.run_command( + [ "git", "apply", patches_dir / patch[ "name" ] ], + f"Applying patch: { patch[ "name" ] }", + patch[ "dir" ] + ) + else: + print( f"[WARNING] cannot apply patch ({ patch[ "name" ] }) because dir doesn't exist!" ) + +def disable_gmock(): + gmock_gn_file_path = v8_src_path / "testing" / "gmock" / "BUILD.gn" + content = """ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Disabled to avoid visibility issues with gtest_config +# V8 monolithic build doesn't need gmock + +import("//build_overrides/build.gni") + +group("gmock") { +testonly = true +} + +group("gmock_main") { +testonly = true +} +""" + + gmock_gn_file_path.write_text( content ) + +def disable_cppgc(): + cppgc_gn_file_path = v8_src_path / "src" / "heap" / "cppgc" / "BUILD.gn" + content = """ +# Copyright 2020 the V8 project authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Disabled to avoid ARM64 toolchain issues + +import("//build/config/sanitizers/sanitizers.gni") +import("../../gni/v8.gni") + +group("cppgc_base") { + visibility = [ ":*" ] +} + +group("cppgc_base_for_testing") { + testonly = true + visibility = [ ":*" ] +} +""" + + cppgc_gn_file_path.write_text( content ) + +def build_gn() -> Path: + nc.shallow_checkout( gn_source_path, "https://gn.googlesource.com/gn", "281ba2c91861b10fec7407c4b6172ec3d4661243" ) + + nc.ensure_directory_exists( gn_source_path / "out" ) + + nc.run_command( + [ "python", "build/gen.py", "--no-last-commit-position" ], + "Generate GN build", + cwd = gn_source_path, + env = { + "CC": "clang", + "CXX": "clang++" + } + ) + + content = """ +#pragma once +#define LAST_COMMIT_POSITION_NUM 0 +#define LAST_COMMIT_POSITION "0 (unknown)" +""" + ( gn_source_path / "out" / "last_commit_position.h" ).write_text( content ) + + nc.run_command( + [ "ninja", "-C", "out" ], + "Building GN", + cwd = gn_source_path, + env = { + "CC": "clang", + "CXX": "clang++" + } + ) + + gn_bin_path = v8_src_path / "buildtools" / "linux64" / "gn-built" + + nc.ensure_directory_exists( gn_bin_path ) + try: + shutil.copy2( gn_source_path / "out" / "gn", gn_bin_path ) + except Exception as e: + nc.abort_op( f"Copy failed: {e}" ) + + return gn_bin_path / "gn" + +def get_cpu(): + arch = platform.machine() + if arch == "x86_64": + targetarch = "x64" + elif arch == "aarch64" or arch == "arm64": + targetarch = "arm64" + else: + nc.abort_op( f"Unsupported architecture: {arch}" ) + +def fetch_and_patch(): + + nc.create_workdir() + + # Get depot_tools + nc.run_command( + [ "git", "clone", "https://chromium.googlesource.com/chromium/tools/depot_tools.git", depot_tools_path ], + "Clone depot_tools" + ) + + # Update depot_tools + nc.run_command( + [ "git", "pull", "origin", "main" ], + "Update depot_tools", + depot_tools_path, + error_is_fatal = False + ) + + # Fetch v8 + nc.run_command( [ "git", "clone", "https://chromium.googlesource.com/v8/v8.git", v8_src_path ], "Clone v8" ) + nc.run_command( [ "git", "checkout", "8.9.45" ], "Git checkout 8.9.45", v8_src_path ) + + nc.create_work_dir_ok_marker() + + print( "Fetch & patch completed" ) + +def build_and_install(): + nc.create_install_dir() + + # Clean gclient state + files_to_remove = [ ".gclient", ".gclient_entries", "_bad_scm", "chromium.googlesource.com" ] + for file in files_to_remove: + Path( v8_root_path / file ).unlink( missing_ok = True ) + + # Clean v8 state + nc.run_command( [ "git", "reset", "--hard" ], "Git reset", v8_src_path ) + nc.run_command( [ "git", "clean", "-fdx" ], "Git clean", v8_src_path ) + nc.run_command( [ "git", "fetch", "origin" ], "Git fetch", v8_src_path ) + + # Clean jinja state + if ( v8_src_path / "third_party" / "jinja2" ).is_dir(): + nc.run_command( [ "git", "reset", "--hard" ], "Git reset (jinja)", v8_src_path / "third_party" / "jinja2" ) + nc.run_command( [ "git", "clean", "-fd" ], "Git clean (jinja)", v8_src_path / "third_party" / "jinja2" ) + + # Clean depot tools + nc.run_command( [ "git", "reset", "--hard" ], "Git reset (depot_tools)", depot_tools_path ) + nc.run_command( [ "git", "clean", "-fd" ], "Git clean (depot_tools)", depot_tools_path ) + + # Create gclient config + content = """ +solutions = [ + { + "name": "v8", + "url": "https://chromium.googlesource.com/v8/v8.git", + "deps_file": "DEPS", + "managed": False, + "custom_deps": {}, + }, +] +target_os = ["linux"] + """ + Path( v8_root_path / ".gclient" ).write_text(content) + + # Sync v8 dependencies + depot_env = os.environ.copy() + depot_env["PATH"] = f"{depot_tools_path}:" + depot_env["PATH"] + depot_env["GCLIENT_SUPPRESS_GIT_VERSION_WARNING"] = "1" + depot_env["GYP_CHROMIUM_NO_ACTION"] = "1" + nc.run_command( + [ "gclient", "sync", "--no-history", "--shallow" ], + "GClient sync", + v8_root_path, + env = depot_env, + ) + + if nc.is_linux(): + apply_patches() + disable_gmock() + disable_cppgc() + gn_bin_path = build_gn() + + targetarch = get_cpu() + clang_path = Path(shutil.which("clang")) + clang_dir = clang_path.parent.parent + + output_path = v8_src_path / "out.gn"/ f"{targetarch}.release" + + # ensure out dir is clean + try: + shutil.rmtree( output_path ) + except FileNotFoundError: + pass + + gn_args=f""" +target_os="linux" +target_cpu="{targetarch}" +v8_target_cpu="{targetarch}" + +is_debug=false +is_component_build=false +is_official_build=false + +is_clang=true +clang_use_chrome_plugins=false + +use_sysroot=false +use_custom_libcxx=false + +# Symbol and debug settings +symbol_level=0 +strip_debug_info=true +enable_dsyms=false +treat_warnings_as_errors=false + +# V8 core settings +v8_monolithic=true +v8_use_external_startup_data=false +v8_enable_i18n_support=false +v8_enable_webassembly=false +v8_enable_pointer_compression=true +v8_enable_sandbox=false + +# Disable cppgc to avoid build issues +cppgc_enable_caged_heap=false +v8_enable_conservative_stack_scanning=false +cppgc_is_standalone=false + +# Disable all testing infrastructure - CRITICAL for avoiding gmock/gtest issues +v8_enable_test_features=false +v8_enable_verify_heap=false +v8_enable_verify_predictable=false +build_with_chromium=false + +# Explicitly disable test targets +v8_enable_backtrace=false +v8_enable_disassembler=false +v8_enable_object_print=false + +# Additional stability flags +v8_use_snapshot=true +v8_enable_lazy_source_positions=false +v8_enable_gdbjit=false +v8_enable_vtunejit=false +v8_enable_handle_zapping=false + +# Use system toolchain properly +use_gold=false +use_lld=true +""" + + nc.ensure_directory_exists( output_path ) + # gn_args_file_path = Path( v8_src_path / "gn_args.gn" ) + gn_args_file_path = Path( output_path / "args.gn" ) + gn_args_file_path.write_text( gn_args ) + + + + print( "gn_bin_path: " + str( gn_bin_path ) ) + print( "gn_args_file_path: " + str( gn_args_file_path ) ) + print( "output path: " + str( output_path ) ) + print( "cwd: " + str( v8_src_path ) ) + nc.run_command( + # [ gn_bin_path, "gen", output_path, f"--args-file={ gn_args_file_path }" ], + [ gn_bin_path, "gen", output_path ], + "Running gn", + v8_src_path + ) + + if not Path( output_path / "build.ninja" ).exists(): + nc.abort_op( "build.ninja not generated!" ) + + # Check that the tools actually exist + for tool in [ "ninja" ]: + if shutil.which( tool ) is None: + abort_op( f"Tool not found: {tool}" ) + + build_env = { + "SHELL": "/bin/bash", + } + + job_count = max( os.cpu_count() or 1, 4 ) # at least 4 jobs + + nc.run_command( + [ "ninja", "-C", output_path, f"-j{job_count}", "v8_monolith" ], + "Building v8", + v8_src_path + ) + + else: + abort_op( f"Unkown target platform: {sys.platform}" ) + + + + + nc.create_install_dir_ok_marker() + + print( "Build and install completed" ) + +check_prequisites() + +if not nc.work_dir_looks_ok(): + fetch_and_patch() + +if not nc.install_dir_looks_ok(): + if nc.is_windows() and shutil.which("nmake") is None: + raise RuntimeError( + "MSVC environment is not set up: 'nmake' not found in PATH.\n" + "Run 'vcvarsx86_amd64.bat' or use 'x64 Native Tools Command Prompt'." + ) + build_and_install() From a8770c358de2bc9897d9bf77a1c3c676e4a8d80e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Wed, 29 Apr 2026 15:21:37 +0200 Subject: [PATCH 17/80] fix: Updating python v8 build for arm --- Common/3dParty/build_3rdparty.py | 22 +++++-- Common/3dParty/build_3rdparty_common.py | 20 ++++++ Common/3dParty/v8/nc-build.py | 83 ++++++++++++++++++++----- 3 files changed, 107 insertions(+), 18 deletions(-) diff --git a/Common/3dParty/build_3rdparty.py b/Common/3dParty/build_3rdparty.py index fac2446a1c..76b331e696 100644 --- a/Common/3dParty/build_3rdparty.py +++ b/Common/3dParty/build_3rdparty.py @@ -6,9 +6,12 @@ import shutil from pathlib import Path +import build_3rdparty_common as nc + script_path = Path(sys.argv[0]).resolve() script_dir = script_path.parent + if len( sys.argv ) < 3: print( "Needs 2 arguments: work_dir_abs install_dir_abs" ) sys.exit(1) @@ -36,12 +39,16 @@ 'v8', ] +total_time = nc.MeasurementObj( "Total" ) + for subfolder in subfolders: + print( "---------------------------------------------------------------------------" ) print( f"Working on {subfolder}..." ) - print( f" Invoking {str(Path( script_dir / subfolder / "nc-build.py" ))}" ) sub_script = Path( script_dir / subfolder / "nc-build.py" ) if sub_script.exists(): try: + time_meas = nc.MeasurementObj( subfolder ) + subprocess.run( [sys.executable, sub_script, work_dir / subfolder, install_dir / subfolder], check=True, @@ -49,11 +56,18 @@ stdout=None, stderr=None, ) + except subprocess.CalledProcessError as e: - print(f"\n❌ {subfolder} failed with code {e.returncode}") + print( f" ❌ {subfolder} failed with code {e.returncode}" ) + print( f" { time_meas.elapsed_string() }" ) + time_meas.report() sys.exit(e.returncode) - print( f"✅ {subfolder} ready" ) + print( f" ✅ {subfolder} ready" ) + print( f" { time_meas.elapsed_string() }" ) else: - print( "Not good" ) + print( f"❌ { subfolder } build script cannot be found ({ sub_script })" ) + +print( "" ) +total_time.report() diff --git a/Common/3dParty/build_3rdparty_common.py b/Common/3dParty/build_3rdparty_common.py index 0561a542c5..b9ff2bbbe0 100644 --- a/Common/3dParty/build_3rdparty_common.py +++ b/Common/3dParty/build_3rdparty_common.py @@ -2,6 +2,7 @@ import shutil import subprocess import os +import time from pathlib import Path dep_name = None @@ -94,6 +95,10 @@ def run_command( else: abort_op( f"{description} failed: {e.stderr.strip() or e.stdout.strip() or e}", error_is_fatal=error_is_fatal ) +def capture_process_output( cmd : list[str] ) -> str: + result = subprocess.run( [ "clang", "--version" ], capture_output = True, text = True, check = True ) + return result.stdout + def fix_terminal_encoding(): sys.stdout.reconfigure( encoding='utf-8' ) if is_windows(): @@ -136,3 +141,18 @@ def shallow_checkout( repo_dir : Path, repo_url : str, commit : str ): f"Checkout head ({repo_dir.name})", repo_dir ) + +class MeasurementObj: + def __init__( self, name: str ): + self.name = name + self.start = time.perf_counter() + + def report( self ): + end = time.perf_counter() + elapsed = end - self.start + print( f"{self.name}: {elapsed:.6f} second(s)" ) + + def elapsed_string( self ) -> float: + end = time.perf_counter() + elapsed = end - self.start + return f"{elapsed:.6f} second(s)" diff --git a/Common/3dParty/v8/nc-build.py b/Common/3dParty/v8/nc-build.py index 44a27590f3..4382f75df3 100644 --- a/Common/3dParty/v8/nc-build.py +++ b/Common/3dParty/v8/nc-build.py @@ -3,6 +3,8 @@ import sys import shutil import os +import platform +import re from pathlib import Path script_path = Path(sys.argv[0]).resolve() @@ -28,7 +30,7 @@ def check_prequisites(): for tool in [ "git", "python3", "clang", "ninja" ]: if shutil.which( tool ) is None: - abort_op( f"Tool not found: {tool}" ) + nc.abort_op( f"Tool not found: {tool}" ) def apply_patches(): patches_dir = script_dir / "tools" / "8.9" / "x64-linux-dynamic" @@ -97,6 +99,7 @@ def disable_cppgc(): cppgc_gn_file_path.write_text( content ) def build_gn() -> Path: + print( "Fetching and building gn" ) nc.shallow_checkout( gn_source_path, "https://gn.googlesource.com/gn", "281ba2c91861b10fec7407c4b6172ec3d4661243" ) nc.ensure_directory_exists( gn_source_path / "out" ) @@ -138,7 +141,8 @@ def build_gn() -> Path: return gn_bin_path / "gn" -def get_cpu(): +def get_cpu() -> str: + targetarch = "Unknown" arch = platform.machine() if arch == "x86_64": targetarch = "x64" @@ -146,12 +150,14 @@ def get_cpu(): targetarch = "arm64" else: nc.abort_op( f"Unsupported architecture: {arch}" ) + return targetarch def fetch_and_patch(): nc.create_workdir() # Get depot_tools + print( "Fetching depot_tool" ) nc.run_command( [ "git", "clone", "https://chromium.googlesource.com/chromium/tools/depot_tools.git", depot_tools_path ], "Clone depot_tools" @@ -166,6 +172,7 @@ def fetch_and_patch(): ) # Fetch v8 + print( "Fetching v8" ) nc.run_command( [ "git", "clone", "https://chromium.googlesource.com/v8/v8.git", v8_src_path ], "Clone v8" ) nc.run_command( [ "git", "checkout", "8.9.45" ], "Git checkout 8.9.45", v8_src_path ) @@ -211,6 +218,7 @@ def build_and_install(): Path( v8_root_path / ".gclient" ).write_text(content) # Sync v8 dependencies + print( "Synching v8 dependencies" ) depot_env = os.environ.copy() depot_env["PATH"] = f"{depot_tools_path}:" + depot_env["PATH"] depot_env["GCLIENT_SUPPRESS_GIT_VERSION_WARNING"] = "1" @@ -295,21 +303,29 @@ def build_and_install(): # Use system toolchain properly use_gold=false use_lld=true +""" + + if targetarch == "arm64": + # Check clang version (it must be 13) + clang_version_output = nc.capture_process_output( [ "clang", "--version" ] ) + match = re.search( r'\d+\.\d+\.\d+', clang_version_output ) + version = match.group() if match else None + + if not version.startswith( "13." ): + nc.abort_op( f"Need clang 13 in path. Currently it's: { version }" ) + + gn_args = f"""{ gn_args } +cc="clang" +cxx="clang++" +clang_base_path="{ clang_dir }" """ nc.ensure_directory_exists( output_path ) - # gn_args_file_path = Path( v8_src_path / "gn_args.gn" ) gn_args_file_path = Path( output_path / "args.gn" ) gn_args_file_path.write_text( gn_args ) - - - print( "gn_bin_path: " + str( gn_bin_path ) ) - print( "gn_args_file_path: " + str( gn_args_file_path ) ) - print( "output path: " + str( output_path ) ) - print( "cwd: " + str( v8_src_path ) ) + print( "Running gn gen" ) nc.run_command( - # [ gn_bin_path, "gen", output_path, f"--args-file={ gn_args_file_path }" ], [ gn_bin_path, "gen", output_path ], "Running gn", v8_src_path @@ -321,7 +337,7 @@ def build_and_install(): # Check that the tools actually exist for tool in [ "ninja" ]: if shutil.which( tool ) is None: - abort_op( f"Tool not found: {tool}" ) + nc.abort_op( f"Tool not found: {tool}" ) build_env = { "SHELL": "/bin/bash", @@ -329,17 +345,56 @@ def build_and_install(): job_count = max( os.cpu_count() or 1, 4 ) # at least 4 jobs + print( "Building v8" ) nc.run_command( [ "ninja", "-C", output_path, f"-j{job_count}", "v8_monolith" ], "Building v8", v8_src_path ) - else: - abort_op( f"Unkown target platform: {sys.platform}" ) + # Verify artifacts + if not ( output_path / "obj" / "libv8_monolith.a" ).exists(): + nc.abort_op( "Build completed but libv8_monolith.a not found" ) - + print( "Installing v8" ) + try: + shutil.copy2( output_path / "obj" / "libv8_monolith.a", nc.install_dir / "libv8_monolith.a" ) + except Exception: + nc.abort_op( "Failed to install libv8_monolith.a" ) + + nc.ensure_directory_exists( nc.install_dir / "v8" / "include" ) + try: + shutil.copytree( v8_src_path / "include", nc.install_dir / "v8" / "include" ) + except Exception: + nc.abort_op( "Failed to install public headers" ) + src = v8_src_path / "src" + dst = nc.install_dir / "v8" / "src" + try: + for file in src.rglob( "*.h" ): + relative = file.relative_to( src ) + target = dst / relative + nc.ensure_directory_exists( target.parent ) + shutil.copy2( file, target ) + except Exception as e: + nc.abort_op( f"Failed to install private headers ({e})" ) + + # Create pkg-config file + pkg_cfg_file = f"prefix={ nc.install_dir }" + pkg_cfg_file = pkg_cfg_file + """ +libdir=${prefix} +includedir=${prefix}/v8/include + +Name: V8 +Description: V8 JavaScript Engine +Version: 8.9.45 +Libs: -L${libdir} -lv8_monolith -pthread +Cflags: -I${includedir} +""" + ( nc.install_dir / "v8.pc" ).write_text( pkg_cfg_file ) + + else: + abort_op( f"Unkown target platform: {sys.platform}" ) nc.create_install_dir_ok_marker() From ba2108d85445e487a1e0b548a711967e35dc5322 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Wed, 29 Apr 2026 19:32:24 +0200 Subject: [PATCH 18/80] fix: Fix v8 install in python script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Common/3dParty/v8/nc-build.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Common/3dParty/v8/nc-build.py b/Common/3dParty/v8/nc-build.py index 4382f75df3..51bea75b74 100644 --- a/Common/3dParty/v8/nc-build.py +++ b/Common/3dParty/v8/nc-build.py @@ -364,9 +364,9 @@ def build_and_install(): nc.ensure_directory_exists( nc.install_dir / "v8" / "include" ) try: - shutil.copytree( v8_src_path / "include", nc.install_dir / "v8" / "include" ) - except Exception: - nc.abort_op( "Failed to install public headers" ) + shutil.copytree( v8_src_path / "include", nc.install_dir / "v8" / "include", dirs_exist_ok = True ) + except Exception as e: + nc.abort_op( f"Failed to install public headers ({ e })" ) src = v8_src_path / "src" dst = nc.install_dir / "v8" / "src" From 4a985fad3d2138e75a23a719e92048196d24e15b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Thu, 30 Apr 2026 16:40:26 +0200 Subject: [PATCH 19/80] feature: Add some command line args to python build script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Common/3dParty/build_3rdparty.py | 101 +++++++++++++++++++----- Common/3dParty/build_3rdparty_common.py | 4 +- 2 files changed, 84 insertions(+), 21 deletions(-) diff --git a/Common/3dParty/build_3rdparty.py b/Common/3dParty/build_3rdparty.py index 76b331e696..156f6ac1f1 100644 --- a/Common/3dParty/build_3rdparty.py +++ b/Common/3dParty/build_3rdparty.py @@ -8,23 +8,6 @@ import build_3rdparty_common as nc -script_path = Path(sys.argv[0]).resolve() -script_dir = script_path.parent - - -if len( sys.argv ) < 3: - print( "Needs 2 arguments: work_dir_abs install_dir_abs" ) - sys.exit(1) - -work_dir = Path( sys.argv[1] ) -install_dir = Path( sys.argv[2] ) - -if sys.platform == "win32" and shutil.which("nmake") is None: - raise RuntimeError( - "MSVC environment is not set up: 'nmake' not found in PATH.\n" - "Run 'vcvarsx86_amd64.bat' or use 'x64 Native Tools Command Prompt'." - ) - subfolders = [ 'apple', 'brotli', @@ -39,18 +22,97 @@ 'v8', ] +force_redo_subfolders = [] + +script_path = Path(sys.argv[0]).resolve() +script_dir = script_path.parent + +def print_help(): + print( + f""" +Usage: { script_path.name } [options] work_dir_abs install_dir_abs + work_dir_abs : Absolute path to the work directory (repos will be checked out and built here). + install_dir_abs : Absolute path to the install directory (artifacts will be installed here). + + Options: + --list : Prints a list of known subfolders. + --force-redo= : A list of subdirectories to re-do even if they are already done. + --help | -h : Prints this help. + + Examples: + { script_path.name } $PWD/work $PWD/install + Build and install everything to these directories. + + { script_path.name } --force-redo=v8,icu $PWD/work $PWD/install + Build and install everything to these directories but delete and re-do v8 and icu. + """ + ) + +argc = len( sys.argv ) + +if ( argc < 2 ): + print_help() + sys.exit( 0 ) + +last_consumed_arg_idx = 0 +for i in range( 1, argc ): + if sys.argv[ i ].startswith( "--force-redo=" ): + force_redo_subfolders = ( sys.argv[ i ][ len( "--force-redo=" ): ] ).split( ',' ) + for fr_subfolder in force_redo_subfolders: + if fr_subfolder not in subfolders: + print( f"Unkown subfolder: { fr_subfolder }" ) + print_help() + sys.exit( 1 ) + + elif sys.argv[ i ] == "--list": + for subfolder in subfolders: + print( subfolder ) + sys.exit( 0 ) + + elif sys.argv[ i ] in [ "--help", "-h" ]: + print_help() + sys.exit( 0 ) + + elif sys.argv[ i ].startswith( "-" ): + print( f"Unkown option { sys.argv[ i ] }" ) + sys.exit( 1 ) + + else: + break + + last_consumed_arg_idx = i + +if last_consumed_arg_idx >= argc - 2: + print( "Needs at least 2 arguments: work_dir_abs install_dir_abs" ) + print_help() + sys.exit( 1 ) + + + +work_dir = Path( sys.argv[ argc - 2 ] ) +install_dir = Path( sys.argv[ argc - 1 ] ) + +if sys.platform == "win32" and shutil.which( "nmake" ) is None: + raise RuntimeError( + "MSVC environment is not set up: 'nmake' not found in PATH.\n" + "Run 'vcvarsx86_amd64.bat' or use 'x64 Native Tools Command Prompt'." + ) + + + total_time = nc.MeasurementObj( "Total" ) for subfolder in subfolders: + force_redo = subfolder in force_redo_subfolders print( "---------------------------------------------------------------------------" ) - print( f"Working on {subfolder}..." ) + print( f"Working on {subfolder}{ " (redo forced)" if force_redo else "" }..." ) sub_script = Path( script_dir / subfolder / "nc-build.py" ) if sub_script.exists(): try: time_meas = nc.MeasurementObj( subfolder ) subprocess.run( - [sys.executable, sub_script, work_dir / subfolder, install_dir / subfolder], + [sys.executable, sub_script, work_dir / subfolder, install_dir / subfolder, "force-redo" if force_redo else "" ], check=True, text=True, stdout=None, @@ -70,4 +132,5 @@ print( f"❌ { subfolder } build script cannot be found ({ sub_script })" ) print( "" ) +print( "🎉 Success! 🎉" ) total_time.report() diff --git a/Common/3dParty/build_3rdparty_common.py b/Common/3dParty/build_3rdparty_common.py index b9ff2bbbe0..fdfdce0319 100644 --- a/Common/3dParty/build_3rdparty_common.py +++ b/Common/3dParty/build_3rdparty_common.py @@ -30,10 +30,10 @@ def is_windows() -> bool: return sys.platform == "win32" def work_dir_looks_ok() -> bool: - return Path( work_dir / "ok_marker" ).exists() + return ( not force_redo ) and Path( work_dir / "ok_marker" ).exists() def install_dir_looks_ok() -> bool: - return Path( install_dir / "ok_marker" ).exists() + return ( not force_redo ) and Path( install_dir / "ok_marker" ).exists() def create_work_dir_ok_marker(): Path( work_dir / "ok_marker" ).touch() From 6f06e4a5be6a620b2fa203ecc94e5c647107cc23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Mon, 4 May 2026 13:17:30 +0200 Subject: [PATCH 20/80] fix: Preparing cmake file for python base deps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- common.cmake | 74 +++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 67 insertions(+), 7 deletions(-) diff --git a/common.cmake b/common.cmake index 75806e7767..17b63bd621 100644 --- a/common.cmake +++ b/common.cmake @@ -4,16 +4,67 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) -set(EO_CORE_OUTPUT_DIR "${CMAKE_BINARY_DIR}/package" CACHE PATH "Where to place output files (absolute path recommended)") -set(EO_CORE_TOOLS_DIR "${CMAKE_BINARY_DIR}/package" CACHE PATH "Where to place tools output files (absolute path recommended)") +# These version numbers don't affect what build_3rdparty.py builds. They just have to match. +set(ICU_MAJOR_VER "74") +set(ICU_MINOR_VER "2") -set(EO_CORE_3RD_PARTY_DIR "${CMAKE_BINARY_DIR}/third_party" CACHE PATH "Where to place and build 3rd party projects (absolute path recommended)") -set(EO_CORE_3RD_PARTY_WORK_DIR "${EO_CORE_3RD_PARTY_DIR}/workdir" CACHE PATH "3rd party work dir for clone and build.") -set(EO_CORE_3RD_PARTY_INSTALL_DIR "${EO_CORE_3RD_PARTY_DIR}/install" CACHE PATH "3rd party install dir.") +cmake_path( APPEND DEFAULT_EO_CORE_OUTPUT_DIR "${CMAKE_BINARY_DIR}" "package" ) +cmake_path( APPEND DEFAULT_EO_CORE_TOOLS_DIR "${CMAKE_BINARY_DIR}" "package" ) -set(VCPKG_BINARY_REMOTE "https://cloud.nextcloud.com/public.php/dav/files/n9KYBcFYyLLCgEw" CACHE STRING "Base URL for vcpkg binary package remote") +cmake_path( APPEND DEFAULT_EO_CORE_3RD_PARTY_DIR "${CMAKE_BINARY_DIR}" "third_party" ) +if( NOT DEFINED EO_CORE_OUTPUT_DIR ) + set(EO_CORE_OUTPUT_DIR "${DEFAULT_EO_CORE_OUTPUT_DIR}" CACHE PATH "Where to place output files (absolute path recommended)") +endif() + +if( NOT DEFINED EO_CORE_TOOLS_DIR ) + set(EO_CORE_TOOLS_DIR "${DEFAULT_EO_CORE_TOOLS_DIR}" CACHE PATH "Where to place tools output files (absolute path recommended)") +endif() + +if( NOT DEFINED EO_CORE_3RD_PARTY_DIR ) + set(EO_CORE_3RD_PARTY_DIR "${DEFAULT_EO_CORE_3RD_PARTY_DIR}" CACHE PATH "Where to place and build 3rd party projects (absolute path recommended)") +endif() + +if( NOT DEFINED EO_CORE_3RD_PARTY_WORK_DIR ) + cmake_path( APPEND DEFAULT_EO_CORE_3RD_PARTY_WORK_DIR "${EO_CORE_3RD_PARTY_DIR}" "work" ) + set(EO_CORE_3RD_PARTY_WORK_DIR "${DEFAULT_EO_CORE_3RD_PARTY_WORK_DIR}" CACHE PATH "3rd party work dir for clone and build.") +endif() + +if( NOT DEFINED EO_CORE_3RD_PARTY_INSTALL_DIR ) + cmake_path( APPEND DEFAULT_EO_CORE_3RD_PARTY_INSTALL_DIR "${EO_CORE_3RD_PARTY_DIR}" "install" ) + set(EO_CORE_3RD_PARTY_INSTALL_DIR "${DEFAULT_EO_CORE_3RD_PARTY_INSTALL_DIR}" CACHE PATH "3rd party install dir.") +endif() + +if( NOT DEFINED VCPKG_BINARY_REMOTE ) + set(VCPKG_BINARY_REMOTE "https://cloud.nextcloud.com/public.php/dav/files/n9KYBcFYyLLCgEw" CACHE STRING "Base URL for vcpkg binary package remote") +endif() + +if( NOT DEFINED PYTHON_BIN ) + set(PYTHON_BIN "python" CACHE FILEPATH "Python binary to use.") +endif() + +message("3rdparty dir: " ${EO_CORE_3RD_PARTY_DIR}) +message("workdir: " ${EO_CORE_3RD_PARTY_WORK_DIR}) +message("install: " ${EO_CORE_3RD_PARTY_INSTALL_DIR}) + +if(NOT THIRD_PARTY_PREPARED) + cmake_path( APPEND BUILDER_PATH "${CMAKE_CURRENT_LIST_DIR}" "Common" "3dParty" "build_3rdparty.py" ) + execute_process( + COMMAND_ECHO STDOUT + COMMAND "${PYTHON_BIN}" + "${BUILDER_PATH}" + "${EO_CORE_3RD_PARTY_WORK_DIR}" "${EO_CORE_3RD_PARTY_INSTALL_DIR}" + RESULT_VARIABLE result + ) + + if(result) # on error + message(FATAL_ERROR "Common/3dParty/build_3rdparty.py failed!") + else() + set(THIRD_PARTY_PREPARED TRUE CACHE INTERNAL "Third party prepared") + endif() +endif() + # Do NOT auto-add absolute link directories to RPATH set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE) @@ -124,7 +175,6 @@ function(set_default_options target) ) endfunction() - function(copy_artifacts_to_folder artifacts dest_dir) foreach(artifact ${artifacts}) add_custom_command(TARGET ${artifact} POST_BUILD @@ -151,6 +201,16 @@ function(copy_boost_libs artifact) ) endfunction() +function(declare_victory build_target) + add_custom_command(TARGET ${build_target} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E echo "" + COMMAND ${CMAKE_COMMAND} -E echo "-------------------------------------------------------------" + COMMAND ${CMAKE_COMMAND} -E echo "🎉 Success! [$] is ready! 🎉" + COMMAND ${CMAKE_COMMAND} -E echo "-------------------------------------------------------------" + COMMAND ${CMAKE_COMMAND} -E echo "" + ) +endfunction() + # Javascript bundler for wasm builds function(inject_script TARGET_NAME TEMPLATE_FILE OUTPUT_FILE) cmake_parse_arguments(ARG "" "MODE" "REPLACEMENTS" ${ARGN}) From 6da4355e50a00e59a2d92ccf9b9e2d7a95d7603d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Mon, 4 May 2026 13:18:02 +0200 Subject: [PATCH 21/80] feature(python-deps): UnicodeConverter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- UnicodeConverter/CMakeLists.txt | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/UnicodeConverter/CMakeLists.txt b/UnicodeConverter/CMakeLists.txt index a3462dc3a3..9c07cd17af 100644 --- a/UnicodeConverter/CMakeLists.txt +++ b/UnicodeConverter/CMakeLists.txt @@ -6,22 +6,8 @@ include(${CORE_ROOT_DIR}/common.cmake) project(UnicodeConverter) - - -message( "Fetch and build icu (UnicodeConverter)" ) -set(ICU_3RDPARTY_DIR "${CORE_ROOT_DIR}/Common/3dParty/icu") set(ICU_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu") -set(ICU_MAJOR_VER "74") -set(ICU_MINOR_VER "2") -get_filename_component(ICU_3RDPARTY_DIR_ABS "${ICU_3RDPARTY_DIR}" ABSOLUTE) get_filename_component(ICU_INSTALL_DIR_ABS "${ICU_INSTALL_DIR}" ABSOLUTE) -execute_process( - COMMAND_ECHO STDOUT - COMMAND ./nc-build.sh "${EO_CORE_3RD_PARTY_WORK_DIR}/icu" "${ICU_INSTALL_DIR}" ${ICU_MAJOR_VER} ${ICU_MINOR_VER} - WORKING_DIRECTORY ${ICU_3RDPARTY_DIR_ABS} -) - - add_library(UnicodeConverter SHARED UnicodeConverter.cpp @@ -36,7 +22,7 @@ target_compile_definitions(UnicodeConverter PRIVATE target_include_directories(UnicodeConverter PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} - ${ICU_INSTALL_DIR}/include + ${ICU_INSTALL_DIR_ABS}/include ) target_link_libraries(UnicodeConverter PUBLIC @@ -46,3 +32,5 @@ target_link_libraries(UnicodeConverter PUBLIC copy_artifacts_to_folder("UnicodeConverter" "${EO_CORE_OUTPUT_DIR}") copy_icu_libs(UnicodeConverter) + +declare_victory( UnicodeConverter ) From ab756244c252911fcf0cde3d1054d88303ab0dc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Mon, 4 May 2026 13:37:36 +0200 Subject: [PATCH 22/80] feature(python-deps): kernel_network MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Common/CMakeLists.txt | 4 +- Common/Network/CMakeLists.txt | 38 +++++-------------- .../src/socketio/socketio_internal_private.h | 4 +- .../socketio_internal_private_no_tls.h | 4 +- DesktopEditor/xml/build/cmake/CMakeLists.txt | 2 + OfficeUtils/CMakeLists.txt | 2 + 6 files changed, 20 insertions(+), 34 deletions(-) diff --git a/Common/CMakeLists.txt b/Common/CMakeLists.txt index 8652de55d1..6cdb6daf68 100644 --- a/Common/CMakeLists.txt +++ b/Common/CMakeLists.txt @@ -97,4 +97,6 @@ target_link_libraries(kernel PUBLIC UnicodeConverter ) -copy_artifacts_to_folder("kernel" "${EO_CORE_OUTPUT_DIR}") \ No newline at end of file +copy_artifacts_to_folder("kernel" "${EO_CORE_OUTPUT_DIR}") + +declare_victory( kernel ) diff --git a/Common/Network/CMakeLists.txt b/Common/Network/CMakeLists.txt index 899e7f274c..99620289a1 100644 --- a/Common/Network/CMakeLists.txt +++ b/Common/Network/CMakeLists.txt @@ -10,33 +10,11 @@ if(NOT TARGET kernel) add_subdirectory(${CORE_ROOT_DIR}/Common kernel) endif() - - -message( "Fetch and build OpenSSL" ) -set(OPENSSL_3RDPARTY_DIR "${CORE_ROOT_DIR}/Common/3dParty/openssl") -set(OPENSSL_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/openssl_build_linux_64") -get_filename_component(OPENSSL_3RDPARTY_DIR_ABS "${OPENSSL_3RDPARTY_DIR}" ABSOLUTE) +set(OPENSSL_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/openssl") get_filename_component(OPENSSL_INSTALL_DIR_ABS "${OPENSSL_INSTALL_DIR}" ABSOLUTE) -execute_process( - COMMAND_ECHO STDOUT - COMMAND ./nc-build.sh "${EO_CORE_3RD_PARTY_WORK_DIR}/openssl" "${OPENSSL_INSTALL_DIR}" - WORKING_DIRECTORY ${OPENSSL_3RDPARTY_DIR_ABS} -) - - -message( "Fetch and patch Socket-IO" ) -set(SOCKETIO_3DPARTY_DIR "${CORE_ROOT_DIR}/Common/3dParty/socketio") -set(SOCKETIO_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/socket.io-client-cpp") -get_filename_component(SOCKETIO_3DPARTY_DIR_ABS "${SOCKETIO_3DPARTY_DIR}" ABSOLUTE) +set(SOCKETIO_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/socketio") get_filename_component(SOCKETIO_INSTALL_DIR_ABS "${SOCKETIO_INSTALL_DIR}" ABSOLUTE) -execute_process( - COMMAND_ECHO STDOUT - COMMAND ./nc-fetch.sh "${SOCKETIO_INSTALL_DIR}" - WORKING_DIRECTORY ${SOCKETIO_3DPARTY_DIR_ABS} -) - - add_library(kernel_network SHARED ${SOCKETIO_INSTALL_DIR}/src_no_tls/internal/sio_client_impl.cpp @@ -104,11 +82,11 @@ if(UNIX) endif() target_include_directories(kernel_network PRIVATE - ${OPENSSL_INSTALL_DIR}/include + ${OPENSSL_INSTALL_DIR_ABS}/include ${EO_CORE_3RD_PARTY_INSTALL_DIR} - ${SOCKETIO_INSTALL_DIR}/lib/websocketpp - ${SOCKETIO_INSTALL_DIR}/lib/rapidjson/include - ${SOCKETIO_INSTALL_DIR}/lib/asio/asio/include + ${SOCKETIO_INSTALL_DIR_ABS}/lib/websocketpp + ${SOCKETIO_INSTALL_DIR_ABS}/lib/rapidjson/include + ${SOCKETIO_INSTALL_DIR_ABS}/lib/asio/asio/include ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/FileTransporter ) @@ -132,4 +110,6 @@ if(WIN_32) ) endif() -copy_artifacts_to_folder("kernel_network" "${EO_CORE_OUTPUT_DIR}") \ No newline at end of file +copy_artifacts_to_folder("kernel_network" "${EO_CORE_OUTPUT_DIR}") + +declare_victory( kernel_network ) diff --git a/Common/Network/WebSocket/src/socketio/socketio_internal_private.h b/Common/Network/WebSocket/src/socketio/socketio_internal_private.h index 8f030449fd..ea40a49240 100644 --- a/Common/Network/WebSocket/src/socketio/socketio_internal_private.h +++ b/Common/Network/WebSocket/src/socketio/socketio_internal_private.h @@ -26,8 +26,8 @@ #pragma once #include "socketio_internal.h" #include -#include "socket.io-client-cpp/src/internal/sio_packet.h" -#include "socket.io-client-cpp/src/sio_client.h" +#include "socketio/src/internal/sio_packet.h" +#include "socketio/src/sio_client.h" #include #include "../../../../../DesktopEditor/graphics/BaseThread.h" diff --git a/Common/Network/WebSocket/src/socketio/socketio_internal_private_no_tls.h b/Common/Network/WebSocket/src/socketio/socketio_internal_private_no_tls.h index 1ab3e386d0..1214a3c434 100644 --- a/Common/Network/WebSocket/src/socketio/socketio_internal_private_no_tls.h +++ b/Common/Network/WebSocket/src/socketio/socketio_internal_private_no_tls.h @@ -30,8 +30,8 @@ #pragma once #include "socketio_internal.h" #include -#include "socket.io-client-cpp/src_no_tls/internal/sio_packet.h" -#include "socket.io-client-cpp/src_no_tls/sio_client.h" +#include "socketio/src_no_tls/internal/sio_packet.h" +#include "socketio/src_no_tls/sio_client.h" #include #include "../../../../../DesktopEditor/graphics/BaseThread.h" diff --git a/DesktopEditor/xml/build/cmake/CMakeLists.txt b/DesktopEditor/xml/build/cmake/CMakeLists.txt index ff256b1663..633f4188a5 100644 --- a/DesktopEditor/xml/build/cmake/CMakeLists.txt +++ b/DesktopEditor/xml/build/cmake/CMakeLists.txt @@ -98,3 +98,5 @@ target_include_directories(libxml PRIVATE ) set_property(TARGET libxml PROPERTY POSITION_INDEPENDENT_CODE ON) + +declare_victory( libxml ) diff --git a/OfficeUtils/CMakeLists.txt b/OfficeUtils/CMakeLists.txt index 5742bbeb79..dbd975fd0d 100644 --- a/OfficeUtils/CMakeLists.txt +++ b/OfficeUtils/CMakeLists.txt @@ -68,3 +68,5 @@ if (WIN32) else() target_compile_options(OfficeUtils PRIVATE -include unistd.h) endif() + +declare_victory( OfficeUtils ) From 4290ac4cb4c2aeea5affb3d5a4c023998af18b46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Mon, 4 May 2026 14:23:06 +0200 Subject: [PATCH 23/80] feature(python-deps): MsBinaryFile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Common/3dParty/cryptopp/project/CMakeLists.txt | 4 +++- Common/cfcpp/CMakeLists.txt | 2 ++ MsBinaryFile/Projects/DocFormatLib/Linux/cmake/CMakeLists.txt | 4 +++- MsBinaryFile/Projects/PPTFormatLib/Linux/cmake/CMakeLists.txt | 4 +++- MsBinaryFile/Projects/VbaFormatLib/Linux/cmake/CMakeLists.txt | 4 +++- MsBinaryFile/Projects/XlsFormatLib/Linux/cmake/CMakeLists.txt | 4 +++- 6 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Common/3dParty/cryptopp/project/CMakeLists.txt b/Common/3dParty/cryptopp/project/CMakeLists.txt index 4098dc087b..80702a47b5 100644 --- a/Common/3dParty/cryptopp/project/CMakeLists.txt +++ b/Common/3dParty/cryptopp/project/CMakeLists.txt @@ -415,4 +415,6 @@ if(LINUX) ) endif() -copy_boost_libs(CryptoPPLib) \ No newline at end of file +copy_boost_libs(CryptoPPLib) + +declare_victory( CryptoPPLib ) diff --git a/Common/cfcpp/CMakeLists.txt b/Common/cfcpp/CMakeLists.txt index 3a1cd908a0..63b3d9800f 100644 --- a/Common/cfcpp/CMakeLists.txt +++ b/Common/cfcpp/CMakeLists.txt @@ -51,3 +51,5 @@ add_library(CompoundFileLib STATIC set_default_options(CompoundFileLib) set_property(TARGET CompoundFileLib PROPERTY POSITION_INDEPENDENT_CODE ON) + +declare_victory( CompoundFileLib ) diff --git a/MsBinaryFile/Projects/DocFormatLib/Linux/cmake/CMakeLists.txt b/MsBinaryFile/Projects/DocFormatLib/Linux/cmake/CMakeLists.txt index bf8720ce84..3277deb645 100644 --- a/MsBinaryFile/Projects/DocFormatLib/Linux/cmake/CMakeLists.txt +++ b/MsBinaryFile/Projects/DocFormatLib/Linux/cmake/CMakeLists.txt @@ -298,4 +298,6 @@ target_include_directories(DocFormatLib PRIVATE set_property(TARGET DocFormatLib PROPERTY POSITION_INDEPENDENT_CODE ON) -copy_boost_libs(DocFormatLib) \ No newline at end of file +copy_boost_libs(DocFormatLib) + +declare_victory( DocFormatLib ) diff --git a/MsBinaryFile/Projects/PPTFormatLib/Linux/cmake/CMakeLists.txt b/MsBinaryFile/Projects/PPTFormatLib/Linux/cmake/CMakeLists.txt index 0f33005c76..7df6a40f5e 100644 --- a/MsBinaryFile/Projects/PPTFormatLib/Linux/cmake/CMakeLists.txt +++ b/MsBinaryFile/Projects/PPTFormatLib/Linux/cmake/CMakeLists.txt @@ -510,4 +510,6 @@ target_compile_definitions(PptFormatLib PRIVATE set_property(TARGET PptFormatLib PROPERTY POSITION_INDEPENDENT_CODE ON) -copy_boost_libs(PptFormatLib) \ No newline at end of file +copy_boost_libs(PptFormatLib) + +declare_victory( PptFormatLib ) diff --git a/MsBinaryFile/Projects/VbaFormatLib/Linux/cmake/CMakeLists.txt b/MsBinaryFile/Projects/VbaFormatLib/Linux/cmake/CMakeLists.txt index e675ca94d6..8e391016ef 100644 --- a/MsBinaryFile/Projects/VbaFormatLib/Linux/cmake/CMakeLists.txt +++ b/MsBinaryFile/Projects/VbaFormatLib/Linux/cmake/CMakeLists.txt @@ -39,4 +39,6 @@ target_include_directories(VbaFormatLib PRIVATE set_property(TARGET VbaFormatLib PROPERTY POSITION_INDEPENDENT_CODE ON) -copy_boost_libs(VbaFormatLib) \ No newline at end of file +copy_boost_libs(VbaFormatLib) + +declare_victory( VbaFormatLib ) diff --git a/MsBinaryFile/Projects/XlsFormatLib/Linux/cmake/CMakeLists.txt b/MsBinaryFile/Projects/XlsFormatLib/Linux/cmake/CMakeLists.txt index 65f35def6a..0743ce7930 100644 --- a/MsBinaryFile/Projects/XlsFormatLib/Linux/cmake/CMakeLists.txt +++ b/MsBinaryFile/Projects/XlsFormatLib/Linux/cmake/CMakeLists.txt @@ -135,4 +135,6 @@ target_link_libraries(XlsFormatLib PRIVATE set_property(TARGET XlsFormatLib PROPERTY POSITION_INDEPENDENT_CODE ON) -copy_boost_libs(XlsFormatLib) \ No newline at end of file +copy_boost_libs(XlsFormatLib) + +declare_victory( XlsFormatLib ) From 64a31ded4f6695ce343fbc93278c8a52195ca255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Mon, 4 May 2026 14:30:38 +0200 Subject: [PATCH 24/80] feature(python-deps): OOXML formats MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- OOXML/Projects/Linux/BinDocument/CMakeLists.txt | 4 +++- OOXML/Projects/Linux/DocxFormatLib/CMakeLists.txt | 4 +++- OOXML/Projects/Linux/PPTXFormatLib/CMakeLists.txt | 4 +++- OOXML/Projects/Linux/XlsbFormatLib/CMakeLists.txt | 4 +++- OdfFile/Projects/Linux/CMakeLists.txt | 4 +++- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/OOXML/Projects/Linux/BinDocument/CMakeLists.txt b/OOXML/Projects/Linux/BinDocument/CMakeLists.txt index b035f75f81..f8bf4a2f24 100644 --- a/OOXML/Projects/Linux/BinDocument/CMakeLists.txt +++ b/OOXML/Projects/Linux/BinDocument/CMakeLists.txt @@ -137,4 +137,6 @@ target_link_libraries(BinDocument PRIVATE set_property(TARGET BinDocument PROPERTY POSITION_INDEPENDENT_CODE ON) -copy_boost_libs(BinDocument) \ No newline at end of file +copy_boost_libs(BinDocument) + +declare_victory( BinDocument ) diff --git a/OOXML/Projects/Linux/DocxFormatLib/CMakeLists.txt b/OOXML/Projects/Linux/DocxFormatLib/CMakeLists.txt index a766e424e7..5da1f89f13 100644 --- a/OOXML/Projects/Linux/DocxFormatLib/CMakeLists.txt +++ b/OOXML/Projects/Linux/DocxFormatLib/CMakeLists.txt @@ -408,4 +408,6 @@ target_link_libraries(DocxFormatLib PRIVATE set_property(TARGET DocxFormatLib PROPERTY POSITION_INDEPENDENT_CODE ON) -copy_boost_libs(DocxFormatLib) \ No newline at end of file +copy_boost_libs(DocxFormatLib) + +declare_victory( DocxFormatLib ) diff --git a/OOXML/Projects/Linux/PPTXFormatLib/CMakeLists.txt b/OOXML/Projects/Linux/PPTXFormatLib/CMakeLists.txt index 34debf8df6..00aa23cac5 100644 --- a/OOXML/Projects/Linux/PPTXFormatLib/CMakeLists.txt +++ b/OOXML/Projects/Linux/PPTXFormatLib/CMakeLists.txt @@ -1298,4 +1298,6 @@ target_link_libraries(PPTXFormatLib PRIVATE set_property(TARGET PPTXFormatLib PROPERTY POSITION_INDEPENDENT_CODE ON) -copy_boost_libs(PPTXFormatLib) \ No newline at end of file +copy_boost_libs(PPTXFormatLib) + +declare_victory( PPTXFormatLib ) diff --git a/OOXML/Projects/Linux/XlsbFormatLib/CMakeLists.txt b/OOXML/Projects/Linux/XlsbFormatLib/CMakeLists.txt index e507ebae50..c81e773d47 100644 --- a/OOXML/Projects/Linux/XlsbFormatLib/CMakeLists.txt +++ b/OOXML/Projects/Linux/XlsbFormatLib/CMakeLists.txt @@ -2168,4 +2168,6 @@ target_link_libraries(XlsbFormatLib PRIVATE set_property(TARGET XlsbFormatLib PROPERTY POSITION_INDEPENDENT_CODE ON) -copy_boost_libs(XlsbFormatLib) \ No newline at end of file +copy_boost_libs(XlsbFormatLib) + +declare_victory( XlsbFormatLib ) diff --git a/OdfFile/Projects/Linux/CMakeLists.txt b/OdfFile/Projects/Linux/CMakeLists.txt index 5e2fa88512..b6424fff41 100644 --- a/OdfFile/Projects/Linux/CMakeLists.txt +++ b/OdfFile/Projects/Linux/CMakeLists.txt @@ -491,4 +491,6 @@ target_link_libraries(OdfFormatLib PUBLIC set_property(TARGET OdfFormatLib PROPERTY POSITION_INDEPENDENT_CODE ON) -copy_boost_libs(OdfFormatLib) \ No newline at end of file +copy_boost_libs(OdfFormatLib) + +declare_victory( OdfFormatLib ) From 71ed84b8ee81ae01beeeabd00fb1d3412a31e342 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Mon, 4 May 2026 15:11:48 +0200 Subject: [PATCH 25/80] feature(pythond-deps): libgraphics MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- DesktopEditor/graphics/cmake/CMakeLists.txt | 669 +++++++++----------- RtfFile/Projects/Linux/CMakeLists.txt | 4 +- TxtFile/Projects/Linux/CMakeLists.txt | 4 +- 3 files changed, 318 insertions(+), 359 deletions(-) diff --git a/DesktopEditor/graphics/cmake/CMakeLists.txt b/DesktopEditor/graphics/cmake/CMakeLists.txt index 57ef1c3e08..f6f25033aa 100644 --- a/DesktopEditor/graphics/cmake/CMakeLists.txt +++ b/DesktopEditor/graphics/cmake/CMakeLists.txt @@ -27,65 +27,19 @@ endif() set(BOOST_ROOT "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/boost/linux_64") find_package(Boost REQUIRED COMPONENTS system filesystem regex date_time) - - -message( "Fetch and patch Katana and Gumbo" ) -set(HTML_3RDPARTY_DIR "${CORE_ROOT_DIR}/Common/3dParty/html") set(KATANA_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/katana-parser") set(GUMBO_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/gumbo-parser") -get_filename_component(HTML_3RDPARTY_DIR_ABS "${HTML_3RDPARTY_DIR}" ABSOLUTE) get_filename_component(KATANA_INSTALL_DIR_ABS "${KATANA_INSTALL_DIR}" ABSOLUTE) get_filename_component(GUMBO_INSTALL_DIR_ABS "${GUMBO_INSTALL_DIR}" ABSOLUTE) -execute_process( - COMMAND_ECHO STDOUT - COMMAND ./nc-fetch.sh "${KATANA_INSTALL_DIR}" "${GUMBO_INSTALL_DIR}" - WORKING_DIRECTORY ${HTML_3RDPARTY_DIR} -) - - - -message( "Fetch and patch Harfbuzz" ) -set(HARFBUZZ_3RDPARTY_DIR "${CORE_ROOT_DIR}/Common/3dParty/harfbuzz") set(HARFBUZZ_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz") -get_filename_component(HARFBUZZ_3RDPARTY_DIR_ABS "${HARFBUZZ_3RDPARTY_DIR}" ABSOLUTE) get_filename_component(HARFBUZZ_INSTALL_DIR_ABS "${HARFBUZZ_INSTALL_DIR}" ABSOLUTE) -execute_process( - COMMAND_ECHO STDOUT - COMMAND ./nc-fetch.sh "${HARFBUZZ_INSTALL_DIR}" - WORKING_DIRECTORY ${HARFBUZZ_3RDPARTY_DIR_ABS} -) - - - -message( "Fetch Brotli" ) -set(BROTLI_3RDPARTY_DIR "${CORE_ROOT_DIR}/Common/3dParty/brotli") set(BROTLI_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/brotli") -get_filename_component(BROTLI_3RDPARTY_DIR_ABS "${BROTLI_3RDPARTY_DIR}" ABSOLUTE) get_filename_component(BROTLI_INSTALL_DIR_ABS "${BROTLI_INSTALL_DIR}" ABSOLUTE) -execute_process( - COMMAND_ECHO STDOUT - COMMAND ./nc-fetch.sh "${BROTLI_INSTALL_DIR}" - WORKING_DIRECTORY ${BROTLI_3RDPARTY_DIR_ABS} -) - - - -message( "Fetch Hyphen" ) -set(HYPHEN_3RDPARTY_DIR "${CORE_ROOT_DIR}/Common/3dParty/hyphen") set(HYPHEN_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/hyphen") -get_filename_component(HYPHEN_3RDPARTY_DIR_ABS "${HYPHEN_3RDPARTY_DIR}" ABSOLUTE) get_filename_component(HYPHEN_INSTALL_DIR_ABS "${HYPHEN_INSTALL_DIR}" ABSOLUTE) -execute_process( - COMMAND_ECHO STDOUT - COMMAND ./nc-fetch.sh "${HYPHEN_INSTALL_DIR}" - WORKING_DIRECTORY ${HYPHEN_3RDPARTY_DIR_ABS} -) - - - add_library(graphics SHARED ${METAFILE_SOURCER_DIR}/MetaFile.h @@ -598,20 +552,20 @@ add_library(graphics SHARED # } # katana.pri - ${KATANA_INSTALL_DIR}/src/foundation.c - ${KATANA_INSTALL_DIR}/src/katana.lex.c - ${KATANA_INSTALL_DIR}/src/katana.tab.c - ${KATANA_INSTALL_DIR}/src/parser.c - ${KATANA_INSTALL_DIR}/src/selector.c - ${KATANA_INSTALL_DIR}/src/tokenizer.c - - ${KATANA_INSTALL_DIR}/src/foundation.h - ${KATANA_INSTALL_DIR}/src/katana.h - ${KATANA_INSTALL_DIR}/src/katana.lex.h - ${KATANA_INSTALL_DIR}/src/katana.tab.h - ${KATANA_INSTALL_DIR}/src/parser.h - ${KATANA_INSTALL_DIR}/src/selector.h - ${KATANA_INSTALL_DIR}/src/tokenizer.h + ${KATANA_INSTALL_DIR_ABS}/src/foundation.c + ${KATANA_INSTALL_DIR_ABS}/src/katana.lex.c + ${KATANA_INSTALL_DIR_ABS}/src/katana.tab.c + ${KATANA_INSTALL_DIR_ABS}/src/parser.c + ${KATANA_INSTALL_DIR_ABS}/src/selector.c + ${KATANA_INSTALL_DIR_ABS}/src/tokenizer.c + + ${KATANA_INSTALL_DIR_ABS}/src/foundation.h + ${KATANA_INSTALL_DIR_ABS}/src/katana.h + ${KATANA_INSTALL_DIR_ABS}/src/katana.lex.h + ${KATANA_INSTALL_DIR_ABS}/src/katana.tab.h + ${KATANA_INSTALL_DIR_ABS}/src/parser.h + ${KATANA_INSTALL_DIR_ABS}/src/selector.h + ${KATANA_INSTALL_DIR_ABS}/src/tokenizer.h # freetype.pri @@ -704,303 +658,302 @@ add_library(graphics SHARED ${FONT_ENGINE_SOURCES_DIR}/FontsAssistant.h ${FONT_ENGINE_SOURCES_DIR}/FontsAssistant.cpp - - # harfbuzz.pri - ${HARFBUZZ_INSTALL_DIR}/src/hb-aat-layout.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-aat-map.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-blob.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-buffer-serialize.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-buffer-verify.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-buffer.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-cairo-utils.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-cairo.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-common.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-coretext.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-directwrite.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-draw.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-face-builder.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-face.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-fallback-shape.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-font.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-ft.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-gdi.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-glib.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-gobject-structs.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-graphite2.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-icu.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-map.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-number.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-cff1-table.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-cff2-table.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-color.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-face.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-font.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-layout.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-map.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-math.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-meta.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-metrics.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-name.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-shape-fallback.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-shape-normalize.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-shape.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-shaper-arabic.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-shaper-default.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-shaper-hangul.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-shaper-hebrew.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-shaper-indic-table.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-shaper-indic.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-shaper-khmer.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-shaper-myanmar.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-shaper-syllabic.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-shaper-thai.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-shaper-use.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-shaper-vowel-constraints.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-tag.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-var.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-outline.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-paint-extents.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-paint.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-set.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-shape-plan.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-shape.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-shaper.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-static.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-style.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-subset-cff-common.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-subset-cff1.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-subset-cff2.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-subset-input.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-subset-instancer-solver.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-subset-plan.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-subset-repacker.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-subset.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-ucd.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-unicode.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-uniscribe.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-wasm-api.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-wasm-shape.cc - ${HARFBUZZ_INSTALL_DIR}/src/hb-aat-layout.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-aat.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-blob.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-buffer.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-cairo.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-common.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-coretext.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-deprecated.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-directwrite.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-draw.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-face.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-font.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-ft.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-gdi.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-glib.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-gobject-structs.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-gobject.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-graphite2.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-icu.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-map.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-color.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-deprecated.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-font.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-layout.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-math.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-meta.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-metrics.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-name.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-shape.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-var.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-paint.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-set.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-shape-plan.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-shape.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-style.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-subset-repacker.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-subset.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-unicode.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-uniscribe.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-version.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-wasm-api.h - ${HARFBUZZ_INSTALL_DIR}/src/hb.h - ${HARFBUZZ_INSTALL_DIR}/src/hb-aat-layout-ankr-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-aat-layout-bsln-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-aat-layout-common.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-aat-layout-feat-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-aat-layout-just-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-aat-layout-kerx-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-aat-layout-morx-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-aat-layout-opbd-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-aat-layout-trak-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-aat-layout.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-aat-ltag-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-aat-map.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-algs.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-array.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-atomic.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-bimap.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-bit-page.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-bit-set-invertible.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-bit-set.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-blob.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-buffer-deserialize-json.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-buffer-deserialize-text-glyphs.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-buffer-deserialize-text-unicode.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-buffer.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-cache.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-cairo-utils.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-cff-interp-common.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-cff-interp-cs-common.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-cff-interp-dict-common.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-cff1-interp-cs.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-cff2-interp-cs.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-config.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-cplusplus.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-debug.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-dispatch.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-draw.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-face.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-font.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ft-colr.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-iter.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-kern.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-limits.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-machinery.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-map.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-meta.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ms-feature-ranges.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-multimap.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-mutex.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-null.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-number-parser.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-number.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-object.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-open-file.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-open-type.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-cff-common.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-cff1-std-str.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-cff1-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-cff2-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-cmap-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-face-table-list.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-face.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-gasp-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-glyf-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-hdmx-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-head-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-hhea-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-hmtx-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-kern-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-layout-base-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-layout-common.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-layout-gdef-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-layout-gpos-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-layout-gsub-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-layout-gsubgpos.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-layout-jstf-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-layout.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-map.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-math-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-maxp-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-meta-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-metrics.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-name-language-static.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-name-language.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-name-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-os2-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-os2-unicode-ranges.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-post-macroman.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-post-table-v2subset.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-post-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-shape-fallback.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-shape-normalize.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-shape.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-shaper-arabic-fallback.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-shaper-arabic-joining-list.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-shaper-arabic-pua.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-shaper-arabic-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-shaper-arabic-win1256.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-shaper-arabic.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-shaper-indic-machine.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-shaper-indic.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-shaper-khmer-machine.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-shaper-myanmar-machine.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-shaper-syllabic.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-shaper-use-machine.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-shaper-use-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-shaper-vowel-constraints.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-shaper.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-stat-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-tag-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-var-avar-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-var-common.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-var-cvar-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-var-fvar-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-var-gvar-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-var-hvar-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-var-mvar-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ot-vorg-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-outline.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-paint-extents.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-paint.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-pool.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-priority-queue.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-repacker.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-sanitize.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-serialize.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-set-digest.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-set.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-shape-plan.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-shaper-impl.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-shaper-list.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-shaper.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-string-array.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-subset-accelerator.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-subset-cff-common.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-subset-input.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-subset-instancer-solver.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-subset-plan-member-list.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-subset-plan.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-subset.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-ucd-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-unicode-emoji-table.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-unicode.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-utf.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-vector.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-wasm-api-blob.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-wasm-api-buffer.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-wasm-api-common.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-wasm-api-face.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-wasm-api-font.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-wasm-api-list.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-wasm-api-shape.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb-wasm-api.hh - ${HARFBUZZ_INSTALL_DIR}/src/hb.hh - - ${HARFBUZZ_INSTALL_DIR}/src/graph/gsubgpos-context.cc - ${HARFBUZZ_INSTALL_DIR}/src/graph/gsubgpos-context.hh - ${HARFBUZZ_INSTALL_DIR}/src/graph/classdef-graph.hh - ${HARFBUZZ_INSTALL_DIR}/src/graph/coverage-graph.hh - ${HARFBUZZ_INSTALL_DIR}/src/graph/graph.hh - ${HARFBUZZ_INSTALL_DIR}/src/graph/gsubgpos-graph.hh - ${HARFBUZZ_INSTALL_DIR}/src/graph/markbasepos-graph.hh - ${HARFBUZZ_INSTALL_DIR}/src/graph/pairpos-graph.hh - ${HARFBUZZ_INSTALL_DIR}/src/graph/serialize.hh - ${HARFBUZZ_INSTALL_DIR}/src/graph/split-helpers.hh + # harfbuzz.pri_ABS + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-aat-layout.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-aat-map.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-blob.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-buffer-serialize.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-buffer-verify.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-buffer.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-cairo-utils.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-cairo.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-common.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-coretext.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-directwrite.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-draw.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-face-builder.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-face.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-fallback-shape.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-font.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ft.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-gdi.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-glib.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-gobject-structs.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-graphite2.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-icu.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-map.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-number.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-cff1-table.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-cff2-table.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-color.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-face.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-font.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-layout.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-map.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-math.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-meta.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-metrics.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-name.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-shape-fallback.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-shape-normalize.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-shape.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-shaper-arabic.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-shaper-default.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-shaper-hangul.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-shaper-hebrew.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-shaper-indic-table.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-shaper-indic.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-shaper-khmer.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-shaper-myanmar.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-shaper-syllabic.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-shaper-thai.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-shaper-use.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-shaper-vowel-constraints.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-tag.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-var.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-outline.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-paint-extents.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-paint.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-set.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-shape-plan.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-shape.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-shaper.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-static.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-style.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-subset-cff-common.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-subset-cff1.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-subset-cff2.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-subset-input.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-subset-instancer-solver.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-subset-plan.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-subset-repacker.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-subset.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ucd.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-unicode.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-uniscribe.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-wasm-api.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-wasm-shape.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-aat-layout.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-aat.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-blob.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-buffer.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-cairo.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-common.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-coretext.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-deprecated.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-directwrite.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-draw.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-face.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-font.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ft.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-gdi.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-glib.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-gobject-structs.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-gobject.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-graphite2.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-icu.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-map.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-color.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-deprecated.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-font.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-layout.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-math.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-meta.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-metrics.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-name.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-shape.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-var.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-paint.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-set.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-shape-plan.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-shape.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-style.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-subset-repacker.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-subset.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-unicode.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-uniscribe.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-version.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-wasm-api.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb.h + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-aat-layout-ankr-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-aat-layout-bsln-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-aat-layout-common.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-aat-layout-feat-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-aat-layout-just-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-aat-layout-kerx-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-aat-layout-morx-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-aat-layout-opbd-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-aat-layout-trak-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-aat-layout.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-aat-ltag-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-aat-map.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-algs.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-array.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-atomic.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-bimap.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-bit-page.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-bit-set-invertible.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-bit-set.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-blob.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-buffer-deserialize-json.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-buffer-deserialize-text-glyphs.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-buffer-deserialize-text-unicode.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-buffer.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-cache.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-cairo-utils.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-cff-interp-common.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-cff-interp-cs-common.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-cff-interp-dict-common.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-cff1-interp-cs.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-cff2-interp-cs.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-config.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-cplusplus.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-debug.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-dispatch.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-draw.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-face.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-font.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ft-colr.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-iter.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-kern.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-limits.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-machinery.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-map.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-meta.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ms-feature-ranges.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-multimap.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-mutex.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-null.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-number-parser.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-number.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-object.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-open-file.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-open-type.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-cff-common.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-cff1-std-str.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-cff1-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-cff2-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-cmap-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-face-table-list.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-face.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-gasp-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-glyf-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-hdmx-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-head-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-hhea-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-hmtx-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-kern-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-layout-base-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-layout-common.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-layout-gdef-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-layout-gpos-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-layout-gsub-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-layout-gsubgpos.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-layout-jstf-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-layout.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-map.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-math-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-maxp-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-meta-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-metrics.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-name-language-static.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-name-language.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-name-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-os2-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-os2-unicode-ranges.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-post-macroman.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-post-table-v2subset.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-post-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-shape-fallback.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-shape-normalize.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-shape.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-shaper-arabic-fallback.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-shaper-arabic-joining-list.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-shaper-arabic-pua.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-shaper-arabic-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-shaper-arabic-win1256.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-shaper-arabic.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-shaper-indic-machine.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-shaper-indic.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-shaper-khmer-machine.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-shaper-myanmar-machine.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-shaper-syllabic.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-shaper-use-machine.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-shaper-use-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-shaper-vowel-constraints.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-shaper.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-stat-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-tag-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-var-avar-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-var-common.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-var-cvar-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-var-fvar-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-var-gvar-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-var-hvar-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-var-mvar-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ot-vorg-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-outline.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-paint-extents.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-paint.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-pool.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-priority-queue.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-repacker.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-sanitize.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-serialize.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-set-digest.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-set.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-shape-plan.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-shaper-impl.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-shaper-list.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-shaper.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-string-array.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-subset-accelerator.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-subset-cff-common.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-subset-input.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-subset-instancer-solver.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-subset-plan-member-list.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-subset-plan.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-subset.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-ucd-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-unicode-emoji-table.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-unicode.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-utf.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-vector.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-wasm-api-blob.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-wasm-api-buffer.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-wasm-api-common.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-wasm-api-face.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-wasm-api-font.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-wasm-api-list.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-wasm-api-shape.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-wasm-api.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb.hh + + ${HARFBUZZ_INSTALL_DIR_ABS}/src/graph/gsubgpos-context.cc + ${HARFBUZZ_INSTALL_DIR_ABS}/src/graph/gsubgpos-context.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/graph/classdef-graph.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/graph/coverage-graph.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/graph/graph.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/graph/gsubgpos-graph.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/graph/markbasepos-graph.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/graph/pairpos-graph.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/graph/serialize.hh + ${HARFBUZZ_INSTALL_DIR_ABS}/src/graph/split-helpers.hh # brotli.pri - ${BROTLI_INSTALL_DIR}/c/common/constants.c - ${BROTLI_INSTALL_DIR}/c/common/context.c - ${BROTLI_INSTALL_DIR}/c/common/dictionary.c - ${BROTLI_INSTALL_DIR}/c/common/platform.c - ${BROTLI_INSTALL_DIR}/c/common/shared_dictionary.c - ${BROTLI_INSTALL_DIR}/c/common/transform.c - ${BROTLI_INSTALL_DIR}/c/dec/bit_reader.c - ${BROTLI_INSTALL_DIR}/c/dec/decode.c - ${BROTLI_INSTALL_DIR}/c/dec/huffman.c - # ${BROTLI_INSTALL_DIR}/c/dec/prefix.c - ${BROTLI_INSTALL_DIR}/c/dec/state.c - # ${BROTLI_INSTALL_DIR}/c/dec/static_init.c + ${BROTLI_INSTALL_DIR_ABS}/c/common/constants.c + ${BROTLI_INSTALL_DIR_ABS}/c/common/context.c + ${BROTLI_INSTALL_DIR_ABS}/c/common/dictionary.c + ${BROTLI_INSTALL_DIR_ABS}/c/common/platform.c + ${BROTLI_INSTALL_DIR_ABS}/c/common/shared_dictionary.c + ${BROTLI_INSTALL_DIR_ABS}/c/common/transform.c + ${BROTLI_INSTALL_DIR_ABS}/c/dec/bit_reader.c + ${BROTLI_INSTALL_DIR_ABS}/c/dec/decode.c + ${BROTLI_INSTALL_DIR_ABS}/c/dec/huffman.c + # ${BROTLI_INSTALL_DIR_ABS}/c/dec/prefix.c + ${BROTLI_INSTALL_DIR_ABS}/c/dec/state.c + # ${BROTLI_INSTALL_DIR_ABS}/c/dec/static_init.c ) set_default_options(graphics) @@ -1108,11 +1061,13 @@ target_link_libraries(graphics PUBLIC ) if(WIN32) - target_link_libraries(doctrenderer PUBLIC + target_link_libraries(graphics PUBLIC Advapi32 Shell32 User32 ) endif() -copy_artifacts_to_folder("graphics" "${EO_CORE_OUTPUT_DIR}") \ No newline at end of file +copy_artifacts_to_folder("graphics" "${EO_CORE_OUTPUT_DIR}") + +declare_victory( graphics ) diff --git a/RtfFile/Projects/Linux/CMakeLists.txt b/RtfFile/Projects/Linux/CMakeLists.txt index 202cdbc27d..50055a075d 100644 --- a/RtfFile/Projects/Linux/CMakeLists.txt +++ b/RtfFile/Projects/Linux/CMakeLists.txt @@ -197,4 +197,6 @@ target_link_libraries(RtfFormatLib PRIVATE set_property(TARGET RtfFormatLib PROPERTY POSITION_INDEPENDENT_CODE ON) -copy_boost_libs(RtfFormatLib) \ No newline at end of file +copy_boost_libs(RtfFormatLib) + +declare_victory( RtfFormatLib ) diff --git a/TxtFile/Projects/Linux/CMakeLists.txt b/TxtFile/Projects/Linux/CMakeLists.txt index 52ef32870a..88769a8406 100644 --- a/TxtFile/Projects/Linux/CMakeLists.txt +++ b/TxtFile/Projects/Linux/CMakeLists.txt @@ -41,4 +41,6 @@ target_link_libraries(TxtXmlFormatLib PRIVATE set_property(TARGET TxtXmlFormatLib PROPERTY POSITION_INDEPENDENT_CODE ON) -copy_boost_libs(TxtXmlFormatLib) \ No newline at end of file +copy_boost_libs(TxtXmlFormatLib) + +declare_victory( TxtXmlFormatLib ) From 735d8da2f93003000dd644a2a3af201a79ed19aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Mon, 4 May 2026 15:12:27 +0200 Subject: [PATCH 26/80] feature(python-deps): Fb2File MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Fb2File/CMakeLists.txt | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/Fb2File/CMakeLists.txt b/Fb2File/CMakeLists.txt index 0fb9741aff..85bfa75b9e 100644 --- a/Fb2File/CMakeLists.txt +++ b/Fb2File/CMakeLists.txt @@ -21,22 +21,11 @@ if(NOT TARGET graphics) add_subdirectory(${CORE_ROOT_DIR}/DesktopEditor/graphics/cmake graphics) endif() - - -message( "Fetch and patch Katana and Gumbo" ) set(HTML_3RDPARTY_DIR "${CORE_ROOT_DIR}/Common/3dParty/html") set(KATANA_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/katana-parser") set(GUMBO_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/gumbo-parser") -get_filename_component(HTML_3RDPARTY_DIR_ABS "${HTML_3RDPARTY_DIR}" ABSOLUTE) get_filename_component(KATANA_INSTALL_DIR_ABS "${KATANA_INSTALL_DIR}" ABSOLUTE) get_filename_component(GUMBO_INSTALL_DIR_ABS "${GUMBO_INSTALL_DIR}" ABSOLUTE) -execute_process( - COMMAND_ECHO STDOUT - COMMAND ./nc-fetch.sh "${KATANA_INSTALL_DIR}" "${GUMBO_INSTALL_DIR}" - WORKING_DIRECTORY ${HTML_3RDPARTY_DIR} -) - - add_library(Fb2File SHARED Fb2File.cpp @@ -88,7 +77,7 @@ target_compile_definitions(Fb2File PRIVATE target_include_directories(Fb2File PRIVATE ${EO_CORE_3RD_PARTY_INSTALL_DIR} - ${HTML_3RDPARTY_DIR} + ${HTML_3RDPARTY_DIR_ABS} ${GUMBO_INSTALL_DIR_ABS}/src ${Boost_INCLUDE_DIRS} ) @@ -106,4 +95,6 @@ target_link_libraries(Fb2File PUBLIC copy_artifacts_to_folder("Fb2File" "${EO_CORE_OUTPUT_DIR}") -copy_boost_libs(Fb2File) \ No newline at end of file +copy_boost_libs(Fb2File) + +declare_victory( Fb2File ) From 45e016ed621af4352e522bb66d01cdcba96524f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Mon, 4 May 2026 15:29:34 +0200 Subject: [PATCH 27/80] feature(python-deps): HtmlFile2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Common/3dParty/md/md2html.cpp | 2 +- HtmlFile2/CMakeLists.txt | 128 +++++++++++++++------------------- PdfFile/CMakeLists.txt | 4 +- 3 files changed, 60 insertions(+), 74 deletions(-) diff --git a/Common/3dParty/md/md2html.cpp b/Common/3dParty/md/md2html.cpp index 068d123fd6..5415f06ee7 100644 --- a/Common/3dParty/md/md2html.cpp +++ b/Common/3dParty/md/md2html.cpp @@ -1,6 +1,6 @@ #include "md2html.h" -#include "md4c/src/md4c-html.h" +#include "md/src/md4c-html.h" #include "../../../DesktopEditor/common/File.h" namespace Md diff --git a/HtmlFile2/CMakeLists.txt b/HtmlFile2/CMakeLists.txt index 4c58ff5a36..05291f3bff 100644 --- a/HtmlFile2/CMakeLists.txt +++ b/HtmlFile2/CMakeLists.txt @@ -28,33 +28,15 @@ if(NOT TARGET graphics) add_subdirectory(${CORE_ROOT_DIR}/DesktopEditor/graphics/cmake graphics) endif() - - -message( "Fetch and patch Katana and Gumbo" ) -set(HTML_3RDPARTY_DIR "${CORE_ROOT_DIR}/Common/3dParty/html") set(KATANA_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/katana-parser") set(GUMBO_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/gumbo-parser") -get_filename_component(HTML_3RDPARTY_DIR_ABS "${HTML_3RDPARTY_DIR}" ABSOLUTE) get_filename_component(KATANA_INSTALL_DIR_ABS "${KATANA_INSTALL_DIR}" ABSOLUTE) get_filename_component(GUMBO_INSTALL_DIR_ABS "${GUMBO_INSTALL_DIR}" ABSOLUTE) -execute_process( - COMMAND_ECHO STDOUT - COMMAND ./nc-fetch.sh "${KATANA_INSTALL_DIR}" "${GUMBO_INSTALL_DIR}" - WORKING_DIRECTORY ${HTML_3RDPARTY_DIR} -) -message( "Fetch md" ) set(MD_3RDPARTY_DIR "${CORE_ROOT_DIR}/Common/3dParty/md") -set(MD_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/md4c") +set(MD_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/md") get_filename_component(MD_3RDPARTY_DIR_ABS "${MD_3RDPARTY_DIR}" ABSOLUTE) get_filename_component(MD_INSTALL_DIR_ABS "${MD_INSTALL_DIR}" ABSOLUTE) -execute_process( - COMMAND_ECHO STDOUT - COMMAND ./nc-fetch.sh "${MD_INSTALL_DIR}" - WORKING_DIRECTORY ${MD_3RDPARTY_DIR_ABS} -) - - add_library(HtmlFile2 SHARED htmlfile2.cpp @@ -87,54 +69,54 @@ add_library(HtmlFile2 SHARED Writers/OOXMLWriter.h # katana.pri - ${KATANA_INSTALL_DIR}/src/foundation.c - ${KATANA_INSTALL_DIR}/src/katana.lex.c - ${KATANA_INSTALL_DIR}/src/katana.tab.c - ${KATANA_INSTALL_DIR}/src/parser.c - ${KATANA_INSTALL_DIR}/src/selector.c - ${KATANA_INSTALL_DIR}/src/tokenizer.c - - ${KATANA_INSTALL_DIR}/src/foundation.h - ${KATANA_INSTALL_DIR}/src/katana.h - ${KATANA_INSTALL_DIR}/src/katana.lex.h - ${KATANA_INSTALL_DIR}/src/katana.tab.h - ${KATANA_INSTALL_DIR}/src/parser.h - ${KATANA_INSTALL_DIR}/src/selector.h - ${KATANA_INSTALL_DIR}/src/tokenizer.h + ${KATANA_INSTALL_DIR_ABS}/src/foundation.c + ${KATANA_INSTALL_DIR_ABS}/src/katana.lex.c + ${KATANA_INSTALL_DIR_ABS}/src/katana.tab.c + ${KATANA_INSTALL_DIR_ABS}/src/parser.c + ${KATANA_INSTALL_DIR_ABS}/src/selector.c + ${KATANA_INSTALL_DIR_ABS}/src/tokenizer.c + + ${KATANA_INSTALL_DIR_ABS}/src/foundation.h + ${KATANA_INSTALL_DIR_ABS}/src/katana.h + ${KATANA_INSTALL_DIR_ABS}/src/katana.lex.h + ${KATANA_INSTALL_DIR_ABS}/src/katana.tab.h + ${KATANA_INSTALL_DIR_ABS}/src/parser.h + ${KATANA_INSTALL_DIR_ABS}/src/selector.h + ${KATANA_INSTALL_DIR_ABS}/src/tokenizer.h # gumbo.pri - ${GUMBO_INSTALL_DIR}/src/attribute.c - ${GUMBO_INSTALL_DIR}/src/char_ref.c - ${GUMBO_INSTALL_DIR}/src/error.c - ${GUMBO_INSTALL_DIR}/src/parser.c - ${GUMBO_INSTALL_DIR}/src/string_buffer.c - ${GUMBO_INSTALL_DIR}/src/string_piece.c - ${GUMBO_INSTALL_DIR}/src/tag.c - ${GUMBO_INSTALL_DIR}/src/tokenizer.c - ${GUMBO_INSTALL_DIR}/src/utf8.c - ${GUMBO_INSTALL_DIR}/src/util.c - ${GUMBO_INSTALL_DIR}/src/vector.c + ${GUMBO_INSTALL_DIR_ABS}/src/attribute.c + ${GUMBO_INSTALL_DIR_ABS}/src/char_ref.c + ${GUMBO_INSTALL_DIR_ABS}/src/error.c + ${GUMBO_INSTALL_DIR_ABS}/src/parser.c + ${GUMBO_INSTALL_DIR_ABS}/src/string_buffer.c + ${GUMBO_INSTALL_DIR_ABS}/src/string_piece.c + ${GUMBO_INSTALL_DIR_ABS}/src/tag.c + ${GUMBO_INSTALL_DIR_ABS}/src/tokenizer.c + ${GUMBO_INSTALL_DIR_ABS}/src/utf8.c + ${GUMBO_INSTALL_DIR_ABS}/src/util.c + ${GUMBO_INSTALL_DIR_ABS}/src/vector.c ${HTML_3RDPARTY_DIR}/htmltoxhtml.cpp - ${GUMBO_INSTALL_DIR}/src/attribute.h - ${GUMBO_INSTALL_DIR}/src/char_ref.h - ${GUMBO_INSTALL_DIR}/src/error.h - ${GUMBO_INSTALL_DIR}/src/gumbo.h - ${GUMBO_INSTALL_DIR}/src/insertion_mode.h - ${GUMBO_INSTALL_DIR}/src/parser.h - ${GUMBO_INSTALL_DIR}/src/string_buffer.h - ${GUMBO_INSTALL_DIR}/src/string_piece.h - ${GUMBO_INSTALL_DIR}/src/tag_enum.h - ${GUMBO_INSTALL_DIR}/src/tag_gperf.h - ${GUMBO_INSTALL_DIR}/src/tag_sizes.h - ${GUMBO_INSTALL_DIR}/src/tag_strings.h - ${GUMBO_INSTALL_DIR}/src/token_type.h - ${GUMBO_INSTALL_DIR}/src/tokenizer_states.h - ${GUMBO_INSTALL_DIR}/src/tokenizer.h - ${GUMBO_INSTALL_DIR}/src/utf8.h - ${GUMBO_INSTALL_DIR}/src/util.h - ${GUMBO_INSTALL_DIR}/src/vector.h + ${GUMBO_INSTALL_DIR_ABS}/src/attribute.h + ${GUMBO_INSTALL_DIR_ABS}/src/char_ref.h + ${GUMBO_INSTALL_DIR_ABS}/src/error.h + ${GUMBO_INSTALL_DIR_ABS}/src/gumbo.h + ${GUMBO_INSTALL_DIR_ABS}/src/insertion_mode.h + ${GUMBO_INSTALL_DIR_ABS}/src/parser.h + ${GUMBO_INSTALL_DIR_ABS}/src/string_buffer.h + ${GUMBO_INSTALL_DIR_ABS}/src/string_piece.h + ${GUMBO_INSTALL_DIR_ABS}/src/tag_enum.h + ${GUMBO_INSTALL_DIR_ABS}/src/tag_gperf.h + ${GUMBO_INSTALL_DIR_ABS}/src/tag_sizes.h + ${GUMBO_INSTALL_DIR_ABS}/src/tag_strings.h + ${GUMBO_INSTALL_DIR_ABS}/src/token_type.h + ${GUMBO_INSTALL_DIR_ABS}/src/tokenizer_states.h + ${GUMBO_INSTALL_DIR_ABS}/src/tokenizer.h + ${GUMBO_INSTALL_DIR_ABS}/src/utf8.h + ${GUMBO_INSTALL_DIR_ABS}/src/util.h + ${GUMBO_INSTALL_DIR_ABS}/src/vector.h ${HTML_3RDPARTY_DIR}/htmltoxhtml.h @@ -166,15 +148,15 @@ add_library(HtmlFile2 SHARED # md2html.pri - ${MD_3RDPARTY_DIR}/md2html.h - ${MD_INSTALL_DIR}/src/entity.h - ${MD_INSTALL_DIR}/src/md4c-html.h - ${MD_INSTALL_DIR}/src/md4c.h - - ${MD_3RDPARTY_DIR}/md2html.cpp - ${MD_INSTALL_DIR}/src/entity.c - ${MD_INSTALL_DIR}/src/md4c-html.c - ${MD_INSTALL_DIR}/src/md4c.c + ${MD_3RDPARTY_DIR_ABS}/md2html.h + ${MD_INSTALL_DIR_ABS}/src/entity.h + ${MD_INSTALL_DIR_ABS}/src/md4c-html.h + ${MD_INSTALL_DIR_ABS}/src/md4c.h + + ${MD_3RDPARTY_DIR_ABS}/md2html.cpp + ${MD_INSTALL_DIR_ABS}/src/entity.c + ${MD_INSTALL_DIR_ABS}/src/md4c-html.c + ${MD_INSTALL_DIR_ABS}/src/md4c.c ) set_default_options(HtmlFile2) @@ -212,4 +194,6 @@ target_link_libraries(HtmlFile2 PUBLIC copy_artifacts_to_folder("HtmlFile2" "${EO_CORE_OUTPUT_DIR}") -copy_boost_libs(HtmlFile2) \ No newline at end of file +copy_boost_libs(HtmlFile2) + +declare_victory( HtmlFile2 ) diff --git a/PdfFile/CMakeLists.txt b/PdfFile/CMakeLists.txt index 19ed7e82b2..581e3c33c5 100644 --- a/PdfFile/CMakeLists.txt +++ b/PdfFile/CMakeLists.txt @@ -517,4 +517,6 @@ target_link_libraries(PdfFile PUBLIC # Ole32 # Windows ) -copy_artifacts_to_folder("PdfFile" "${EO_CORE_OUTPUT_DIR}") \ No newline at end of file +copy_artifacts_to_folder("PdfFile" "${EO_CORE_OUTPUT_DIR}") + +declare_victory( PdfFile ) From 96dc8eb7728f1913cc36aaee9058903d140e7e3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Mon, 4 May 2026 18:46:17 +0200 Subject: [PATCH 28/80] feature(python-deps): Various simple formats MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- DjVuFile/CMakeLists.txt | 5 +++-- EpubFile/cmake/CMakeLists.txt | 4 +++- OFDFile/CMakeLists.txt | 4 +++- XpsFile/CMakeLists.txt | 4 +++- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/DjVuFile/CMakeLists.txt b/DjVuFile/CMakeLists.txt index 2f58af1adb..6110aefc9d 100644 --- a/DjVuFile/CMakeLists.txt +++ b/DjVuFile/CMakeLists.txt @@ -3,7 +3,6 @@ cmake_minimum_required(VERSION 3.10) project(DjVuFile) set(CORE_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/..") -# set(CORE_ROOT_DIR "..") include(${CORE_ROOT_DIR}/common.cmake) @@ -185,4 +184,6 @@ target_link_libraries(DjVuFile PUBLIC # Ole32 # Windows ) -copy_artifacts_to_folder("DjVuFile" "${EO_CORE_OUTPUT_DIR}") \ No newline at end of file +copy_artifacts_to_folder("DjVuFile" "${EO_CORE_OUTPUT_DIR}") + +declare_victory( DjVuFile ) diff --git a/EpubFile/cmake/CMakeLists.txt b/EpubFile/cmake/CMakeLists.txt index f77d83f8b5..5c9068d4ea 100644 --- a/EpubFile/cmake/CMakeLists.txt +++ b/EpubFile/cmake/CMakeLists.txt @@ -52,4 +52,6 @@ target_link_libraries(EpubFile PUBLIC HtmlFile2 ) -copy_artifacts_to_folder("EpubFile" "${EO_CORE_OUTPUT_DIR}") \ No newline at end of file +copy_artifacts_to_folder("EpubFile" "${EO_CORE_OUTPUT_DIR}") + +declare_victory( EpubFile ) diff --git a/OFDFile/CMakeLists.txt b/OFDFile/CMakeLists.txt index f8892881ca..ba468fa5d3 100644 --- a/OFDFile/CMakeLists.txt +++ b/OFDFile/CMakeLists.txt @@ -109,4 +109,6 @@ target_link_libraries(OFDFile PUBLIC # Ole32 # Windows ) -copy_artifacts_to_folder("OFDFile" "${EO_CORE_OUTPUT_DIR}") \ No newline at end of file +copy_artifacts_to_folder("OFDFile" "${EO_CORE_OUTPUT_DIR}") + +declare_victory( OFDFile ) diff --git a/XpsFile/CMakeLists.txt b/XpsFile/CMakeLists.txt index 0a076d86ab..c70afaaac3 100644 --- a/XpsFile/CMakeLists.txt +++ b/XpsFile/CMakeLists.txt @@ -66,4 +66,6 @@ target_link_libraries(XpsFile PUBLIC # Ole32 # Windows ) -copy_artifacts_to_folder("XpsFile" "${EO_CORE_OUTPUT_DIR}") \ No newline at end of file +copy_artifacts_to_folder("XpsFile" "${EO_CORE_OUTPUT_DIR}") + +declare_victory( XpsFile ) From 36f0aa97e5d8314942a67743252083af3b781bbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Mon, 4 May 2026 18:55:10 +0200 Subject: [PATCH 29/80] feature(python-deps): doctrenderer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- DesktopEditor/doctrenderer/CMakeLists.txt | 40 ++++------------------- DocxRenderer/CMakeLists.txt | 4 ++- 2 files changed, 10 insertions(+), 34 deletions(-) diff --git a/DesktopEditor/doctrenderer/CMakeLists.txt b/DesktopEditor/doctrenderer/CMakeLists.txt index 57aa7646f6..66a09c9189 100644 --- a/DesktopEditor/doctrenderer/CMakeLists.txt +++ b/DesktopEditor/doctrenderer/CMakeLists.txt @@ -59,39 +59,11 @@ if(DRAWINGFILE_SUPPORT) endif() endif() - - - - -message( "Fetch and build OpenSSL" ) -set(OPENSSL_3RDPARTY_DIR "${CORE_ROOT_DIR}/Common/3dParty/openssl") -set(OPENSSL_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/openssl_build_linux_64") -get_filename_component(OPENSSL_3RDPARTY_DIR_ABS "${OPENSSL_3RDPARTY_DIR}" ABSOLUTE) +set(OPENSSL_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/openssl") get_filename_component(OPENSSL_INSTALL_DIR_ABS "${OPENSSL_INSTALL_DIR}" ABSOLUTE) -execute_process( - COMMAND_ECHO STDOUT - COMMAND ./nc-build.sh "${EO_CORE_3RD_PARTY_WORK_DIR}/openssl" "${OPENSSL_INSTALL_DIR}" - WORKING_DIRECTORY ${OPENSSL_3RDPARTY_DIR_ABS} -) - - - - - -message( "Fetch, patch and build v8" ) -set(V8_INSTALL_DIR_ABS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/v8/v8") - -# Set TARGETARCH based on detected architecture (x64 or arm64) -if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|arm64") - set(TARGETARCH arm64) -else() - set(TARGETARCH x64) -endif() - - - - +set(V8_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/v8") +get_filename_component(V8_INSTALL_DIR_ABS "${V8_INSTALL_DIR}" ABSOLUTE) add_library(doctrenderer SHARED ${CMAKE_CURRENT_SOURCE_DIR}/docbuilder_p.cpp @@ -239,7 +211,7 @@ target_include_directories(doctrenderer PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/addon ${CMAKE_CURRENT_SOURCE_DIR}/js_internal # js_base_embed.pri - ${OPENSSL_INSTALL_DIR}/include + ${OPENSSL_INSTALL_DIR_ABS}/include ${V8_INSTALL_DIR_ABS}/v8 ${V8_INSTALL_DIR_ABS}/v8/include ) @@ -327,4 +299,6 @@ target_link_libraries(doctrenderer PUBLIC copy_artifacts_to_folder("doctrenderer" "${EO_CORE_OUTPUT_DIR}") -copy_boost_libs(doctrenderer) \ No newline at end of file +copy_boost_libs(doctrenderer) + +declare_victory( doctrenderer ) diff --git a/DocxRenderer/CMakeLists.txt b/DocxRenderer/CMakeLists.txt index 1f541172c1..5e051a9935 100644 --- a/DocxRenderer/CMakeLists.txt +++ b/DocxRenderer/CMakeLists.txt @@ -98,4 +98,6 @@ if(WIN32) ) endif() -copy_artifacts_to_folder("DocxRenderer" "${EO_CORE_OUTPUT_DIR}") \ No newline at end of file +copy_artifacts_to_folder("DocxRenderer" "${EO_CORE_OUTPUT_DIR}") + +declare_victory( DocxRenderer ) From d90a0476e5ffe72e781d7d64ecc5ac1883401159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Mon, 4 May 2026 19:05:14 +0200 Subject: [PATCH 30/80] feature(python-deps): IWorkFile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Apple/CMakeLists.txt | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/Apple/CMakeLists.txt b/Apple/CMakeLists.txt index c64b38bf6e..8943b4eb48 100644 --- a/Apple/CMakeLists.txt +++ b/Apple/CMakeLists.txt @@ -26,29 +26,17 @@ if(NOT TARGET UnicodeConverter) add_subdirectory(${CORE_ROOT_DIR}/UnicodeConverter UnicodeConverter) endif() - - - -message( "Fetch, patch Apple related 3rd-party repos" ) set(APPLE_3RDPARTY_DIR "${COMMON_3RDPARTY_ROOT}/apple") set(APPLE_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/apple") get_filename_component(APPLE_3RDPARTY_DIR_ABS "${APPLE_3RDPARTY_DIR}" ABSOLUTE) get_filename_component(APPLE_INSTALL_DIR_ABS "${APPLE_INSTALL_DIR}" ABSOLUTE) -execute_process( - COMMAND_ECHO STDOUT - COMMAND ./fetch.sh "${APPLE_INSTALL_DIR}" - WORKING_DIRECTORY ${APPLE_3RDPARTY_DIR_ABS} -) + set(REVENGE_LIB_ROOT "${APPLE_INSTALL_DIR}/librevenge") set(ODF_LIB_ROOT "${APPLE_INSTALL_DIR}/libodfgen") set(ETONYEK_LIB_ROOT "${APPLE_INSTALL_DIR}/libetonyek") set(MDDS_LIB_ROOT "${APPLE_INSTALL_DIR}/mdds") set(GLM_LIB_ROOT "${APPLE_INSTALL_DIR}/glm") - - - - add_library(IWorkFile SHARED ${CMAKE_CURRENT_SOURCE_DIR}/IWork.cpp @@ -551,7 +539,7 @@ target_include_directories(IWorkFile PRIVATE # apple.pri ${APPLE_INSTALL_DIR} - ${APPLE_3RDPARTY_DIR}/headers + ${APPLE_3RDPARTY_DIR_ABS}/headers ${REVENGE_LIB_ROOT}/inc ${ODF_LIB_ROOT}/inc ${ETONYEK_LIB_ROOT}/inc @@ -589,4 +577,6 @@ target_link_libraries(IWorkFile PUBLIC copy_artifacts_to_folder("IWorkFile" "${EO_CORE_OUTPUT_DIR}") -copy_boost_libs(IWorkFile) \ No newline at end of file +copy_boost_libs(IWorkFile) + +declare_victory( IWorkFile ) From dfd78d46ab262df842d874812a51b8a6b2a6b088 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Mon, 4 May 2026 19:15:50 +0200 Subject: [PATCH 31/80] feature(python-deps): starmath, xmlsec, HwpFile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- DesktopEditor/xmlsec/src/CMakeLists.txt | 20 ++++++++++--------- HwpFile/CMakeLists.txt | 4 +++- .../Converter/StarMath2OOXML/CMakeLists.txt | 2 ++ 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/DesktopEditor/xmlsec/src/CMakeLists.txt b/DesktopEditor/xmlsec/src/CMakeLists.txt index 9428e73300..f4977e54cd 100644 --- a/DesktopEditor/xmlsec/src/CMakeLists.txt +++ b/DesktopEditor/xmlsec/src/CMakeLists.txt @@ -23,16 +23,16 @@ if(NOT TARGET kernel) add_subdirectory(${CORE_ROOT_DIR}/Common kernel) endif() -message( "Fetch and build OpenSSL" ) -set(OPENSSL_3RDPARTY_DIR "${CORE_ROOT_DIR}/Common/3dParty/openssl") -set(OPENSSL_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/openssl_build_linux_64") -get_filename_component(OPENSSL_3RDPARTY_DIR_ABS "${OPENSSL_3RDPARTY_DIR}" ABSOLUTE) +# message( "Fetch and build OpenSSL" ) +# set(OPENSSL_3RDPARTY_DIR "${CORE_ROOT_DIR}/Common/3dParty/openssl") +set(OPENSSL_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/openssl") +# get_filename_component(OPENSSL_3RDPARTY_DIR_ABS "${OPENSSL_3RDPARTY_DIR}" ABSOLUTE) get_filename_component(OPENSSL_INSTALL_DIR_ABS "${OPENSSL_INSTALL_DIR}" ABSOLUTE) -execute_process( - COMMAND_ECHO STDOUT - COMMAND ./nc-build.sh "${EO_CORE_3RD_PARTY_WORK_DIR}/openssl" "${OPENSSL_INSTALL_DIR}" - WORKING_DIRECTORY ${OPENSSL_3RDPARTY_DIR_ABS} -) +# execute_process( +# COMMAND_ECHO STDOUT +# COMMAND ./nc-build.sh "${EO_CORE_3RD_PARTY_WORK_DIR}/openssl" "${OPENSSL_INSTALL_DIR}" +# WORKING_DIRECTORY ${OPENSSL_3RDPARTY_DIR_ABS} +# ) # Set target version @@ -105,3 +105,5 @@ if(SUPPORT_OFORM) endif() copy_artifacts_to_folder("ooxmlsignature" "${EO_CORE_OUTPUT_DIR}") + +declare_victory( ooxmlsignature ) diff --git a/HwpFile/CMakeLists.txt b/HwpFile/CMakeLists.txt index 0967fccb59..38e7c603b4 100644 --- a/HwpFile/CMakeLists.txt +++ b/HwpFile/CMakeLists.txt @@ -213,4 +213,6 @@ target_link_libraries(HWPFile PUBLIC graphics ) -copy_artifacts_to_folder("HWPFile" "${EO_CORE_OUTPUT_DIR}") \ No newline at end of file +copy_artifacts_to_folder("HWPFile" "${EO_CORE_OUTPUT_DIR}") + +declare_victory( HWPFile ) diff --git a/OdfFile/Reader/Converter/StarMath2OOXML/CMakeLists.txt b/OdfFile/Reader/Converter/StarMath2OOXML/CMakeLists.txt index ed955e0338..d2c73f036c 100644 --- a/OdfFile/Reader/Converter/StarMath2OOXML/CMakeLists.txt +++ b/OdfFile/Reader/Converter/StarMath2OOXML/CMakeLists.txt @@ -76,3 +76,5 @@ if(WIN32) endif() copy_artifacts_to_folder("StarMathConverter" "${EO_CORE_OUTPUT_DIR}") + +declare_victory( StarMathConverter ) From 3a8e90586c7b2c46936277b72d435a9d6a4b3315 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Tue, 5 May 2026 10:07:17 +0200 Subject: [PATCH 32/80] feature(python-deps): tools MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- DesktopEditor/AllFontsGen/CMakeLists.txt | 14 +++-------- DesktopEditor/allthemesgen/CMakeLists.txt | 14 +++-------- .../doctrenderer/app_builder/CMakeLists.txt | 24 ++++++++++--------- DesktopEditor/pluginsmanager/CMakeLists.txt | 24 ++++++++++--------- DesktopEditor/xmlsec/src/CMakeLists.txt | 9 ------- PdfFile/Resources/CMapMemory/CMakeLists.txt | 5 ++-- Test/Applications/x2tTester/CMakeLists.txt | 2 ++ X2tConverter/build/cmake/CMakeLists.txt | 4 +++- .../build/cmake/library/CMakeLists.txt | 14 +++-------- 9 files changed, 42 insertions(+), 68 deletions(-) diff --git a/DesktopEditor/AllFontsGen/CMakeLists.txt b/DesktopEditor/AllFontsGen/CMakeLists.txt index 9679b0b99f..bcca35fb30 100644 --- a/DesktopEditor/AllFontsGen/CMakeLists.txt +++ b/DesktopEditor/AllFontsGen/CMakeLists.txt @@ -18,18 +18,8 @@ if(NOT TARGET graphics) add_subdirectory(${CORE_ROOT_DIR}/DesktopEditor/graphics/cmake graphics) endif() -message( "Fetch and build icu" ) -set(ICU_3RDPARTY_DIR "${CORE_ROOT_DIR}/Common/3dParty/icu") set(ICU_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu") -set(ICU_MAJOR_VER "74") -set(ICU_MINOR_VER "2") -get_filename_component(ICU_3RDPARTY_DIR_ABS "${ICU_3RDPARTY_DIR}" ABSOLUTE) get_filename_component(ICU_INSTALL_DIR_ABS "${ICU_INSTALL_DIR}" ABSOLUTE) -execute_process( - COMMAND_ECHO STDOUT - COMMAND ./nc-build.sh "${EO_CORE_3RD_PARTY_WORK_DIR}/icu" "${ICU_INSTALL_DIR}" ${ICU_MAJOR_VER} ${ICU_MINOR_VER} - WORKING_DIRECTORY ${ICU_3RDPARTY_DIR_ABS} -) add_executable(allfontsgen ${CMAKE_CURRENT_LIST_DIR}/main.cpp @@ -56,4 +46,6 @@ target_link_libraries(allfontsgen PUBLIC ) copy_artifacts_to_folder("allfontsgen" "${EO_CORE_TOOLS_DIR}") -copy_icu_libs(allfontsgen) \ No newline at end of file +copy_icu_libs(allfontsgen) + +declare_victory( allfontsgen ) diff --git a/DesktopEditor/allthemesgen/CMakeLists.txt b/DesktopEditor/allthemesgen/CMakeLists.txt index 30fadc0353..6095c08e98 100644 --- a/DesktopEditor/allthemesgen/CMakeLists.txt +++ b/DesktopEditor/allthemesgen/CMakeLists.txt @@ -42,18 +42,8 @@ if(NOT TARGET DocxRenderer) add_subdirectory(${CORE_ROOT_DIR}/DocxRenderer DocxRenderer) endif() -message( "Fetch and build icu (allthemesgen)" ) -set(ICU_3RDPARTY_DIR "${CORE_ROOT_DIR}/Common/3dParty/icu") set(ICU_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu") -set(ICU_MAJOR_VER "74") -set(ICU_MINOR_VER "2") -get_filename_component(ICU_3RDPARTY_DIR_ABS "${ICU_3RDPARTY_DIR}" ABSOLUTE) get_filename_component(ICU_INSTALL_DIR_ABS "${ICU_INSTALL_DIR}" ABSOLUTE) -execute_process( - COMMAND_ECHO STDOUT - COMMAND ./nc-build.sh "${EO_CORE_3RD_PARTY_WORK_DIR}/icu" "${ICU_INSTALL_DIR}" ${ICU_MAJOR_VER} ${ICU_MINOR_VER} - WORKING_DIRECTORY ${ICU_3RDPARTY_DIR_ABS} -) add_executable(allthemesgen ${CMAKE_CURRENT_LIST_DIR}/main.cpp @@ -85,4 +75,6 @@ target_link_libraries(allthemesgen PUBLIC ) copy_artifacts_to_folder("allthemesgen" "${EO_CORE_TOOLS_DIR}") -copy_icu_libs(allthemesgen) \ No newline at end of file +copy_icu_libs(allthemesgen) + +declare_victory( allthemesgen ) diff --git a/DesktopEditor/doctrenderer/app_builder/CMakeLists.txt b/DesktopEditor/doctrenderer/app_builder/CMakeLists.txt index 2389874b40..34a070a8a7 100644 --- a/DesktopEditor/doctrenderer/app_builder/CMakeLists.txt +++ b/DesktopEditor/doctrenderer/app_builder/CMakeLists.txt @@ -42,18 +42,18 @@ if(NOT TARGET DocxRenderer) add_subdirectory(${CORE_ROOT_DIR}/DocxRenderer DocxRenderer) endif() -message( "Fetch and build icu (app_builder)" ) -set(ICU_3RDPARTY_DIR "${CORE_ROOT_DIR}/Common/3dParty/icu") +# message( "Fetch and build icu (app_builder)" ) +# set(ICU_3RDPARTY_DIR "${CORE_ROOT_DIR}/Common/3dParty/icu") set(ICU_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu") -set(ICU_MAJOR_VER "74") -set(ICU_MINOR_VER "2") -get_filename_component(ICU_3RDPARTY_DIR_ABS "${ICU_3RDPARTY_DIR}" ABSOLUTE) +# set(ICU_MAJOR_VER "74") +# set(ICU_MINOR_VER "2") +# get_filename_component(ICU_3RDPARTY_DIR_ABS "${ICU_3RDPARTY_DIR}" ABSOLUTE) get_filename_component(ICU_INSTALL_DIR_ABS "${ICU_INSTALL_DIR}" ABSOLUTE) -execute_process( - COMMAND_ECHO STDOUT - COMMAND ./nc-build.sh "${EO_CORE_3RD_PARTY_WORK_DIR}/icu" "${ICU_INSTALL_DIR}" ${ICU_MAJOR_VER} ${ICU_MINOR_VER} - WORKING_DIRECTORY ${ICU_3RDPARTY_DIR_ABS} -) +# execute_process( +# COMMAND_ECHO STDOUT +# COMMAND ./nc-build.sh "${EO_CORE_3RD_PARTY_WORK_DIR}/icu" "${ICU_INSTALL_DIR}" ${ICU_MAJOR_VER} ${ICU_MINOR_VER} +# WORKING_DIRECTORY ${ICU_3RDPARTY_DIR_ABS} +# ) add_executable(docbuilder ${CMAKE_CURRENT_LIST_DIR}/main.cpp @@ -77,4 +77,6 @@ target_link_libraries(docbuilder PUBLIC ) copy_artifacts_to_folder("docbuilder" "${EO_CORE_OUTPUT_DIR}") -copy_icu_libs(docbuilder) \ No newline at end of file +copy_icu_libs(docbuilder) + +declare_victory( docbuilder ) diff --git a/DesktopEditor/pluginsmanager/CMakeLists.txt b/DesktopEditor/pluginsmanager/CMakeLists.txt index b2b5357f47..d6f2da5509 100644 --- a/DesktopEditor/pluginsmanager/CMakeLists.txt +++ b/DesktopEditor/pluginsmanager/CMakeLists.txt @@ -18,18 +18,18 @@ if(NOT TARGET UnicodeConverter) add_subdirectory(${CORE_ROOT_DIR}/UnicodeConverter UnicodeConverter) endif() -message( "Fetch and build icu (pluginsmanager)" ) -set(ICU_3RDPARTY_DIR "${CORE_ROOT_DIR}/Common/3dParty/icu") +# message( "Fetch and build icu (pluginsmanager)" ) +# set(ICU_3RDPARTY_DIR "${CORE_ROOT_DIR}/Common/3dParty/icu") set(ICU_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu") -set(ICU_MAJOR_VER "74") -set(ICU_MINOR_VER "2") -get_filename_component(ICU_3RDPARTY_DIR_ABS "${ICU_3RDPARTY_DIR}" ABSOLUTE) +# set(ICU_MAJOR_VER "74") +# set(ICU_MINOR_VER "2") +# get_filename_component(ICU_3RDPARTY_DIR_ABS "${ICU_3RDPARTY_DIR}" ABSOLUTE) get_filename_component(ICU_INSTALL_DIR_ABS "${ICU_INSTALL_DIR}" ABSOLUTE) -execute_process( - COMMAND_ECHO STDOUT - COMMAND ./nc-build.sh "${EO_CORE_3RD_PARTY_WORK_DIR}/icu" "${ICU_INSTALL_DIR}" ${ICU_MAJOR_VER} ${ICU_MINOR_VER} - WORKING_DIRECTORY ${ICU_3RDPARTY_DIR_ABS} -) +# execute_process( +# COMMAND_ECHO STDOUT +# COMMAND ./nc-build.sh "${EO_CORE_3RD_PARTY_WORK_DIR}/icu" "${ICU_INSTALL_DIR}" ${ICU_MAJOR_VER} ${ICU_MINOR_VER} +# WORKING_DIRECTORY ${ICU_3RDPARTY_DIR_ABS} +# ) add_executable(pluginsmanager ${CMAKE_CURRENT_LIST_DIR}/main.cpp @@ -56,4 +56,6 @@ target_link_libraries(pluginsmanager PUBLIC ) copy_artifacts_to_folder("pluginsmanager" "${EO_CORE_TOOLS_DIR}") -copy_icu_libs(pluginsmanager) \ No newline at end of file +copy_icu_libs(pluginsmanager) + +declare_victory( pluginsmanager ) diff --git a/DesktopEditor/xmlsec/src/CMakeLists.txt b/DesktopEditor/xmlsec/src/CMakeLists.txt index f4977e54cd..7cc7ad7657 100644 --- a/DesktopEditor/xmlsec/src/CMakeLists.txt +++ b/DesktopEditor/xmlsec/src/CMakeLists.txt @@ -23,17 +23,8 @@ if(NOT TARGET kernel) add_subdirectory(${CORE_ROOT_DIR}/Common kernel) endif() -# message( "Fetch and build OpenSSL" ) -# set(OPENSSL_3RDPARTY_DIR "${CORE_ROOT_DIR}/Common/3dParty/openssl") set(OPENSSL_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/openssl") -# get_filename_component(OPENSSL_3RDPARTY_DIR_ABS "${OPENSSL_3RDPARTY_DIR}" ABSOLUTE) get_filename_component(OPENSSL_INSTALL_DIR_ABS "${OPENSSL_INSTALL_DIR}" ABSOLUTE) -# execute_process( -# COMMAND_ECHO STDOUT -# COMMAND ./nc-build.sh "${EO_CORE_3RD_PARTY_WORK_DIR}/openssl" "${OPENSSL_INSTALL_DIR}" -# WORKING_DIRECTORY ${OPENSSL_3RDPARTY_DIR_ABS} -# ) - # Set target version set_target_properties(ooxmlsignature PROPERTIES diff --git a/PdfFile/Resources/CMapMemory/CMakeLists.txt b/PdfFile/Resources/CMapMemory/CMakeLists.txt index 0dbdcef57f..2b7ce3573a 100644 --- a/PdfFile/Resources/CMapMemory/CMakeLists.txt +++ b/PdfFile/Resources/CMapMemory/CMakeLists.txt @@ -23,8 +23,7 @@ set_default_options(CMapSerialize) # Equivalent to ADD_DEPENDENCY(UnicodeConverter, kernel) # You'll need to make sure these targets are defined in your base.cmake -target_link_libraries(CMapSerialize - PRIVATE +target_link_libraries(CMapSerialize PRIVATE UnicodeConverter kernel ) @@ -44,4 +43,4 @@ add_custom_command( add_custom_target(cmapbin ALL DEPENDS "${ARTIFACT_FILE}" -) \ No newline at end of file +) diff --git a/Test/Applications/x2tTester/CMakeLists.txt b/Test/Applications/x2tTester/CMakeLists.txt index 869587b22b..7f461e2302 100644 --- a/Test/Applications/x2tTester/CMakeLists.txt +++ b/Test/Applications/x2tTester/CMakeLists.txt @@ -40,3 +40,5 @@ copy_artifacts_to_folder("x2ttester" "${EO_CORE_TOOLS_DIR}") # Modify rpath so test binary can run properly # register_test_target(x2t_test) + +declare_victory( x2ttester ) diff --git a/X2tConverter/build/cmake/CMakeLists.txt b/X2tConverter/build/cmake/CMakeLists.txt index c0020143aa..4fd91ee4c1 100644 --- a/X2tConverter/build/cmake/CMakeLists.txt +++ b/X2tConverter/build/cmake/CMakeLists.txt @@ -24,4 +24,6 @@ target_link_libraries(x2t PRIVATE x2tlib ) -copy_artifacts_to_folder("x2t" "${EO_CORE_OUTPUT_DIR}") \ No newline at end of file +copy_artifacts_to_folder("x2t" "${EO_CORE_OUTPUT_DIR}") + +declare_victory( x2t ) diff --git a/X2tConverter/build/cmake/library/CMakeLists.txt b/X2tConverter/build/cmake/library/CMakeLists.txt index 469f5d0718..3a23335e31 100644 --- a/X2tConverter/build/cmake/library/CMakeLists.txt +++ b/X2tConverter/build/cmake/library/CMakeLists.txt @@ -126,20 +126,10 @@ if(NOT TARGET ooxmlsignature) add_subdirectory(${CORE_ROOT_DIR}/DesktopEditor/xmlsec/src ooxmlsignature) endif() -message( "Fetch and build icu (x2t_lib)" ) -set(ICU_3RDPARTY_DIR "${CORE_ROOT_DIR}/Common/3dParty/icu") set(ICU_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu") set(ICU_MAJOR_VER "74") set(ICU_MINOR_VER "2") -get_filename_component(ICU_3RDPARTY_DIR_ABS "${ICU_3RDPARTY_DIR}" ABSOLUTE) get_filename_component(ICU_INSTALL_DIR_ABS "${ICU_INSTALL_DIR}" ABSOLUTE) -execute_process( - COMMAND_ECHO STDOUT - COMMAND ./nc-build.sh "${EO_CORE_3RD_PARTY_WORK_DIR}/icu" "${ICU_INSTALL_DIR}" ${ICU_MAJOR_VER} ${ICU_MINOR_VER} - WORKING_DIRECTORY ${ICU_3RDPARTY_DIR_ABS} -) - - add_library(x2tlib SHARED ${CORE_ROOT_DIR}/Common/OfficeFileFormatChecker2.cpp @@ -248,4 +238,6 @@ target_link_libraries(x2tlib PUBLIC set_property(TARGET x2tlib PROPERTY POSITION_INDEPENDENT_CODE ON) copy_artifacts_to_folder("x2tlib" "${EO_CORE_OUTPUT_DIR}") -copy_icu_libs(x2tlib) \ No newline at end of file +copy_icu_libs(x2tlib) + +declare_victory( x2tlib ) From 4e95362dcd8b0092eda4e0db6de462c59fb85c08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Tue, 5 May 2026 10:08:42 +0200 Subject: [PATCH 33/80] fix(python-deps): Removing comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- DesktopEditor/doctrenderer/app_builder/CMakeLists.txt | 10 ---------- DesktopEditor/pluginsmanager/CMakeLists.txt | 10 ---------- 2 files changed, 20 deletions(-) diff --git a/DesktopEditor/doctrenderer/app_builder/CMakeLists.txt b/DesktopEditor/doctrenderer/app_builder/CMakeLists.txt index 34a070a8a7..ba892cc1f0 100644 --- a/DesktopEditor/doctrenderer/app_builder/CMakeLists.txt +++ b/DesktopEditor/doctrenderer/app_builder/CMakeLists.txt @@ -42,18 +42,8 @@ if(NOT TARGET DocxRenderer) add_subdirectory(${CORE_ROOT_DIR}/DocxRenderer DocxRenderer) endif() -# message( "Fetch and build icu (app_builder)" ) -# set(ICU_3RDPARTY_DIR "${CORE_ROOT_DIR}/Common/3dParty/icu") set(ICU_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu") -# set(ICU_MAJOR_VER "74") -# set(ICU_MINOR_VER "2") -# get_filename_component(ICU_3RDPARTY_DIR_ABS "${ICU_3RDPARTY_DIR}" ABSOLUTE) get_filename_component(ICU_INSTALL_DIR_ABS "${ICU_INSTALL_DIR}" ABSOLUTE) -# execute_process( -# COMMAND_ECHO STDOUT -# COMMAND ./nc-build.sh "${EO_CORE_3RD_PARTY_WORK_DIR}/icu" "${ICU_INSTALL_DIR}" ${ICU_MAJOR_VER} ${ICU_MINOR_VER} -# WORKING_DIRECTORY ${ICU_3RDPARTY_DIR_ABS} -# ) add_executable(docbuilder ${CMAKE_CURRENT_LIST_DIR}/main.cpp diff --git a/DesktopEditor/pluginsmanager/CMakeLists.txt b/DesktopEditor/pluginsmanager/CMakeLists.txt index d6f2da5509..89ffd958bd 100644 --- a/DesktopEditor/pluginsmanager/CMakeLists.txt +++ b/DesktopEditor/pluginsmanager/CMakeLists.txt @@ -18,18 +18,8 @@ if(NOT TARGET UnicodeConverter) add_subdirectory(${CORE_ROOT_DIR}/UnicodeConverter UnicodeConverter) endif() -# message( "Fetch and build icu (pluginsmanager)" ) -# set(ICU_3RDPARTY_DIR "${CORE_ROOT_DIR}/Common/3dParty/icu") set(ICU_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu") -# set(ICU_MAJOR_VER "74") -# set(ICU_MINOR_VER "2") -# get_filename_component(ICU_3RDPARTY_DIR_ABS "${ICU_3RDPARTY_DIR}" ABSOLUTE) get_filename_component(ICU_INSTALL_DIR_ABS "${ICU_INSTALL_DIR}" ABSOLUTE) -# execute_process( -# COMMAND_ECHO STDOUT -# COMMAND ./nc-build.sh "${EO_CORE_3RD_PARTY_WORK_DIR}/icu" "${ICU_INSTALL_DIR}" ${ICU_MAJOR_VER} ${ICU_MINOR_VER} -# WORKING_DIRECTORY ${ICU_3RDPARTY_DIR_ABS} -# ) add_executable(pluginsmanager ${CMAKE_CURRENT_LIST_DIR}/main.cpp From 8b4e70a0aa8d54fcea3894a1843d72ce0e8153f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Thu, 7 May 2026 16:41:58 +0200 Subject: [PATCH 34/80] fix(python-deps): Fixing v8 build for windows --- Common/3dParty/build_3rdparty_common.py | 6 +- Common/3dParty/v8/nc-build.py | 337 ++++++++++++------ .../tools/8.9/x64-linux-dynamic/buildgn.patch | 11 +- .../tools/8.9/x64-windows/win_toolchain.patch | 33 ++ 4 files changed, 275 insertions(+), 112 deletions(-) create mode 100644 Common/3dParty/v8/tools/8.9/x64-windows/win_toolchain.patch diff --git a/Common/3dParty/build_3rdparty_common.py b/Common/3dParty/build_3rdparty_common.py index fdfdce0319..2b053d084b 100644 --- a/Common/3dParty/build_3rdparty_common.py +++ b/Common/3dParty/build_3rdparty_common.py @@ -1,5 +1,6 @@ import sys import shutil +import stat import subprocess import os import time @@ -106,8 +107,11 @@ def fix_terminal_encoding(): def shallow_checkout( repo_dir : Path, repo_url : str, commit : str ): if repo_dir.exists(): + def onerror(func, path, exc_info): + os.chmod(path, stat.S_IWRITE) + func(path) try: - shutil.rmtree( repo_dir ) + shutil.rmtree( repo_dir, onexc=onerror ) except FileNotFoundError: pass diff --git a/Common/3dParty/v8/nc-build.py b/Common/3dParty/v8/nc-build.py index 51bea75b74..7b0e071851 100644 --- a/Common/3dParty/v8/nc-build.py +++ b/Common/3dParty/v8/nc-build.py @@ -28,7 +28,11 @@ gn_source_path = nc.work_dir / "gn-source" def check_prequisites(): - for tool in [ "git", "python3", "clang", "ninja" ]: + tools_needed = [ "git", "python3" ] + if nc.is_linux(): + tools_needed.append( "clang" ) + tools_needed.append( "ninja" ) + for tool in tools_needed: if shutil.which( tool ) is None: nc.abort_op( f"Tool not found: {tool}" ) @@ -51,6 +55,13 @@ def apply_patches(): else: print( f"[WARNING] cannot apply patch ({ patch[ "name" ] }) because dir doesn't exist!" ) + if nc.is_windows(): + nc.run_command( + [ "git", "apply", script_dir / "tools" / "8.9" / "x64-windows" / "win_toolchain.patch" ], + "Applying patch: win_toolchain.patch", + v8_src_path / "build" + ) + def disable_gmock(): gmock_gn_file_path = v8_src_path / "testing" / "gmock" / "BUILD.gn" content = """ @@ -104,14 +115,19 @@ def build_gn() -> Path: nc.ensure_directory_exists( gn_source_path / "out" ) + env = { + "CC": "clang", + "CXX": "clang++" + } if nc.is_linux() else { + "CXXFLAGS": "/FIstring", + "CFLAGS": "/FIstring", + } + nc.run_command( [ "python", "build/gen.py", "--no-last-commit-position" ], "Generate GN build", cwd = gn_source_path, - env = { - "CC": "clang", - "CXX": "clang++" - } + env = env ) content = """ @@ -125,32 +141,175 @@ def build_gn() -> Path: [ "ninja", "-C", "out" ], "Building GN", cwd = gn_source_path, - env = { - "CC": "clang", - "CXX": "clang++" - } + env = env ) + gn_bin_name = "gn.exe" if nc.is_windows() else "gn" gn_bin_path = v8_src_path / "buildtools" / "linux64" / "gn-built" nc.ensure_directory_exists( gn_bin_path ) + try: - shutil.copy2( gn_source_path / "out" / "gn", gn_bin_path ) + shutil.copy2( gn_source_path / "out" / gn_bin_name, gn_bin_path ) except Exception as e: - nc.abort_op( f"Copy failed: {e}" ) + nc.abort_op( f"Failed to copy gn binary: {e}" ) - return gn_bin_path / "gn" + return gn_bin_path / gn_bin_name def get_cpu() -> str: - targetarch = "Unknown" - arch = platform.machine() - if arch == "x86_64": - targetarch = "x64" - elif arch == "aarch64" or arch == "arm64": - targetarch = "arm64" + arch = platform.machine().lower() + if arch in [ "x86_64", "amd64" ]: + return "x64" + elif arch in [ "aarch64", "arm64" ]: + return "arm64" else: nc.abort_op( f"Unsupported architecture: {arch}" ) - return targetarch + +def get_gn_args_file_content() -> str: + targetarch = get_cpu() + + if nc.is_linux(): + clang_path = Path(shutil.which("clang")) + clang_dir = clang_path.parent.parent + + gn_args=f""" +target_os="linux" +target_cpu="{targetarch}" +v8_target_cpu="{targetarch}" + +is_debug=false +is_component_build=false +is_official_build=false + +is_clang=true +clang_use_chrome_plugins=false + +use_sysroot=false +use_custom_libcxx=false + +# Symbol and debug settings +symbol_level=0 +strip_debug_info=true +treat_warnings_as_errors=false + +# V8 core settings +v8_monolithic=true +v8_use_external_startup_data=false +v8_enable_i18n_support=false +v8_enable_webassembly=false +v8_enable_pointer_compression=true +v8_enable_sandbox=false + +# Disable cppgc to avoid build issues +cppgc_enable_caged_heap=false +v8_enable_conservative_stack_scanning=false +cppgc_is_standalone=false + +# Disable all testing infrastructure - CRITICAL for avoiding gmock/gtest issues +v8_enable_test_features=false +v8_enable_verify_heap=false +v8_enable_verify_predictable=false +build_with_chromium=false + +# Explicitly disable test targets +v8_enable_backtrace=false +v8_enable_disassembler=false +v8_enable_object_print=false + +# Additional stability flags +v8_use_snapshot=true +v8_enable_lazy_source_positions=false +v8_enable_gdbjit=false +v8_enable_vtunejit=false +v8_enable_handle_zapping=false + +# Use system toolchain properly +use_gold=false +use_lld=true +""" + + if targetarch == "arm64": + gn_args = f"""{ gn_args } +cc="clang" +cxx="clang++" +clang_base_path="{ clang_dir }" +""" + + return gn_args + + elif nc.is_windows(): + gn_args=f""" +target_os="win" +target_cpu="{targetarch}" +v8_target_cpu="{targetarch}" + +is_debug=false +is_component_build=false +is_official_build=false + +is_clang=false + +use_custom_libcxx=false + +# Symbol and debug settings +symbol_level=0 +treat_warnings_as_errors=false + +# V8 core settings +v8_monolithic=true +v8_use_external_startup_data=false +v8_enable_i18n_support=false +v8_enable_webassembly=false +v8_enable_pointer_compression=true +v8_enable_sandbox=false + +# Disable cppgc to avoid build issues +cppgc_enable_caged_heap=false +v8_enable_conservative_stack_scanning=false +cppgc_is_standalone=false + +# Disable all testing infrastructure - CRITICAL for avoiding gmock/gtest issues +v8_enable_test_features=false +v8_enable_verify_heap=false +v8_enable_verify_predictable=false +build_with_chromium=false + +# Explicitly disable test targets +v8_enable_backtrace=false +v8_enable_disassembler=false +v8_enable_object_print=false + +# Additional stability flags +v8_use_snapshot=true +v8_enable_lazy_source_positions=false +v8_enable_gdbjit=false +v8_enable_vtunejit=false +v8_enable_handle_zapping=false +""" + return gn_args + + else: + nc.abort_op( "No gn args prepared for os." ) + return "No gn args prepared for os." + +def create_fake_pipes_shim() -> Path: + shims_path = nc.work_dir / "win_python_shims" + shim_file_path = shims_path / "sitecustomize.py" + nc.ensure_directory_exists( shims_path ) + content = """ +import sys +import shlex + +# Fake the missing Unix module +class PipesModule: + @staticmethod + def quote(s): + return shlex.quote(s) + +sys.modules["pipes"] = PipesModule() +""" + shim_file_path.write_text( content ) + return shims_path def fetch_and_patch(): @@ -213,33 +372,46 @@ def build_and_install(): "custom_deps": {}, }, ] -target_os = ["linux"] """ Path( v8_root_path / ".gclient" ).write_text(content) # Sync v8 dependencies print( "Synching v8 dependencies" ) depot_env = os.environ.copy() - depot_env["PATH"] = f"{depot_tools_path}:" + depot_env["PATH"] + depot_env["PATH"] = f"{depot_tools_path}{os.pathsep}" + depot_env["PATH"] depot_env["GCLIENT_SUPPRESS_GIT_VERSION_WARNING"] = "1" depot_env["GYP_CHROMIUM_NO_ACTION"] = "1" - nc.run_command( - [ "gclient", "sync", "--no-history", "--shallow" ], - "GClient sync", - v8_root_path, - env = depot_env, - ) + + # Since I'm patching v8/build, I need to reset it before sync (if already exists) + if ( v8_src_path / "build" ).is_dir(): + nc.run_command( + [ "git", "reset", "--hard" ], + "Hard reset v8/build", + v8_src_path / "build" + ) + + if nc.is_linux() or nc.is_windows(): + if nc.is_linux(): + nc.run_command( + [ "gclient", "sync", "--no-history", "--shallow" ], + "GClient sync", + v8_root_path, + env = depot_env, + ) + else: # win + nc.run_command( + [ "cmd.exe", "/c", "gclient.bat", "sync", "--no-history", "--shallow" ], + "GClient sync", + v8_root_path, + env = depot_env, + ) - if nc.is_linux(): apply_patches() disable_gmock() disable_cppgc() gn_bin_path = build_gn() targetarch = get_cpu() - clang_path = Path(shutil.which("clang")) - clang_dir = clang_path.parent.parent - output_path = v8_src_path / "out.gn"/ f"{targetarch}.release" # ensure out dir is clean @@ -248,62 +420,7 @@ def build_and_install(): except FileNotFoundError: pass - gn_args=f""" -target_os="linux" -target_cpu="{targetarch}" -v8_target_cpu="{targetarch}" - -is_debug=false -is_component_build=false -is_official_build=false - -is_clang=true -clang_use_chrome_plugins=false - -use_sysroot=false -use_custom_libcxx=false - -# Symbol and debug settings -symbol_level=0 -strip_debug_info=true -enable_dsyms=false -treat_warnings_as_errors=false - -# V8 core settings -v8_monolithic=true -v8_use_external_startup_data=false -v8_enable_i18n_support=false -v8_enable_webassembly=false -v8_enable_pointer_compression=true -v8_enable_sandbox=false - -# Disable cppgc to avoid build issues -cppgc_enable_caged_heap=false -v8_enable_conservative_stack_scanning=false -cppgc_is_standalone=false - -# Disable all testing infrastructure - CRITICAL for avoiding gmock/gtest issues -v8_enable_test_features=false -v8_enable_verify_heap=false -v8_enable_verify_predictable=false -build_with_chromium=false - -# Explicitly disable test targets -v8_enable_backtrace=false -v8_enable_disassembler=false -v8_enable_object_print=false - -# Additional stability flags -v8_use_snapshot=true -v8_enable_lazy_source_positions=false -v8_enable_gdbjit=false -v8_enable_vtunejit=false -v8_enable_handle_zapping=false - -# Use system toolchain properly -use_gold=false -use_lld=true -""" + gn_args = get_gn_args_file_content() if targetarch == "arm64": # Check clang version (it must be 13) @@ -314,21 +431,22 @@ def build_and_install(): if not version.startswith( "13." ): nc.abort_op( f"Need clang 13 in path. Currently it's: { version }" ) - gn_args = f"""{ gn_args } -cc="clang" -cxx="clang++" -clang_base_path="{ clang_dir }" -""" - nc.ensure_directory_exists( output_path ) gn_args_file_path = Path( output_path / "args.gn" ) gn_args_file_path.write_text( gn_args ) - print( "Running gn gen" ) + print( "Running gn gen" ) + gn_rt_env = { "PYTHONPATH": "" } + if nc.is_windows(): + gn_rt_env[ "PYTHONPATH" ] = str( create_fake_pipes_shim() ) + gn_rt_env[ "DEPOT_TOOLS_WIN_TOOLCHAIN" ] = "0" + gn_rt_env[ "vs2022_install" ] = str( Path( os.environ[ "VSINSTALLDIR" ] ) ) + nc.run_command( [ gn_bin_path, "gen", output_path ], "Running gn", - v8_src_path + v8_src_path, + env = gn_rt_env ) if not Path( output_path / "build.ninja" ).exists(): @@ -339,28 +457,35 @@ def build_and_install(): if shutil.which( tool ) is None: nc.abort_op( f"Tool not found: {tool}" ) - build_env = { - "SHELL": "/bin/bash", - } - job_count = max( os.cpu_count() or 1, 4 ) # at least 4 jobs print( "Building v8" ) + env = { + "CC": "clang", + "CXX": "clang++" + } if nc.is_linux() else { + "CXXFLAGS": "/FIstring", + "CFLAGS": "/FIstring", + # "CXXFLAGS": "/FIstring /FIcstdint", + # "CFLAGS": "/FIstring /FIcstdint", + } nc.run_command( [ "ninja", "-C", output_path, f"-j{job_count}", "v8_monolith" ], "Building v8", - v8_src_path + v8_src_path, + env=env ) - # Verify artifacts - if not ( output_path / "obj" / "libv8_monolith.a" ).exists(): - nc.abort_op( "Build completed but libv8_monolith.a not found" ) + # Verify final artifact + artifact_name = "v8_monolith.lib" if nc.is_windows() else "libv8_monolith.a" + if not ( output_path / "obj" / artifact_name ).exists(): + nc.abort_op( f"Build completed but { artifact_name } not found" ) print( "Installing v8" ) try: - shutil.copy2( output_path / "obj" / "libv8_monolith.a", nc.install_dir / "libv8_monolith.a" ) + shutil.copy2( output_path / "obj" / artifact_name, nc.install_dir / artifact_name ) except Exception: - nc.abort_op( "Failed to install libv8_monolith.a" ) + nc.abort_op( f"Failed to install { artifact_name }" ) nc.ensure_directory_exists( nc.install_dir / "v8" / "include" ) try: @@ -394,7 +519,7 @@ def build_and_install(): ( nc.install_dir / "v8.pc" ).write_text( pkg_cfg_file ) else: - abort_op( f"Unkown target platform: {sys.platform}" ) + nc.abort_op( f"Unkown target platform: {sys.platform}" ) nc.create_install_dir_ok_marker() diff --git a/Common/3dParty/v8/tools/8.9/x64-linux-dynamic/buildgn.patch b/Common/3dParty/v8/tools/8.9/x64-linux-dynamic/buildgn.patch index f0d1992789..ee09ba6e03 100644 --- a/Common/3dParty/v8/tools/8.9/x64-linux-dynamic/buildgn.patch +++ b/Common/3dParty/v8/tools/8.9/x64-linux-dynamic/buildgn.patch @@ -1,13 +1,14 @@ diff --git a/BUILD.gn b/BUILD.gn -index f39529a3a95..d4781238201 100644 +index a8618452794..4ab368a4149 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -714,7 +714,7 @@ config("toolchain") { - visibility = [ "./*" ] +@@ -689,6 +689,9 @@ config("toolchain") { defines = [] -- cflags = [] -+ cflags = ["-include", "cstdint"] + cflags = [] ++ if (!is_win) { ++ cflags += ["-include", "cstdint"] ++ } ldflags = [] if (v8_current_cpu == "arm") { diff --git a/Common/3dParty/v8/tools/8.9/x64-windows/win_toolchain.patch b/Common/3dParty/v8/tools/8.9/x64-windows/win_toolchain.patch new file mode 100644 index 0000000000..9ff750c67b --- /dev/null +++ b/Common/3dParty/v8/tools/8.9/x64-windows/win_toolchain.patch @@ -0,0 +1,33 @@ +diff --git a/toolchain/win/tool_wrapper.py b/toolchain/win/tool_wrapper.py +index 5c1fb98..0fe6e65 100644 +--- a/toolchain/win/tool_wrapper.py ++++ b/toolchain/win/tool_wrapper.py +@@ -140,7 +140,8 @@ class WinTool(object): + stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + # Read output one line at a time as it shows up to avoid OOM failures when + # GBs of output is produced. +- for line in link.stdout: ++ for line_bytes in link.stdout: ++ line = line_bytes.decode('utf-8', errors='ignore') + if (not line.startswith(' Creating library ') and + not line.startswith('Generating code') and + not line.startswith('Finished generating code')): +diff --git a/vs_toolchain.py b/vs_toolchain.py +index 6bc24a9..70eae54 100755 +--- a/vs_toolchain.py ++++ b/vs_toolchain.py +@@ -25,12 +25,14 @@ json_data_file = os.path.join(script_dir, 'win_toolchain.json') + + # VS versions are listed in descending order of priority (highest first). + MSVS_VERSIONS = collections.OrderedDict([ ++ ('2022', '17.0'), + ('2019', '16.0'), + ('2017', '15.0'), + ]) + + # List of preferred VC toolset version based on MSVS + MSVC_TOOLSET_VERSION = { ++ '2022' : 'VC143', + '2019' : 'VC142', + '2017' : 'VC141', + } From 02f3c1a874f1844cc6d2668336e1bd2418e19599 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Thu, 7 May 2026 17:15:27 +0200 Subject: [PATCH 35/80] fix(python-deps): Fix v8 build for linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Common/3dParty/v8/nc-build.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Common/3dParty/v8/nc-build.py b/Common/3dParty/v8/nc-build.py index 7b0e071851..fd907eeda2 100644 --- a/Common/3dParty/v8/nc-build.py +++ b/Common/3dParty/v8/nc-build.py @@ -228,12 +228,12 @@ def get_gn_args_file_content() -> str: use_lld=true """ - if targetarch == "arm64": - gn_args = f"""{ gn_args } -cc="clang" -cxx="clang++" -clang_base_path="{ clang_dir }" -""" + if targetarch == "arm64": + gn_args = f"""{ gn_args } + cc="clang" + cxx="clang++" + clang_base_path="{ clang_dir }" + """ return gn_args From b3329144b81d4b4bcdfec7bc095722e7e10c3b05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Fri, 8 May 2026 10:39:40 +0200 Subject: [PATCH 36/80] feature(msvc): UnicodeConverter --- Common/3dParty/.gitignore | 1 + Common/3dParty/build_3rdparty.py | 2 + UnicodeConverter/CMakeLists.txt | 7 +- common.cmake | 183 +++++++++++++++++++++---------- 4 files changed, 132 insertions(+), 61 deletions(-) create mode 100644 Common/3dParty/.gitignore diff --git a/Common/3dParty/.gitignore b/Common/3dParty/.gitignore new file mode 100644 index 0000000000..ed8ebf583f --- /dev/null +++ b/Common/3dParty/.gitignore @@ -0,0 +1 @@ +__pycache__ \ No newline at end of file diff --git a/Common/3dParty/build_3rdparty.py b/Common/3dParty/build_3rdparty.py index 156f6ac1f1..945373fbb5 100644 --- a/Common/3dParty/build_3rdparty.py +++ b/Common/3dParty/build_3rdparty.py @@ -8,6 +8,8 @@ import build_3rdparty_common as nc +sys.stdout.reconfigure(encoding='utf-8') + subfolders = [ 'apple', 'brotli', diff --git a/UnicodeConverter/CMakeLists.txt b/UnicodeConverter/CMakeLists.txt index 9c07cd17af..5732df8af0 100644 --- a/UnicodeConverter/CMakeLists.txt +++ b/UnicodeConverter/CMakeLists.txt @@ -6,9 +6,6 @@ include(${CORE_ROOT_DIR}/common.cmake) project(UnicodeConverter) -set(ICU_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu") -get_filename_component(ICU_INSTALL_DIR_ABS "${ICU_INSTALL_DIR}" ABSOLUTE) - add_library(UnicodeConverter SHARED UnicodeConverter.cpp UnicodeConverter.h @@ -26,8 +23,8 @@ target_include_directories(UnicodeConverter PUBLIC ) target_link_libraries(UnicodeConverter PUBLIC - ${ICU_INSTALL_DIR_ABS}/lib/libicuuc.so.${ICU_MAJOR_VER} - ${ICU_INSTALL_DIR_ABS}/lib/libicudata.so.${ICU_MAJOR_VER} + ${LIBICUUC} + ${LIBICUDATA} ) copy_artifacts_to_folder("UnicodeConverter" "${EO_CORE_OUTPUT_DIR}") diff --git a/common.cmake b/common.cmake index 17b63bd621..06fada7dfa 100644 --- a/common.cmake +++ b/common.cmake @@ -4,16 +4,15 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) -# These version numbers don't affect what build_3rdparty.py builds. They just have to match. -set(ICU_MAJOR_VER "74") -set(ICU_MINOR_VER "2") +if( WIN32 ) + set( MSVC TRUE ) +endif() cmake_path( APPEND DEFAULT_EO_CORE_OUTPUT_DIR "${CMAKE_BINARY_DIR}" "package" ) cmake_path( APPEND DEFAULT_EO_CORE_TOOLS_DIR "${CMAKE_BINARY_DIR}" "package" ) cmake_path( APPEND DEFAULT_EO_CORE_3RD_PARTY_DIR "${CMAKE_BINARY_DIR}" "third_party" ) - if( NOT DEFINED EO_CORE_OUTPUT_DIR ) set(EO_CORE_OUTPUT_DIR "${DEFAULT_EO_CORE_OUTPUT_DIR}" CACHE PATH "Where to place output files (absolute path recommended)") endif() @@ -44,6 +43,19 @@ if( NOT DEFINED PYTHON_BIN ) set(PYTHON_BIN "python" CACHE FILEPATH "Python binary to use.") endif() +# These version numbers don't affect what build_3rdparty.py builds. They just have to match. +set(ICU_MAJOR_VER "74") +set(ICU_MINOR_VER "2") +set(ICU_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu") +get_filename_component(ICU_INSTALL_DIR_ABS "${ICU_INSTALL_DIR}" ABSOLUTE) +if( MSVC ) + set(LIBICUUC "${ICU_INSTALL_DIR_ABS}/lib/icuuc.lib") + set(LIBICUDATA "${ICU_INSTALL_DIR_ABS}/lib/icudt.lib") +else() + set(LIBICUUC "${ICU_INSTALL_DIR_ABS}/lib/libicuuc.so.${ICU_MAJOR_VER}") + set(LIBICUDATA "${ICU_INSTALL_DIR_ABS}/lib/libicudata.so.${ICU_MAJOR_VER}") +endif() + message("3rdparty dir: " ${EO_CORE_3RD_PARTY_DIR}) message("workdir: " ${EO_CORE_3RD_PARTY_WORK_DIR}) message("install: " ${EO_CORE_3RD_PARTY_INSTALL_DIR}) @@ -85,18 +97,31 @@ endif() set(COMMON_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}") file(READ "${COMMON_CMAKE_DIR}/Common/version.txt" VERSION_TXT_CONTENT) -set(COMMON_DEFINES - _LINUX - _REENTRANT - CRYPTOPP_DISABLE_ASM - INTVER=${VERSION_TXT_CONTENT} - LINUX - - # Not sure about these: - _UNICODE - DONT_WRITE_EMBEDDED_FONTS - UNICODE -) +if( LINUX ) + set(COMMON_DEFINES + _LINUX + _REENTRANT + CRYPTOPP_DISABLE_ASM + INTVER=${VERSION_TXT_CONTENT} + LINUX + + # Not sure about these: + _UNICODE + DONT_WRITE_EMBEDDED_FONTS + UNICODE + ) +else() # Assume win+msvc + set(COMMON_DEFINES + _REENTRANT + CRYPTOPP_DISABLE_ASM + INTVER=${VERSION_TXT_CONTENT} + + # Not sure about these: + _UNICODE + DONT_WRITE_EMBEDDED_FONTS + UNICODE + ) +endif() if(CMAKE_BUILD_TYPE STREQUAL "Debug") list(APPEND COMMON_DEFINES @@ -104,39 +129,63 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug") ) endif() +if( MSVC ) + set(COMMON_CXX_FLAGS + /W4 + /wd4100 # unreferenced formal parameter + /wd4101 # unreferenced local variable + /wd4505 # unreferenced local function removed + /O2 + /EHsc + ) -set(COMMON_CXX_FLAGS - -fvisibility=hidden - -fvisibility-inlines-hidden - -Wall - -Wextra - -Wno-ignored-qualifiers - -Wno-register - -Wno-unused-variable # TODO remove later; These are just here to reduce the clutter - -Wno-unused-function # TODO remove later; These are just here to reduce the clutter - -Wno-unused-parameter # TODO remove later; These are just here to reduce the clutter - -O2 # Remove for debugging -) - -set(COMMON_C_FLAGS - -fvisibility=hidden - # -fvisibility-inlines-hidden - -Wall - -Wextra - -Wno-ignored-qualifiers - # -Wno-register - -Wno-implicit-function-declaration - -Wno-unused-variable # TODO remove later; These are just here to reduce the clutter - -Wno-unused-function # TODO remove later; These are just here to reduce the clutter - -Wno-unused-parameter # TODO remove later; These are just here to reduce the clutter - -O2 #Remove for debugging -) - - -set(COMMON_LINK_OPTIONS - "-Wl,--disable-new-dtags" -) + set(COMMON_C_FLAGS + /W4 + /wd4100 + /wd4101 + /wd4505 + /wd4996 # optional: CRT deprecation spam + /O2 + ) + + set(COMMON_LINK_OPTIONS + ) + +else() + + set(COMMON_CXX_FLAGS + -fvisibility=hidden + -fvisibility-inlines-hidden + -Wall + -Wextra + -Wno-ignored-qualifiers + -Wno-register + -Wno-unused-variable # TODO remove later; These are just here to reduce the clutter + -Wno-unused-function # TODO remove later; These are just here to reduce the clutter + -Wno-unused-parameter # TODO remove later; These are just here to reduce the clutter + -O2 # Remove for debugging + ) + + set(COMMON_C_FLAGS + -fvisibility=hidden + # -fvisibility-inlines-hidden + -Wall + -Wextra + -Wno-ignored-qualifiers + # -Wno-register + -Wno-implicit-function-declaration + -Wno-unused-variable # TODO remove later; These are just here to reduce the clutter + -Wno-unused-function # TODO remove later; These are just here to reduce the clutter + -Wno-unused-parameter # TODO remove later; These are just here to reduce the clutter + -O2 #Remove for debugging + ) + + set(COMMON_LINK_OPTIONS + "-Wl,--disable-new-dtags" + ) + +endif() function(set_default_options target) @@ -144,16 +193,18 @@ function(set_default_options target) message(FATAL_ERROR "set_default_options(): Target '${target}' does not exist yet.") endif() - # Base RPATHs - set_property(TARGET ${target} PROPERTY BUILD_RPATH "\$ORIGIN;\$ORIGIN/system") - set_property(TARGET ${target} PROPERTY INSTALL_RPATH "\$ORIGIN;\$ORIGIN/system") + if( NOT MSVC ) + # Base RPATHs + set_property(TARGET ${target} PROPERTY BUILD_RPATH "\$ORIGIN;\$ORIGIN/system") + set_property(TARGET ${target} PROPERTY INSTALL_RPATH "\$ORIGIN;\$ORIGIN/system") - # Optional: additional runtime paths from env variable RUN_PATH_ADDON - if(DEFINED ENV{RUN_PATH_ADDON}) - set(RUN_PATH_ADDON "$ENV{RUN_PATH_ADDON}") - string(REPLACE ";;" ";" RUN_PATH_ADDON_LIST "${RUN_PATH_ADDON}") + # Optional: additional runtime paths from env variable RUN_PATH_ADDON + if(DEFINED ENV{RUN_PATH_ADDON}) + set(RUN_PATH_ADDON "$ENV{RUN_PATH_ADDON}") + string(REPLACE ";;" ";" RUN_PATH_ADDON_LIST "${RUN_PATH_ADDON}") - set_property(TARGET ${target} APPEND PROPERTY INSTALL_RPATH "${RUN_PATH_ADDON_LIST}") + set_property(TARGET ${target} APPEND PROPERTY INSTALL_RPATH "${RUN_PATH_ADDON_LIST}") + endif() endif() # C++ flags @@ -191,6 +242,26 @@ function(copy_icu_libs artifact) COMMAND /bin/sh -c "cp -P \"${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu/lib\"/*.so* \"${EO_CORE_OUTPUT_DIR}/\"" COMMENT "Copying ICU libs to ${EO_CORE_OUTPUT_DIR}" ) + if( MSVC ) + + file(GLOB ICU_DLLS + "${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu/lib/icu*74.dll" + ) + + add_custom_command(TARGET ${artifact} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E make_directory "${EO_CORE_OUTPUT_DIR}" + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${ICU_DLLS} + "${EO_CORE_OUTPUT_DIR}" + COMMENT "Copying ICU DLLs to ${EO_CORE_OUTPUT_DIR}" + ) + else() + add_custom_command(TARGET ${artifact} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E make_directory "${EO_CORE_OUTPUT_DIR}" + COMMAND /bin/sh -c "cp -P --update=none \"${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu/lib\"/*.so* \"${EO_CORE_OUTPUT_DIR}/\"" + COMMENT "Copying ICU libs to ${EO_CORE_OUTPUT_DIR}" + ) + endif() endfunction() function(copy_boost_libs artifact) @@ -268,4 +339,4 @@ function(inject_script TARGET_NAME TEMPLATE_FILE OUTPUT_FILE) ${_cmd} ) endif() -endfunction() \ No newline at end of file +endfunction() From 118838ad552667d62d656bd8a89ebe48a7098957 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Fri, 8 May 2026 10:43:53 +0200 Subject: [PATCH 37/80] feature(msvc): OfficeUtils --- OfficeUtils/CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/OfficeUtils/CMakeLists.txt b/OfficeUtils/CMakeLists.txt index dbd975fd0d..5de44c9dc3 100644 --- a/OfficeUtils/CMakeLists.txt +++ b/OfficeUtils/CMakeLists.txt @@ -63,9 +63,7 @@ target_include_directories(OfficeUtils PRIVATE set_property(TARGET OfficeUtils PROPERTY POSITION_INDEPENDENT_CODE ON) -if (WIN32) - target_compile_options(OfficeUtils PRIVATE -include io.h) -else() +if( NOT MSVC ) target_compile_options(OfficeUtils PRIVATE -include unistd.h) endif() From e25eb1589c289ce8f339777754b63ffadc99a6be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Fri, 8 May 2026 11:01:24 +0200 Subject: [PATCH 38/80] feature(msvc): kernel --- Common/CMakeLists.txt | 8 +++++--- common.cmake | 6 ++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Common/CMakeLists.txt b/Common/CMakeLists.txt index 6cdb6daf68..b113a23c54 100644 --- a/Common/CMakeLists.txt +++ b/Common/CMakeLists.txt @@ -82,9 +82,11 @@ target_compile_definitions(kernel PRIVATE BUILD_ZLIB_AS_SOURCES ) -target_compile_options(kernel PRIVATE - -include ${CMAKE_CURRENT_SOURCE_DIR}/posix_compat.h -) +if( NOT MSVC ) + target_compile_options(kernel PRIVATE + -include ${CMAKE_CURRENT_SOURCE_DIR}/posix_compat.h + ) +endif() # static libs target_link_libraries(kernel PUBLIC diff --git a/common.cmake b/common.cmake index 06fada7dfa..02c585b0b5 100644 --- a/common.cmake +++ b/common.cmake @@ -224,6 +224,12 @@ function(set_default_options target) target_link_options(${target} PRIVATE ${COMMON_LINK_OPTIONS} ) + + if( MSVC ) + target_link_libraries(${target} PRIVATE + Rpcrt4 + ) + endif() endfunction() function(copy_artifacts_to_folder artifacts dest_dir) From a6f3b99a66285a517d899274a67ce79f0ff6e8b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Fri, 8 May 2026 11:15:58 +0200 Subject: [PATCH 39/80] feature(msvc): kernel_network --- Common/Network/CMakeLists.txt | 41 ++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/Common/Network/CMakeLists.txt b/Common/Network/CMakeLists.txt index 99620289a1..5196bda1a5 100644 --- a/Common/Network/CMakeLists.txt +++ b/Common/Network/CMakeLists.txt @@ -46,12 +46,10 @@ add_library(kernel_network SHARED WebSocket/src/socketio/socketio_internal_private_no_tls.h # filetransporter.pri - ${CMAKE_CURRENT_SOURCE_DIR}/FileTransporter/src/FileTransporter.cpp ${CMAKE_CURRENT_SOURCE_DIR}/FileTransporter/src/Session.cpp ${CMAKE_CURRENT_SOURCE_DIR}/FileTransporter/src/manager.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/FileTransporter/src/FileTransporter_curl.cpp - + ${CMAKE_CURRENT_SOURCE_DIR}/FileTransporter/include/FileTransporter.h ${CMAKE_CURRENT_SOURCE_DIR}/FileTransporter/include/manager.h ${CMAKE_CURRENT_SOURCE_DIR}/FileTransporter/src/FileTransporter_private.h @@ -59,6 +57,17 @@ add_library(kernel_network SHARED ${CMAKE_CURRENT_SOURCE_DIR}/FileTransporter/src/Session.h ) +# filetransporter.pri +if( MSVC ) + target_sources( kernel_network PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/FileTransporter/src/FileTransporter_win.cpp + ) +else() + target_sources( kernel_network PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/FileTransporter/src/FileTransporter_curl.cpp + ) +endif() + set_default_options(kernel_network) target_compile_definitions(kernel_network PRIVATE @@ -91,21 +100,33 @@ target_include_directories(kernel_network PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/FileTransporter ) -target_link_libraries(kernel_network PRIVATE - ${OPENSSL_INSTALL_DIR_ABS}/lib/libssl.a - ${OPENSSL_INSTALL_DIR_ABS}/lib/libcrypto.a -) +if( MSVC ) + target_link_libraries(kernel_network PRIVATE + ${OPENSSL_INSTALL_DIR_ABS}/lib/libssl.lib + ${OPENSSL_INSTALL_DIR_ABS}/lib/libcrypto.lib + ) +else() + target_link_libraries(kernel_network PRIVATE + ${OPENSSL_INSTALL_DIR_ABS}/lib/libssl.a + ${OPENSSL_INSTALL_DIR_ABS}/lib/libcrypto.a + ) +endif() target_link_libraries(kernel_network PUBLIC kernel - pthread ) -if(WIN_32) +if( UNIX ) + target_link_libraries(kernel_network PUBLIC + pthread + ) +endif() + +if( MSVC ) target_link_libraries(kernel_network PUBLIC + Crypt32 Advapi32 urlmon - Rpcrt4 Shell32 ) endif() From 125de9911a53c7bd05facc72e87343940403d563 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Fri, 8 May 2026 21:37:21 +0200 Subject: [PATCH 40/80] feature(pythond-deps): script for boost MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Common/3dParty/boost/nc-build.py | 110 +++++++++++++++++++++++++++++++ Common/3dParty/build_3rdparty.py | 1 + 2 files changed, 111 insertions(+) create mode 100644 Common/3dParty/boost/nc-build.py diff --git a/Common/3dParty/boost/nc-build.py b/Common/3dParty/boost/nc-build.py new file mode 100644 index 0000000000..fc84a01bd2 --- /dev/null +++ b/Common/3dParty/boost/nc-build.py @@ -0,0 +1,110 @@ +#!/usr/bin/env python3 + +import sys +import shutil +import os +from pathlib import Path + +script_path = Path(sys.argv[0]).resolve() +script_dir = script_path.parent + +third_party_root = ( script_dir / ".." ).resolve() +if str( third_party_root ) not in sys.path: + sys.path.insert( 0, str( third_party_root ) ) +import build_3rdparty_common as nc + +nc.work_dir = Path( sys.argv[1] ) +nc.install_dir = Path( sys.argv[2] ) +nc.force_redo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" +nc.dep_name = "Boost" +nc.debug_mode = True + +modules_needed = [ "headers", "system", "filesystem", "regex", "date_time" ] + +def fetch_and_patch(): + + nc.create_workdir() + nc.run_command( + [ "git", "clone", "https://github.com/boostorg/boost.git", "-b", "boost-1.72.0", nc.work_dir, "--depth", "1" ], + "Clone Boost 1.72.0" + ) + + nc.run_command( + [ "git", "submodule", "update", "--depth", "1", "-q", "--init", Path( "tools" ) / "boostdep" ], + "Get boostdep", + nc.work_dir + ) + + for module in modules_needed: + nc.run_command( + [ "git", "submodule", "update", "--depth", "1", "-q", "--init", Path( "libs" ) / module ], + f"Init { module }", + nc.work_dir + ) + + nc.run_command( + [ "python", Path( "tools" ) / "boostdep" / "depinst" / "depinst.py", "-X", "test", "-g", "--depth 1", module ], + f"Get dependencies for {module}", + nc.work_dir + ) + + nc.create_work_dir_ok_marker() + print( "Fetch & patch completed" ) + +def build_and_install(): + nc.create_install_dir() + + if nc.is_linux(): + nc.run_command( + [ "./bootstrap.sh", f"--prefix={ nc.install_dir }" ], + "Running bootstrap", + nc.work_dir + ) + + + # ./b2 --with-system --prefix=/home/tbari/Junkyard/boost/install install + build_cmd = [ "./b2" ] + for module in modules_needed: + build_cmd.append( f"--with-{ module }" ) + build_cmd.append( f"--prefix={ nc.install_dir }" ) + build_cmd.append( "install" ) + + nc.run_command( + build_cmd, + "Build and install boost libs", + nc.work_dir + ) + + # Additional headers + nc.ensure_directory_exists( nc.install_dir / "include" / "format" ) + try: + shutil.copytree( + nc.work_dir / "libs" / "format" / "include" / "boost" / "format", + nc.install_dir / "include" / "format", + dirs_exist_ok = True + ) + except Exception as e: + nc.abort_op( f"Failed to install format headers { e }" ) + + + elif nc.is_windows(): + + print( "TODO implement Windows!" ) + + else: + abort_op( f"Unkown target platform: {sys.platform}" ) + + nc.create_install_dir_ok_marker() + + print( "Build and install completed" ) + +if not nc.work_dir_looks_ok(): + fetch_and_patch() + +if not nc.install_dir_looks_ok(): + if nc.is_windows() and shutil.which("nmake") is None: + raise RuntimeError( + "MSVC environment is not set up: 'nmake' not found in PATH.\n" + "Run 'vcvarsx86_amd64.bat' or use 'x64 Native Tools Command Prompt'." + ) + build_and_install() diff --git a/Common/3dParty/build_3rdparty.py b/Common/3dParty/build_3rdparty.py index 945373fbb5..92d9f4663b 100644 --- a/Common/3dParty/build_3rdparty.py +++ b/Common/3dParty/build_3rdparty.py @@ -12,6 +12,7 @@ subfolders = [ 'apple', + 'boost', 'brotli', 'harfbuzz', 'html', From 6bc4b906125e8f5509ab4a10da98529cd6d66796 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Sat, 9 May 2026 12:02:38 +0200 Subject: [PATCH 41/80] fix(python-deps): Improving boost build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Common/3dParty/boost/nc-build.py | 51 ++++++++++++++------------------ 1 file changed, 22 insertions(+), 29 deletions(-) diff --git a/Common/3dParty/boost/nc-build.py b/Common/3dParty/boost/nc-build.py index fc84a01bd2..a57f3ac92d 100644 --- a/Common/3dParty/boost/nc-build.py +++ b/Common/3dParty/boost/nc-build.py @@ -20,6 +20,7 @@ nc.debug_mode = True modules_needed = [ "headers", "system", "filesystem", "regex", "date_time" ] +header_only_modules_needed = [ "any", "asio", "beast", "format" ] def fetch_and_patch(): @@ -35,7 +36,7 @@ def fetch_and_patch(): nc.work_dir ) - for module in modules_needed: + for module in ( modules_needed + header_only_modules_needed ): nc.run_command( [ "git", "submodule", "update", "--depth", "1", "-q", "--init", Path( "libs" ) / module ], f"Init { module }", @@ -60,40 +61,32 @@ def build_and_install(): "Running bootstrap", nc.work_dir ) - - - # ./b2 --with-system --prefix=/home/tbari/Junkyard/boost/install install - build_cmd = [ "./b2" ] - for module in modules_needed: - build_cmd.append( f"--with-{ module }" ) - build_cmd.append( f"--prefix={ nc.install_dir }" ) - build_cmd.append( "install" ) - + elif nc.is_windows(): nc.run_command( - build_cmd, - "Build and install boost libs", + [ "bootstrap.bat", f"--prefix={ nc.install_dir }" ], + "Running bootstrap", nc.work_dir ) - - # Additional headers - nc.ensure_directory_exists( nc.install_dir / "include" / "format" ) - try: - shutil.copytree( - nc.work_dir / "libs" / "format" / "include" / "boost" / "format", - nc.install_dir / "include" / "format", - dirs_exist_ok = True - ) - except Exception as e: - nc.abort_op( f"Failed to install format headers { e }" ) - - - elif nc.is_windows(): - - print( "TODO implement Windows!" ) - else: abort_op( f"Unkown target platform: {sys.platform}" ) + build_cmd = [ "b2.exe" if nc.is_windows() else "./b2" ] + for module in modules_needed: + build_cmd.append( f"--with-{ module }" ) + build_cmd.append( "variant=release" ) + build_cmd.append( "link=static" ) + if not nc.is_windows(): + build_cmd.append( "cflags=-fPIC" ) + build_cmd.append( "cxxflags=-fPIC" ) + build_cmd.append( f"--prefix={ nc.install_dir }" ) + build_cmd.append( "install" ) + + nc.run_command( + build_cmd, + "Build and install boost libs", + nc.work_dir + ) + nc.create_install_dir_ok_marker() print( "Build and install completed" ) From 8cc3cc40c21433ed845153ce978b1e16419738fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Sat, 9 May 2026 12:05:22 +0200 Subject: [PATCH 42/80] fix: Using locally built static boost libs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Apple/CMakeLists.txt | 5 --- .../3dParty/cryptopp/project/CMakeLists.txt | 7 +-- DesktopEditor/doctrenderer/CMakeLists.txt | 7 +-- DesktopEditor/graphics/cmake/CMakeLists.txt | 7 +-- Fb2File/CMakeLists.txt | 9 +--- HtmlFile2/CMakeLists.txt | 10 +---- .../DocFormatLib/Linux/cmake/CMakeLists.txt | 5 --- .../PPTFormatLib/Linux/cmake/CMakeLists.txt | 5 --- .../VbaFormatLib/Linux/cmake/CMakeLists.txt | 6 --- .../XlsFormatLib/Linux/cmake/CMakeLists.txt | 5 --- .../Projects/Linux/BinDocument/CMakeLists.txt | 5 --- .../Linux/DocxFormatLib/CMakeLists.txt | 6 --- .../Linux/PPTXFormatLib/CMakeLists.txt | 5 --- .../Linux/XlsbFormatLib/CMakeLists.txt | 6 --- OdfFile/Projects/Linux/CMakeLists.txt | 6 --- .../Converter/StarMath2OOXML/CMakeLists.txt | 4 -- RtfFile/Projects/Linux/CMakeLists.txt | 6 --- TxtFile/Projects/Linux/CMakeLists.txt | 6 --- .../build/cmake/library/CMakeLists.txt | 2 - common.cmake | 45 ++++++++++--------- 20 files changed, 32 insertions(+), 125 deletions(-) diff --git a/Apple/CMakeLists.txt b/Apple/CMakeLists.txt index 8943b4eb48..f6bfc4edb3 100644 --- a/Apple/CMakeLists.txt +++ b/Apple/CMakeLists.txt @@ -6,9 +6,6 @@ set(CORE_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/..") include(${CORE_ROOT_DIR}/common.cmake) -set(BOOST_ROOT "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/boost/linux_64") -find_package(Boost REQUIRED COMPONENTS system filesystem regex date_time) - set(OFFICE_UTILS_ROOT_DIR "${CORE_ROOT_DIR}/OfficeUtils") set(DESKTOP_EDITOR_ROOT "${CORE_ROOT_DIR}/DesktopEditor") set(COMMON_3RDPARTY_ROOT "${CORE_ROOT_DIR}/Common/3dParty") @@ -577,6 +574,4 @@ target_link_libraries(IWorkFile PUBLIC copy_artifacts_to_folder("IWorkFile" "${EO_CORE_OUTPUT_DIR}") -copy_boost_libs(IWorkFile) - declare_victory( IWorkFile ) diff --git a/Common/3dParty/cryptopp/project/CMakeLists.txt b/Common/3dParty/cryptopp/project/CMakeLists.txt index 80702a47b5..e183e2ca2f 100644 --- a/Common/3dParty/cryptopp/project/CMakeLists.txt +++ b/Common/3dParty/cryptopp/project/CMakeLists.txt @@ -6,9 +6,6 @@ set(CORE_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../..") include(${CORE_ROOT_DIR}/common.cmake) -set(BOOST_ROOT "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/boost/linux_64") -find_package(Boost REQUIRED COMPONENTS system filesystem regex date_time) - set(CRYPTOPP_SOURCES_DIR "${CMAKE_CURRENT_LIST_DIR}/..") add_library(CryptoPPLib STATIC @@ -402,7 +399,7 @@ target_compile_definitions(CryptoPPLib PRIVATE DISABLE_TYPE_MISMATCH ) -target_link_libraries(CryptoPPLib PRIVATE +target_link_libraries(CryptoPPLib PUBLIC Boost::system Boost::filesystem Boost::regex @@ -415,6 +412,4 @@ if(LINUX) ) endif() -copy_boost_libs(CryptoPPLib) - declare_victory( CryptoPPLib ) diff --git a/DesktopEditor/doctrenderer/CMakeLists.txt b/DesktopEditor/doctrenderer/CMakeLists.txt index 66a09c9189..820e20e452 100644 --- a/DesktopEditor/doctrenderer/CMakeLists.txt +++ b/DesktopEditor/doctrenderer/CMakeLists.txt @@ -6,9 +6,6 @@ set(CORE_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/../..") include(${CORE_ROOT_DIR}/common.cmake) -set(BOOST_ROOT "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/boost/linux_64") -find_package(Boost REQUIRED COMPONENTS system filesystem regex date_time) - # As far as I can tell, this should be set to 1 when building on mac. if(NOT DEFINED USE_JAVASCRIPT_CORE) set(USE_JAVASCRIPT_CORE 0) @@ -264,7 +261,7 @@ if(APPLE) ) endif() -target_link_libraries(CryptoPPLib INTERFACE +target_link_libraries(doctrenderer INTERFACE Boost::system Boost::filesystem Boost::regex @@ -299,6 +296,4 @@ target_link_libraries(doctrenderer PUBLIC copy_artifacts_to_folder("doctrenderer" "${EO_CORE_OUTPUT_DIR}") -copy_boost_libs(doctrenderer) - declare_victory( doctrenderer ) diff --git a/DesktopEditor/graphics/cmake/CMakeLists.txt b/DesktopEditor/graphics/cmake/CMakeLists.txt index f6f25033aa..fd3421fb74 100644 --- a/DesktopEditor/graphics/cmake/CMakeLists.txt +++ b/DesktopEditor/graphics/cmake/CMakeLists.txt @@ -24,11 +24,8 @@ if(NOT TARGET kernel) add_subdirectory(${CORE_ROOT_DIR}/Common kernel) endif() -set(BOOST_ROOT "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/boost/linux_64") -find_package(Boost REQUIRED COMPONENTS system filesystem regex date_time) - -set(KATANA_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/katana-parser") -set(GUMBO_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/gumbo-parser") +set(KATANA_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/html/katana-parser") +set(GUMBO_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/html/gumbo-parser") get_filename_component(KATANA_INSTALL_DIR_ABS "${KATANA_INSTALL_DIR}" ABSOLUTE) get_filename_component(GUMBO_INSTALL_DIR_ABS "${GUMBO_INSTALL_DIR}" ABSOLUTE) diff --git a/Fb2File/CMakeLists.txt b/Fb2File/CMakeLists.txt index 85bfa75b9e..d905d79118 100644 --- a/Fb2File/CMakeLists.txt +++ b/Fb2File/CMakeLists.txt @@ -6,9 +6,6 @@ set(CORE_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/..") include(${CORE_ROOT_DIR}/common.cmake) -set(BOOST_ROOT "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/boost/linux_64") -find_package(Boost REQUIRED) - if(NOT TARGET kernel) add_subdirectory(${CORE_ROOT_DIR}/Common kernel) endif() @@ -22,8 +19,8 @@ if(NOT TARGET graphics) endif() set(HTML_3RDPARTY_DIR "${CORE_ROOT_DIR}/Common/3dParty/html") -set(KATANA_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/katana-parser") -set(GUMBO_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/gumbo-parser") +set(KATANA_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/html/katana-parser") +set(GUMBO_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/html/gumbo-parser") get_filename_component(KATANA_INSTALL_DIR_ABS "${KATANA_INSTALL_DIR}" ABSOLUTE) get_filename_component(GUMBO_INSTALL_DIR_ABS "${GUMBO_INSTALL_DIR}" ABSOLUTE) @@ -95,6 +92,4 @@ target_link_libraries(Fb2File PUBLIC copy_artifacts_to_folder("Fb2File" "${EO_CORE_OUTPUT_DIR}") -copy_boost_libs(Fb2File) - declare_victory( Fb2File ) diff --git a/HtmlFile2/CMakeLists.txt b/HtmlFile2/CMakeLists.txt index 05291f3bff..b2e4715511 100644 --- a/HtmlFile2/CMakeLists.txt +++ b/HtmlFile2/CMakeLists.txt @@ -6,10 +6,6 @@ set(CORE_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/..") include(${CORE_ROOT_DIR}/common.cmake) - -set(BOOST_ROOT "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/boost/linux_64") -find_package(Boost REQUIRED COMPONENTS system filesystem regex date_time) - set(HTML_3RDPARTY_DIR "${CORE_ROOT_DIR}/Common/3dParty/html") if(NOT TARGET kernel) @@ -28,8 +24,8 @@ if(NOT TARGET graphics) add_subdirectory(${CORE_ROOT_DIR}/DesktopEditor/graphics/cmake graphics) endif() -set(KATANA_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/katana-parser") -set(GUMBO_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/gumbo-parser") +set(KATANA_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/html/katana-parser") +set(GUMBO_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/html/gumbo-parser") get_filename_component(KATANA_INSTALL_DIR_ABS "${KATANA_INSTALL_DIR}" ABSOLUTE) get_filename_component(GUMBO_INSTALL_DIR_ABS "${GUMBO_INSTALL_DIR}" ABSOLUTE) @@ -194,6 +190,4 @@ target_link_libraries(HtmlFile2 PUBLIC copy_artifacts_to_folder("HtmlFile2" "${EO_CORE_OUTPUT_DIR}") -copy_boost_libs(HtmlFile2) - declare_victory( HtmlFile2 ) diff --git a/MsBinaryFile/Projects/DocFormatLib/Linux/cmake/CMakeLists.txt b/MsBinaryFile/Projects/DocFormatLib/Linux/cmake/CMakeLists.txt index 3277deb645..3785bdb03e 100644 --- a/MsBinaryFile/Projects/DocFormatLib/Linux/cmake/CMakeLists.txt +++ b/MsBinaryFile/Projects/DocFormatLib/Linux/cmake/CMakeLists.txt @@ -10,9 +10,6 @@ set(DOC_FILE_SOURCES_DIR "${CORE_ROOT_DIR}/MsBinaryFile/DocFile") set(COMMON_BASE_SOURCES_DIR "${CORE_ROOT_DIR}/MsBinaryFile/Common/Base") set(_3RDPARTY_POLE_SOURCES_DIR "${CORE_ROOT_DIR}/Common/3dParty/pole") -set(BOOST_ROOT "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/boost/linux_64") -find_package(Boost REQUIRED COMPONENTS system filesystem regex date_time) - add_library(DocFormatLib STATIC ${COMMON_BASE_SOURCES_DIR}/FormatUtils.cpp ${COMMON_BASE_SOURCES_DIR}/XmlTools.cpp @@ -298,6 +295,4 @@ target_include_directories(DocFormatLib PRIVATE set_property(TARGET DocFormatLib PROPERTY POSITION_INDEPENDENT_CODE ON) -copy_boost_libs(DocFormatLib) - declare_victory( DocFormatLib ) diff --git a/MsBinaryFile/Projects/PPTFormatLib/Linux/cmake/CMakeLists.txt b/MsBinaryFile/Projects/PPTFormatLib/Linux/cmake/CMakeLists.txt index 7df6a40f5e..762680f3eb 100644 --- a/MsBinaryFile/Projects/PPTFormatLib/Linux/cmake/CMakeLists.txt +++ b/MsBinaryFile/Projects/PPTFormatLib/Linux/cmake/CMakeLists.txt @@ -7,9 +7,6 @@ include(${CORE_ROOT_DIR}/common.cmake) set(PPT_FILE_SOURCES_DIR "${CORE_ROOT_DIR}/MsBinaryFile/PptFile") -set(BOOST_ROOT "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/boost/linux_64") -find_package(Boost REQUIRED COMPONENTS system filesystem regex date_time) - add_library(PptFormatLib STATIC ${PPT_FILE_SOURCES_DIR}/Enums/RecordType.cpp ${PPT_FILE_SOURCES_DIR}/Reader/ReadStructures.cpp @@ -510,6 +507,4 @@ target_compile_definitions(PptFormatLib PRIVATE set_property(TARGET PptFormatLib PROPERTY POSITION_INDEPENDENT_CODE ON) -copy_boost_libs(PptFormatLib) - declare_victory( PptFormatLib ) diff --git a/MsBinaryFile/Projects/VbaFormatLib/Linux/cmake/CMakeLists.txt b/MsBinaryFile/Projects/VbaFormatLib/Linux/cmake/CMakeLists.txt index 8e391016ef..079ab57db6 100644 --- a/MsBinaryFile/Projects/VbaFormatLib/Linux/cmake/CMakeLists.txt +++ b/MsBinaryFile/Projects/VbaFormatLib/Linux/cmake/CMakeLists.txt @@ -7,10 +7,6 @@ include(${CORE_ROOT_DIR}/common.cmake) set(SOURCES_DIR "${CORE_ROOT_DIR}/MsBinaryFile/Common/Vba") - -set(BOOST_ROOT "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/boost/linux_64") -find_package(Boost REQUIRED COMPONENTS system filesystem regex date_time) - add_library(VbaFormatLib STATIC ${SOURCES_DIR}/Records.cpp ${SOURCES_DIR}/StreamObjects.cpp @@ -39,6 +35,4 @@ target_include_directories(VbaFormatLib PRIVATE set_property(TARGET VbaFormatLib PROPERTY POSITION_INDEPENDENT_CODE ON) -copy_boost_libs(VbaFormatLib) - declare_victory( VbaFormatLib ) diff --git a/MsBinaryFile/Projects/XlsFormatLib/Linux/cmake/CMakeLists.txt b/MsBinaryFile/Projects/XlsFormatLib/Linux/cmake/CMakeLists.txt index 0743ce7930..c7982714de 100644 --- a/MsBinaryFile/Projects/XlsFormatLib/Linux/cmake/CMakeLists.txt +++ b/MsBinaryFile/Projects/XlsFormatLib/Linux/cmake/CMakeLists.txt @@ -8,9 +8,6 @@ include(${CORE_ROOT_DIR}/common.cmake) set(XLS_FILE_SOURCES_DIR "${CORE_ROOT_DIR}/MsBinaryFile/XlsFile") set(COMMON_SOURCES_DIR "${CORE_ROOT_DIR}/MsBinaryFile/Common") -set(BOOST_ROOT "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/boost/linux_64") -find_package(Boost REQUIRED COMPONENTS system filesystem regex date_time) - add_library(XlsFormatLib STATIC ${XLS_FILE_SOURCES_DIR}/Format/Auxiliary/HelpFunc.cpp ${XLS_FILE_SOURCES_DIR}/Format/Binary/CFRecord.cpp @@ -135,6 +132,4 @@ target_link_libraries(XlsFormatLib PRIVATE set_property(TARGET XlsFormatLib PROPERTY POSITION_INDEPENDENT_CODE ON) -copy_boost_libs(XlsFormatLib) - declare_victory( XlsFormatLib ) diff --git a/OOXML/Projects/Linux/BinDocument/CMakeLists.txt b/OOXML/Projects/Linux/BinDocument/CMakeLists.txt index f8bf4a2f24..36817cf06c 100644 --- a/OOXML/Projects/Linux/BinDocument/CMakeLists.txt +++ b/OOXML/Projects/Linux/BinDocument/CMakeLists.txt @@ -10,9 +10,6 @@ set(OOXML_ROOT_DIR "${CORE_ROOT_DIR}/OOXML") set(BIN_SOURCES_DIR "${OOXML_ROOT_DIR}/Binary") set(MS_BINARY_FILE_ROOT "${CORE_ROOT_DIR}/MsBinaryFile") -set(BOOST_ROOT "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/boost/linux_64") -find_package(Boost REQUIRED COMPONENTS system filesystem regex date_time) - add_library(BinDocument STATIC ${BIN_SOURCES_DIR}/Document/DocWrapper/DocxSerializer.cpp ${BIN_SOURCES_DIR}/Document/DocWrapper/FontProcessor.cpp @@ -137,6 +134,4 @@ target_link_libraries(BinDocument PRIVATE set_property(TARGET BinDocument PROPERTY POSITION_INDEPENDENT_CODE ON) -copy_boost_libs(BinDocument) - declare_victory( BinDocument ) diff --git a/OOXML/Projects/Linux/DocxFormatLib/CMakeLists.txt b/OOXML/Projects/Linux/DocxFormatLib/CMakeLists.txt index 5da1f89f13..5458de2d51 100644 --- a/OOXML/Projects/Linux/DocxFormatLib/CMakeLists.txt +++ b/OOXML/Projects/Linux/DocxFormatLib/CMakeLists.txt @@ -9,10 +9,6 @@ include(${CORE_ROOT_DIR}/common.cmake) set(OOXML_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/../../..") set(DOCX_FORMAT_SOURCES_ROOT "${OOXML_ROOT_DIR}/DocxFormat") - -set(BOOST_ROOT "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/boost/linux_64") -find_package(Boost REQUIRED COMPONENTS system filesystem regex date_time) - add_library(DocxFormatLib STATIC ${CORE_ROOT_DIR}/Common/3dParty/pole/pole.cpp ${DOCX_FORMAT_SOURCES_ROOT}/App.cpp @@ -408,6 +404,4 @@ target_link_libraries(DocxFormatLib PRIVATE set_property(TARGET DocxFormatLib PROPERTY POSITION_INDEPENDENT_CODE ON) -copy_boost_libs(DocxFormatLib) - declare_victory( DocxFormatLib ) diff --git a/OOXML/Projects/Linux/PPTXFormatLib/CMakeLists.txt b/OOXML/Projects/Linux/PPTXFormatLib/CMakeLists.txt index 00aa23cac5..9d17836931 100644 --- a/OOXML/Projects/Linux/PPTXFormatLib/CMakeLists.txt +++ b/OOXML/Projects/Linux/PPTXFormatLib/CMakeLists.txt @@ -9,9 +9,6 @@ include(${CORE_ROOT_DIR}/common.cmake) set(OOXML_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/../../..") set(PPTX_FORMAT_DIR "${OOXML_ROOT_DIR}/PPTXFormat") -set(BOOST_ROOT "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/boost/linux_64") -find_package(Boost REQUIRED COMPONENTS system filesystem regex date_time) - add_library(PPTXFormatLib STATIC ${PPTX_FORMAT_DIR}/Comments.cpp ${PPTX_FORMAT_DIR}/FileContainer.cpp @@ -1298,6 +1295,4 @@ target_link_libraries(PPTXFormatLib PRIVATE set_property(TARGET PPTXFormatLib PROPERTY POSITION_INDEPENDENT_CODE ON) -copy_boost_libs(PPTXFormatLib) - declare_victory( PPTXFormatLib ) diff --git a/OOXML/Projects/Linux/XlsbFormatLib/CMakeLists.txt b/OOXML/Projects/Linux/XlsbFormatLib/CMakeLists.txt index c81e773d47..66b162abd1 100644 --- a/OOXML/Projects/Linux/XlsbFormatLib/CMakeLists.txt +++ b/OOXML/Projects/Linux/XlsbFormatLib/CMakeLists.txt @@ -9,10 +9,6 @@ include(${CORE_ROOT_DIR}/common.cmake) set(OOXML_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/../../..") set(XLSB_FORMAT_DIR "${OOXML_ROOT_DIR}/XlsbFormat") - -set(BOOST_ROOT "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/boost/linux_64") -find_package(Boost REQUIRED COMPONENTS system filesystem regex date_time) - add_library(XlsbFormatLib STATIC ${XLSB_FORMAT_DIR}/Biff12_unions/COMMENTS_bu.cpp ${XLSB_FORMAT_DIR}/Xlsb.cpp @@ -2168,6 +2164,4 @@ target_link_libraries(XlsbFormatLib PRIVATE set_property(TARGET XlsbFormatLib PROPERTY POSITION_INDEPENDENT_CODE ON) -copy_boost_libs(XlsbFormatLib) - declare_victory( XlsbFormatLib ) diff --git a/OdfFile/Projects/Linux/CMakeLists.txt b/OdfFile/Projects/Linux/CMakeLists.txt index b6424fff41..641a3901e4 100644 --- a/OdfFile/Projects/Linux/CMakeLists.txt +++ b/OdfFile/Projects/Linux/CMakeLists.txt @@ -18,10 +18,6 @@ if(NOT TARGET UnicodeConverter) add_subdirectory(${CORE_ROOT_DIR}/UnicodeConverter UnicodeConverter) endif() - -set(BOOST_ROOT "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/boost/linux_64") -find_package(Boost REQUIRED COMPONENTS system filesystem regex date_time) - add_library(OdfFormatLib STATIC ${CMAKE_CURRENT_LIST_DIR}/odf_converter.cpp ${CMAKE_CURRENT_LIST_DIR}/odf_datatypes.cpp @@ -491,6 +487,4 @@ target_link_libraries(OdfFormatLib PUBLIC set_property(TARGET OdfFormatLib PROPERTY POSITION_INDEPENDENT_CODE ON) -copy_boost_libs(OdfFormatLib) - declare_victory( OdfFormatLib ) diff --git a/OdfFile/Reader/Converter/StarMath2OOXML/CMakeLists.txt b/OdfFile/Reader/Converter/StarMath2OOXML/CMakeLists.txt index d2c73f036c..b7f5f43249 100644 --- a/OdfFile/Reader/Converter/StarMath2OOXML/CMakeLists.txt +++ b/OdfFile/Reader/Converter/StarMath2OOXML/CMakeLists.txt @@ -20,10 +20,6 @@ if(NOT TARGET kernel) add_subdirectory(${CORE_ROOT_DIR}/Common kernel) endif() -set(BOOST_ROOT "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/boost/linux_64") -find_package(Boost REQUIRED COMPONENTS system filesystem regex date_time) - - # Set target version set_target_properties(StarMathConverter PROPERTIES VERSION ${PROJECT_VERSION} diff --git a/RtfFile/Projects/Linux/CMakeLists.txt b/RtfFile/Projects/Linux/CMakeLists.txt index 50055a075d..23e4bffa5f 100644 --- a/RtfFile/Projects/Linux/CMakeLists.txt +++ b/RtfFile/Projects/Linux/CMakeLists.txt @@ -8,10 +8,6 @@ include(${CORE_ROOT_DIR}/common.cmake) set(RTF_FILE_ROOT "${CMAKE_CURRENT_LIST_DIR}/../..") - -set(BOOST_ROOT "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/boost/linux_64") -find_package(Boost REQUIRED COMPONENTS system filesystem regex date_time) - add_library(RtfFormatLib STATIC ${RTF_FILE_ROOT}/Format/ConvertationManager.cpp ${RTF_FILE_ROOT}/Format/DestinationCommand.cpp @@ -197,6 +193,4 @@ target_link_libraries(RtfFormatLib PRIVATE set_property(TARGET RtfFormatLib PROPERTY POSITION_INDEPENDENT_CODE ON) -copy_boost_libs(RtfFormatLib) - declare_victory( RtfFormatLib ) diff --git a/TxtFile/Projects/Linux/CMakeLists.txt b/TxtFile/Projects/Linux/CMakeLists.txt index 88769a8406..8b99ab763e 100644 --- a/TxtFile/Projects/Linux/CMakeLists.txt +++ b/TxtFile/Projects/Linux/CMakeLists.txt @@ -8,10 +8,6 @@ include(${CORE_ROOT_DIR}/common.cmake) set(TXT_XML_FORMAT_SOURCES_DIR "${CMAKE_CURRENT_LIST_DIR}/../../Source") - -set(BOOST_ROOT "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/boost/linux_64") -find_package(Boost REQUIRED COMPONENTS system filesystem regex date_time) - add_library(TxtXmlFormatLib STATIC ${TXT_XML_FORMAT_SOURCES_DIR}/ConvertDocx2Txt.cpp ${TXT_XML_FORMAT_SOURCES_DIR}/ConvertTxt2Docx.cpp @@ -41,6 +37,4 @@ target_link_libraries(TxtXmlFormatLib PRIVATE set_property(TARGET TxtXmlFormatLib PROPERTY POSITION_INDEPENDENT_CODE ON) -copy_boost_libs(TxtXmlFormatLib) - declare_victory( TxtXmlFormatLib ) diff --git a/X2tConverter/build/cmake/library/CMakeLists.txt b/X2tConverter/build/cmake/library/CMakeLists.txt index 3a23335e31..a58292ba45 100644 --- a/X2tConverter/build/cmake/library/CMakeLists.txt +++ b/X2tConverter/build/cmake/library/CMakeLists.txt @@ -8,8 +8,6 @@ include(${CORE_ROOT_DIR}/common.cmake) set(X2T_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/../../..") -find_package(Boost REQUIRED COMPONENTS system filesystem regex date_time) - if(NOT TARGET CryptoPPLib) add_subdirectory(${CORE_ROOT_DIR}/Common/3dParty/cryptopp/project CryptoPPLib) endif() diff --git a/common.cmake b/common.cmake index 02c585b0b5..c364cba8e7 100644 --- a/common.cmake +++ b/common.cmake @@ -1,5 +1,7 @@ include_guard(GLOBAL) +cmake_policy(SET CMP0167 OLD) + set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) @@ -43,19 +45,6 @@ if( NOT DEFINED PYTHON_BIN ) set(PYTHON_BIN "python" CACHE FILEPATH "Python binary to use.") endif() -# These version numbers don't affect what build_3rdparty.py builds. They just have to match. -set(ICU_MAJOR_VER "74") -set(ICU_MINOR_VER "2") -set(ICU_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu") -get_filename_component(ICU_INSTALL_DIR_ABS "${ICU_INSTALL_DIR}" ABSOLUTE) -if( MSVC ) - set(LIBICUUC "${ICU_INSTALL_DIR_ABS}/lib/icuuc.lib") - set(LIBICUDATA "${ICU_INSTALL_DIR_ABS}/lib/icudt.lib") -else() - set(LIBICUUC "${ICU_INSTALL_DIR_ABS}/lib/libicuuc.so.${ICU_MAJOR_VER}") - set(LIBICUDATA "${ICU_INSTALL_DIR_ABS}/lib/libicudata.so.${ICU_MAJOR_VER}") -endif() - message("3rdparty dir: " ${EO_CORE_3RD_PARTY_DIR}) message("workdir: " ${EO_CORE_3RD_PARTY_WORK_DIR}) message("install: " ${EO_CORE_3RD_PARTY_INSTALL_DIR}) @@ -77,6 +66,28 @@ if(NOT THIRD_PARTY_PREPARED) endif() endif() + +# These version numbers don't affect what build_3rdparty.py builds. They just have to match. +set(ICU_MAJOR_VER "74") +set(ICU_MINOR_VER "2") +set(ICU_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu") +get_filename_component(ICU_INSTALL_DIR_ABS "${ICU_INSTALL_DIR}" ABSOLUTE) +if( MSVC ) + set(LIBICUUC "${ICU_INSTALL_DIR_ABS}/lib/icuuc.lib") + set(LIBICUDATA "${ICU_INSTALL_DIR_ABS}/lib/icudt.lib") +else() + set(LIBICUUC "${ICU_INSTALL_DIR_ABS}/lib/libicuuc.so.${ICU_MAJOR_VER}") + set(LIBICUDATA "${ICU_INSTALL_DIR_ABS}/lib/libicudata.so.${ICU_MAJOR_VER}") +endif() + +# Ensure boost +set( BOOST_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/boost" ) +get_filename_component(BOOST_INSTALL_DIR_ABS "${BOOST_INSTALL_DIR}" ABSOLUTE) +set( CMAKE_PREFIX_PATH "${BOOST_INSTALL_DIR_ABS}" ) +include_directories( "${BOOST_INSTALL_DIR_ABS}/include" ) +set(Boost_USE_STATIC_LIBS ON) +find_package( Boost REQUIRED COMPONENTS system filesystem regex date_time ) + # Do NOT auto-add absolute link directories to RPATH set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE) @@ -270,14 +281,6 @@ function(copy_icu_libs artifact) endif() endfunction() -function(copy_boost_libs artifact) - add_custom_command(TARGET ${artifact} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E make_directory "${EO_CORE_OUTPUT_DIR}" - COMMAND /bin/sh -c "cp -P \"${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/boost/linux_64/lib\"/*.so* \"${EO_CORE_OUTPUT_DIR}/\"" - COMMENT "Copying Boost libs to ${EO_CORE_OUTPUT_DIR}" - ) -endfunction() - function(declare_victory build_target) add_custom_command(TARGET ${build_target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E echo "" From 082a17787015ef38b8f9b062ef2e61e37c39d0a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Sun, 10 May 2026 18:45:43 +0200 Subject: [PATCH 43/80] fix(python-deps): Boost script fixed for Windows (and upgraded to 1.78) --- Common/3dParty/boost/nc-build.py | 34 ++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/Common/3dParty/boost/nc-build.py b/Common/3dParty/boost/nc-build.py index a57f3ac92d..e16a2fa245 100644 --- a/Common/3dParty/boost/nc-build.py +++ b/Common/3dParty/boost/nc-build.py @@ -25,11 +25,13 @@ def fetch_and_patch(): nc.create_workdir() + print( "Clone Boost 1.78.0..." ) nc.run_command( - [ "git", "clone", "https://github.com/boostorg/boost.git", "-b", "boost-1.72.0", nc.work_dir, "--depth", "1" ], - "Clone Boost 1.72.0" + [ "git", "clone", "https://github.com/boostorg/boost.git", "-b", "boost-1.78.0", nc.work_dir, "--depth", "1" ], + "Clone Boost 1.78.0" ) + print( "Get boostdep..." ) nc.run_command( [ "git", "submodule", "update", "--depth", "1", "-q", "--init", Path( "tools" ) / "boostdep" ], "Get boostdep", @@ -37,12 +39,15 @@ def fetch_and_patch(): ) for module in ( modules_needed + header_only_modules_needed ): + print( f"Initializing { module }..." ) nc.run_command( [ "git", "submodule", "update", "--depth", "1", "-q", "--init", Path( "libs" ) / module ], f"Init { module }", nc.work_dir ) + for module in ( modules_needed + header_only_modules_needed ): + print( f"Running boostdep for { module }..." ) nc.run_command( [ "python", Path( "tools" ) / "boostdep" / "depinst" / "depinst.py", "-X", "test", "-g", "--depth 1", module ], f"Get dependencies for {module}", @@ -63,14 +68,29 @@ def build_and_install(): ) elif nc.is_windows(): nc.run_command( - [ "bootstrap.bat", f"--prefix={ nc.install_dir }" ], + [ "cmd.exe", "/c" "bootstrap.bat", f"--prefix={ nc.install_dir }" ], "Running bootstrap", nc.work_dir ) else: - abort_op( f"Unkown target platform: {sys.platform}" ) - - build_cmd = [ "b2.exe" if nc.is_windows() else "./b2" ] + nc.abort_op( f"Unkown target platform: {sys.platform}" ) + + if nc.is_windows(): + # Fix project-config.jam + content = f""" +# Boost.Build Configuration +# Generated by nc-build.py + +import option ; + +using msvc : 14.0 : "{ os.environ[ "VCToolsInstallDir" ] }\\bin\\Hostx64\\x64\\cl.exe"; + +option.set keep-going : false ; + +""" + ( Path( nc.work_dir ) / "project-config.jam" ).write_text( content ) + + build_cmd = [ ( nc.work_dir / "b2.exe" ) if nc.is_windows() else "./b2" ] for module in modules_needed: build_cmd.append( f"--with-{ module }" ) build_cmd.append( "variant=release" ) @@ -79,6 +99,8 @@ def build_and_install(): build_cmd.append( "cflags=-fPIC" ) build_cmd.append( "cxxflags=-fPIC" ) build_cmd.append( f"--prefix={ nc.install_dir }" ) + if nc.is_windows(): + build_cmd.append( "address-model=64" ) build_cmd.append( "install" ) nc.run_command( From 07bf72fea5416d0c1285c649428698e2b47fa971 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Mon, 11 May 2026 14:55:06 +0200 Subject: [PATCH 44/80] fix: Fixed missing include for IWorkFile with new(er) boost MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Apple/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Apple/CMakeLists.txt b/Apple/CMakeLists.txt index f6bfc4edb3..2d70d9bc99 100644 --- a/Apple/CMakeLists.txt +++ b/Apple/CMakeLists.txt @@ -525,6 +525,12 @@ if(WIN32) ) endif() +if( NOT MSVC ) + target_compile_options(IWorkFile PRIVATE + $<$:-include iostream> + ) +endif() + target_include_directories(IWorkFile PRIVATE ${OFFICE_UTILS_ROOT_DIR}/src/zlib-1.2.11 From 63b01fa2931c65852e39ffe012c5598de23d8a20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Mon, 11 May 2026 17:07:11 +0200 Subject: [PATCH 45/80] feature(python-deps): Clarified common init in python scripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Common/3dParty/apple/nc-build.py | 12 ++++++------ Common/3dParty/boost/nc-build.py | 16 +++++++++------- Common/3dParty/brotli/nc-build.py | 12 ++++++------ Common/3dParty/build_3rdparty_common.py | 16 ++++++++++++++++ Common/3dParty/harfbuzz/nc-build.py | 12 ++++++------ Common/3dParty/html/nc-build.py | 12 ++++++------ Common/3dParty/hunspell/nc-build.py | 12 ++++++------ Common/3dParty/hyphen/nc-build.py | 12 ++++++------ Common/3dParty/md/nc-build.py | 12 ++++++------ Common/3dParty/openssl/nc-build.py | 12 ++++++------ Common/3dParty/socketio/nc-build.py | 12 ++++++------ Common/3dParty/v8/nc-build.py | 14 ++++++-------- 12 files changed, 85 insertions(+), 69 deletions(-) diff --git a/Common/3dParty/apple/nc-build.py b/Common/3dParty/apple/nc-build.py index dd0a18b18f..f7f5d91407 100644 --- a/Common/3dParty/apple/nc-build.py +++ b/Common/3dParty/apple/nc-build.py @@ -13,12 +13,12 @@ sys.path.insert( 0, str( third_party_root ) ) import build_3rdparty_common as nc -nc.work_dir = Path( sys.argv[1] ) -nc.install_dir = Path( sys.argv[2] ) -nc.work_dir = nc.install_dir -nc.force_redo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" -nc.dep_name = "Apple" -nc.debug_mode = True +nc.init_for_dep( + depname = "Apple", + workdir = Path( sys.argv[2] ), + installdir = Path( sys.argv[2] ), + forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" +) def fetch_and_patch(): nc.create_install_dir() diff --git a/Common/3dParty/boost/nc-build.py b/Common/3dParty/boost/nc-build.py index e16a2fa245..19f17b5869 100644 --- a/Common/3dParty/boost/nc-build.py +++ b/Common/3dParty/boost/nc-build.py @@ -13,17 +13,17 @@ sys.path.insert( 0, str( third_party_root ) ) import build_3rdparty_common as nc -nc.work_dir = Path( sys.argv[1] ) -nc.install_dir = Path( sys.argv[2] ) -nc.force_redo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" -nc.dep_name = "Boost" -nc.debug_mode = True +nc.init_for_dep( + depname = "Boost", + workdir = Path( sys.argv[1] ), + installdir = Path( sys.argv[2] ), + forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" +) modules_needed = [ "headers", "system", "filesystem", "regex", "date_time" ] header_only_modules_needed = [ "any", "asio", "beast", "format" ] def fetch_and_patch(): - nc.create_workdir() print( "Clone Boost 1.78.0..." ) nc.run_command( @@ -60,6 +60,7 @@ def fetch_and_patch(): def build_and_install(): nc.create_install_dir() + print( "Running bootstrap..." ) if nc.is_linux(): nc.run_command( [ "./bootstrap.sh", f"--prefix={ nc.install_dir }" ], @@ -76,7 +77,7 @@ def build_and_install(): nc.abort_op( f"Unkown target platform: {sys.platform}" ) if nc.is_windows(): - # Fix project-config.jam + print( "Fixing project-config.jam..." ) content = f""" # Boost.Build Configuration # Generated by nc-build.py @@ -103,6 +104,7 @@ def build_and_install(): build_cmd.append( "address-model=64" ) build_cmd.append( "install" ) + print( "Running b2..." ) nc.run_command( build_cmd, "Build and install boost libs", diff --git a/Common/3dParty/brotli/nc-build.py b/Common/3dParty/brotli/nc-build.py index 3bab97a98d..1e78c7a5e2 100644 --- a/Common/3dParty/brotli/nc-build.py +++ b/Common/3dParty/brotli/nc-build.py @@ -12,12 +12,12 @@ sys.path.insert( 0, str( third_party_root ) ) import build_3rdparty_common as nc -nc.work_dir = Path( sys.argv[1] ) -nc.install_dir = Path( sys.argv[2] ) -nc.work_dir = nc.install_dir -nc.force_redo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" -nc.dep_name = "Brotli" -nc.debug_mode = True +nc.init_for_dep( + depname = "Brotli", + workdir = Path( sys.argv[2] ), + installdir = Path( sys.argv[2] ), + forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" +) def fetch_and_patch(): nc.create_install_dir() diff --git a/Common/3dParty/build_3rdparty_common.py b/Common/3dParty/build_3rdparty_common.py index 2b053d084b..116cb48e43 100644 --- a/Common/3dParty/build_3rdparty_common.py +++ b/Common/3dParty/build_3rdparty_common.py @@ -12,6 +12,22 @@ install_dir = None force_redo = False +def init_for_dep( + depname : str, + workdir : Path, + installdir : Path, + forceredo : bool, + debugmode : bool = True +): + global dep_name, work_dir, install_dir, force_redo, debug_mode, log_cleared + + dep_name = depname + work_dir = workdir + install_dir = installdir + force_redo = forceredo + debug_mode = debugmode + log_cleared = False + def abort_op( message : str, keep_work : bool = False, error_is_fatal : bool = True ): print( f"Aboring {dep_name}: {message}", file = sys.stderr ) if error_is_fatal: diff --git a/Common/3dParty/harfbuzz/nc-build.py b/Common/3dParty/harfbuzz/nc-build.py index fd82df3001..f872298037 100644 --- a/Common/3dParty/harfbuzz/nc-build.py +++ b/Common/3dParty/harfbuzz/nc-build.py @@ -13,12 +13,12 @@ sys.path.insert( 0, str( third_party_root ) ) import build_3rdparty_common as nc -nc.work_dir = Path( sys.argv[1] ) -nc.install_dir = Path( sys.argv[2] ) -nc.work_dir = nc.install_dir -nc.force_redo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" -nc.dep_name = "Harfbuzz" -nc.debug_mode = True +nc.init_for_dep( + depname = "Harfbuzz", + workdir = Path( sys.argv[2] ), + installdir = Path( sys.argv[2] ), + forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" +) def fetch_and_patch(): nc.create_install_dir() diff --git a/Common/3dParty/html/nc-build.py b/Common/3dParty/html/nc-build.py index e08809a299..ae9f04eccc 100644 --- a/Common/3dParty/html/nc-build.py +++ b/Common/3dParty/html/nc-build.py @@ -13,12 +13,12 @@ sys.path.insert( 0, str( third_party_root ) ) import build_3rdparty_common as nc -nc.work_dir = Path( sys.argv[1] ) -nc.install_dir = Path( sys.argv[2] ) -nc.work_dir = nc.install_dir -nc.force_redo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" -nc.dep_name = "SocketIO" -nc.debug_mode = True +nc.init_for_dep( + depname = "SocketIO", + workdir = Path( sys.argv[2] ), + installdir = Path( sys.argv[2] ), + forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" +) def fetch_and_patch(): nc.create_workdir() diff --git a/Common/3dParty/hunspell/nc-build.py b/Common/3dParty/hunspell/nc-build.py index d7e57302d5..de25916d0c 100644 --- a/Common/3dParty/hunspell/nc-build.py +++ b/Common/3dParty/hunspell/nc-build.py @@ -13,12 +13,12 @@ sys.path.insert( 0, str( third_party_root ) ) import build_3rdparty_common as nc -nc.work_dir = Path( sys.argv[1] ) -nc.install_dir = Path( sys.argv[2] ) -nc.work_dir = nc.install_dir -nc.force_redo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" -nc.dep_name = "Hunspell" -nc.debug_mode = True +nc.init_for_dep( + depname = "Hunspell", + workdir = Path( sys.argv[2] ), + installdir = Path( sys.argv[2] ), + forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" +) def fetch_and_patch(): nc.create_workdir() diff --git a/Common/3dParty/hyphen/nc-build.py b/Common/3dParty/hyphen/nc-build.py index 532f7f19f7..9303737566 100644 --- a/Common/3dParty/hyphen/nc-build.py +++ b/Common/3dParty/hyphen/nc-build.py @@ -12,12 +12,12 @@ sys.path.insert( 0, str( third_party_root ) ) import build_3rdparty_common as nc -nc.work_dir = Path( sys.argv[1] ) -nc.install_dir = Path( sys.argv[2] ) -nc.work_dir = nc.install_dir -nc.force_redo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" -nc.dep_name = "Hyphen" -nc.debug_mode = True +nc.init_for_dep( + depname = "Hyphen", + workdir = Path( sys.argv[2] ), + installdir = Path( sys.argv[2] ), + forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" +) def fetch_and_patch(): nc.create_install_dir() diff --git a/Common/3dParty/md/nc-build.py b/Common/3dParty/md/nc-build.py index 243906178f..75c8920b92 100644 --- a/Common/3dParty/md/nc-build.py +++ b/Common/3dParty/md/nc-build.py @@ -12,12 +12,12 @@ sys.path.insert( 0, str( third_party_root ) ) import build_3rdparty_common as nc -nc.work_dir = Path( sys.argv[1] ) -nc.install_dir = Path( sys.argv[2] ) -nc.work_dir = nc.install_dir -nc.force_redo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" -nc.dep_name = "MD" -nc.debug_mode = True +nc.init_for_dep( + depname = "MD", + workdir = Path( sys.argv[2] ), + installdir = Path( sys.argv[2] ), + forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" +) def fetch_and_patch(): nc.create_install_dir() diff --git a/Common/3dParty/openssl/nc-build.py b/Common/3dParty/openssl/nc-build.py index 9a4fc25294..c071fdc49c 100644 --- a/Common/3dParty/openssl/nc-build.py +++ b/Common/3dParty/openssl/nc-build.py @@ -13,14 +13,14 @@ sys.path.insert( 0, str( third_party_root ) ) import build_3rdparty_common as nc -nc.work_dir = Path( sys.argv[1] ) -nc.install_dir = Path( sys.argv[2] ) -nc.force_redo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" -nc.dep_name = "OpenSSL" -nc.debug_mode = True +nc.init_for_dep( + depname = "OpenSSL", + workdir = Path( sys.argv[1] ), + installdir = Path( sys.argv[2] ), + forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" +) def fetch_and_patch(): - nc.create_workdir() nc.run_command( diff --git a/Common/3dParty/socketio/nc-build.py b/Common/3dParty/socketio/nc-build.py index 79c00adefa..707993cbf8 100644 --- a/Common/3dParty/socketio/nc-build.py +++ b/Common/3dParty/socketio/nc-build.py @@ -13,12 +13,12 @@ sys.path.insert( 0, str( third_party_root ) ) import build_3rdparty_common as nc -nc.work_dir = Path( sys.argv[1] ) -nc.install_dir = Path( sys.argv[2] ) -nc.work_dir = nc.install_dir -nc.force_redo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" -nc.dep_name = "SocketIO" -nc.debug_mode = True +nc.init_for_dep( + depname = "SocketIO", + workdir = Path( sys.argv[2] ), + installdir = Path( sys.argv[2] ), + forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" +) def fetch_and_patch(): nc.create_workdir() diff --git a/Common/3dParty/v8/nc-build.py b/Common/3dParty/v8/nc-build.py index fd907eeda2..fc8dc2e108 100644 --- a/Common/3dParty/v8/nc-build.py +++ b/Common/3dParty/v8/nc-build.py @@ -15,11 +15,12 @@ sys.path.insert( 0, str( third_party_root ) ) import build_3rdparty_common as nc -nc.work_dir = Path( sys.argv[1] ) -nc.install_dir = Path( sys.argv[2] ) -nc.force_redo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" -nc.dep_name = "V8" -nc.debug_mode = True +nc.init_for_dep( + depname = "V8", + workdir = Path( sys.argv[1] ), + installdir = Path( sys.argv[2] ), + forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" +) depot_tools_path = nc.work_dir / "depot_tools" v8_root_path = nc.work_dir / "v8" @@ -312,7 +313,6 @@ def quote(s): return shims_path def fetch_and_patch(): - nc.create_workdir() # Get depot_tools @@ -466,8 +466,6 @@ def build_and_install(): } if nc.is_linux() else { "CXXFLAGS": "/FIstring", "CFLAGS": "/FIstring", - # "CXXFLAGS": "/FIstring /FIcstdint", - # "CFLAGS": "/FIstring /FIcstdint", } nc.run_command( [ "ninja", "-C", output_path, f"-j{job_count}", "v8_monolith" ], From a4d5c1f8b9fa76ecffd6c9f4b7bf35df20ea7765 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Tue, 12 May 2026 13:30:28 +0200 Subject: [PATCH 46/80] fix(msvc): Fix build for Odf and Xls --- Common/3dParty/boost/nc-build.py | 2 +- .../Projects/XlsFormatLib/Linux/cmake/CMakeLists.txt | 4 ++++ OdfFile/Projects/Linux/CMakeLists.txt | 5 +++++ OdfFile/Projects/Linux/msvc_fix.h | 7 +++++++ 4 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 OdfFile/Projects/Linux/msvc_fix.h diff --git a/Common/3dParty/boost/nc-build.py b/Common/3dParty/boost/nc-build.py index 19f17b5869..003f99d621 100644 --- a/Common/3dParty/boost/nc-build.py +++ b/Common/3dParty/boost/nc-build.py @@ -21,7 +21,7 @@ ) modules_needed = [ "headers", "system", "filesystem", "regex", "date_time" ] -header_only_modules_needed = [ "any", "asio", "beast", "format" ] +header_only_modules_needed = [ "any", "asio", "beast", "foreach", "format", "functional", "multi_index", "uuid" ] def fetch_and_patch(): nc.create_workdir() diff --git a/MsBinaryFile/Projects/XlsFormatLib/Linux/cmake/CMakeLists.txt b/MsBinaryFile/Projects/XlsFormatLib/Linux/cmake/CMakeLists.txt index c7982714de..0fbc9f3383 100644 --- a/MsBinaryFile/Projects/XlsFormatLib/Linux/cmake/CMakeLists.txt +++ b/MsBinaryFile/Projects/XlsFormatLib/Linux/cmake/CMakeLists.txt @@ -130,6 +130,10 @@ target_link_libraries(XlsFormatLib PRIVATE Boost::date_time ) +if( MSVC ) + target_compile_options( XlsFormatLib PRIVATE /bigobj ) +endif() + set_property(TARGET XlsFormatLib PROPERTY POSITION_INDEPENDENT_CODE ON) declare_victory( XlsFormatLib ) diff --git a/OdfFile/Projects/Linux/CMakeLists.txt b/OdfFile/Projects/Linux/CMakeLists.txt index 641a3901e4..699ebbf7db 100644 --- a/OdfFile/Projects/Linux/CMakeLists.txt +++ b/OdfFile/Projects/Linux/CMakeLists.txt @@ -473,9 +473,14 @@ target_include_directories(OdfFormatLib PRIVATE ) target_precompile_headers(OdfFormatLib PRIVATE + msvc_fix.h precompiled.h ) +if( MSVC ) + target_compile_options( OdfFormatLib PRIVATE /bigobj ) +endif() + target_link_libraries(OdfFormatLib PUBLIC UnicodeConverter kernel diff --git a/OdfFile/Projects/Linux/msvc_fix.h b/OdfFile/Projects/Linux/msvc_fix.h new file mode 100644 index 0000000000..667c8403d8 --- /dev/null +++ b/OdfFile/Projects/Linux/msvc_fix.h @@ -0,0 +1,7 @@ +#ifdef WIN32_LEAN_AND_MEAN +# undef WIN32_LEAN_AND_MEAN +#endif + +#ifdef _WIN32 +# include +#endif From d6c5db1d3a931902bcc8c6b831eb278cbc3eec47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Tue, 12 May 2026 13:37:43 +0200 Subject: [PATCH 47/80] fix(msvc): Fix BinDocument build --- common.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/common.cmake b/common.cmake index c364cba8e7..cc8bfcaf92 100644 --- a/common.cmake +++ b/common.cmake @@ -126,6 +126,7 @@ else() # Assume win+msvc _REENTRANT CRYPTOPP_DISABLE_ASM INTVER=${VERSION_TXT_CONTENT} + NOMINMAX # Not sure about these: _UNICODE From 83df5ebc44517836831871b767dcf1cfead7c08d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Thu, 14 May 2026 10:25:21 +0200 Subject: [PATCH 48/80] fix(msvc): libgraphics build --- Common/Network/CMakeLists.txt | 8 +++++ DesktopEditor/graphics/cmake/CMakeLists.txt | 39 ++++++++++++++------- OdfFile/Projects/Linux/CMakeLists.txt | 2 +- OdfFile/Projects/Linux/msvc_fix.h | 7 ---- PdfFile/CMakeLists.txt | 19 ++++++---- common.cmake | 3 +- msvc_fix.h | 9 +++++ 7 files changed, 58 insertions(+), 29 deletions(-) delete mode 100644 OdfFile/Projects/Linux/msvc_fix.h create mode 100644 msvc_fix.h diff --git a/Common/Network/CMakeLists.txt b/Common/Network/CMakeLists.txt index 5196bda1a5..00cbaceedc 100644 --- a/Common/Network/CMakeLists.txt +++ b/Common/Network/CMakeLists.txt @@ -70,6 +70,14 @@ endif() set_default_options(kernel_network) +if( MSVC ) + set_source_files_properties( + ${CMAKE_CURRENT_SOURCE_DIR}/FileTransporter/src/FileTransporter_win.cpp + PROPERTIES + COMPILE_DEFINITIONS "UNICODE;_UNICODE" + ) +endif() + target_compile_definitions(kernel_network PRIVATE KERNEL_USE_DYNAMIC_LIBRARY_BUILDING BOOST_DATE_TIME_NO_LIB diff --git a/DesktopEditor/graphics/cmake/CMakeLists.txt b/DesktopEditor/graphics/cmake/CMakeLists.txt index fd3421fb74..e2f02d3ab2 100644 --- a/DesktopEditor/graphics/cmake/CMakeLists.txt +++ b/DesktopEditor/graphics/cmake/CMakeLists.txt @@ -123,6 +123,7 @@ add_library(graphics SHARED ${GRAPHICS_ROOT_DIR}/structures.h # raster.pri + ${CORE_ROOT_DIR}/DesktopEditor/xml/src/xmlwriter.cpp ${DESKTOP_EDITOR_ROOT_DIR}/graphics/Image.cpp ${DESKTOP_EDITOR_ROOT_DIR}/raster/BgraFrame.cpp ${DESKTOP_EDITOR_ROOT_DIR}/raster/ImageFileFormatChecker.cpp @@ -962,6 +963,7 @@ else() endif() target_compile_definitions(graphics PRIVATE + GRAPHICS_USE_DYNAMIC_LIBRARY_BUILDING DISABLE_IMAGE_EXCEPTIONS EXCLUDE_JPG_SUPPORT MNG_SUPPORT_DISPLAY @@ -970,7 +972,6 @@ target_compile_definitions(graphics PRIVATE MNG_ACCESS_CHUNKS MNG_STORE_CHUNKS MNG_ERROR_TELLTALE - # JAS_WIN_MSVC_BUILD NOMINMAX # win # metafile.pri METAFILE_SUPPORT_WMF_EMF # !metafile_disable_wmf_emf @@ -997,11 +998,18 @@ target_compile_definitions(graphics PRIVATE if(LINUX) target_compile_definitions(graphics PRIVATE HAVE_UNISTD_H - HAVE_UNISTD_H HAVE_FCNTL_H # linux or mac + HAVE_FCNTL_H _LINUX ) endif() +if( MSVC ) + target_compile_definitions(graphics PRIVATE + JAS_WIN_MSVC_BUILD + DLL_EXPORT # freetype dll export + ) +endif() + target_include_directories(graphics PRIVATE ${EO_CORE_3RD_PARTY_INSTALL_DIR} ${KATANA_INSTALL_DIR_ABS}/src @@ -1028,24 +1036,31 @@ target_include_directories(graphics PRIVATE ${BROTLI_INSTALL_DIR_ABS}/c/include ) -target_compile_options(graphics PRIVATE - -Wno-narrowing - -UUNICODE - -U_UNICODE +if( MSVC ) + target_include_directories(graphics PRIVATE + ${KATANA_INSTALL_DIR_ABS}/visualc/include + ) +endif() + +target_precompile_headers(graphics PRIVATE + ${CORE_ROOT_DIR}/msvc_fix.h ) if(LINUX) target_compile_options(graphics PRIVATE + -Wno-narrowing + -UUNICODE + -U_UNICODE -fpermissive -UHAVE_IO_H ) -endif() -# Re-enable exporting symbols -target_compile_options(graphics PRIVATE - -fvisibility=default - -fvisibility-inlines-hidden -) + # Re-enable exporting symbols + target_compile_options(graphics PRIVATE + -fvisibility=default + -fvisibility-inlines-hidden + ) +endif() # dynamic libs target_link_libraries(graphics PUBLIC diff --git a/OdfFile/Projects/Linux/CMakeLists.txt b/OdfFile/Projects/Linux/CMakeLists.txt index 699ebbf7db..cc4f2498e1 100644 --- a/OdfFile/Projects/Linux/CMakeLists.txt +++ b/OdfFile/Projects/Linux/CMakeLists.txt @@ -473,7 +473,7 @@ target_include_directories(OdfFormatLib PRIVATE ) target_precompile_headers(OdfFormatLib PRIVATE - msvc_fix.h + ${CORE_ROOT_DIR}/msvc_fix.h precompiled.h ) diff --git a/OdfFile/Projects/Linux/msvc_fix.h b/OdfFile/Projects/Linux/msvc_fix.h deleted file mode 100644 index 667c8403d8..0000000000 --- a/OdfFile/Projects/Linux/msvc_fix.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifdef WIN32_LEAN_AND_MEAN -# undef WIN32_LEAN_AND_MEAN -#endif - -#ifdef _WIN32 -# include -#endif diff --git a/PdfFile/CMakeLists.txt b/PdfFile/CMakeLists.txt index 581e3c33c5..e71a1c4495 100644 --- a/PdfFile/CMakeLists.txt +++ b/PdfFile/CMakeLists.txt @@ -445,14 +445,17 @@ target_compile_definitions(PdfFile PRIVATE CRYPTOPP_DISABLE_ASM NOMINMAX - HAVE_UNISTD_H # Linux and mac - HAVE_FCNTL_H # Linux and mac - # brotli.pri FT_CONFIG_OPTION_USE_BROTLI - ) +if( UNIX ) + target_compile_definitions(PdfFile PRIVATE + HAVE_UNISTD_H # Linux and mac + HAVE_FCNTL_H # Linux and mac + ) +endif() + target_include_directories(PdfFile PRIVATE lib/goo lib/fofi @@ -475,9 +478,11 @@ target_include_directories(PdfFile PRIVATE ${BROTLI_IN_TREE_LOCATION}/c/include ) -target_compile_options(PdfFile PRIVATE - $<$:-include limits> -) +if( UNIX ) + target_compile_options(PdfFile PRIVATE + $<$:-include limits> + ) +endif() if(UNIX AND NOT APPLE) target_compile_options(PdfFile PRIVATE diff --git a/common.cmake b/common.cmake index cc8bfcaf92..2d3f282b9e 100644 --- a/common.cmake +++ b/common.cmake @@ -129,9 +129,7 @@ else() # Assume win+msvc NOMINMAX # Not sure about these: - _UNICODE DONT_WRITE_EMBEDDED_FONTS - UNICODE ) endif() @@ -150,6 +148,7 @@ if( MSVC ) /wd4505 # unreferenced local function removed /O2 /EHsc + /permissive ) set(COMMON_C_FLAGS diff --git a/msvc_fix.h b/msvc_fix.h new file mode 100644 index 0000000000..0cfcb2143d --- /dev/null +++ b/msvc_fix.h @@ -0,0 +1,9 @@ +#ifdef _WIN32 +#define WIN32_LEAN_AND_MEAN +# include +# include +/* Undef Windows API macros that conflict with FontFile.cpp */ +# ifdef GetCharWidth +# undef GetCharWidth +# endif +#endif From c1c66e4face42ebbdda3e139ed1e1c7822fa2537 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Thu, 14 May 2026 17:00:43 +0200 Subject: [PATCH 49/80] fix(msvc): OfficeUtils and libxml2 are not proper libraries anymore --- Common/CMakeLists.txt | 13 +- DesktopEditor/xml/build/cmake/CMakeLists.txt | 169 +++++++++---------- OfficeUtils/CMakeLists.txt | 117 +++++++------ common.cmake | 18 ++ 4 files changed, 160 insertions(+), 157 deletions(-) diff --git a/Common/CMakeLists.txt b/Common/CMakeLists.txt index b113a23c54..927290efdb 100644 --- a/Common/CMakeLists.txt +++ b/Common/CMakeLists.txt @@ -75,11 +75,15 @@ add_library(kernel SHARED ${CORE_ROOT_DIR}/DesktopEditor/common/ProcessEnv.cpp ) -set_default_options(kernel) +set_default_options( kernel ) +add_officeutils( kernel ${CORE_ROOT_DIR}/OfficeUtils ) +add_libxml( kernel ${CORE_ROOT_DIR}/DesktopEditor/xml FALSE ) target_compile_definitions(kernel PRIVATE KERNEL_USE_DYNAMIC_LIBRARY_BUILDING BUILD_ZLIB_AS_SOURCES + ZLIB_DLL + ZLIB_INTERNAL ) if( NOT MSVC ) @@ -88,13 +92,6 @@ if( NOT MSVC ) ) endif() -# static libs -target_link_libraries(kernel PUBLIC - libxml - OfficeUtils -) - -# dynamic libs target_link_libraries(kernel PUBLIC UnicodeConverter ) diff --git a/DesktopEditor/xml/build/cmake/CMakeLists.txt b/DesktopEditor/xml/build/cmake/CMakeLists.txt index 633f4188a5..2a3783145a 100644 --- a/DesktopEditor/xml/build/cmake/CMakeLists.txt +++ b/DesktopEditor/xml/build/cmake/CMakeLists.txt @@ -2,101 +2,90 @@ cmake_minimum_required(VERSION 3.10) project(libxml) -set(CORE_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../..") +function(add_libxml TARGET XML_ROOT_DIR ONLY_LIBXML) -include(${CORE_ROOT_DIR}/common.cmake) + set(LIBXML2_SOURCES_DIR "${XML_ROOT_DIR}/libxml2") -if(NOT DEFINED ONLY_LIBXML) - set(ONLY_LIBXML 0) -endif() -set(XML_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/../..") -set(LIBXML2_SOURCES_DIR "${CMAKE_CURRENT_LIST_DIR}/../../libxml2") - -add_library(libxml STATIC - ${LIBXML2_SOURCES_DIR}/buf.c - ${LIBXML2_SOURCES_DIR}/c14n.c - ${LIBXML2_SOURCES_DIR}/catalog.c - ${LIBXML2_SOURCES_DIR}/chvalid.c - ${LIBXML2_SOURCES_DIR}/debugXML.c - ${LIBXML2_SOURCES_DIR}/dict.c - ${LIBXML2_SOURCES_DIR}/DOCBparser.c - ${LIBXML2_SOURCES_DIR}/encoding.c - ${LIBXML2_SOURCES_DIR}/entities.c - ${LIBXML2_SOURCES_DIR}/error.c - ${LIBXML2_SOURCES_DIR}/globals.c - ${LIBXML2_SOURCES_DIR}/hash.c - ${LIBXML2_SOURCES_DIR}/HTMLparser.c - ${LIBXML2_SOURCES_DIR}/HTMLtree.c - ${LIBXML2_SOURCES_DIR}/legacy.c - ${LIBXML2_SOURCES_DIR}/list.c - ${LIBXML2_SOURCES_DIR}/nanoftp.c - ${LIBXML2_SOURCES_DIR}/nanohttp.c - ${LIBXML2_SOURCES_DIR}/parserInternals.c - ${LIBXML2_SOURCES_DIR}/pattern.c - ${LIBXML2_SOURCES_DIR}/relaxng.c - ${LIBXML2_SOURCES_DIR}/SAX.c - ${LIBXML2_SOURCES_DIR}/SAX2.c - ${LIBXML2_SOURCES_DIR}/schematron.c - ${LIBXML2_SOURCES_DIR}/threads.c - ${LIBXML2_SOURCES_DIR}/tree.c - ${LIBXML2_SOURCES_DIR}/uri.c - ${LIBXML2_SOURCES_DIR}/xinclude.c - ${LIBXML2_SOURCES_DIR}/xlink.c - ${LIBXML2_SOURCES_DIR}/xmlIO.c - ${LIBXML2_SOURCES_DIR}/xmlmemory.c - ${LIBXML2_SOURCES_DIR}/xmlmodule.c - ${LIBXML2_SOURCES_DIR}/xmlreader.c - ${LIBXML2_SOURCES_DIR}/xmlregexp.c - ${LIBXML2_SOURCES_DIR}/xmlsave.c - ${LIBXML2_SOURCES_DIR}/xmlschemas.c - ${LIBXML2_SOURCES_DIR}/xmlschemastypes.c - ${LIBXML2_SOURCES_DIR}/xmlstring.c - ${LIBXML2_SOURCES_DIR}/xmlunicode.c - ${LIBXML2_SOURCES_DIR}/xmlwriter.c - ${LIBXML2_SOURCES_DIR}/xpath.c - ${LIBXML2_SOURCES_DIR}/xpointer.c - ${LIBXML2_SOURCES_DIR}/valid.c - ${LIBXML2_SOURCES_DIR}/parser.c -) + target_sources( ${TARGET} PRIVATE + ${LIBXML2_SOURCES_DIR}/buf.c + ${LIBXML2_SOURCES_DIR}/c14n.c + ${LIBXML2_SOURCES_DIR}/catalog.c + ${LIBXML2_SOURCES_DIR}/chvalid.c + ${LIBXML2_SOURCES_DIR}/debugXML.c + ${LIBXML2_SOURCES_DIR}/dict.c + ${LIBXML2_SOURCES_DIR}/DOCBparser.c + ${LIBXML2_SOURCES_DIR}/encoding.c + ${LIBXML2_SOURCES_DIR}/entities.c + ${LIBXML2_SOURCES_DIR}/error.c + ${LIBXML2_SOURCES_DIR}/globals.c + ${LIBXML2_SOURCES_DIR}/hash.c + ${LIBXML2_SOURCES_DIR}/HTMLparser.c + ${LIBXML2_SOURCES_DIR}/HTMLtree.c + ${LIBXML2_SOURCES_DIR}/legacy.c + ${LIBXML2_SOURCES_DIR}/list.c + ${LIBXML2_SOURCES_DIR}/nanoftp.c + ${LIBXML2_SOURCES_DIR}/nanohttp.c + ${LIBXML2_SOURCES_DIR}/parserInternals.c + ${LIBXML2_SOURCES_DIR}/pattern.c + ${LIBXML2_SOURCES_DIR}/relaxng.c + ${LIBXML2_SOURCES_DIR}/SAX.c + ${LIBXML2_SOURCES_DIR}/SAX2.c + ${LIBXML2_SOURCES_DIR}/schematron.c + ${LIBXML2_SOURCES_DIR}/threads.c + ${LIBXML2_SOURCES_DIR}/tree.c + ${LIBXML2_SOURCES_DIR}/uri.c + ${LIBXML2_SOURCES_DIR}/xinclude.c + ${LIBXML2_SOURCES_DIR}/xlink.c + ${LIBXML2_SOURCES_DIR}/xmlIO.c + ${LIBXML2_SOURCES_DIR}/xmlmemory.c + ${LIBXML2_SOURCES_DIR}/xmlmodule.c + ${LIBXML2_SOURCES_DIR}/xmlreader.c + ${LIBXML2_SOURCES_DIR}/xmlregexp.c + ${LIBXML2_SOURCES_DIR}/xmlsave.c + ${LIBXML2_SOURCES_DIR}/xmlschemas.c + ${LIBXML2_SOURCES_DIR}/xmlschemastypes.c + ${LIBXML2_SOURCES_DIR}/xmlstring.c + ${LIBXML2_SOURCES_DIR}/xmlunicode.c + ${LIBXML2_SOURCES_DIR}/xmlwriter.c + ${LIBXML2_SOURCES_DIR}/xpath.c + ${LIBXML2_SOURCES_DIR}/xpointer.c + ${LIBXML2_SOURCES_DIR}/valid.c + ${LIBXML2_SOURCES_DIR}/parser.c + ) -set_default_options(libxml) + if(NOT ONLY_LIBXML) + message("Including XML writer!") + target_sources( ${TARGET} PRIVATE + ${XML_ROOT_DIR}/src/xmlwriter.cpp + ${XML_ROOT_DIR}/src/xmllight.cpp + ${XML_ROOT_DIR}/src/xmldom.cpp -if(NOT ONLY_LIBXML) - message("Including XML writer!") - target_sources(libxml PRIVATE - ${XML_ROOT_DIR}/src/xmlwriter.cpp - ${XML_ROOT_DIR}/src/xmllight.cpp - ${XML_ROOT_DIR}/src/xmldom.cpp + ${XML_ROOT_DIR}/src/xmllight_private.h + ${XML_ROOT_DIR}/include/xmlutils.h + ${XML_ROOT_DIR}/include/xmlwriter.h + ) + endif() - ${XML_ROOT_DIR}/src/xmllight_private.h - ${XML_ROOT_DIR}/include/xmlutils.h - ${XML_ROOT_DIR}/include/xmlwriter.h + target_compile_definitions( ${TARGET} PUBLIC + HAVE_VA_COPY + LIBXML_READER_ENABLED + LIBXML_PUSH_ENABLED + LIBXML_HTML_ENABLED + LIBXML_XPATH_ENABLED + LIBXML_OUTPUT_ENABLED + LIBXML_C14N_ENABLED + LIBXML_SAX1_ENABLED + LIBXML_TREE_ENABLED + LIBXML_XPTR_ENABLED + IN_LIBXML + LIBXML_STATIC + XML_ERROR_DISABLE_MODE ) -endif() - -target_compile_definitions(libxml PUBLIC - HAVE_VA_COPY - LIBXML_READER_ENABLED - LIBXML_PUSH_ENABLED - LIBXML_HTML_ENABLED - LIBXML_XPATH_ENABLED - LIBXML_OUTPUT_ENABLED - LIBXML_C14N_ENABLED - LIBXML_SAX1_ENABLED - LIBXML_TREE_ENABLED - LIBXML_XPTR_ENABLED - IN_LIBXML - LIBXML_STATIC - XML_ERROR_DISABLE_MODE # only release -) -target_include_directories(libxml PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/../qt - ${LIBXML2_SOURCES_DIR}/include - ${LIBXML2_SOURCES_DIR}/include/libxml -) - -set_property(TARGET libxml PROPERTY POSITION_INDEPENDENT_CODE ON) + target_include_directories( ${TARGET} PRIVATE + ${XML_ROOT_DIR}/build/qt + ${LIBXML2_SOURCES_DIR}/include + ${LIBXML2_SOURCES_DIR}/include/libxml + ) -declare_victory( libxml ) +endfunction() diff --git a/OfficeUtils/CMakeLists.txt b/OfficeUtils/CMakeLists.txt index 5de44c9dc3..6dec691077 100644 --- a/OfficeUtils/CMakeLists.txt +++ b/OfficeUtils/CMakeLists.txt @@ -1,70 +1,69 @@ cmake_minimum_required(VERSION 3.10) -project(OfficeUtils) +function(add_officeutils TARGET OFFICE_UTILS_DIR) -set(CORE_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/..") + set(OFFICE_UTILS_SOURCES_DIR "${OFFICE_UTILS_DIR}/src") -include(${CORE_ROOT_DIR}/common.cmake) + # OfficeUtils.pro + set(OFFICE_UTILS_SOURCES + ${OFFICE_UTILS_SOURCES_DIR}/OfficeUtils.cpp + ${OFFICE_UTILS_SOURCES_DIR}/ZipBuffer.cpp + ${OFFICE_UTILS_SOURCES_DIR}/ZipUtilsCP.cpp + + ${OFFICE_UTILS_SOURCES_DIR}/OfficeUtils.h + ${OFFICE_UTILS_SOURCES_DIR}/OfficeUtilsCommon.h + ${OFFICE_UTILS_SOURCES_DIR}/ZipBuffer.h + ${OFFICE_UTILS_SOURCES_DIR}/ZipFolder.h + ${OFFICE_UTILS_SOURCES_DIR}/ZipUtilsCP.h -set(OFFICE_UTILS_SOURCES_DIR "${CMAKE_CURRENT_LIST_DIR}/src") + ${OFFICE_UTILS_SOURCES_DIR}/zlib_addon.c + ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/adler32.c + ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/compress.c + ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/contrib/minizip/ioapi.c + ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/contrib/minizip/ioapibuf.c + ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/contrib/minizip/miniunz.c + ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/contrib/minizip/minizip.c + ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/contrib/minizip/mztools.c + ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/contrib/minizip/unzip.c + ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/contrib/minizip/zip.c + ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/crc32.c + ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/deflate.c + ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/gzclose.c + ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/gzlib.c + ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/gzread.c + ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/gzwrite.c + ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/infback.c + ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/inffast.c + ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/inflate.c + ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/inftrees.c + ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/trees.c + ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/uncompr.c + ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/zutil.c -add_library(OfficeUtils STATIC - ${OFFICE_UTILS_SOURCES_DIR}/OfficeUtils.cpp - ${OFFICE_UTILS_SOURCES_DIR}/OfficeUtils.h - ${OFFICE_UTILS_SOURCES_DIR}/OfficeUtilsCommon.h - ${OFFICE_UTILS_SOURCES_DIR}/ZipBuffer.cpp - ${OFFICE_UTILS_SOURCES_DIR}/ZipBuffer.h - ${OFFICE_UTILS_SOURCES_DIR}/ZipFolder.h - ${OFFICE_UTILS_SOURCES_DIR}/ZipUtilsCP.cpp - ${OFFICE_UTILS_SOURCES_DIR}/ZipUtilsCP.h - ${OFFICE_UTILS_SOURCES_DIR}/zlib_addon.c - ${OFFICE_UTILS_SOURCES_DIR}/zlib_addon.h - ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/adler32.c - ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/compress.c - ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/contrib/minizip/crypt.h - ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/contrib/minizip/ioapi.c - ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/contrib/minizip/ioapi.h - ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/contrib/minizip/ioapibuf.c - ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/contrib/minizip/ioapibuf.h - ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/contrib/minizip/miniunz.c - ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/contrib/minizip/minizip.c - ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/contrib/minizip/mztools.c - ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/contrib/minizip/mztools.h - ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/contrib/minizip/unzip.c - ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/contrib/minizip/unzip.h - ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/contrib/minizip/zip.c - ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/contrib/minizip/zip.h - ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/crc32.c - ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/deflate.c - ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/gzclose.c - ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/gzlib.c - ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/gzread.c - ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/gzwrite.c - ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/infback.c - ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/inffast.c - ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/inflate.c - ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/inftrees.c - ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/trees.c - ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/uncompr.c - ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/zutil.c -) - -if (WIN32) - target_sources(OfficeUtils PRIVATE - ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/contrib/minizip/iowin32.c + ${OFFICE_UTILS_SOURCES_DIR}/zlib_addon.h + ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/contrib/minizip/crypt.h + ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/contrib/minizip/ioapi.h + ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/contrib/minizip/ioapibuf.h + ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/contrib/minizip/mztools.h + ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/contrib/minizip/unzip.h + ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/contrib/minizip/zip.h ) -endif() -target_include_directories(OfficeUtils PRIVATE - ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/contrib/minizip - ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11 - ${OFFICE_UTILS_SOURCES_DIR} -) + target_sources( ${TARGET} PRIVATE ${OFFICE_UTILS_SOURCES} ) -set_property(TARGET OfficeUtils PROPERTY POSITION_INDEPENDENT_CODE ON) + if (WIN32) + target_sources( ${TARGET} PRIVATE + ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/contrib/minizip/iowin32.c + ) + endif() -if( NOT MSVC ) - target_compile_options(OfficeUtils PRIVATE -include unistd.h) -endif() + target_include_directories( ${TARGET} PRIVATE + ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11/contrib/minizip + ${OFFICE_UTILS_SOURCES_DIR}/zlib-1.2.11 + ${OFFICE_UTILS_SOURCES_DIR} + ) -declare_victory( OfficeUtils ) + if( NOT MSVC ) + target_compile_options( ${TARGET} PRIVATE -include unistd.h) + endif() +endfunction() diff --git a/common.cmake b/common.cmake index 2d3f282b9e..bfd39f9013 100644 --- a/common.cmake +++ b/common.cmake @@ -349,3 +349,21 @@ function(inject_script TARGET_NAME TEMPLATE_FILE OUTPUT_FILE) ) endif() endfunction() + +function( add_cpp_sources_from_dir_recurive TARGET DIR ) + file(GLOB_RECURSE DIR_SOURCES CONFIGURE_DEPENDS + "${DIR}/*.cpp" + "${DIR}/*.cxx" + "${DIR}/*.h" + "${DIR}/*.hpp" + "${DIR}/*.hxx" + ) + + target_sources( ${TARGET} PRIVATE + ${DIR_SOURCES} + ) + + target_include_directories( ${TARGET} PRIVATE + ${DIR} + ) +endfunction() From 7e2d6a0d23b81c60d3d70197fe38b8c87ce89609 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Thu, 14 May 2026 17:04:36 +0200 Subject: [PATCH 50/80] fix(msvc): IWorkFile build --- Apple/CMakeLists.txt | 123 +++---------------------------------------- 1 file changed, 7 insertions(+), 116 deletions(-) diff --git a/Apple/CMakeLists.txt b/Apple/CMakeLists.txt index 2d70d9bc99..5a16948f19 100644 --- a/Apple/CMakeLists.txt +++ b/Apple/CMakeLists.txt @@ -10,7 +10,6 @@ set(OFFICE_UTILS_ROOT_DIR "${CORE_ROOT_DIR}/OfficeUtils") set(DESKTOP_EDITOR_ROOT "${CORE_ROOT_DIR}/DesktopEditor") set(COMMON_3RDPARTY_ROOT "${CORE_ROOT_DIR}/Common/3dParty") -set(ONLY_LIBXML 1) if(NOT TARGET libxml) add_subdirectory(${CORE_ROOT_DIR}/DesktopEditor/xml/build/cmake libxml) endif() @@ -39,74 +38,8 @@ add_library(IWorkFile SHARED ${CMAKE_CURRENT_SOURCE_DIR}/IWork.h - # OfficeUtils.pri - ${OFFICE_UTILS_ROOT_DIR}/src/OfficeUtils.cpp - ${OFFICE_UTILS_ROOT_DIR}/src/ZipBuffer.cpp - ${OFFICE_UTILS_ROOT_DIR}/src/ZipUtilsCP.cpp + # Hack: The zlib addon functions are not exported by kernel, so we need to have them here as well. ${OFFICE_UTILS_ROOT_DIR}/src/zlib_addon.c - ${OFFICE_UTILS_ROOT_DIR}/src/zlib-1.2.11/adler32.c - ${OFFICE_UTILS_ROOT_DIR}/src/zlib-1.2.11/compress.c - ${OFFICE_UTILS_ROOT_DIR}/src/zlib-1.2.11/contrib/minizip/ioapi.c - ${OFFICE_UTILS_ROOT_DIR}/src/zlib-1.2.11/contrib/minizip/ioapibuf.c - ${OFFICE_UTILS_ROOT_DIR}/src/zlib-1.2.11/contrib/minizip/miniunz.c - ${OFFICE_UTILS_ROOT_DIR}/src/zlib-1.2.11/contrib/minizip/minizip.c - ${OFFICE_UTILS_ROOT_DIR}/src/zlib-1.2.11/contrib/minizip/mztools.c - ${OFFICE_UTILS_ROOT_DIR}/src/zlib-1.2.11/contrib/minizip/unzip.c - ${OFFICE_UTILS_ROOT_DIR}/src/zlib-1.2.11/contrib/minizip/zip.c - ${OFFICE_UTILS_ROOT_DIR}/src/zlib-1.2.11/crc32.c - ${OFFICE_UTILS_ROOT_DIR}/src/zlib-1.2.11/deflate.c - ${OFFICE_UTILS_ROOT_DIR}/src/zlib-1.2.11/gzclose.c - ${OFFICE_UTILS_ROOT_DIR}/src/zlib-1.2.11/gzlib.c - ${OFFICE_UTILS_ROOT_DIR}/src/zlib-1.2.11/gzread.c - ${OFFICE_UTILS_ROOT_DIR}/src/zlib-1.2.11/gzwrite.c - ${OFFICE_UTILS_ROOT_DIR}/src/zlib-1.2.11/infback.c - ${OFFICE_UTILS_ROOT_DIR}/src/zlib-1.2.11/inffast.c - ${OFFICE_UTILS_ROOT_DIR}/src/zlib-1.2.11/inflate.c - ${OFFICE_UTILS_ROOT_DIR}/src/zlib-1.2.11/inftrees.c - ${OFFICE_UTILS_ROOT_DIR}/src/zlib-1.2.11/trees.c - ${OFFICE_UTILS_ROOT_DIR}/src/zlib-1.2.11/uncompr.c - ${OFFICE_UTILS_ROOT_DIR}/src/zlib-1.2.11/zutil.c - - ${OFFICE_UTILS_ROOT_DIR}/src/OfficeUtils.h - ${OFFICE_UTILS_ROOT_DIR}/src/OfficeUtilsCommon.h - ${OFFICE_UTILS_ROOT_DIR}/src/ZipBuffer.h - ${OFFICE_UTILS_ROOT_DIR}/src/ZipFolder.h - ${OFFICE_UTILS_ROOT_DIR}/src/ZipUtilsCP.h - ${OFFICE_UTILS_ROOT_DIR}/src/zlib_addon.h - ${OFFICE_UTILS_ROOT_DIR}/src/zlib-1.2.11/contrib/minizip/crypt.h - ${OFFICE_UTILS_ROOT_DIR}/src/zlib-1.2.11/contrib/minizip/ioapi.h - ${OFFICE_UTILS_ROOT_DIR}/src/zlib-1.2.11/contrib/minizip/ioapibuf.h - ${OFFICE_UTILS_ROOT_DIR}/src/zlib-1.2.11/contrib/minizip/mztools.h - ${OFFICE_UTILS_ROOT_DIR}/src/zlib-1.2.11/contrib/minizip/unzip.h - ${OFFICE_UTILS_ROOT_DIR}/src/zlib-1.2.11/contrib/minizip/zip.h - - # apple.pri - ${REVENGE_LIB_ROOT}/src/lib/RVNGBinaryData.cpp - ${REVENGE_LIB_ROOT}/src/lib/RVNGCSVSpreadsheetGenerator.cpp - ${REVENGE_LIB_ROOT}/src/lib/RVNGHTMLTextGenerator.cpp - ${REVENGE_LIB_ROOT}/src/lib/RVNGHTMLTextTableStyle.cpp - ${REVENGE_LIB_ROOT}/src/lib/RVNGHTMLTextTextStyle.cpp - ${REVENGE_LIB_ROOT}/src/lib/RVNGMemoryStream.cpp - ${REVENGE_LIB_ROOT}/src/lib/RVNGOLEStream.cpp - ${REVENGE_LIB_ROOT}/src/lib/RVNGProperty.cpp - ${REVENGE_LIB_ROOT}/src/lib/RVNGPropertyList.cpp - ${REVENGE_LIB_ROOT}/src/lib/RVNGPropertyListVector.cpp - ${REVENGE_LIB_ROOT}/src/lib/RVNGRawDrawingGenerator.cpp - ${REVENGE_LIB_ROOT}/src/lib/RVNGRawGeneratorBase.cpp - ${REVENGE_LIB_ROOT}/src/lib/RVNGRawPresentationGenerator.cpp - ${REVENGE_LIB_ROOT}/src/lib/RVNGRawSpreadsheetGenerator.cpp - ${REVENGE_LIB_ROOT}/src/lib/RVNGRawTextGenerator.cpp - ${REVENGE_LIB_ROOT}/src/lib/RVNGSVGDrawingGenerator.cpp - ${REVENGE_LIB_ROOT}/src/lib/RVNGSVGPresentationGenerator.cpp - ${REVENGE_LIB_ROOT}/src/lib/RVNGString.cpp - ${REVENGE_LIB_ROOT}/src/lib/RVNGStringVector.cpp - ${REVENGE_LIB_ROOT}/src/lib/RVNGTextDrawingGenerator.cpp - ${REVENGE_LIB_ROOT}/src/lib/RVNGTextPresentationGenerator.cpp - ${REVENGE_LIB_ROOT}/src/lib/RVNGTextSpreadsheetGenerator.cpp - ${REVENGE_LIB_ROOT}/src/lib/RVNGTextTextGenerator.cpp - ${REVENGE_LIB_ROOT}/src/lib/RVNGZipStream.cpp - ${REVENGE_LIB_ROOT}/src/lib/RVNGDirectoryStream.cpp - ${REVENGE_LIB_ROOT}/src/lib/RVNGStreamImplementation.cpp ${ODF_LIB_ROOT}/src/DocumentElement.cxx ${ODF_LIB_ROOT}/src/FilterInternal.cxx @@ -275,47 +208,6 @@ add_library(IWorkFile SHARED ${ETONYEK_LIB_ROOT}/src/lib/IWORKFormula.cpp ${ETONYEK_LIB_ROOT}/src/lib/IWORKTable.cpp - - - ${REVENGE_LIB_ROOT}/src/lib/RVNGHTMLTextTableStyle.h - ${REVENGE_LIB_ROOT}/src/lib/RVNGHTMLTextTextStyle.h - ${REVENGE_LIB_ROOT}/src/lib/RVNGMemoryStream.h - ${REVENGE_LIB_ROOT}/src/lib/RVNGOLEStream.h - ${REVENGE_LIB_ROOT}/src/lib/RVNGRawGeneratorBase.h - ${REVENGE_LIB_ROOT}/src/lib/RVNGZipStream.h - ${REVENGE_LIB_ROOT}/src/lib/librevenge_internal.h - ${REVENGE_LIB_ROOT}/inc/librevenge-generators/RVNGCSVSpreadsheetGenerator.h - ${REVENGE_LIB_ROOT}/inc/librevenge-generators/RVNGHTMLTextGenerator.h - ${REVENGE_LIB_ROOT}/inc/librevenge-generators/RVNGRawDrawingGenerator.h - ${REVENGE_LIB_ROOT}/inc/librevenge-generators/RVNGRawPresentationGenerator.h - ${REVENGE_LIB_ROOT}/inc/librevenge-generators/RVNGRawSpreadsheetGenerator.h - ${REVENGE_LIB_ROOT}/inc/librevenge-generators/RVNGRawTextGenerator.h - ${REVENGE_LIB_ROOT}/inc/librevenge-generators/RVNGSVGPresentationGenerator.h - ${REVENGE_LIB_ROOT}/inc/librevenge-generators/RVNGTextDrawingGenerator.h - ${REVENGE_LIB_ROOT}/inc/librevenge-generators/RVNGTextPresentationGenerator.h - ${REVENGE_LIB_ROOT}/inc/librevenge-generators/RVNGTextSpreadsheetGenerator.h - ${REVENGE_LIB_ROOT}/inc/librevenge-generators/RVNGTextTextGenerator.h - ${REVENGE_LIB_ROOT}/inc/librevenge-generators/librevenge-generators-api.h - ${REVENGE_LIB_ROOT}/inc/librevenge-generators/librevenge-generators.h - ${REVENGE_LIB_ROOT}/inc/librevenge-stream/RVNGDirectoryStream.h - ${REVENGE_LIB_ROOT}/inc/librevenge-stream/RVNGStream.h - ${REVENGE_LIB_ROOT}/inc/librevenge-stream/librevenge-stream-api.h - ${REVENGE_LIB_ROOT}/inc/librevenge-stream/librevenge-stream.h - ${REVENGE_LIB_ROOT}/inc/librevenge-stream/RVNGStreamImplementation.h - ${REVENGE_LIB_ROOT}/inc/librevenge/RVNGBinaryData.h - ${REVENGE_LIB_ROOT}/inc/librevenge/RVNGDrawingInterface.h - ${REVENGE_LIB_ROOT}/inc/librevenge/RVNGPresentationInterface.h - ${REVENGE_LIB_ROOT}/inc/librevenge/RVNGProperty.h - ${REVENGE_LIB_ROOT}/inc/librevenge/RVNGPropertyList.h - ${REVENGE_LIB_ROOT}/inc/librevenge/RVNGPropertyListVector.h - ${REVENGE_LIB_ROOT}/inc/librevenge/RVNGSVGDrawingGenerator.h - ${REVENGE_LIB_ROOT}/inc/librevenge/RVNGSpreadsheetInterface.h - ${REVENGE_LIB_ROOT}/inc/librevenge/RVNGString.h - ${REVENGE_LIB_ROOT}/inc/librevenge/RVNGStringVector.h - ${REVENGE_LIB_ROOT}/inc/librevenge/RVNGTextInterface.h - ${REVENGE_LIB_ROOT}/inc/librevenge/librevenge-api.h - ${REVENGE_LIB_ROOT}/inc/librevenge/librevenge.h - ${ODF_LIB_ROOT}/inc/libodfgen/OdfDocumentHandler.hxx ${ODF_LIB_ROOT}/inc/libodfgen/OdgGenerator.hxx ${ODF_LIB_ROOT}/inc/libodfgen/OdpGenerator.hxx @@ -517,13 +409,11 @@ add_library(IWorkFile SHARED ${ETONYEK_LIB_ROOT}/src/lib/libetonyek_xml.h ) -set_default_options(IWorkFile) +add_cpp_sources_from_dir_recurive( IWorkFile ${REVENGE_LIB_ROOT}/src/lib ) +add_cpp_sources_from_dir_recurive( IWorkFile ${REVENGE_LIB_ROOT}/inc ) -if(WIN32) - target_sources(IWorkFile PRIVATE - ${OFFICE_UTILS_ROOT_DIR}/src/zlib-1.2.11/contrib/minizip/iowin32.c # OfficeUtils.pri - ) -endif() +set_default_options( IWorkFile ) +add_libxml( IWorkFile ${CORE_ROOT_DIR}/DesktopEditor/xml TRUE ) if( NOT MSVC ) target_compile_options(IWorkFile PRIVATE @@ -561,11 +451,12 @@ endif() target_compile_definitions(IWorkFile PRIVATE IWORK_USE_DYNAMIC_LIBRARY BUILD_ZLIB_AS_SOURCES # OfficeUtils.pri + ZLIB_DLL ) # static libs target_link_libraries(IWorkFile PUBLIC - libxml + # libxml Boost::system Boost::filesystem Boost::regex From 7072736103e492ca60f45c081e4b1c2e043e6560 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Thu, 14 May 2026 17:11:27 +0200 Subject: [PATCH 51/80] fix(msvc): Fix Fb2File build --- DesktopEditor/graphics/cmake/CMakeLists.txt | 1 - Fb2File/CMakeLists.txt | 12 +++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/DesktopEditor/graphics/cmake/CMakeLists.txt b/DesktopEditor/graphics/cmake/CMakeLists.txt index e2f02d3ab2..cbb716a4a7 100644 --- a/DesktopEditor/graphics/cmake/CMakeLists.txt +++ b/DesktopEditor/graphics/cmake/CMakeLists.txt @@ -123,7 +123,6 @@ add_library(graphics SHARED ${GRAPHICS_ROOT_DIR}/structures.h # raster.pri - ${CORE_ROOT_DIR}/DesktopEditor/xml/src/xmlwriter.cpp ${DESKTOP_EDITOR_ROOT_DIR}/graphics/Image.cpp ${DESKTOP_EDITOR_ROOT_DIR}/raster/BgraFrame.cpp ${DESKTOP_EDITOR_ROOT_DIR}/raster/ImageFileFormatChecker.cpp diff --git a/Fb2File/CMakeLists.txt b/Fb2File/CMakeLists.txt index d905d79118..b0b6d8fe11 100644 --- a/Fb2File/CMakeLists.txt +++ b/Fb2File/CMakeLists.txt @@ -66,6 +66,12 @@ add_library(Fb2File SHARED ${HTML_3RDPARTY_DIR}/htmltoxhtml.h ) +if( MSVC ) + target_include_directories(Fb2File PRIVATE + ${GUMBO_INSTALL_DIR}/visualc/include + ) +endif() + set_default_options(Fb2File) target_compile_definitions(Fb2File PRIVATE @@ -79,9 +85,9 @@ target_include_directories(Fb2File PRIVATE ${Boost_INCLUDE_DIRS} ) -target_compile_options(Fb2File PRIVATE - $<$:-std=c99> -) +if(UNIX) + target_compile_options(Fb2File PRIVATE -std=c99) +endif() # dynamic libs target_link_libraries(Fb2File PUBLIC From 31d821c8d6c843b7423d445381a39385ad7a302b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Thu, 14 May 2026 17:26:01 +0200 Subject: [PATCH 52/80] fix(msvc): DjVuFile build --- DjVuFile/CMakeLists.txt | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/DjVuFile/CMakeLists.txt b/DjVuFile/CMakeLists.txt index 6110aefc9d..673afb5f39 100644 --- a/DjVuFile/CMakeLists.txt +++ b/DjVuFile/CMakeLists.txt @@ -138,18 +138,12 @@ add_library(DjVuFile SHARED set_default_options(DjVuFile) -target_compile_options(DjVuFile PRIVATE - -UUNICODE - -U_UNICODE -) - target_compile_definitions(DjVuFile PRIVATE DJVU_USE_DYNAMIC_LIBRARY ) if( NOT WIN32 ) target_compile_definitions(DjVuFile PRIVATE - HAVE_UNISTD_H HAVE_MBSTATE_T GCONTAINER_NO_MEMBER_TEMPLATES=1 HAS_WCHAR @@ -170,18 +164,11 @@ target_include_directories(DjVuFile PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ) -# dynamic libs target_link_libraries(DjVuFile PUBLIC graphics kernel UnicodeConverter PdfFile - - # gdi32 # Windows - # advapi32 # Windows - # user32 # Windows - # shell32 # Windows - # Ole32 # Windows ) copy_artifacts_to_folder("DjVuFile" "${EO_CORE_OUTPUT_DIR}") From 84f328bf3d939c86a341e3335bbc0182165dd965 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Fri, 15 May 2026 00:19:51 +0200 Subject: [PATCH 53/80] fix(msvc): Big cleanup pt1 --- DesktopEditor/graphics/cmake/CMakeLists.txt | 1 + .../DocFormatLib/Linux/cmake/CMakeLists.txt | 7 +++++++ .../PPTFormatLib/Linux/cmake/CMakeLists.txt | 7 +++++++ .../VbaFormatLib/Linux/cmake/CMakeLists.txt | 7 +++++++ .../XlsFormatLib/Linux/cmake/CMakeLists.txt | 7 +++++++ .../Projects/Linux/BinDocument/CMakeLists.txt | 7 +++++++ .../Linux/DocxFormatLib/CMakeLists.txt | 18 +++++++++++------- .../Linux/PPTXFormatLib/CMakeLists.txt | 7 +++++++ .../Linux/XlsbFormatLib/CMakeLists.txt | 7 +++++++ OdfFile/Projects/Linux/CMakeLists.txt | 7 +++++++ PdfFile/CMakeLists.txt | 17 ++++++----------- RtfFile/Projects/Linux/CMakeLists.txt | 7 +++++++ TxtFile/Projects/Linux/CMakeLists.txt | 7 +++++++ UnicodeConverter/CMakeLists.txt | 4 ++-- msvc_fix.h | 1 - 15 files changed, 90 insertions(+), 21 deletions(-) diff --git a/DesktopEditor/graphics/cmake/CMakeLists.txt b/DesktopEditor/graphics/cmake/CMakeLists.txt index cbb716a4a7..52e41e9291 100644 --- a/DesktopEditor/graphics/cmake/CMakeLists.txt +++ b/DesktopEditor/graphics/cmake/CMakeLists.txt @@ -1006,6 +1006,7 @@ if( MSVC ) target_compile_definitions(graphics PRIVATE JAS_WIN_MSVC_BUILD DLL_EXPORT # freetype dll export + WIN32_LEAN_AND_MEAN ) endif() diff --git a/MsBinaryFile/Projects/DocFormatLib/Linux/cmake/CMakeLists.txt b/MsBinaryFile/Projects/DocFormatLib/Linux/cmake/CMakeLists.txt index 3785bdb03e..05cdb2f3f7 100644 --- a/MsBinaryFile/Projects/DocFormatLib/Linux/cmake/CMakeLists.txt +++ b/MsBinaryFile/Projects/DocFormatLib/Linux/cmake/CMakeLists.txt @@ -279,6 +279,13 @@ add_library(DocFormatLib STATIC set_default_options(DocFormatLib) +if( MSVC ) + target_compile_definitions( DocFormatLib PRIVATE + _UNICODE + UNICODE + ) +endif() + target_link_libraries(DocFormatLib INTERFACE Boost::system Boost::filesystem diff --git a/MsBinaryFile/Projects/PPTFormatLib/Linux/cmake/CMakeLists.txt b/MsBinaryFile/Projects/PPTFormatLib/Linux/cmake/CMakeLists.txt index 762680f3eb..81c3d4c76e 100644 --- a/MsBinaryFile/Projects/PPTFormatLib/Linux/cmake/CMakeLists.txt +++ b/MsBinaryFile/Projects/PPTFormatLib/Linux/cmake/CMakeLists.txt @@ -489,6 +489,13 @@ add_library(PptFormatLib STATIC set_default_options(PptFormatLib) +if( MSVC ) + target_compile_definitions( PptFormatLib PRIVATE + _UNICODE + UNICODE + ) +endif() + target_link_libraries(PptFormatLib PRIVATE Boost::system Boost::filesystem diff --git a/MsBinaryFile/Projects/VbaFormatLib/Linux/cmake/CMakeLists.txt b/MsBinaryFile/Projects/VbaFormatLib/Linux/cmake/CMakeLists.txt index 079ab57db6..46d0891e63 100644 --- a/MsBinaryFile/Projects/VbaFormatLib/Linux/cmake/CMakeLists.txt +++ b/MsBinaryFile/Projects/VbaFormatLib/Linux/cmake/CMakeLists.txt @@ -22,6 +22,13 @@ add_library(VbaFormatLib STATIC set_default_options(VbaFormatLib) +if( MSVC ) + target_compile_definitions( VbaFormatLib PRIVATE + _UNICODE + UNICODE + ) +endif() + target_link_libraries(VbaFormatLib PRIVATE Boost::system Boost::filesystem diff --git a/MsBinaryFile/Projects/XlsFormatLib/Linux/cmake/CMakeLists.txt b/MsBinaryFile/Projects/XlsFormatLib/Linux/cmake/CMakeLists.txt index 0fbc9f3383..d4b9053bc9 100644 --- a/MsBinaryFile/Projects/XlsFormatLib/Linux/cmake/CMakeLists.txt +++ b/MsBinaryFile/Projects/XlsFormatLib/Linux/cmake/CMakeLists.txt @@ -116,6 +116,13 @@ target_precompile_headers(XlsFormatLib PRIVATE set_default_options(XlsFormatLib) +if( MSVC ) + target_compile_definitions( XlsFormatLib PRIVATE + _UNICODE + UNICODE + ) +endif() + target_include_directories(XlsFormatLib PRIVATE ${XLS_FILE_SOURCES_DIR}/Format ${XLS_FILE_SOURCES_DIR}/Format/Logic diff --git a/OOXML/Projects/Linux/BinDocument/CMakeLists.txt b/OOXML/Projects/Linux/BinDocument/CMakeLists.txt index 36817cf06c..1b830dc2c4 100644 --- a/OOXML/Projects/Linux/BinDocument/CMakeLists.txt +++ b/OOXML/Projects/Linux/BinDocument/CMakeLists.txt @@ -109,6 +109,13 @@ add_library(BinDocument STATIC set_default_options(BinDocument) +if( MSVC ) + target_compile_definitions( BinDocument PRIVATE + _UNICODE + UNICODE + ) +endif() + target_compile_definitions(BinDocument PRIVATE SOLUTION_ASCOFFICEDOCXFILE2 #DISABLE_FILE_DOWNLOADER diff --git a/OOXML/Projects/Linux/DocxFormatLib/CMakeLists.txt b/OOXML/Projects/Linux/DocxFormatLib/CMakeLists.txt index 5458de2d51..e89bc67ee4 100644 --- a/OOXML/Projects/Linux/DocxFormatLib/CMakeLists.txt +++ b/OOXML/Projects/Linux/DocxFormatLib/CMakeLists.txt @@ -378,22 +378,26 @@ add_library(DocxFormatLib STATIC set_default_options(DocxFormatLib) +if( MSVC ) + target_compile_definitions( DocxFormatLib PRIVATE + _UNICODE + UNICODE + ) +endif() + target_precompile_headers(DocxFormatLib PRIVATE precompiled.h ) -if(LINUX) +if(UNIX) target_compile_options(DocxFormatLib PRIVATE -include cfloat + # Re-enable exporting symbols + -fvisibility=default + -fvisibility-inlines-hidden ) endif() -# Re-enable exporting symbols -target_compile_options(DocxFormatLib PRIVATE - -fvisibility=default - -fvisibility-inlines-hidden -) - target_link_libraries(DocxFormatLib PRIVATE Boost::system Boost::filesystem diff --git a/OOXML/Projects/Linux/PPTXFormatLib/CMakeLists.txt b/OOXML/Projects/Linux/PPTXFormatLib/CMakeLists.txt index 9d17836931..f00db21ea9 100644 --- a/OOXML/Projects/Linux/PPTXFormatLib/CMakeLists.txt +++ b/OOXML/Projects/Linux/PPTXFormatLib/CMakeLists.txt @@ -1268,6 +1268,13 @@ add_library(PPTXFormatLib STATIC set_default_options(PPTXFormatLib) +if( MSVC ) + target_compile_definitions( PPTXFormatLib PRIVATE + _UNICODE + UNICODE + ) +endif() + target_compile_definitions(PPTXFormatLib PRIVATE AVS_USE_CONVERT_PPTX_TOCUSTOM_VML ) diff --git a/OOXML/Projects/Linux/XlsbFormatLib/CMakeLists.txt b/OOXML/Projects/Linux/XlsbFormatLib/CMakeLists.txt index 66b162abd1..4714e812cb 100644 --- a/OOXML/Projects/Linux/XlsbFormatLib/CMakeLists.txt +++ b/OOXML/Projects/Linux/XlsbFormatLib/CMakeLists.txt @@ -2151,6 +2151,13 @@ add_library(XlsbFormatLib STATIC set_default_options(XlsbFormatLib) +if( MSVC ) + target_compile_definitions( XlsbFormatLib PRIVATE + _UNICODE + UNICODE + ) +endif() + target_precompile_headers(XlsbFormatLib PRIVATE precompiled.h ) diff --git a/OdfFile/Projects/Linux/CMakeLists.txt b/OdfFile/Projects/Linux/CMakeLists.txt index cc4f2498e1..29e58ace4a 100644 --- a/OdfFile/Projects/Linux/CMakeLists.txt +++ b/OdfFile/Projects/Linux/CMakeLists.txt @@ -468,6 +468,13 @@ add_library(OdfFormatLib STATIC set_default_options(OdfFormatLib) +if( MSVC ) + target_compile_definitions( OdfFormatLib PRIVATE + _UNICODE + UNICODE + ) +endif() + target_include_directories(OdfFormatLib PRIVATE ${ODF_FILE_ROOT_DIR}/Common ) diff --git a/PdfFile/CMakeLists.txt b/PdfFile/CMakeLists.txt index e71a1c4495..60a10b4f2e 100644 --- a/PdfFile/CMakeLists.txt +++ b/PdfFile/CMakeLists.txt @@ -496,20 +496,15 @@ if(ANDROID) ) endif() -if(WIN32) - target_compile_options(PdfFile PRIVATE - -UUNICODE - -U_UNICODE - ) -endif() +# if(WIN32) +# target_compile_options(PdfFile PRIVATE +# -UUNICODE +# -U_UNICODE +# ) +# endif() -# static libs target_link_libraries(PdfFile PUBLIC CryptoPPLib -) - -# dynamic libs -target_link_libraries(PdfFile PUBLIC graphics kernel UnicodeConverter diff --git a/RtfFile/Projects/Linux/CMakeLists.txt b/RtfFile/Projects/Linux/CMakeLists.txt index 23e4bffa5f..9dd6d4a6fb 100644 --- a/RtfFile/Projects/Linux/CMakeLists.txt +++ b/RtfFile/Projects/Linux/CMakeLists.txt @@ -176,6 +176,13 @@ add_library(RtfFormatLib STATIC set_default_options(RtfFormatLib) +if( MSVC ) + target_compile_definitions( RtfFormatLib PRIVATE + _UNICODE + UNICODE + ) +endif() + target_compile_definitions(RtfFormatLib PRIVATE AVS_USE_CONVERT_PPTX_TOCUSTOM_VML ) diff --git a/TxtFile/Projects/Linux/CMakeLists.txt b/TxtFile/Projects/Linux/CMakeLists.txt index 8b99ab763e..adb609f2ea 100644 --- a/TxtFile/Projects/Linux/CMakeLists.txt +++ b/TxtFile/Projects/Linux/CMakeLists.txt @@ -28,6 +28,13 @@ add_library(TxtXmlFormatLib STATIC set_default_options(TxtXmlFormatLib) +if( MSVC ) + target_compile_definitions( TxtXmlFormatLib PRIVATE + _UNICODE + UNICODE + ) +endif() + target_link_libraries(TxtXmlFormatLib PRIVATE Boost::system Boost::filesystem diff --git a/UnicodeConverter/CMakeLists.txt b/UnicodeConverter/CMakeLists.txt index 5732df8af0..599d4683c4 100644 --- a/UnicodeConverter/CMakeLists.txt +++ b/UnicodeConverter/CMakeLists.txt @@ -2,10 +2,10 @@ cmake_minimum_required(VERSION 3.10) set(CORE_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/..") -include(${CORE_ROOT_DIR}/common.cmake) - project(UnicodeConverter) +include(${CORE_ROOT_DIR}/common.cmake) + add_library(UnicodeConverter SHARED UnicodeConverter.cpp UnicodeConverter.h diff --git a/msvc_fix.h b/msvc_fix.h index 0cfcb2143d..a96e8f4ef3 100644 --- a/msvc_fix.h +++ b/msvc_fix.h @@ -1,5 +1,4 @@ #ifdef _WIN32 -#define WIN32_LEAN_AND_MEAN # include # include /* Undef Windows API macros that conflict with FontFile.cpp */ From 4017ebc1adacabf90ef87709bb821ce87cde44fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Sat, 16 May 2026 18:42:07 +0200 Subject: [PATCH 54/80] fix(msvc): Big cleanup pt2 --- Common/3dParty/v8/nc-build.py | 19 ++++- Common/Network/CMakeLists.txt | 18 +---- DesktopEditor/doctrenderer/CMakeLists.txt | 39 +++++++--- DesktopEditor/xmlsec/src/CMakeLists.txt | 77 ++++++++----------- DocxRenderer/CMakeLists.txt | 8 +- HtmlFile2/CMakeLists.txt | 7 ++ HwpFile/CMakeLists.txt | 10 +-- .../Converter/StarMath2OOXML/CMakeLists.txt | 59 +++++--------- X2tConverter/build/cmake/CMakeLists.txt | 11 ++- .../build/cmake/library/CMakeLists.txt | 50 ++++++------ common.cmake | 34 ++++++-- msvc_fix.h | 4 + 12 files changed, 183 insertions(+), 153 deletions(-) diff --git a/Common/3dParty/v8/nc-build.py b/Common/3dParty/v8/nc-build.py index fc8dc2e108..f5b573fbea 100644 --- a/Common/3dParty/v8/nc-build.py +++ b/Common/3dParty/v8/nc-build.py @@ -381,6 +381,12 @@ def build_and_install(): depot_env["PATH"] = f"{depot_tools_path}{os.pathsep}" + depot_env["PATH"] depot_env["GCLIENT_SUPPRESS_GIT_VERSION_WARNING"] = "1" depot_env["GYP_CHROMIUM_NO_ACTION"] = "1" + depot_env["DEPOT_TOOLS_WIN_TOOLCHAIN"] = "0" + + if nc.is_windows(): + fake_pipes_shim_path = create_fake_pipes_shim() + depot_env[ "PYTHONPATH" ] = str( fake_pipes_shim_path ) + # Since I'm patching v8/build, I need to reset it before sync (if already exists) if ( v8_src_path / "build" ).is_dir(): @@ -389,7 +395,7 @@ def build_and_install(): "Hard reset v8/build", v8_src_path / "build" ) - + if nc.is_linux() or nc.is_windows(): if nc.is_linux(): nc.run_command( @@ -399,6 +405,7 @@ def build_and_install(): env = depot_env, ) else: # win + nc.run_command( [ "cmd.exe", "/c", "gclient.bat", "sync", "--no-history", "--shallow" ], "GClient sync", @@ -438,7 +445,7 @@ def build_and_install(): print( "Running gn gen" ) gn_rt_env = { "PYTHONPATH": "" } if nc.is_windows(): - gn_rt_env[ "PYTHONPATH" ] = str( create_fake_pipes_shim() ) + gn_rt_env[ "PYTHONPATH" ] = str( fake_pipes_shim_path ) gn_rt_env[ "DEPOT_TOOLS_WIN_TOOLCHAIN" ] = "0" gn_rt_env[ "vs2022_install" ] = str( Path( os.environ[ "VSINSTALLDIR" ] ) ) @@ -458,14 +465,18 @@ def build_and_install(): nc.abort_op( f"Tool not found: {tool}" ) job_count = max( os.cpu_count() or 1, 4 ) # at least 4 jobs + if nc.is_windows(): + # On Windows, MSVC is more likely to run out of memory if it uses too many workers. TODO: Maybe we could set an optimal job count based on free memory and cpu core count. + job_count = 4 print( "Building v8" ) env = { "CC": "clang", "CXX": "clang++" } if nc.is_linux() else { - "CXXFLAGS": "/FIstring", - "CFLAGS": "/FIstring", + # "CXXFLAGS": "/FIstring /Zm300", + # "CFLAGS": "/FIstring /Zm300", + "CL": "/FIstring /Zm300", } nc.run_command( [ "ninja", "-C", output_path, f"-j{job_count}", "v8_monolith" ], diff --git a/Common/Network/CMakeLists.txt b/Common/Network/CMakeLists.txt index 00cbaceedc..e0f851794d 100644 --- a/Common/Network/CMakeLists.txt +++ b/Common/Network/CMakeLists.txt @@ -10,9 +10,6 @@ if(NOT TARGET kernel) add_subdirectory(${CORE_ROOT_DIR}/Common kernel) endif() -set(OPENSSL_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/openssl") -get_filename_component(OPENSSL_INSTALL_DIR_ABS "${OPENSSL_INSTALL_DIR}" ABSOLUTE) - set(SOCKETIO_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/socketio") get_filename_component(SOCKETIO_INSTALL_DIR_ABS "${SOCKETIO_INSTALL_DIR}" ABSOLUTE) @@ -108,17 +105,10 @@ target_include_directories(kernel_network PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/FileTransporter ) -if( MSVC ) - target_link_libraries(kernel_network PRIVATE - ${OPENSSL_INSTALL_DIR_ABS}/lib/libssl.lib - ${OPENSSL_INSTALL_DIR_ABS}/lib/libcrypto.lib - ) -else() - target_link_libraries(kernel_network PRIVATE - ${OPENSSL_INSTALL_DIR_ABS}/lib/libssl.a - ${OPENSSL_INSTALL_DIR_ABS}/lib/libcrypto.a - ) -endif() +target_link_libraries(kernel_network PRIVATE + ${OPENSSL_LIBSSL} + ${OPENSSL_LIBCRYPTO} +) target_link_libraries(kernel_network PUBLIC kernel diff --git a/DesktopEditor/doctrenderer/CMakeLists.txt b/DesktopEditor/doctrenderer/CMakeLists.txt index 820e20e452..32637d3f7b 100644 --- a/DesktopEditor/doctrenderer/CMakeLists.txt +++ b/DesktopEditor/doctrenderer/CMakeLists.txt @@ -56,12 +56,6 @@ if(DRAWINGFILE_SUPPORT) endif() endif() -set(OPENSSL_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/openssl") -get_filename_component(OPENSSL_INSTALL_DIR_ABS "${OPENSSL_INSTALL_DIR}" ABSOLUTE) - -set(V8_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/v8") -get_filename_component(V8_INSTALL_DIR_ABS "${V8_INSTALL_DIR}" ABSOLUTE) - add_library(doctrenderer SHARED ${CMAKE_CURRENT_SOURCE_DIR}/docbuilder_p.cpp ${CMAKE_CURRENT_SOURCE_DIR}/docbuilder.cpp @@ -122,6 +116,17 @@ add_library(doctrenderer SHARED set_default_options(doctrenderer) +if( MSVC ) + target_compile_definitions( doctrenderer PRIVATE + _UNICODE + UNICODE + ) + + target_precompile_headers(doctrenderer PRIVATE + ${CORE_ROOT_DIR}/msvc_fix.h + ) +endif() + if(USE_JAVASCRIPT_CORE) target_sources(doctrenderer PRIVATE ${DESKTOP_EDITOR_ROOT}/common/Mac/NSString+StringUtils.mm @@ -269,18 +274,26 @@ target_link_libraries(doctrenderer INTERFACE ) target_link_libraries(doctrenderer PRIVATE - ${OPENSSL_INSTALL_DIR_ABS}/lib/libssl.a - ${OPENSSL_INSTALL_DIR_ABS}/lib/libcrypto.a + ${OPENSSL_LIBSSL} + ${OPENSSL_LIBCRYPTO} + ${V8_MONILITH} ) target_link_libraries(doctrenderer PUBLIC - ${V8_INSTALL_DIR_ABS}/libv8_monolith.a graphics kernel UnicodeConverter kernel_network ) +if( MSVC ) + target_link_libraries(doctrenderer PUBLIC + Rpcrt4 + Winmm + Dbghelp + ) +endif() + if(DRAWINGFILE_SUPPORT) target_link_libraries(doctrenderer PUBLIC PdfFile @@ -290,9 +303,11 @@ if(DRAWINGFILE_SUPPORT) ) endif() -target_link_libraries(doctrenderer PUBLIC - pthread -) +if( UNIX ) + target_link_libraries(doctrenderer PUBLIC + pthread + ) +endif() copy_artifacts_to_folder("doctrenderer" "${EO_CORE_OUTPUT_DIR}") diff --git a/DesktopEditor/xmlsec/src/CMakeLists.txt b/DesktopEditor/xmlsec/src/CMakeLists.txt index 7cc7ad7657..9721b86620 100644 --- a/DesktopEditor/xmlsec/src/CMakeLists.txt +++ b/DesktopEditor/xmlsec/src/CMakeLists.txt @@ -1,31 +1,19 @@ cmake_minimum_required(VERSION 3.10) + project(ooxmlsignature VERSION 1) -# Custom option to replace the `support_oform` scope option(SUPPORT_OFORM "Enable OFORM support" OFF) set(CORE_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../..") include(${CORE_ROOT_DIR}/common.cmake) -# Ensure Qt core and gui are NOT included automatically if using a Qt-aware environment -# (In CMake, you simply don't call find_package(Qt...) if you don't need it) - -# Remove UNICODE definition if it was inherited from directory properties -remove_definitions(-DUNICODE -D_UNICODE) - -# TEMPLATE = lib, CONFIG += shared plugin -# In CMake, MODULE is often used for plugins loaded at runtime, but SHARED is standard -# for dynamic libraries linked at compile time. add_library(ooxmlsignature SHARED) if(NOT TARGET kernel) add_subdirectory(${CORE_ROOT_DIR}/Common kernel) endif() -set(OPENSSL_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/openssl") -get_filename_component(OPENSSL_INSTALL_DIR_ABS "${OPENSSL_INSTALL_DIR}" ABSOLUTE) - # Set target version set_target_properties(ooxmlsignature PROPERTIES VERSION ${PROJECT_VERSION} @@ -34,65 +22,60 @@ set_target_properties(ooxmlsignature PROPERTIES # HEADERS and SOURCES target_sources(ooxmlsignature PRIVATE - include/Certificate.h - include/CertificateCommon.h - include/OOXMLSigner.h - include/OOXMLVerifier.h - #src/XmlCanonicalizator.h - src/XmlRels.h - src/XmlTransform.h - src/common.h - src/XmlTransform.cpp - src/CertificateCommon.cpp - src/OOXMLSigner.cpp - src/OOXMLVerifier.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/include/Certificate.h + ${CMAKE_CURRENT_SOURCE_DIR}/include/CertificateCommon.h + ${CMAKE_CURRENT_SOURCE_DIR}/include/OOXMLSigner.h + ${CMAKE_CURRENT_SOURCE_DIR}/include/OOXMLVerifier.h + # ${CMAKE_CURRENT_SOURCE_DIR}/src/XmlCanonicalizator.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/XmlRels.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/XmlTransform.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/common.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/Certificate_openssl.h + + ${CMAKE_CURRENT_SOURCE_DIR}/src/XmlTransform.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/CertificateCommon.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/OOXMLSigner.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/OOXMLVerifier.cpp - # Global Openssl header - src/Certificate_openssl.h ) -# Add include directories so the compiler can find the headers target_include_directories(ooxmlsignature PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/src ${OPENSSL_INSTALL_DIR}/include ) -target_link_libraries(ooxmlsignature PRIVATE - ${OPENSSL_INSTALL_DIR_ABS}/lib/libssl.a - ${OPENSSL_INSTALL_DIR_ABS}/lib/libcrypto.a -) - -# Global Defines target_compile_definitions(ooxmlsignature PRIVATE SUPPORT_OPENSSL + COMMON_OPENSSL_BUILDING ) -# ADD_DEPENDENCY(kernel) -# Replaces your custom kernel dependency. -# Assumes 'kernel' is another CMake target defined elsewhere in your project. -target_link_libraries(ooxmlsignature PRIVATE kernel) +if( UNIX ) + remove_definitions(-DUNICODE -D_UNICODE) +endif() +target_link_libraries(ooxmlsignature PRIVATE + ${OPENSSL_LIBSSL} + ${OPENSSL_LIBCRYPTO} + kernel +) -# core_windows { ... } if(WIN32) target_compile_definitions(ooxmlsignature PRIVATE SUPPORT_MS_CRYPTO) target_sources(ooxmlsignature PRIVATE src/Certificate_mscrypto.h) - # LIBS += -lcrypt32 -lcryptui -lAdvapi32 -lws2_32 -lUser32 target_link_libraries(ooxmlsignature PRIVATE - crypt32 - cryptui - advapi32 - ws2_32 - user32 + Crypt32 + Cryptui + Advapi32 + Ws2_32 + User32 ) endif() -# support_oform { ... } if(SUPPORT_OFORM) target_compile_definitions(ooxmlsignature PRIVATE SUPPORT_OFORM) - target_sources(ooxmlsignature PRIVATE src/Certificate_oform.h) + target_sources(ooxmlsignature PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/Certificate_oform.h) endif() copy_artifacts_to_folder("ooxmlsignature" "${EO_CORE_OUTPUT_DIR}") diff --git a/DocxRenderer/CMakeLists.txt b/DocxRenderer/CMakeLists.txt index 5e051a9935..d78b93e538 100644 --- a/DocxRenderer/CMakeLists.txt +++ b/DocxRenderer/CMakeLists.txt @@ -91,10 +91,10 @@ target_link_libraries(DocxRenderer PUBLIC if(WIN32) target_link_libraries(DocxRenderer PUBLIC - gdi32 - advapi32 - user32 - shell32 + Gdi32 + Advapi32 + User32 + Shell32 ) endif() diff --git a/HtmlFile2/CMakeLists.txt b/HtmlFile2/CMakeLists.txt index b2e4715511..3cf1ba688d 100644 --- a/HtmlFile2/CMakeLists.txt +++ b/HtmlFile2/CMakeLists.txt @@ -165,6 +165,13 @@ target_include_directories(HtmlFile2 PRIVATE ${KATANA_INSTALL_DIR_ABS}/src ) +if( MSVC ) + target_include_directories(HtmlFile2 PRIVATE + ${KATANA_INSTALL_DIR_ABS}/visualc/include + ${GUMBO_INSTALL_DIR}/visualc/include + ) +endif() + target_compile_definitions(HtmlFile2 PRIVATE HTMLFILE2_USE_DYNAMIC_LIBRARY CSSCALCULATOR_LIBRARY_STATIC diff --git a/HwpFile/CMakeLists.txt b/HwpFile/CMakeLists.txt index 38e7c603b4..f0e87ec242 100644 --- a/HwpFile/CMakeLists.txt +++ b/HwpFile/CMakeLists.txt @@ -22,6 +22,10 @@ if(NOT TARGET graphics) add_subdirectory(${CORE_ROOT_DIR}/DesktopEditor/graphics/cmake graphics) endif() +if(NOT TARGET StarMathConverter) + add_subdirectory(${CORE_ROOT_DIR}/OdfFile/Reader/Converter/StarMath2OOXML StarMathConverter) +endif() + add_library(HWPFile SHARED ${CMAKE_CURRENT_SOURCE_DIR}/HwpDoc/Common/WriterContext.cpp ${CMAKE_CURRENT_SOURCE_DIR}/HwpDoc/Common/XMLReader.cpp @@ -201,16 +205,12 @@ target_compile_definitions(HWPFile PRIVATE CRYPTOPP_DISABLE_ASM ) -# static libs target_link_libraries(HWPFile PUBLIC CryptoPPLib -) - -# shared libs -target_link_libraries(HWPFile PUBLIC kernel UnicodeConverter graphics + StarMathConverter ) copy_artifacts_to_folder("HWPFile" "${EO_CORE_OUTPUT_DIR}") diff --git a/OdfFile/Reader/Converter/StarMath2OOXML/CMakeLists.txt b/OdfFile/Reader/Converter/StarMath2OOXML/CMakeLists.txt index b7f5f43249..929b312cfd 100644 --- a/OdfFile/Reader/Converter/StarMath2OOXML/CMakeLists.txt +++ b/OdfFile/Reader/Converter/StarMath2OOXML/CMakeLists.txt @@ -5,15 +5,6 @@ set(CORE_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../..") include(${CORE_ROOT_DIR}/common.cmake) -# Ensure Qt core and gui are NOT included automatically if using a Qt-aware environment -# (In CMake, you simply don't call find_package(Qt...) if you don't need it) - -# Remove UNICODE definition if it was inherited from directory properties -remove_definitions(-DUNICODE -D_UNICODE) - -# TEMPLATE = lib, CONFIG += shared plugin -# In CMake, MODULE is often used for plugins loaded at runtime, but SHARED is standard -# for dynamic libraries linked at compile time. add_library(StarMathConverter SHARED) if(NOT TARGET kernel) @@ -28,26 +19,24 @@ set_target_properties(StarMathConverter PROPERTIES # HEADERS and SOURCES target_sources(StarMathConverter PRIVATE - cconversionsmtoooxml.cpp - ${CORE_ROOT_DIR}/OOXML/Base/Unit.cpp - conversionmathformula.cpp - cstarmathpars.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/conversionmathformula.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/cconversionsmtoooxml.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/cstarmathpars.cpp - TextDirection.h - cconversionsmtoooxml.h + ${CMAKE_CURRENT_SOURCE_DIR}/conversionmathformula.h + ${CMAKE_CURRENT_SOURCE_DIR}/cconversionsmtoooxml.h + ${CMAKE_CURRENT_SOURCE_DIR}/cstarmathpars.h + ${CMAKE_CURRENT_SOURCE_DIR}/fontType.h + ${CMAKE_CURRENT_SOURCE_DIR}/TextDirection.h + ${CMAKE_CURRENT_SOURCE_DIR}/TFormulaSize.h + ${CMAKE_CURRENT_SOURCE_DIR}/typeConversion.h + ${CMAKE_CURRENT_SOURCE_DIR}/typeselements.h + + ${CORE_ROOT_DIR}/OOXML/Base/Unit.cpp + ${CORE_ROOT_DIR}/OOXML/Base/Unit.h - conversionmathformula.h - cstarmathpars.h - fontType.h - typeConversion.h - typeselements.h - TFormulaSize.h ) - -# ADD_DEPENDENCY(kernel) -# Replaces your custom kernel dependency. -# Assumes 'kernel' is another CMake target defined elsewhere in your project. target_link_libraries(StarMathConverter PRIVATE Boost::system Boost::filesystem @@ -56,19 +45,13 @@ target_link_libraries(StarMathConverter PRIVATE kernel ) -# core_windows { ... } -if(WIN32) - target_compile_definitions(StarMathConverter PRIVATE SUPPORT_MS_CRYPTO) - target_sources(StarMathConverter PRIVATE src/Certificate_mscrypto.h) - - # LIBS += -lcrypt32 -lcryptui -lAdvapi32 -lws2_32 -lUser32 - target_link_libraries(StarMathConverter PRIVATE - crypt32 - cryptui - advapi32 - ws2_32 - user32 - ) +target_compile_definitions(StarMathConverter PRIVATE + STARMATH_USE_DYNAMIC_LIBRARY +) + +if( UNIX ) + # Remove UNICODE definition if it was inherited from directory properties + remove_definitions(-DUNICODE -D_UNICODE) endif() copy_artifacts_to_folder("StarMathConverter" "${EO_CORE_OUTPUT_DIR}") diff --git a/X2tConverter/build/cmake/CMakeLists.txt b/X2tConverter/build/cmake/CMakeLists.txt index 4fd91ee4c1..195299189d 100644 --- a/X2tConverter/build/cmake/CMakeLists.txt +++ b/X2tConverter/build/cmake/CMakeLists.txt @@ -11,7 +11,7 @@ find_package(Boost REQUIRED COMPONENTS system filesystem regex date_time) set(X2T_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/../..") -add_subdirectory(library) +add_subdirectory(library x2tlib) add_executable(x2t ${X2T_ROOT_DIR}/src/main.cpp @@ -19,7 +19,14 @@ add_executable(x2t set_default_options(x2t) -# dynamic libs +if( MSVC ) + target_compile_definitions(x2t PRIVATE + _RWSTD_NO_SETRLIMIT + _UNICODE + UNICODE + ) +endif() + target_link_libraries(x2t PRIVATE x2tlib ) diff --git a/X2tConverter/build/cmake/library/CMakeLists.txt b/X2tConverter/build/cmake/library/CMakeLists.txt index a58292ba45..a13d37dee5 100644 --- a/X2tConverter/build/cmake/library/CMakeLists.txt +++ b/X2tConverter/build/cmake/library/CMakeLists.txt @@ -124,17 +124,15 @@ if(NOT TARGET ooxmlsignature) add_subdirectory(${CORE_ROOT_DIR}/DesktopEditor/xmlsec/src ooxmlsignature) endif() -set(ICU_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu") -set(ICU_MAJOR_VER "74") -set(ICU_MINOR_VER "2") -get_filename_component(ICU_INSTALL_DIR_ABS "${ICU_INSTALL_DIR}" ABSOLUTE) - add_library(x2tlib SHARED ${CORE_ROOT_DIR}/Common/OfficeFileFormatChecker2.cpp + ${CORE_ROOT_DIR}/OOXML/Base/Unit.cpp + ${X2T_ROOT_DIR}/src/cextracttools.cpp ${X2T_ROOT_DIR}/src/ASCConverters.cpp ${CORE_ROOT_DIR}/Common/OfficeFileFormatChecker.h + ${X2T_ROOT_DIR}/src/ASCConverters.h ${X2T_ROOT_DIR}/src/cextracttools.h ${X2T_ROOT_DIR}/src/lib/common.h @@ -159,18 +157,17 @@ add_library(x2tlib SHARED set_default_options(x2tlib) +if( MSVC ) + target_compile_definitions( x2tlib PRIVATE + _UNICODE + UNICODE + ) +endif() + target_compile_definitions(x2tlib PRIVATE FILTER_FLATE_DECODE_ENABLED AVS_USE_CONVERT_PPTX_TOCUSTOM_VML - PDFFILE_USE_DYNAMIC_LIBRARY - XPS_USE_DYNAMIC_LIBRARY - OFD_USE_DYNAMIC_LIBRARY - DJVU_USE_DYNAMIC_LIBRARY - HTMLFILE_USE_DYNAMIC_LIBRARY - UNICODECONVERTER_USE_DYNAMIC_LIBRARY FILE_FORMAT_CHECKER_WITH_MACRO - KERNEL_USE_DYNAMIC_LIBRARY - GRAPHICS_USE_DYNAMIC_LIBRARY BUILD_X2T_AS_LIBRARY_DYLIB ) @@ -180,14 +177,22 @@ target_include_directories(x2tlib PRIVATE ${CORE_ROOT_DIR}/OOXML/Binary/Document ${CORE_ROOT_DIR}/OOXML/Binary/Presentation ${CORE_ROOT_DIR}/OfficeUtils/src - ${ICU_INSTALL_DIR}/include + ${ICU_INSTALL_DIR_ABS}/include ) -# Re-enable exporting symbols -target_compile_options(x2tlib PRIVATE - -fvisibility=default - -fvisibility-inlines-hidden -) +if( UNIX ) + # Re-enable exporting symbols + target_compile_options(x2tlib PRIVATE + -fvisibility=default + -fvisibility-inlines-hidden + ) +endif() + +if( MSVC ) + set_target_properties(x2tlib PROPERTIES + WINDOWS_EXPORT_ALL_SYMBOLS ON + ) +endif() # static libs target_link_libraries(x2tlib PRIVATE @@ -225,17 +230,18 @@ target_link_libraries(x2tlib PUBLIC HWPFile StarMathConverter ooxmlsignature + Boost::system Boost::filesystem Boost::regex Boost::date_time - ${ICU_INSTALL_DIR_ABS}/lib/libicuuc.so.${ICU_MAJOR_VER} - ${ICU_INSTALL_DIR_ABS}/lib/libicudata.so.${ICU_MAJOR_VER} + + ${LIBICUUC} + ${LIBICUDATA} ) set_property(TARGET x2tlib PROPERTY POSITION_INDEPENDENT_CODE ON) copy_artifacts_to_folder("x2tlib" "${EO_CORE_OUTPUT_DIR}") -copy_icu_libs(x2tlib) declare_victory( x2tlib ) diff --git a/common.cmake b/common.cmake index bfd39f9013..49131e3292 100644 --- a/common.cmake +++ b/common.cmake @@ -6,10 +6,6 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) -if( WIN32 ) - set( MSVC TRUE ) -endif() - cmake_path( APPEND DEFAULT_EO_CORE_OUTPUT_DIR "${CMAKE_BINARY_DIR}" "package" ) cmake_path( APPEND DEFAULT_EO_CORE_TOOLS_DIR "${CMAKE_BINARY_DIR}" "package" ) @@ -66,7 +62,14 @@ if(NOT THIRD_PARTY_PREPARED) endif() endif() +if(MSVC) + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>" CACHE STRING "" FORCE) + foreach(flag_var CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_RELEASE CMAKE_C_FLAGS CMAKE_C_FLAGS_RELEASE) + string(REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") + endforeach() +endif() +# Setup icu # These version numbers don't affect what build_3rdparty.py builds. They just have to match. set(ICU_MAJOR_VER "74") set(ICU_MINOR_VER "2") @@ -80,7 +83,7 @@ else() set(LIBICUDATA "${ICU_INSTALL_DIR_ABS}/lib/libicudata.so.${ICU_MAJOR_VER}") endif() -# Ensure boost +# Setup boost set( BOOST_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/boost" ) get_filename_component(BOOST_INSTALL_DIR_ABS "${BOOST_INSTALL_DIR}" ABSOLUTE) set( CMAKE_PREFIX_PATH "${BOOST_INSTALL_DIR_ABS}" ) @@ -88,6 +91,26 @@ include_directories( "${BOOST_INSTALL_DIR_ABS}/include" ) set(Boost_USE_STATIC_LIBS ON) find_package( Boost REQUIRED COMPONENTS system filesystem regex date_time ) +# Setup v8 +set(V8_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/v8") +get_filename_component(V8_INSTALL_DIR_ABS "${V8_INSTALL_DIR}" ABSOLUTE) +if( MSVC ) + set(V8_MONILITH "${V8_INSTALL_DIR_ABS}/v8_monolith.lib") +else() + set(V8_MONILITH "${V8_INSTALL_DIR_ABS}/libv8_monolith.a") +endif() + +# Setup openssl +set(OPENSSL_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/openssl") +get_filename_component(OPENSSL_INSTALL_DIR_ABS "${OPENSSL_INSTALL_DIR}" ABSOLUTE) +if( MSVC ) + set(OPENSSL_LIBSSL "${OPENSSL_INSTALL_DIR_ABS}/lib/libssl.lib") + set(OPENSSL_LIBCRYPTO "${OPENSSL_INSTALL_DIR_ABS}/lib/libcrypto.lib") +else() + set(OPENSSL_LIBSSL "${OPENSSL_INSTALL_DIR_ABS}/lib/libssl.a") + set(OPENSSL_LIBCRYPTO "${OPENSSL_INSTALL_DIR_ABS}/lib/libcrypto.a") +endif() + # Do NOT auto-add absolute link directories to RPATH set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE) @@ -162,6 +185,7 @@ if( MSVC ) set(COMMON_LINK_OPTIONS ) + else() diff --git a/msvc_fix.h b/msvc_fix.h index a96e8f4ef3..0bcfd63cf3 100644 --- a/msvc_fix.h +++ b/msvc_fix.h @@ -5,4 +5,8 @@ # ifdef GetCharWidth # undef GetCharWidth # endif +/* Undef Windows API macros that conflict with docbuilder_p.cpp */ +# ifdef CreateFile +# undef CreateFile +# endif #endif From 9bfdbfbc615e7a24c1a43d447d6235eb9288b287 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Sat, 16 May 2026 21:05:19 +0200 Subject: [PATCH 55/80] fix(msvc): Big cleanup pt3 --- DesktopEditor/AllFontsGen/CMakeLists.txt | 16 +++------------- DesktopEditor/allthemesgen/CMakeLists.txt | 15 +++------------ .../doctrenderer/app_builder/CMakeLists.txt | 19 ++++++++++++------- DesktopEditor/pluginsmanager/CMakeLists.txt | 10 +++------- PdfFile/Resources/CMapMemory/CMakeLists.txt | 6 ++---- Test/Applications/x2tTester/CMakeLists.txt | 14 +++++++++++--- 6 files changed, 34 insertions(+), 46 deletions(-) diff --git a/DesktopEditor/AllFontsGen/CMakeLists.txt b/DesktopEditor/AllFontsGen/CMakeLists.txt index bcca35fb30..1fdb053ea0 100644 --- a/DesktopEditor/AllFontsGen/CMakeLists.txt +++ b/DesktopEditor/AllFontsGen/CMakeLists.txt @@ -18,9 +18,6 @@ if(NOT TARGET graphics) add_subdirectory(${CORE_ROOT_DIR}/DesktopEditor/graphics/cmake graphics) endif() -set(ICU_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu") -get_filename_component(ICU_INSTALL_DIR_ABS "${ICU_INSTALL_DIR}" ABSOLUTE) - add_executable(allfontsgen ${CMAKE_CURRENT_LIST_DIR}/main.cpp ) @@ -28,24 +25,17 @@ add_executable(allfontsgen set_default_options(allfontsgen) target_include_directories(allfontsgen PRIVATE - ${ICU_INSTALL_DIR}/include -) - - -target_compile_definitions(allfontsgen PRIVATE - KERNEL_USE_DYNAMIC_LIBRARY - GRAPHICS_USE_DYNAMIC_LIBRARY + ${ICU_INSTALL_DIR_ABS}/include ) target_link_libraries(allfontsgen PUBLIC UnicodeConverter kernel graphics - ${ICU_INSTALL_DIR_ABS}/lib/libicuuc.so.${ICU_MAJOR_VER} - ${ICU_INSTALL_DIR_ABS}/lib/libicudata.so.${ICU_MAJOR_VER} + ${LIBICUUC} + ${LIBICUDATA} ) copy_artifacts_to_folder("allfontsgen" "${EO_CORE_TOOLS_DIR}") -copy_icu_libs(allfontsgen) declare_victory( allfontsgen ) diff --git a/DesktopEditor/allthemesgen/CMakeLists.txt b/DesktopEditor/allthemesgen/CMakeLists.txt index 6095c08e98..e76883e435 100644 --- a/DesktopEditor/allthemesgen/CMakeLists.txt +++ b/DesktopEditor/allthemesgen/CMakeLists.txt @@ -42,9 +42,6 @@ if(NOT TARGET DocxRenderer) add_subdirectory(${CORE_ROOT_DIR}/DocxRenderer DocxRenderer) endif() -set(ICU_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu") -get_filename_component(ICU_INSTALL_DIR_ABS "${ICU_INSTALL_DIR}" ABSOLUTE) - add_executable(allthemesgen ${CMAKE_CURRENT_LIST_DIR}/main.cpp ) @@ -52,12 +49,7 @@ add_executable(allthemesgen set_default_options(allthemesgen) target_include_directories(allthemesgen PRIVATE - ${ICU_INSTALL_DIR}/include -) - -target_compile_definitions(allthemesgen PRIVATE - KERNEL_USE_DYNAMIC_LIBRARY - GRAPHICS_USE_DYNAMIC_LIBRARY + ${ICU_INSTALL_DIR_ABS}/include ) target_link_libraries(allthemesgen PUBLIC @@ -70,11 +62,10 @@ target_link_libraries(allthemesgen PUBLIC XpsFile DjVuFile DocxRenderer - ${ICU_INSTALL_DIR_ABS}/lib/libicuuc.so.${ICU_MAJOR_VER} - ${ICU_INSTALL_DIR_ABS}/lib/libicudata.so.${ICU_MAJOR_VER} + ${LIBICUUC} + ${LIBICUDATA} ) copy_artifacts_to_folder("allthemesgen" "${EO_CORE_TOOLS_DIR}") -copy_icu_libs(allthemesgen) declare_victory( allthemesgen ) diff --git a/DesktopEditor/doctrenderer/app_builder/CMakeLists.txt b/DesktopEditor/doctrenderer/app_builder/CMakeLists.txt index ba892cc1f0..e44ec86ecb 100644 --- a/DesktopEditor/doctrenderer/app_builder/CMakeLists.txt +++ b/DesktopEditor/doctrenderer/app_builder/CMakeLists.txt @@ -42,9 +42,6 @@ if(NOT TARGET DocxRenderer) add_subdirectory(${CORE_ROOT_DIR}/DocxRenderer DocxRenderer) endif() -set(ICU_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu") -get_filename_component(ICU_INSTALL_DIR_ABS "${ICU_INSTALL_DIR}" ABSOLUTE) - add_executable(docbuilder ${CMAKE_CURRENT_LIST_DIR}/main.cpp ) @@ -61,12 +58,20 @@ target_link_libraries(docbuilder PUBLIC XpsFile DjVuFile DocxRenderer - ${ICU_INSTALL_DIR_ABS}/lib/libicuuc.so.${ICU_MAJOR_VER} - ${ICU_INSTALL_DIR_ABS}/lib/libicudata.so.${ICU_MAJOR_VER} - dl + ${LIBICUUC} + ${LIBICUDATA} ) +if( MSVC ) + target_link_libraries(docbuilder PUBLIC + Kernel32 + ) +elseif( UNIX ) + target_link_libraries(docbuilder PUBLIC + dl + ) +endif() + copy_artifacts_to_folder("docbuilder" "${EO_CORE_OUTPUT_DIR}") -copy_icu_libs(docbuilder) declare_victory( docbuilder ) diff --git a/DesktopEditor/pluginsmanager/CMakeLists.txt b/DesktopEditor/pluginsmanager/CMakeLists.txt index 89ffd958bd..6d8d89526a 100644 --- a/DesktopEditor/pluginsmanager/CMakeLists.txt +++ b/DesktopEditor/pluginsmanager/CMakeLists.txt @@ -18,9 +18,6 @@ if(NOT TARGET UnicodeConverter) add_subdirectory(${CORE_ROOT_DIR}/UnicodeConverter UnicodeConverter) endif() -set(ICU_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu") -get_filename_component(ICU_INSTALL_DIR_ABS "${ICU_INSTALL_DIR}" ABSOLUTE) - add_executable(pluginsmanager ${CMAKE_CURRENT_LIST_DIR}/main.cpp @@ -30,7 +27,7 @@ add_executable(pluginsmanager set_default_options(pluginsmanager) target_include_directories(pluginsmanager PRIVATE - ${ICU_INSTALL_DIR}/include + ${ICU_INSTALL_DIR_ABS}/include ) target_compile_definitions(pluginsmanager PRIVATE @@ -41,11 +38,10 @@ target_link_libraries(pluginsmanager PUBLIC kernel kernel_network UnicodeConverter - ${ICU_INSTALL_DIR_ABS}/lib/libicuuc.so.${ICU_MAJOR_VER} - ${ICU_INSTALL_DIR_ABS}/lib/libicudata.so.${ICU_MAJOR_VER} + ${LIBICUUC} + ${LIBICUDATA} ) copy_artifacts_to_folder("pluginsmanager" "${EO_CORE_TOOLS_DIR}") -copy_icu_libs(pluginsmanager) declare_victory( pluginsmanager ) diff --git a/PdfFile/Resources/CMapMemory/CMakeLists.txt b/PdfFile/Resources/CMapMemory/CMakeLists.txt index 2b7ce3573a..9d00e29174 100644 --- a/PdfFile/Resources/CMapMemory/CMakeLists.txt +++ b/PdfFile/Resources/CMapMemory/CMakeLists.txt @@ -21,8 +21,6 @@ add_executable(CMapSerialize set_default_options(CMapSerialize) -# Equivalent to ADD_DEPENDENCY(UnicodeConverter, kernel) -# You'll need to make sure these targets are defined in your base.cmake target_link_libraries(CMapSerialize PRIVATE UnicodeConverter kernel @@ -34,8 +32,8 @@ set(ARTIFACT_FILE "${EO_CORE_OUTPUT_DIR}/cmap.bin") add_custom_command( OUTPUT "${ARTIFACT_FILE}" - COMMAND ${EO_CORE_OUTPUT_DIR}/CMapSerialize "${CMAKE_CURRENT_SOURCE_DIR}/../CMap/CMap" - COMMAND rm ${EO_CORE_OUTPUT_DIR}/CMapSerialize + COMMAND ${EO_CORE_OUTPUT_DIR}/$ "${CMAKE_CURRENT_SOURCE_DIR}/../CMap/CMap" + COMMAND ${CMAKE_COMMAND} -E remove ${EO_CORE_OUTPUT_DIR}/$ DEPENDS CMapSerialize COMMENT "Executing CMapSerialize to create ${ARTIFACT_FILE}" VERBATIM diff --git a/Test/Applications/x2tTester/CMakeLists.txt b/Test/Applications/x2tTester/CMakeLists.txt index 7f461e2302..592628f47e 100644 --- a/Test/Applications/x2tTester/CMakeLists.txt +++ b/Test/Applications/x2tTester/CMakeLists.txt @@ -15,7 +15,6 @@ if(NOT TARGET UnicodeConverter) add_subdirectory(${CORE_ROOT_DIR}/UnicodeConverter UnicodeConverter) endif() - if(NOT TARGET graphics) add_subdirectory(${CORE_ROOT_DIR}/DesktopEditor/graphics/cmake graphics) endif() @@ -29,11 +28,20 @@ add_executable(x2ttester ${CMAKE_CURRENT_LIST_DIR}/x2tTester.h ) +set_default_options(x2ttester) + +if( MSVC ) + target_compile_definitions( x2ttester PRIVATE + _UNICODE + UNICODE + ) +endif() + target_link_libraries(x2ttester PUBLIC kernel graphics - UnicodeConverter) -set_default_options(x2ttester) + UnicodeConverter +) copy_artifacts_to_folder("x2ttester" "${EO_CORE_TOOLS_DIR}") From 236ad5031d32d1dde5f139d6c22b218ce4742a29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Tue, 19 May 2026 16:00:38 +0200 Subject: [PATCH 56/80] fix: OfficeUtils build for linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Common/CMakeLists.txt | 2 +- OfficeUtils/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Common/CMakeLists.txt b/Common/CMakeLists.txt index 927290efdb..85736ff82e 100644 --- a/Common/CMakeLists.txt +++ b/Common/CMakeLists.txt @@ -88,7 +88,7 @@ target_compile_definitions(kernel PRIVATE if( NOT MSVC ) target_compile_options(kernel PRIVATE - -include ${CMAKE_CURRENT_SOURCE_DIR}/posix_compat.h + -include${CMAKE_CURRENT_SOURCE_DIR}/posix_compat.h ) endif() diff --git a/OfficeUtils/CMakeLists.txt b/OfficeUtils/CMakeLists.txt index 6dec691077..da4114a0cd 100644 --- a/OfficeUtils/CMakeLists.txt +++ b/OfficeUtils/CMakeLists.txt @@ -64,6 +64,6 @@ function(add_officeutils TARGET OFFICE_UTILS_DIR) ) if( NOT MSVC ) - target_compile_options( ${TARGET} PRIVATE -include unistd.h) + target_compile_options( ${TARGET} PRIVATE -includeunistd.h) endif() endfunction() From 914facca8f6de52c9c3c31e58cbe71efee1ac726 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Fri, 22 May 2026 16:09:36 +0200 Subject: [PATCH 57/80] feature(python-deps): A list of targets can be specified MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Common/3dParty/build_3rdparty.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Common/3dParty/build_3rdparty.py b/Common/3dParty/build_3rdparty.py index 92d9f4663b..42af3774c0 100644 --- a/Common/3dParty/build_3rdparty.py +++ b/Common/3dParty/build_3rdparty.py @@ -26,6 +26,7 @@ ] force_redo_subfolders = [] +only_subfolders = [] script_path = Path(sys.argv[0]).resolve() script_dir = script_path.parent @@ -40,6 +41,7 @@ def print_help(): Options: --list : Prints a list of known subfolders. --force-redo= : A list of subdirectories to re-do even if they are already done. + --only= : Build only the specified comma-separated subfolders (skip all others). --help | -h : Prints this help. Examples: @@ -48,6 +50,9 @@ def print_help(): { script_path.name } --force-redo=v8,icu $PWD/work $PWD/install Build and install everything to these directories but delete and re-do v8 and icu. + + { script_path.name } --only=v8,icu $PWD/work $PWD/install + Build and install only v8 and icu. """ ) @@ -67,6 +72,14 @@ def print_help(): print_help() sys.exit( 1 ) + elif sys.argv[ i ].startswith( "--only=" ): + only_subfolders = ( sys.argv[ i ][ len( "--only=" ): ] ).split( ',' ) + for only_subfolder in only_subfolders: + if only_subfolder not in subfolders: + print( f"Unknown subfolder: { only_subfolder }" ) + print_help() + sys.exit( 1 ) + elif sys.argv[ i ] == "--list": for subfolder in subfolders: print( subfolder ) @@ -103,6 +116,9 @@ def print_help(): +if only_subfolders: + subfolders = [ s for s in subfolders if s in only_subfolders ] + total_time = nc.MeasurementObj( "Total" ) for subfolder in subfolders: From babc0c611595592262a8a03c83b83747695df8bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Fri, 22 May 2026 16:15:46 +0200 Subject: [PATCH 58/80] fix(python-deps): Fixing vcvars hint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Common/3dParty/build_3rdparty.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/3dParty/build_3rdparty.py b/Common/3dParty/build_3rdparty.py index 42af3774c0..7cc1c50935 100644 --- a/Common/3dParty/build_3rdparty.py +++ b/Common/3dParty/build_3rdparty.py @@ -111,7 +111,7 @@ def print_help(): if sys.platform == "win32" and shutil.which( "nmake" ) is None: raise RuntimeError( "MSVC environment is not set up: 'nmake' not found in PATH.\n" - "Run 'vcvarsx86_amd64.bat' or use 'x64 Native Tools Command Prompt'." + "Run 'vcvars64.bat' or use 'x64 Native Tools Command Prompt'." ) From 081299a6798b9a215c44a827321801d56a762ef7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Fri, 22 May 2026 16:49:05 +0200 Subject: [PATCH 59/80] feature(python-deps): Exception list can be provided for deps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Common/3dParty/build_3rdparty.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Common/3dParty/build_3rdparty.py b/Common/3dParty/build_3rdparty.py index 7cc1c50935..203cb9b81b 100644 --- a/Common/3dParty/build_3rdparty.py +++ b/Common/3dParty/build_3rdparty.py @@ -27,6 +27,7 @@ force_redo_subfolders = [] only_subfolders = [] +except_subfolders = [] script_path = Path(sys.argv[0]).resolve() script_dir = script_path.parent @@ -42,6 +43,8 @@ def print_help(): --list : Prints a list of known subfolders. --force-redo= : A list of subdirectories to re-do even if they are already done. --only= : Build only the specified comma-separated subfolders (skip all others). + --except= : Build everything except the specified comma-separated subfolders. + Note: --only= and --except= are mutually exclusive. --help | -h : Prints this help. Examples: @@ -53,6 +56,9 @@ def print_help(): { script_path.name } --only=v8,icu $PWD/work $PWD/install Build and install only v8 and icu. + + { script_path.name } --except=v8,icu $PWD/work $PWD/install + Build and install everything except v8 and icu. """ ) @@ -80,6 +86,14 @@ def print_help(): print_help() sys.exit( 1 ) + elif sys.argv[ i ].startswith( "--except=" ): + except_subfolders = ( sys.argv[ i ][ len( "--except=" ): ] ).split( ',' ) + for ex_subfolder in except_subfolders: + if ex_subfolder not in subfolders: + print( f"Unknown subfolder: { ex_subfolder }" ) + print_help() + sys.exit( 1 ) + elif sys.argv[ i ] == "--list": for subfolder in subfolders: print( subfolder ) @@ -116,8 +130,14 @@ def print_help(): +if only_subfolders and except_subfolders: + print( "Error: --only= and --except= are mutually exclusive." ) + sys.exit( 1 ) + if only_subfolders: subfolders = [ s for s in subfolders if s in only_subfolders ] +elif except_subfolders: + subfolders = [ s for s in subfolders if s not in except_subfolders ] total_time = nc.MeasurementObj( "Total" ) From d55ee1b2a5e066b71b07652c3191eff808565009 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Wed, 27 May 2026 22:48:46 +0200 Subject: [PATCH 60/80] fix(wasm): fix hash build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- CMakeLists.txt | 48 +----- Common/3dParty/build_3rdparty.py | 1 + Common/3dParty/openssl-hash/nc-build.py | 118 ++++++++++++++ .../xmlsec/src/wasm/hash/CMakeLists.txt | 23 +-- common.cmake | 145 +++++++++++------- 5 files changed, 214 insertions(+), 121 deletions(-) create mode 100644 Common/3dParty/openssl-hash/nc-build.py diff --git a/CMakeLists.txt b/CMakeLists.txt index 30dc2e281f..2900c6479e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,6 @@ set(CORE_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}") include(${CORE_ROOT_DIR}/common.cmake) -# platform-specific compile flags if(EMSCRIPTEN) add_subdirectory( "${CORE_ROOT_DIR}/OfficeUtils/js" zlib ) @@ -15,6 +14,7 @@ if(EMSCRIPTEN) add_subdirectory( "${CORE_ROOT_DIR}/Common/3dParty/hunspell" spell ) add_subdirectory( "${CORE_ROOT_DIR}/DesktopEditor/fontengine/js" fonts ) add_subdirectory( "${CORE_ROOT_DIR}/DesktopEditor/graphics/pro/js/" drawingfile ) + else() add_subdirectory( "${CORE_ROOT_DIR}/X2tConverter/build/cmake" x2t ) @@ -25,50 +25,4 @@ else() add_subdirectory( "${CORE_ROOT_DIR}/PdfFile/Resources/CMapMemory" cmapbin ) add_subdirectory( "${CORE_ROOT_DIR}/Test/Applications/x2tTester" x2ttester ) - #[[ - set( ALL_ARTIFACTS - UnicodeConverter - kernel - kernel_network - Fb2File - PdfFile - HtmlFile2 - EpubFile - XpsFile - OFDFile - DjVuFile - DocxRenderer - doctrenderer - IWorkFile - HWPFile - graphics - x2tlib - allfontsgen - allthemesgen - pluginsmanager - docbuilder - x2t - ) - - add_custom_target(copy_artifacts ALL - COMMENT "Copying all artifacts into ${EO_CORE_OUTPUT_DIR}" - ) - - add_dependencies(copy_artifacts ${ALL_ARTIFACTS}) - - foreach(artifact ${ALL_ARTIFACTS}) - add_custom_command(TARGET copy_artifacts POST_BUILD - COMMAND ${CMAKE_COMMAND} -E make_directory "${EO_CORE_OUTPUT_DIR}" - COMMAND ${CMAKE_COMMAND} -E copy $ "${EO_CORE_OUTPUT_DIR}/" - COMMENT "Copying ${artifact} to ${EO_CORE_OUTPUT_DIR}" - ) - endforeach() - - add_custom_command(TARGET copy_artifacts POST_BUILD - COMMAND ${CMAKE_COMMAND} -E make_directory "${EO_CORE_OUTPUT_DIR}" - COMMAND /bin/sh -c "cp -P \"${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu/lib\"/*.so* \"${EO_CORE_OUTPUT_DIR}/\"" - COMMENT "Copying ICU libs to ${EO_CORE_OUTPUT_DIR}" - ) - ]] - endif() diff --git a/Common/3dParty/build_3rdparty.py b/Common/3dParty/build_3rdparty.py index 203cb9b81b..5180f87cb8 100644 --- a/Common/3dParty/build_3rdparty.py +++ b/Common/3dParty/build_3rdparty.py @@ -20,6 +20,7 @@ 'icu', 'md', 'openssl', + 'openssl-hash', 'socketio', 'hunspell', 'v8', diff --git a/Common/3dParty/openssl-hash/nc-build.py b/Common/3dParty/openssl-hash/nc-build.py new file mode 100644 index 0000000000..b6384a5d90 --- /dev/null +++ b/Common/3dParty/openssl-hash/nc-build.py @@ -0,0 +1,118 @@ +#!/usr/bin/env python3 + +import sys +import shutil +import os +import re +from pathlib import Path + +script_path = Path(sys.argv[0]).resolve() +script_dir = script_path.parent + +third_party_root = ( script_dir / ".." ).resolve() +if str( third_party_root ) not in sys.path: + sys.path.insert( 0, str( third_party_root ) ) +import build_3rdparty_common as nc + +patches_dir = script_dir.parent.parent.parent / "DesktopEditor" / "xmlsec" / "src" / "wasm" / "3rdParty" / "patches" + +nc.init_for_dep( + depname = "OpenSSL-WASM", + workdir = Path( sys.argv[1] ), + installdir = Path( sys.argv[2] ), + forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" +) + +def fetch_and_patch(): + nc.create_workdir() + + nc.run_command( + [ "git", "-c", "core.autocrlf=false", "-c", "core.eol=lf", + "clone", "--depth", "1", + "--branch", "OpenSSL_1_1_1f", + "https://github.com/openssl/openssl.git", + str(nc.work_dir) + ], + "Clone repo" + ) + + nc.run_command( + [ "git", "apply", patches_dir / "fix-wasm-openssl.patch" ], + "Patch OpenSSL-HASH", + nc.work_dir + ) + + nc.create_work_dir_ok_marker() + + print( "Fetch & patch completed" ) + +def build_and_install(): + nc.create_install_dir() + + if shutil.which( "emmake" ) is None: + nc.abort_op( "Tool not found: emmake - Emsdk is probably not activated" ) + + if nc.is_linux(): + nc.run_command( + [ "emconfigure", + "./config", + "no-shared", + "no-asm", + "no-threads", + "no-dso", + "enable-md2", + f"--prefix={nc.install_dir}", + f"--openssldir={nc.install_dir}", + ], + "Configure", + nc.work_dir + ) + + # Fiddle with the makefile + try: + path = nc.work_dir / "Makefile" + content = path.read_text() + content = re.sub( + r"^CROSS_COMPILE.*$", + "CROSS_COMPILE=", + content, + flags=re.MULTILINE, + ) + path.write_text(content) + except Exception as e: + nc.abort_op( "Failed to fix Makefile" ) + + nc.run_command( + [ "emmake", + "make", + f"-j{os.cpu_count()}", + "build_generated", + "libcrypto.a", + "libssl.a", + ], + "Build", + nc.work_dir + ) + + nc.run_command( + [ "make", "install" ], + "Install", + nc.work_dir + ) + + else: + abort_op( f"Unkown target platform: {sys.platform}" ) + + nc.create_install_dir_ok_marker() + + print( "Build and install completed" ) + +if nc.is_windows(): + print( "WARNING: OpenSSL Wasm build is not implemented on Windows - skipping" ) + sys.exit( 0 ) + +if not nc.work_dir_looks_ok(): + fetch_and_patch() + +if not nc.install_dir_looks_ok(): + build_and_install() diff --git a/DesktopEditor/xmlsec/src/wasm/hash/CMakeLists.txt b/DesktopEditor/xmlsec/src/wasm/hash/CMakeLists.txt index 4e0adb9397..1700ec6e27 100644 --- a/DesktopEditor/xmlsec/src/wasm/hash/CMakeLists.txt +++ b/DesktopEditor/xmlsec/src/wasm/hash/CMakeLists.txt @@ -1,9 +1,6 @@ cmake_minimum_required(VERSION 3.16) project(engine) -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_C_STANDARD 11) - # ------------------------------------------------- # Ensure Emscripten toolchain # ------------------------------------------------- @@ -15,16 +12,6 @@ set(CORE_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../../../..) include(${CORE_ROOT}/common.cmake) -# ------------------------------------------------- -# Pre / Post build scripts -# ------------------------------------------------- -set(OPENSSL_ROOT "../3rdParty") -get_filename_component(OPENSSL_ROOT_ABS "${OPENSSL_ROOT}" ABSOLUTE) -add_custom_target(${PROJECT_NAME}_run_before ALL - COMMAND bash ${OPENSSL_ROOT_ABS}/nc-build.sh "${EO_CORE_3RD_PARTY_WORK_DIR}/openssl-hash" "${EO_CORE_3RD_PARTY_INSTALL_DIR}/openssl-hash" -) - - # ------------------------------------------------- # Source files (compile_files_array) # ------------------------------------------------- @@ -60,7 +47,6 @@ set_source_files_properties(${SRC} PROPERTIES GENERATED TRUE) # Executable (WASM module) # ------------------------------------------------- add_executable(${PROJECT_NAME} ${SRC} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}_run_before) # ------------------------------------------------- # Output settings @@ -82,8 +68,8 @@ target_include_directories(${PROJECT_NAME} PRIVATE # link libraries # ------------------------------------------------- target_link_libraries(${PROJECT_NAME} PRIVATE - ${EO_CORE_3RD_PARTY_WORK_DIR}/openssl-hash/libcrypto.a - ${EO_CORE_3RD_PARTY_WORK_DIR}/openssl-hash/libssl.a + ${OPENSSL_WASM_LIBCRYPTO} + ${OPENSSL_WASM_LIBSSL} ) # ------------------------------------------------- @@ -122,4 +108,7 @@ target_link_options(${PROJECT_NAME} PRIVATE "SHELL:--pre-js ${CORE_ROOT}/Common/js/string_utf8.js" "SHELL:--post-js ${CORE_ROOT}/Common/js/desktop_fetch_new.js" "SHELL:--post-js ${CMAKE_CURRENT_SOURCE_DIR}/hash_base_post.js" -) \ No newline at end of file +) + +declare_victory( ${PROJECT_NAME} ) + diff --git a/common.cmake b/common.cmake index 49131e3292..3dcfe361c2 100644 --- a/common.cmake +++ b/common.cmake @@ -45,70 +45,101 @@ message("3rdparty dir: " ${EO_CORE_3RD_PARTY_DIR}) message("workdir: " ${EO_CORE_3RD_PARTY_WORK_DIR}) message("install: " ${EO_CORE_3RD_PARTY_INSTALL_DIR}) -if(NOT THIRD_PARTY_PREPARED) - cmake_path( APPEND BUILDER_PATH "${CMAKE_CURRENT_LIST_DIR}" "Common" "3dParty" "build_3rdparty.py" ) - execute_process( - COMMAND_ECHO STDOUT - COMMAND "${PYTHON_BIN}" - "${BUILDER_PATH}" - "${EO_CORE_3RD_PARTY_WORK_DIR}" "${EO_CORE_3RD_PARTY_INSTALL_DIR}" - RESULT_VARIABLE result - ) +if( EMSCRIPTEN ) + + if(NOT THIRD_PARTY_PREPARED) + cmake_path( APPEND BUILDER_PATH "${CMAKE_CURRENT_LIST_DIR}" "Common" "3dParty" "build_3rdparty.py" ) + execute_process( + COMMAND_ECHO STDOUT + COMMAND "${PYTHON_BIN}" + "${BUILDER_PATH}" + "--only=openssl-hash" + "${EO_CORE_3RD_PARTY_WORK_DIR}" "${EO_CORE_3RD_PARTY_INSTALL_DIR}" + RESULT_VARIABLE result + ) - if(result) # on error - message(FATAL_ERROR "Common/3dParty/build_3rdparty.py failed!") - else() - set(THIRD_PARTY_PREPARED TRUE CACHE INTERNAL "Third party prepared") + if(result) # on error + message(FATAL_ERROR "Common/3dParty/build_3rdparty.py failed!") + else() + set(THIRD_PARTY_PREPARED TRUE CACHE INTERNAL "Third party prepared") + endif() endif() -endif() -if(MSVC) - set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>" CACHE STRING "" FORCE) - foreach(flag_var CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_RELEASE CMAKE_C_FLAGS CMAKE_C_FLAGS_RELEASE) - string(REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") - endforeach() -endif() + # Setup openssl + set(OPENSSL_WASM_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/openssl-hash") + get_filename_component(OPENSSL_WASM_INSTALL_DIR_ABS "${OPENSSL_WASM_INSTALL_DIR}" ABSOLUTE) + set(OPENSSL_WASM_LIBSSL "${OPENSSL_WASM_INSTALL_DIR_ABS}/lib/libssl.a") + set(OPENSSL_WASM_LIBCRYPTO "${OPENSSL_WASM_INSTALL_DIR_ABS}/lib/libcrypto.a") -# Setup icu -# These version numbers don't affect what build_3rdparty.py builds. They just have to match. -set(ICU_MAJOR_VER "74") -set(ICU_MINOR_VER "2") -set(ICU_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu") -get_filename_component(ICU_INSTALL_DIR_ABS "${ICU_INSTALL_DIR}" ABSOLUTE) -if( MSVC ) - set(LIBICUUC "${ICU_INSTALL_DIR_ABS}/lib/icuuc.lib") - set(LIBICUDATA "${ICU_INSTALL_DIR_ABS}/lib/icudt.lib") else() - set(LIBICUUC "${ICU_INSTALL_DIR_ABS}/lib/libicuuc.so.${ICU_MAJOR_VER}") - set(LIBICUDATA "${ICU_INSTALL_DIR_ABS}/lib/libicudata.so.${ICU_MAJOR_VER}") -endif() -# Setup boost -set( BOOST_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/boost" ) -get_filename_component(BOOST_INSTALL_DIR_ABS "${BOOST_INSTALL_DIR}" ABSOLUTE) -set( CMAKE_PREFIX_PATH "${BOOST_INSTALL_DIR_ABS}" ) -include_directories( "${BOOST_INSTALL_DIR_ABS}/include" ) -set(Boost_USE_STATIC_LIBS ON) -find_package( Boost REQUIRED COMPONENTS system filesystem regex date_time ) - -# Setup v8 -set(V8_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/v8") -get_filename_component(V8_INSTALL_DIR_ABS "${V8_INSTALL_DIR}" ABSOLUTE) -if( MSVC ) - set(V8_MONILITH "${V8_INSTALL_DIR_ABS}/v8_monolith.lib") -else() - set(V8_MONILITH "${V8_INSTALL_DIR_ABS}/libv8_monolith.a") -endif() + if(NOT THIRD_PARTY_PREPARED) + cmake_path( APPEND BUILDER_PATH "${CMAKE_CURRENT_LIST_DIR}" "Common" "3dParty" "build_3rdparty.py" ) + execute_process( + COMMAND_ECHO STDOUT + COMMAND "${PYTHON_BIN}" + "${BUILDER_PATH}" + "--except=openssl-wasm" + "${EO_CORE_3RD_PARTY_WORK_DIR}" "${EO_CORE_3RD_PARTY_INSTALL_DIR}" + RESULT_VARIABLE result + ) + + if(result) # on error + message(FATAL_ERROR "Common/3dParty/build_3rdparty.py failed!") + else() + set(THIRD_PARTY_PREPARED TRUE CACHE INTERNAL "Third party prepared") + endif() + endif() + + if(MSVC) + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>" CACHE STRING "" FORCE) + foreach(flag_var CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_RELEASE CMAKE_C_FLAGS CMAKE_C_FLAGS_RELEASE) + string(REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") + endforeach() + endif() + + # Setup icu + # These version numbers don't affect what build_3rdparty.py builds. They just have to match. + set(ICU_MAJOR_VER "74") + set(ICU_MINOR_VER "2") + set(ICU_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu") + get_filename_component(ICU_INSTALL_DIR_ABS "${ICU_INSTALL_DIR}" ABSOLUTE) + if( MSVC ) + set(LIBICUUC "${ICU_INSTALL_DIR_ABS}/lib/icuuc.lib") + set(LIBICUDATA "${ICU_INSTALL_DIR_ABS}/lib/icudt.lib") + else() + set(LIBICUUC "${ICU_INSTALL_DIR_ABS}/lib/libicuuc.so.${ICU_MAJOR_VER}") + set(LIBICUDATA "${ICU_INSTALL_DIR_ABS}/lib/libicudata.so.${ICU_MAJOR_VER}") + endif() + + # Setup boost + set( BOOST_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/boost" ) + get_filename_component(BOOST_INSTALL_DIR_ABS "${BOOST_INSTALL_DIR}" ABSOLUTE) + set( CMAKE_PREFIX_PATH "${BOOST_INSTALL_DIR_ABS}" ) + include_directories( "${BOOST_INSTALL_DIR_ABS}/include" ) + set(Boost_USE_STATIC_LIBS ON) + find_package( Boost REQUIRED COMPONENTS system filesystem regex date_time ) + + # Setup v8 + set(V8_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/v8") + get_filename_component(V8_INSTALL_DIR_ABS "${V8_INSTALL_DIR}" ABSOLUTE) + if( MSVC ) + set(V8_MONILITH "${V8_INSTALL_DIR_ABS}/v8_monolith.lib") + else() + set(V8_MONILITH "${V8_INSTALL_DIR_ABS}/libv8_monolith.a") + endif() + + # Setup openssl + set(OPENSSL_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/openssl") + get_filename_component(OPENSSL_INSTALL_DIR_ABS "${OPENSSL_INSTALL_DIR}" ABSOLUTE) + if( MSVC ) + set(OPENSSL_LIBSSL "${OPENSSL_INSTALL_DIR_ABS}/lib/libssl.lib") + set(OPENSSL_LIBCRYPTO "${OPENSSL_INSTALL_DIR_ABS}/lib/libcrypto.lib") + else() + set(OPENSSL_LIBSSL "${OPENSSL_INSTALL_DIR_ABS}/lib/libssl.a") + set(OPENSSL_LIBCRYPTO "${OPENSSL_INSTALL_DIR_ABS}/lib/libcrypto.a") + endif() -# Setup openssl -set(OPENSSL_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/openssl") -get_filename_component(OPENSSL_INSTALL_DIR_ABS "${OPENSSL_INSTALL_DIR}" ABSOLUTE) -if( MSVC ) - set(OPENSSL_LIBSSL "${OPENSSL_INSTALL_DIR_ABS}/lib/libssl.lib") - set(OPENSSL_LIBCRYPTO "${OPENSSL_INSTALL_DIR_ABS}/lib/libcrypto.lib") -else() - set(OPENSSL_LIBSSL "${OPENSSL_INSTALL_DIR_ABS}/lib/libssl.a") - set(OPENSSL_LIBCRYPTO "${OPENSSL_INSTALL_DIR_ABS}/lib/libcrypto.a") endif() # Do NOT auto-add absolute link directories to RPATH From 3dabfa67470a481882f15f4db92ec3f7c0b5a41b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Wed, 27 May 2026 22:54:06 +0200 Subject: [PATCH 61/80] fix(wasm): fix OfficeUtils/js build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- OfficeUtils/js/CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/OfficeUtils/js/CMakeLists.txt b/OfficeUtils/js/CMakeLists.txt index 088a0c3d76..d9dd60eba7 100644 --- a/OfficeUtils/js/CMakeLists.txt +++ b/OfficeUtils/js/CMakeLists.txt @@ -1,8 +1,6 @@ cmake_minimum_required(VERSION 3.10) project(zlib) -set(CMAKE_CXX_STANDARD 17) - # ------------------------------------------------- # Ensure Emscripten toolchain # ------------------------------------------------- @@ -16,6 +14,8 @@ endif() # ------------------------------------------------- set(CORE_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..) +include(${CORE_ROOT}/common.cmake) + set(SRC # ---- minizip ---- ${CORE_ROOT}/OfficeUtils/src/zlib-1.2.11/contrib/minizip/unzip.c @@ -496,4 +496,6 @@ add_custom_target(${PROJECT_NAME}_copy_extra_files ALL "$/../code.js" COMMENT "Copying extra files to output" VERBATIM -) \ No newline at end of file +) + +declare_victory( ${PROJECT_NAME}) From 86dfd0b8e5733e14a94bcd3893f7649eac3b458e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Wed, 27 May 2026 23:03:31 +0200 Subject: [PATCH 62/80] fix(wasm): fix hunspell-wasm build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Common/3dParty/hunspell/CMakeLists.txt | 35 +++++++++++--------------- Common/3dParty/hunspell/nc-build.py | 2 +- common.cmake | 2 +- 3 files changed, 16 insertions(+), 23 deletions(-) diff --git a/Common/3dParty/hunspell/CMakeLists.txt b/Common/3dParty/hunspell/CMakeLists.txt index 492e412fe0..edc1f71265 100644 --- a/Common/3dParty/hunspell/CMakeLists.txt +++ b/Common/3dParty/hunspell/CMakeLists.txt @@ -1,8 +1,6 @@ cmake_minimum_required(VERSION 3.16) project(spell) -set(CMAKE_CXX_STANDARD 17) - # ------------------------------------------------- # Ensure Emscripten toolchain # ------------------------------------------------- @@ -14,26 +12,19 @@ set(CORE_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../..) include(${CORE_ROOT}/common.cmake) -# ------------------------------------------------- -# Pre / Post build scripts -# ------------------------------------------------- -add_custom_target(${PROJECT_NAME}_run_before ALL - COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/nc-build.sh "${EO_CORE_3RD_PARTY_WORK_DIR}/hunspell" -) - # ------------------------------------------------- # Source files (compile_files_array) # ------------------------------------------------- set(HUNSPELL_SRC - ${EO_CORE_3RD_PARTY_WORK_DIR}/hunspell/src/hunspell/affentry.cxx - ${EO_CORE_3RD_PARTY_WORK_DIR}/hunspell/src/hunspell/affixmgr.cxx - ${EO_CORE_3RD_PARTY_WORK_DIR}/hunspell/src/hunspell/csutil.cxx - ${EO_CORE_3RD_PARTY_WORK_DIR}/hunspell/src/hunspell/hashmgr.cxx - ${EO_CORE_3RD_PARTY_WORK_DIR}/hunspell/src/hunspell/hunspell.cxx - ${EO_CORE_3RD_PARTY_WORK_DIR}/hunspell/src/hunspell/hunzip.cxx - ${EO_CORE_3RD_PARTY_WORK_DIR}/hunspell/src/hunspell/phonet.cxx - ${EO_CORE_3RD_PARTY_WORK_DIR}/hunspell/src/hunspell/replist.cxx - ${EO_CORE_3RD_PARTY_WORK_DIR}/hunspell/src/hunspell/suggestmgr.cxx + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/hunspell/hunspell-wasm/src/hunspell/affentry.cxx + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/hunspell/hunspell-wasm/src/hunspell/affixmgr.cxx + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/hunspell/hunspell-wasm/src/hunspell/csutil.cxx + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/hunspell/hunspell-wasm/src/hunspell/hashmgr.cxx + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/hunspell/hunspell-wasm/src/hunspell/hunspell.cxx + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/hunspell/hunspell-wasm/src/hunspell/hunzip.cxx + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/hunspell/hunspell-wasm/src/hunspell/phonet.cxx + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/hunspell/hunspell-wasm/src/hunspell/replist.cxx + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/hunspell/hunspell-wasm/src/hunspell/suggestmgr.cxx ) set_source_files_properties(${HUNSPELL_SRC} PROPERTIES GENERATED TRUE) @@ -53,7 +44,6 @@ add_executable(${PROJECT_NAME} ${HUNSPELL_SRC} ${WRAPPER_SRC} ) -add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}_run_before) # ------------------------------------------------- # Output folder @@ -66,7 +56,7 @@ set_target_properties(${PROJECT_NAME} PROPERTIES # Include directories # ------------------------------------------------- target_include_directories(${PROJECT_NAME} PRIVATE - ${EO_CORE_3RD_PARTY_WORK_DIR}/hunspell/src/hunspell + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/hunspell/hunspell-wasm/src/hunspell ${CMAKE_CURRENT_SOURCE_DIR}/wasm/src ) @@ -115,4 +105,7 @@ add_custom_target(${PROJECT_NAME}_copy_extra_files ALL "$/../index.html" COMMENT "Copying extra files to output" VERBATIM -) \ No newline at end of file +) + +declare_victory( ${PROJECT_NAME} ) + diff --git a/Common/3dParty/hunspell/nc-build.py b/Common/3dParty/hunspell/nc-build.py index de25916d0c..2d4aa26a69 100644 --- a/Common/3dParty/hunspell/nc-build.py +++ b/Common/3dParty/hunspell/nc-build.py @@ -34,7 +34,7 @@ def fetch_and_patch(): try: shutil.copytree( nc.work_dir / "hunspell", nc.work_dir / "hunspell-wasm" ) except Exception as e: - nc.abort_op( f"No TLS copy failed: {e.stderr.strip() or e.stdout.strip() or e}" ) + nc.abort_op( f"Hunspell-wasm copy failed: {e.stderr.strip() or e.stdout.strip() or e}" ) nc.run_command( [ "git", "apply", patches_dir / "fix-wasm-hunspell.patch" ], diff --git a/common.cmake b/common.cmake index 3dcfe361c2..f20d5109c5 100644 --- a/common.cmake +++ b/common.cmake @@ -53,7 +53,7 @@ if( EMSCRIPTEN ) COMMAND_ECHO STDOUT COMMAND "${PYTHON_BIN}" "${BUILDER_PATH}" - "--only=openssl-hash" + "--only=openssl-hash,hunspell" "${EO_CORE_3RD_PARTY_WORK_DIR}" "${EO_CORE_3RD_PARTY_INSTALL_DIR}" RESULT_VARIABLE result ) From 10abddf18e294acb404f448377de2bb732331ce5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Wed, 27 May 2026 23:10:59 +0200 Subject: [PATCH 63/80] fix(wasm): fix fontengine wasm build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- DesktopEditor/fontengine/js/CMakeLists.txt | 197 ++++++++++----------- common.cmake | 2 +- 2 files changed, 94 insertions(+), 105 deletions(-) diff --git a/DesktopEditor/fontengine/js/CMakeLists.txt b/DesktopEditor/fontengine/js/CMakeLists.txt index 2601f64297..2200246e41 100644 --- a/DesktopEditor/fontengine/js/CMakeLists.txt +++ b/DesktopEditor/fontengine/js/CMakeLists.txt @@ -1,9 +1,6 @@ cmake_minimum_required(VERSION 3.20) project(fonts) -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_C_STANDARD 11) - # ------------------------------------------------- # Must use Emscripten # ------------------------------------------------- @@ -16,16 +13,6 @@ set(DESKTOP_ROOT ${CORE_ROOT}/DesktopEditor) include(${CORE_ROOT}/common.cmake) -# ------------------------------------------------- -# Pre/Post scripts -# ------------------------------------------------- -add_custom_target(${PROJECT_NAME}_run_before ALL - COMMAND bash ${CORE_ROOT}/Common/3dParty/brotli/nc-fetch.sh ${EO_CORE_3RD_PARTY_WORK_DIR}/brotli - COMMAND bash ${CORE_ROOT}/Common/3dParty/harfbuzz/nc-fetch.sh ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz - COMMAND bash ${CORE_ROOT}/Common/3dParty/hyphen/nc-fetch.sh ${EO_CORE_3RD_PARTY_WORK_DIR}/hyphen/hyphen - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} -) - # ------------------------------------------------- # Sources (from compile_files_array) # Pattern: / @@ -33,17 +20,17 @@ add_custom_target(${PROJECT_NAME}_run_before ALL set(SOURCES - ${EO_CORE_3RD_PARTY_WORK_DIR}/brotli/c/common/constants.c - ${EO_CORE_3RD_PARTY_WORK_DIR}/brotli/c/common/context.c - ${EO_CORE_3RD_PARTY_WORK_DIR}/brotli/c/common/dictionary.c - ${EO_CORE_3RD_PARTY_WORK_DIR}/brotli/c/common/platform.c - ${EO_CORE_3RD_PARTY_WORK_DIR}/brotli/c/common/shared_dictionary.c - ${EO_CORE_3RD_PARTY_WORK_DIR}/brotli/c/common/transform.c + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/brotli/c/common/constants.c + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/brotli/c/common/context.c + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/brotli/c/common/dictionary.c + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/brotli/c/common/platform.c + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/brotli/c/common/shared_dictionary.c + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/brotli/c/common/transform.c - ${EO_CORE_3RD_PARTY_WORK_DIR}/brotli/c/dec/bit_reader.c - ${EO_CORE_3RD_PARTY_WORK_DIR}/brotli/c/dec/decode.c - ${EO_CORE_3RD_PARTY_WORK_DIR}/brotli/c/dec/huffman.c - ${EO_CORE_3RD_PARTY_WORK_DIR}/brotli/c/dec/state.c + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/brotli/c/dec/bit_reader.c + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/brotli/c/dec/decode.c + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/brotli/c/dec/huffman.c + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/brotli/c/dec/state.c ${DESKTOP_ROOT}/freetype-2.10.4/src/base/ftdebug.c ${DESKTOP_ROOT}/freetype-2.10.4/src/autofit/autofit.c @@ -86,81 +73,81 @@ set(SOURCES ${DESKTOP_ROOT}/freetype-2.10.4/src/winfonts/winfnt.c ${DESKTOP_ROOT}/graphics/GraphicsPath.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-aat-layout.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-aat-map.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-blob.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-buffer-serialize.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-buffer-verify.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-buffer.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-cairo-utils.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-cairo.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-common.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-coretext.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-directwrite.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-draw.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-face-builder.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-face.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-fallback-shape.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-font.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-ft.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-gdi.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-glib.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-gobject-structs.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-graphite2.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-icu.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-map.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-number.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-ot-cff1-table.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-ot-cff2-table.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-ot-color.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-ot-face.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-ot-font.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-ot-layout.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-ot-map.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-ot-math.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-ot-meta.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-ot-metrics.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-ot-name.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-ot-shape-fallback.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-ot-shape-normalize.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-ot-shape.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-ot-shaper-arabic.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-ot-shaper-default.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-ot-shaper-hangul.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-ot-shaper-hebrew.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-ot-shaper-indic-table.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-ot-shaper-indic.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-ot-shaper-khmer.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-ot-shaper-myanmar.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-ot-shaper-syllabic.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-ot-shaper-thai.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-ot-shaper-use.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-ot-shaper-vowel-constraints.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-ot-tag.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-ot-var.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-outline.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-paint-extents.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-paint.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-set.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-shape-plan.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-shape.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-shaper.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-static.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-style.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-subset-cff-common.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-subset-cff1.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-subset-cff2.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-subset-input.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-subset-instancer-solver.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-subset-plan.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-subset-repacker.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-subset.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-ucd.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-unicode.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-uniscribe.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-wasm-api.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/hb-wasm-shape.cc - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src/graph/gsubgpos-context.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-aat-layout.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-aat-map.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-blob.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-buffer-serialize.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-buffer-verify.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-buffer.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-cairo-utils.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-cairo.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-common.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-coretext.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-directwrite.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-draw.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-face-builder.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-face.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-fallback-shape.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-font.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-ft.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-gdi.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-glib.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-gobject-structs.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-graphite2.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-icu.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-map.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-number.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-ot-cff1-table.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-ot-cff2-table.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-ot-color.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-ot-face.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-ot-font.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-ot-layout.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-ot-map.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-ot-math.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-ot-meta.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-ot-metrics.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-ot-name.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-ot-shape-fallback.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-ot-shape-normalize.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-ot-shape.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-ot-shaper-arabic.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-ot-shaper-default.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-ot-shaper-hangul.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-ot-shaper-hebrew.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-ot-shaper-indic-table.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-ot-shaper-indic.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-ot-shaper-khmer.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-ot-shaper-myanmar.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-ot-shaper-syllabic.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-ot-shaper-thai.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-ot-shaper-use.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-ot-shaper-vowel-constraints.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-ot-tag.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-ot-var.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-outline.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-paint-extents.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-paint.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-set.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-shape-plan.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-shape.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-shaper.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-static.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-style.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-subset-cff-common.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-subset-cff1.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-subset-cff2.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-subset-input.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-subset-instancer-solver.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-subset-plan.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-subset-repacker.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-subset.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-ucd.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-unicode.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-uniscribe.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-wasm-api.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/hb-wasm-shape.cc + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src/graph/gsubgpos-context.cc ${CORE_ROOT}/OfficeUtils/src/zlib-1.2.11/adler32.c ${CORE_ROOT}/OfficeUtils/src/zlib-1.2.11/crc32.c @@ -369,7 +356,6 @@ set_source_files_properties( # Executable (WASM module) # ------------------------------------------------- add_executable(${PROJECT_NAME} ${SOURCES}) -add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}_run_before) # ------------------------------------------------- # Include paths @@ -379,10 +365,11 @@ target_include_directories(${PROJECT_NAME} PRIVATE ${DESKTOP_ROOT}/freetype-2.10.4/include/freetype ${DESKTOP_ROOT}/freetype-2.10.4/include/freetype/internal ${DESKTOP_ROOT}/graphics/pro/js/wasm/src/lib - ${EO_CORE_3RD_PARTY_WORK_DIR}/harfbuzz/src - ${EO_CORE_3RD_PARTY_WORK_DIR}/brotli/c/include - ${EO_CORE_3RD_PARTY_WORK_DIR}/hyphen/hyphen/c/include - ${EO_CORE_3RD_PARTY_WORK_DIR}/hyphen/ + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/harfbuzz/src + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/brotli/c/include + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/hyphen/hyphen/c/include + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/hyphen + ${EO_CORE_3RD_PARTY_INSTALL_DIR} ${CORE_ROOT}/OfficeUtils/src ${CORE_ROOT}/OfficeUtils/src/zlib-1.2.11 ${DESKTOP_ROOT}/cximage/jasper/include @@ -525,4 +512,6 @@ add_custom_target(${PROJECT_NAME}_copy_extra_files ALL "$/fonts_native.js" COMMENT "Copying extra files to output" VERBATIM -) \ No newline at end of file +) + +declare_victory( ${PROJECT_NAME} ) diff --git a/common.cmake b/common.cmake index f20d5109c5..572b4e5e3b 100644 --- a/common.cmake +++ b/common.cmake @@ -53,7 +53,7 @@ if( EMSCRIPTEN ) COMMAND_ECHO STDOUT COMMAND "${PYTHON_BIN}" "${BUILDER_PATH}" - "--only=openssl-hash,hunspell" + "--only=openssl-hash,hunspell,brotli,harfbuzz,hyphen" "${EO_CORE_3RD_PARTY_WORK_DIR}" "${EO_CORE_3RD_PARTY_INSTALL_DIR}" RESULT_VARIABLE result ) From 09aaa083754f976ada015a9df4f58aa08b875714 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Thu, 28 May 2026 00:37:32 +0200 Subject: [PATCH 64/80] fix(wasm): fix drawingfile wasm build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Common/3dParty/build_3rdparty.py | 1 + Common/3dParty/icu-wasm/nc-build.py | 70 +++++++ Common/3dParty/icu/nc-build.py | 16 +- Common/3dParty/openssl-hash/nc-build.py | 13 +- DesktopEditor/graphics/pro/js/CMakeLists.txt | 196 ++++++++----------- common.cmake | 4 +- 6 files changed, 176 insertions(+), 124 deletions(-) create mode 100644 Common/3dParty/icu-wasm/nc-build.py diff --git a/Common/3dParty/build_3rdparty.py b/Common/3dParty/build_3rdparty.py index 5180f87cb8..44c302de03 100644 --- a/Common/3dParty/build_3rdparty.py +++ b/Common/3dParty/build_3rdparty.py @@ -18,6 +18,7 @@ 'html', 'hyphen', 'icu', + 'icu-wasm', 'md', 'openssl', 'openssl-hash', diff --git a/Common/3dParty/icu-wasm/nc-build.py b/Common/3dParty/icu-wasm/nc-build.py new file mode 100644 index 0000000000..f2de198d4b --- /dev/null +++ b/Common/3dParty/icu-wasm/nc-build.py @@ -0,0 +1,70 @@ +#!/usr/bin/env python3 + +import sys +import shutil +import os +from pathlib import Path + +script_path = Path(sys.argv[0]).resolve() +script_dir = script_path.parent +icu_major = "74" +icu_minor = "2" + +third_party_root = ( script_dir / ".." ).resolve() +if str( third_party_root ) not in sys.path: + sys.path.insert( 0, str( third_party_root ) ) +import build_3rdparty_common as nc + +nc.init_for_dep( + depname = "ICU-WASM", + workdir = Path( sys.argv[2] ), + installdir = Path( sys.argv[2] ), + forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" +) + +patches_dir = script_dir.parent.parent.parent / "DesktopEditor" / "graphics" / "pro" / "js" / "wasm" / "patches" +# DesktopEditor/graphics/pro/js/wasm/patches/fix-wasm-icu.patch + +def fetch_and_patch(): + nc.create_workdir() + + nc.run_command( + [ "git", "-c", "core.autocrlf=false", "-c", "core.eol=lf", "clone", + "--depth", "1", "--branch", f"release-{icu_major}-{icu_minor}", + "https://github.com/unicode-org/icu.git", str(nc.work_dir / "icu2") + ], + "Checkout git repo", + ) + + try: + shutil.copytree( + nc.work_dir / "icu2" / "icu4c", + nc.work_dir / "icu", + copy_function=shutil.copy2 + ) + except Exception as e: + nc.abort_op( f"Copy failed: {e}" ) + + try: + shutil.copy2( nc.work_dir / "icu2" / "LICENSE", nc.work_dir / "LICENSE" ) + except Exception as e: + nc.abort_op( f"License copy failed: {e}" ) + + try: + shutil.rmtree( nc.work_dir / "icu2" ) + except FileNotFoundError: + pass + + nc.run_command( + [ "git", "apply", patches_dir / "fix-wasm-icu.patch" ], + "Patch ICU-WASM", + nc.work_dir / "icu" + ) + + nc.create_work_dir_ok_marker() + + print( "Fetch & patch completed" ) + +if not nc.work_dir_looks_ok(): + fetch_and_patch() + diff --git a/Common/3dParty/icu/nc-build.py b/Common/3dParty/icu/nc-build.py index 5ea4f49c2b..65fc216658 100644 --- a/Common/3dParty/icu/nc-build.py +++ b/Common/3dParty/icu/nc-build.py @@ -15,11 +15,12 @@ sys.path.insert( 0, str( third_party_root ) ) import build_3rdparty_common as nc -nc.work_dir = Path( sys.argv[1] ) -nc.install_dir = Path( sys.argv[2] ) -nc.force_redo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" -nc.dep_name = "ICU" -nc.debug_mode = True +nc.init_for_dep( + depname = "ICU", + workdir = Path( sys.argv[1] ), + installdir = Path( sys.argv[2] ), + forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" +) def fetch_and_patch(): nc.create_workdir() @@ -46,6 +47,11 @@ def fetch_and_patch(): except Exception as e: nc.abort_op( f"License copy failed: {e}" ) + try: + shutil.rmtree( nc.work_dir / "icu2" ) + except FileNotFoundError: + pass + nc.create_work_dir_ok_marker() print( "Fetch & patch completed" ) diff --git a/Common/3dParty/openssl-hash/nc-build.py b/Common/3dParty/openssl-hash/nc-build.py index b6384a5d90..1e0d37840d 100644 --- a/Common/3dParty/openssl-hash/nc-build.py +++ b/Common/3dParty/openssl-hash/nc-build.py @@ -14,7 +14,8 @@ sys.path.insert( 0, str( third_party_root ) ) import build_3rdparty_common as nc -patches_dir = script_dir.parent.parent.parent / "DesktopEditor" / "xmlsec" / "src" / "wasm" / "3rdParty" / "patches" +patches_dir_1 = script_dir.parent.parent.parent / "DesktopEditor" / "xmlsec" / "src" / "wasm" / "3rdParty" / "patches" +patches_dir_2 = script_dir.parent.parent.parent / "DesktopEditor" / "graphics" / "pro" / "js" / "wasm" / "patches" nc.init_for_dep( depname = "OpenSSL-WASM", @@ -37,8 +38,14 @@ def fetch_and_patch(): ) nc.run_command( - [ "git", "apply", patches_dir / "fix-wasm-openssl.patch" ], - "Patch OpenSSL-HASH", + [ "git", "apply", patches_dir_1 / "fix-wasm-openssl.patch" ], + "Patch OpenSSL-HASH #1", + nc.work_dir + ) + + nc.run_command( + [ "git", "apply", patches_dir_2 / "fix-wasm-openssl.patch" ], + "Patch OpenSSL-HASH #2", nc.work_dir ) diff --git a/DesktopEditor/graphics/pro/js/CMakeLists.txt b/DesktopEditor/graphics/pro/js/CMakeLists.txt index 8bc3213d25..8fc1d95616 100644 --- a/DesktopEditor/graphics/pro/js/CMakeLists.txt +++ b/DesktopEditor/graphics/pro/js/CMakeLists.txt @@ -1,9 +1,6 @@ cmake_minimum_required(VERSION 3.20) project(drawingfile) -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_C_STANDARD 11) - # ------------------------------------------------- # Ensure Emscripten # ------------------------------------------------- @@ -16,37 +13,6 @@ set(DESKTOP_ROOT ${CORE_ROOT}/DesktopEditor) include(${CORE_ROOT}/common.cmake) -# ------------------------------------------------- -# Pre/Post build scripts -# ------------------------------------------------- -set(PATCH_STAMP ${CMAKE_BINARY_DIR}/.draw_prereqs_done) - -add_custom_command( - OUTPUT ${PATCH_STAMP} - - COMMAND bash ${CORE_ROOT}/Common/3dParty/icu/nc-build.sh - "${EO_CORE_3RD_PARTY_WORK_DIR}/icu" - "${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu" - 74 2 1 - - COMMAND bash ${CORE_ROOT}/Common/3dParty/openssl/nc-build.sh - "${EO_CORE_3RD_PARTY_WORK_DIR}/openssl" - "${EO_CORE_3RD_PARTY_INSTALL_DIR}/openssl" - 1 - - COMMAND git -C ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu apply - ${CMAKE_CURRENT_SOURCE_DIR}/wasm/patches/fix-wasm-icu.patch - - COMMAND git -C ${EO_CORE_3RD_PARTY_WORK_DIR}/openssl apply - ${CMAKE_CURRENT_SOURCE_DIR}/wasm/patches/fix-wasm-openssl.patch - - COMMAND ${CMAKE_COMMAND} -E touch ${PATCH_STAMP} -) - -add_custom_target(${PROJECT_NAME}_run_before - DEPENDS ${PATCH_STAMP} -) - # ------------------------------------------------- # Source files # (generated from compile_files_array) @@ -757,81 +723,81 @@ set(SOURCES ${CORE_ROOT}/OdfFile/Common/logging.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/ustr_wcs.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/ustrtrns.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/udata.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/ucnv_io.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/ustring.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/umutex.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/putil.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/ustr_cnv.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/ucnvmbcs.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/ucln_cmn.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/ucnv2022.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/ucnvbocu.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/stringpiece.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/charstr.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/ucnv_ext.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/uobject.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/usprep.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/unistr.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/uniset_props.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/loadednormalizer2impl.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/filterednormalizer2.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/utrie2.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/normalizer2.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/normalizer2impl.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/utrie.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/ucase.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/uniset.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/ruleiter.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/parsepos.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/util.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/uprops.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/uvector.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/unames.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/propname.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/utrie2_builder.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/unifunct.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/bmpset.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/unisetspan.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/unifilt.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/patternprops.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/ustrcase.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/bytestrie.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/utf_impl.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/cmemory.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/uhash.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/udatamem.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/umapfile.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/uinvchar.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/uchar.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/ubidi_props.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/characterproperties.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/ucptrie.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/edits.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/umutablecptrie.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/bytesinkutil.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/emojiprops.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/cstring.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/ucmndata.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/ucnv.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/ucnv_u7.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/ucnv_u8.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/ucnv_u16.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/ucnv_u32.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/ucnv_err.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/ucnv_cnv.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/ucnv_lmb.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/ucnv_cb.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/ucnv_ct.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/ucharstrieiterator.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/ucnvlat1.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/uvectr32.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/ucnvhz.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/ucnvscsu.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/ucnv_bld.cpp - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common/ucnvisci.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/ustr_wcs.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/ustrtrns.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/udata.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/ucnv_io.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/ustring.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/umutex.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/putil.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/ustr_cnv.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/ucnvmbcs.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/ucln_cmn.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/ucnv2022.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/ucnvbocu.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/stringpiece.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/charstr.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/ucnv_ext.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/uobject.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/usprep.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/unistr.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/uniset_props.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/loadednormalizer2impl.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/filterednormalizer2.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/utrie2.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/normalizer2.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/normalizer2impl.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/utrie.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/ucase.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/uniset.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/ruleiter.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/parsepos.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/util.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/uprops.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/uvector.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/unames.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/propname.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/utrie2_builder.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/unifunct.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/bmpset.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/unisetspan.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/unifilt.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/patternprops.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/ustrcase.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/bytestrie.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/utf_impl.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/cmemory.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/uhash.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/udatamem.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/umapfile.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/uinvchar.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/uchar.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/ubidi_props.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/characterproperties.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/ucptrie.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/edits.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/umutablecptrie.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/bytesinkutil.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/emojiprops.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/cstring.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/ucmndata.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/ucnv.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/ucnv_u7.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/ucnv_u8.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/ucnv_u16.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/ucnv_u32.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/ucnv_err.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/ucnv_cnv.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/ucnv_lmb.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/ucnv_cb.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/ucnv_ct.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/ucharstrieiterator.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/ucnvlat1.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/uvectr32.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/ucnvhz.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/ucnvscsu.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/ucnv_bld.cpp + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common/ucnvisci.cpp ${DESKTOP_ROOT}/freetype-2.10.4/src/base/ftdebug.c ${DESKTOP_ROOT}/freetype-2.10.4/src/autofit/autofit.c @@ -900,7 +866,6 @@ set_source_files_properties( add_executable(${PROJECT_NAME} ${SOURCES} ) -add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}_run_before) # ------------------------------------------------- # Include directories @@ -916,7 +881,7 @@ target_include_directories(${PROJECT_NAME} PRIVATE ${CORE_ROOT}/OfficeUtils/src/zlib-1.2.11 ${CORE_ROOT}/OfficeUtils/src/zlib-1.2.11/contrib/minizip ${CORE_ROOT}/OfficeUtils/src - ${EO_CORE_3RD_PARTY_WORK_DIR}/icu/icu/source/common + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu-wasm/icu/source/common ${DESKTOP_ROOT}/xml/libxml2/include ${DESKTOP_ROOT}/xml/build/qt ${CORE_ROOT}/PdfFile/lib/goo @@ -925,9 +890,9 @@ target_include_directories(${PROJECT_NAME} PRIVATE ${CORE_ROOT}/PdfFile/lib ${DESKTOP_ROOT}/raster/Jp2/openjpeg ${DESKTOP_ROOT}/raster/Jp2/openjpeg/openjpeg-2.4.0/src/lib/openjp2 - ${EO_CORE_3RD_PARTY_WORK_DIR}/openssl/include - ${EO_CORE_3RD_PARTY_INSTALL_DIR}/openssl/include - ${EO_CORE_3RD_PARTY_WORK_DIR}/openssl + ${EO_CORE_3RD_PARTY_WORK_DIR}/openssl-hash/include + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/openssl-hash/include + ${EO_CORE_3RD_PARTY_WORK_DIR}/openssl-hash ${CORE_ROOT}/DocxRenderer ) @@ -1086,3 +1051,6 @@ add_custom_command( ) add_custom_target(web_bundle ALL DEPENDS "${EO_CORE_OUTPUT_DIR}/engine/drawingfile_native.js") + +declare_victory( ${PROJECT_NAME} ) + diff --git a/common.cmake b/common.cmake index 572b4e5e3b..ba61a618fb 100644 --- a/common.cmake +++ b/common.cmake @@ -53,7 +53,7 @@ if( EMSCRIPTEN ) COMMAND_ECHO STDOUT COMMAND "${PYTHON_BIN}" "${BUILDER_PATH}" - "--only=openssl-hash,hunspell,brotli,harfbuzz,hyphen" + "--only=openssl-hash,hunspell,brotli,harfbuzz,hyphen,icu-wasm" "${EO_CORE_3RD_PARTY_WORK_DIR}" "${EO_CORE_3RD_PARTY_INSTALL_DIR}" RESULT_VARIABLE result ) @@ -79,7 +79,7 @@ else() COMMAND_ECHO STDOUT COMMAND "${PYTHON_BIN}" "${BUILDER_PATH}" - "--except=openssl-wasm" + "--except=openssl-hash,icu-wasm" "${EO_CORE_3RD_PARTY_WORK_DIR}" "${EO_CORE_3RD_PARTY_INSTALL_DIR}" RESULT_VARIABLE result ) From 8b46a46c1a9ea56a58d16625bf7d7a3a340d32bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Thu, 28 May 2026 10:35:21 +0200 Subject: [PATCH 65/80] fix: Guarding cmake policy in common.cmake MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- common.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common.cmake b/common.cmake index ba61a618fb..d3011dca79 100644 --- a/common.cmake +++ b/common.cmake @@ -1,6 +1,8 @@ include_guard(GLOBAL) -cmake_policy(SET CMP0167 OLD) +if(POLICY CMP0167) + cmake_policy(SET CMP0167 OLD) +endif() set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) From b142aa9f49e13b18919c32e77dc9769deb2f56d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Thu, 28 May 2026 10:42:56 +0200 Subject: [PATCH 66/80] fix: Getting error output from python dep build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- common.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/common.cmake b/common.cmake index d3011dca79..9ed3f8fff2 100644 --- a/common.cmake +++ b/common.cmake @@ -58,9 +58,13 @@ if( EMSCRIPTEN ) "--only=openssl-hash,hunspell,brotli,harfbuzz,hyphen,icu-wasm" "${EO_CORE_3RD_PARTY_WORK_DIR}" "${EO_CORE_3RD_PARTY_INSTALL_DIR}" RESULT_VARIABLE result + OUTPUT_VARIABLE output + ERROR_VARIABLE error ) if(result) # on error + message(STATUS "Python script output: ${output}") + message(STATUS "Python script error: ${error}") message(FATAL_ERROR "Common/3dParty/build_3rdparty.py failed!") else() set(THIRD_PARTY_PREPARED TRUE CACHE INTERNAL "Third party prepared") @@ -84,9 +88,13 @@ else() "--except=openssl-hash,icu-wasm" "${EO_CORE_3RD_PARTY_WORK_DIR}" "${EO_CORE_3RD_PARTY_INSTALL_DIR}" RESULT_VARIABLE result + OUTPUT_VARIABLE output + ERROR_VARIABLE error ) if(result) # on error + message(STATUS "Python script output: ${output}") + message(STATUS "Python script error: ${error}") message(FATAL_ERROR "Common/3dParty/build_3rdparty.py failed!") else() set(THIRD_PARTY_PREPARED TRUE CACHE INTERNAL "Third party prepared") From 752bb17613b2e9794f85094d3bd543d5554d50ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Thu, 28 May 2026 10:52:55 +0200 Subject: [PATCH 67/80] fix(python-deps): Fixing typo in helper function to capture process output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Common/3dParty/build_3rdparty_common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/3dParty/build_3rdparty_common.py b/Common/3dParty/build_3rdparty_common.py index 116cb48e43..aa3b4ea919 100644 --- a/Common/3dParty/build_3rdparty_common.py +++ b/Common/3dParty/build_3rdparty_common.py @@ -113,7 +113,7 @@ def run_command( abort_op( f"{description} failed: {e.stderr.strip() or e.stdout.strip() or e}", error_is_fatal=error_is_fatal ) def capture_process_output( cmd : list[str] ) -> str: - result = subprocess.run( [ "clang", "--version" ], capture_output = True, text = True, check = True ) + result = subprocess.run( cmd, capture_output = True, text = True, check = True ) return result.stdout def fix_terminal_encoding(): From 89f5b68a337622b3df1487218b763235b10c21ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Thu, 28 May 2026 10:53:15 +0200 Subject: [PATCH 68/80] fix: Attempt to fix the wasm workflow #1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- .github/workflows/build-wasm.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/build-wasm.yml b/.github/workflows/build-wasm.yml index b51fd2e204..517e3473a1 100644 --- a/.github/workflows/build-wasm.yml +++ b/.github/workflows/build-wasm.yml @@ -32,6 +32,22 @@ jobs: ref: main path: sdkjs/ + - name: Install system dependencies + run: | + apt-get update + apt-get install -y \ + python3 \ + python3-dev \ + build-essential \ + git \ + curl \ + wget \ + pkg-config \ + libssl-dev \ + autoconf \ + automake \ + libtool + - name: Verify Emscripten run: emcc -v From 66df81bf142334daeac6b113b52106d56154c7ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Thu, 28 May 2026 14:13:42 +0200 Subject: [PATCH 69/80] fix: Attempt to fix the wasm workflow #2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Common/3dParty/build_3rdparty.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Common/3dParty/build_3rdparty.py b/Common/3dParty/build_3rdparty.py index 44c302de03..bdba19172f 100644 --- a/Common/3dParty/build_3rdparty.py +++ b/Common/3dParty/build_3rdparty.py @@ -8,7 +8,8 @@ import build_3rdparty_common as nc -sys.stdout.reconfigure(encoding='utf-8') +sys.stdout.reconfigure(encoding='utf-8', line_buffering=True) +sys.stderr.reconfigure(encoding='utf-8', line_buffering=True) subfolders = [ 'apple', From 34bc0a5d5a8685af3359c74b20714bd073cbcf28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Thu, 28 May 2026 14:34:18 +0200 Subject: [PATCH 70/80] fix: Attempt to fix the wasm workflow #3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- common.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/common.cmake b/common.cmake index 9ed3f8fff2..d87e942ea2 100644 --- a/common.cmake +++ b/common.cmake @@ -39,8 +39,13 @@ if( NOT DEFINED VCPKG_BINARY_REMOTE ) set(VCPKG_BINARY_REMOTE "https://cloud.nextcloud.com/public.php/dav/files/n9KYBcFYyLLCgEw" CACHE STRING "Base URL for vcpkg binary package remote") endif() +# if( NOT DEFINED PYTHON_BIN ) +# set(PYTHON_BIN "python" CACHE FILEPATH "Python binary to use.") +# endif() + if( NOT DEFINED PYTHON_BIN ) - set(PYTHON_BIN "python" CACHE FILEPATH "Python binary to use.") + find_package(Python3 REQUIRED) + set(PYTHON_BIN "${Python3_EXECUTABLE}" CACHE FILEPATH "Python binary to use.") endif() message("3rdparty dir: " ${EO_CORE_3RD_PARTY_DIR}) @@ -67,6 +72,7 @@ if( EMSCRIPTEN ) message(STATUS "Python script error: ${error}") message(FATAL_ERROR "Common/3dParty/build_3rdparty.py failed!") else() + message(STATUS "Python script output: ${output}") set(THIRD_PARTY_PREPARED TRUE CACHE INTERNAL "Third party prepared") endif() endif() @@ -97,6 +103,7 @@ else() message(STATUS "Python script error: ${error}") message(FATAL_ERROR "Common/3dParty/build_3rdparty.py failed!") else() + message(STATUS "Python script output: ${output}") set(THIRD_PARTY_PREPARED TRUE CACHE INTERNAL "Third party prepared") endif() endif() From 9876ed741c62e44352b65625510e21c90aeb760f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Thu, 28 May 2026 15:09:50 +0200 Subject: [PATCH 71/80] fix(python-deps): Fixing some suspected and real typos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Common/3dParty/apple/nc-build.py | 2 +- Common/3dParty/brotli/nc-build.py | 2 +- Common/3dParty/harfbuzz/nc-build.py | 2 +- Common/3dParty/html/nc-build.py | 4 ++-- Common/3dParty/hunspell/nc-build.py | 2 +- Common/3dParty/hyphen/nc-build.py | 2 +- Common/3dParty/icu-wasm/nc-build.py | 2 +- Common/3dParty/md/nc-build.py | 2 +- Common/3dParty/openssl-hash/nc-build.py | 2 +- Common/3dParty/socketio/nc-build.py | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Common/3dParty/apple/nc-build.py b/Common/3dParty/apple/nc-build.py index f7f5d91407..daa56e83fa 100644 --- a/Common/3dParty/apple/nc-build.py +++ b/Common/3dParty/apple/nc-build.py @@ -15,7 +15,7 @@ nc.init_for_dep( depname = "Apple", - workdir = Path( sys.argv[2] ), + workdir = Path( sys.argv[2] ), # Work dir is intentionally the same as install dir installdir = Path( sys.argv[2] ), forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" ) diff --git a/Common/3dParty/brotli/nc-build.py b/Common/3dParty/brotli/nc-build.py index 1e78c7a5e2..47d813b062 100644 --- a/Common/3dParty/brotli/nc-build.py +++ b/Common/3dParty/brotli/nc-build.py @@ -14,7 +14,7 @@ nc.init_for_dep( depname = "Brotli", - workdir = Path( sys.argv[2] ), + workdir = Path( sys.argv[2] ), # Work dir is intentionally the same as install dir installdir = Path( sys.argv[2] ), forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" ) diff --git a/Common/3dParty/harfbuzz/nc-build.py b/Common/3dParty/harfbuzz/nc-build.py index f872298037..3afcb39072 100644 --- a/Common/3dParty/harfbuzz/nc-build.py +++ b/Common/3dParty/harfbuzz/nc-build.py @@ -15,7 +15,7 @@ nc.init_for_dep( depname = "Harfbuzz", - workdir = Path( sys.argv[2] ), + workdir = Path( sys.argv[2] ), # Work dir is intentionally the same as install dir installdir = Path( sys.argv[2] ), forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" ) diff --git a/Common/3dParty/html/nc-build.py b/Common/3dParty/html/nc-build.py index ae9f04eccc..f96df89807 100644 --- a/Common/3dParty/html/nc-build.py +++ b/Common/3dParty/html/nc-build.py @@ -14,8 +14,8 @@ import build_3rdparty_common as nc nc.init_for_dep( - depname = "SocketIO", - workdir = Path( sys.argv[2] ), + depname = "HTML", + workdir = Path( sys.argv[2] ), # Work dir is intentionally the same as install dir installdir = Path( sys.argv[2] ), forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" ) diff --git a/Common/3dParty/hunspell/nc-build.py b/Common/3dParty/hunspell/nc-build.py index 2d4aa26a69..6c70ebb817 100644 --- a/Common/3dParty/hunspell/nc-build.py +++ b/Common/3dParty/hunspell/nc-build.py @@ -15,7 +15,7 @@ nc.init_for_dep( depname = "Hunspell", - workdir = Path( sys.argv[2] ), + workdir = Path( sys.argv[2] ), # Work dir is intentionally the same as install dir installdir = Path( sys.argv[2] ), forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" ) diff --git a/Common/3dParty/hyphen/nc-build.py b/Common/3dParty/hyphen/nc-build.py index 9303737566..68f0f9097d 100644 --- a/Common/3dParty/hyphen/nc-build.py +++ b/Common/3dParty/hyphen/nc-build.py @@ -14,7 +14,7 @@ nc.init_for_dep( depname = "Hyphen", - workdir = Path( sys.argv[2] ), + workdir = Path( sys.argv[2] ), # Work dir is intentionally the same as install dir installdir = Path( sys.argv[2] ), forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" ) diff --git a/Common/3dParty/icu-wasm/nc-build.py b/Common/3dParty/icu-wasm/nc-build.py index f2de198d4b..934b795a02 100644 --- a/Common/3dParty/icu-wasm/nc-build.py +++ b/Common/3dParty/icu-wasm/nc-build.py @@ -17,7 +17,7 @@ nc.init_for_dep( depname = "ICU-WASM", - workdir = Path( sys.argv[2] ), + workdir = Path( sys.argv[2] ), # Work dir is intentionally the same as install dir installdir = Path( sys.argv[2] ), forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" ) diff --git a/Common/3dParty/md/nc-build.py b/Common/3dParty/md/nc-build.py index 75c8920b92..4a830c5af2 100644 --- a/Common/3dParty/md/nc-build.py +++ b/Common/3dParty/md/nc-build.py @@ -14,7 +14,7 @@ nc.init_for_dep( depname = "MD", - workdir = Path( sys.argv[2] ), + workdir = Path( sys.argv[2] ), # Work dir is intentionally the same as install dir installdir = Path( sys.argv[2] ), forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" ) diff --git a/Common/3dParty/openssl-hash/nc-build.py b/Common/3dParty/openssl-hash/nc-build.py index 1e0d37840d..be7d87e791 100644 --- a/Common/3dParty/openssl-hash/nc-build.py +++ b/Common/3dParty/openssl-hash/nc-build.py @@ -18,7 +18,7 @@ patches_dir_2 = script_dir.parent.parent.parent / "DesktopEditor" / "graphics" / "pro" / "js" / "wasm" / "patches" nc.init_for_dep( - depname = "OpenSSL-WASM", + depname = "OpenSSL-HASH", workdir = Path( sys.argv[1] ), installdir = Path( sys.argv[2] ), forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" diff --git a/Common/3dParty/socketio/nc-build.py b/Common/3dParty/socketio/nc-build.py index 707993cbf8..ec132cf35d 100644 --- a/Common/3dParty/socketio/nc-build.py +++ b/Common/3dParty/socketio/nc-build.py @@ -15,7 +15,7 @@ nc.init_for_dep( depname = "SocketIO", - workdir = Path( sys.argv[2] ), + workdir = Path( sys.argv[2] ), # Work dir is intentionally the same as install dir installdir = Path( sys.argv[2] ), forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" ) From 017545a5f4ef8c04cf89647085f60d0954fde3aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Thu, 28 May 2026 15:20:09 +0200 Subject: [PATCH 72/80] fix(python-deps): Making sure we use absolute resolved paths MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Common/3dParty/apple/nc-build.py | 4 ++-- Common/3dParty/boost/nc-build.py | 4 ++-- Common/3dParty/brotli/nc-build.py | 4 ++-- Common/3dParty/build_3rdparty.py | 4 ++-- Common/3dParty/harfbuzz/nc-build.py | 4 ++-- Common/3dParty/html/nc-build.py | 4 ++-- Common/3dParty/hunspell/nc-build.py | 4 ++-- Common/3dParty/hyphen/nc-build.py | 4 ++-- Common/3dParty/icu-wasm/nc-build.py | 4 ++-- Common/3dParty/icu/nc-build.py | 4 ++-- Common/3dParty/md/nc-build.py | 4 ++-- Common/3dParty/openssl-hash/nc-build.py | 4 ++-- Common/3dParty/openssl/nc-build.py | 4 ++-- Common/3dParty/socketio/nc-build.py | 4 ++-- Common/3dParty/v8/nc-build.py | 4 ++-- common.cmake | 4 ---- 16 files changed, 30 insertions(+), 34 deletions(-) diff --git a/Common/3dParty/apple/nc-build.py b/Common/3dParty/apple/nc-build.py index daa56e83fa..971e78ebfb 100644 --- a/Common/3dParty/apple/nc-build.py +++ b/Common/3dParty/apple/nc-build.py @@ -15,8 +15,8 @@ nc.init_for_dep( depname = "Apple", - workdir = Path( sys.argv[2] ), # Work dir is intentionally the same as install dir - installdir = Path( sys.argv[2] ), + workdir = Path( sys.argv[2] ).resolve(), # Work dir is intentionally the same as install dir + installdir = Path( sys.argv[2] ).resolve(), forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" ) diff --git a/Common/3dParty/boost/nc-build.py b/Common/3dParty/boost/nc-build.py index 003f99d621..01440e9d4a 100644 --- a/Common/3dParty/boost/nc-build.py +++ b/Common/3dParty/boost/nc-build.py @@ -15,8 +15,8 @@ nc.init_for_dep( depname = "Boost", - workdir = Path( sys.argv[1] ), - installdir = Path( sys.argv[2] ), + workdir = Path( sys.argv[1] ).resolve(), + installdir = Path( sys.argv[2] ).resolve(), forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" ) diff --git a/Common/3dParty/brotli/nc-build.py b/Common/3dParty/brotli/nc-build.py index 47d813b062..ad76f33a4d 100644 --- a/Common/3dParty/brotli/nc-build.py +++ b/Common/3dParty/brotli/nc-build.py @@ -14,8 +14,8 @@ nc.init_for_dep( depname = "Brotli", - workdir = Path( sys.argv[2] ), # Work dir is intentionally the same as install dir - installdir = Path( sys.argv[2] ), + workdir = Path( sys.argv[2] ).resolve(), # Work dir is intentionally the same as install dir + installdir = Path( sys.argv[2] ).resolve(), forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" ) diff --git a/Common/3dParty/build_3rdparty.py b/Common/3dParty/build_3rdparty.py index bdba19172f..9f1f0bdd2d 100644 --- a/Common/3dParty/build_3rdparty.py +++ b/Common/3dParty/build_3rdparty.py @@ -122,8 +122,8 @@ def print_help(): -work_dir = Path( sys.argv[ argc - 2 ] ) -install_dir = Path( sys.argv[ argc - 1 ] ) +work_dir = Path( sys.argv[ argc - 2 ] ).resolve() +install_dir = Path( sys.argv[ argc - 1 ] ).resolve() if sys.platform == "win32" and shutil.which( "nmake" ) is None: raise RuntimeError( diff --git a/Common/3dParty/harfbuzz/nc-build.py b/Common/3dParty/harfbuzz/nc-build.py index 3afcb39072..2daad2b944 100644 --- a/Common/3dParty/harfbuzz/nc-build.py +++ b/Common/3dParty/harfbuzz/nc-build.py @@ -15,8 +15,8 @@ nc.init_for_dep( depname = "Harfbuzz", - workdir = Path( sys.argv[2] ), # Work dir is intentionally the same as install dir - installdir = Path( sys.argv[2] ), + workdir = Path( sys.argv[2] ).resolve(), # Work dir is intentionally the same as install dir + installdir = Path( sys.argv[2] ).resolve(), forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" ) diff --git a/Common/3dParty/html/nc-build.py b/Common/3dParty/html/nc-build.py index f96df89807..415b7abd0c 100644 --- a/Common/3dParty/html/nc-build.py +++ b/Common/3dParty/html/nc-build.py @@ -15,8 +15,8 @@ nc.init_for_dep( depname = "HTML", - workdir = Path( sys.argv[2] ), # Work dir is intentionally the same as install dir - installdir = Path( sys.argv[2] ), + workdir = Path( sys.argv[2] ).resolve(), # Work dir is intentionally the same as install dir + installdir = Path( sys.argv[2] ).resolve(), forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" ) diff --git a/Common/3dParty/hunspell/nc-build.py b/Common/3dParty/hunspell/nc-build.py index 6c70ebb817..89610a970b 100644 --- a/Common/3dParty/hunspell/nc-build.py +++ b/Common/3dParty/hunspell/nc-build.py @@ -15,8 +15,8 @@ nc.init_for_dep( depname = "Hunspell", - workdir = Path( sys.argv[2] ), # Work dir is intentionally the same as install dir - installdir = Path( sys.argv[2] ), + workdir = Path( sys.argv[2] ).resolve(), # Work dir is intentionally the same as install dir + installdir = Path( sys.argv[2] ).resolve(), forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" ) diff --git a/Common/3dParty/hyphen/nc-build.py b/Common/3dParty/hyphen/nc-build.py index 68f0f9097d..1222365288 100644 --- a/Common/3dParty/hyphen/nc-build.py +++ b/Common/3dParty/hyphen/nc-build.py @@ -14,8 +14,8 @@ nc.init_for_dep( depname = "Hyphen", - workdir = Path( sys.argv[2] ), # Work dir is intentionally the same as install dir - installdir = Path( sys.argv[2] ), + workdir = Path( sys.argv[2] ).resolve(), # Work dir is intentionally the same as install dir + installdir = Path( sys.argv[2] ).resolve(), forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" ) diff --git a/Common/3dParty/icu-wasm/nc-build.py b/Common/3dParty/icu-wasm/nc-build.py index 934b795a02..7e0fa90310 100644 --- a/Common/3dParty/icu-wasm/nc-build.py +++ b/Common/3dParty/icu-wasm/nc-build.py @@ -17,8 +17,8 @@ nc.init_for_dep( depname = "ICU-WASM", - workdir = Path( sys.argv[2] ), # Work dir is intentionally the same as install dir - installdir = Path( sys.argv[2] ), + workdir = Path( sys.argv[2] ).resolve(), # Work dir is intentionally the same as install dir + installdir = Path( sys.argv[2] ).resolve(), forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" ) diff --git a/Common/3dParty/icu/nc-build.py b/Common/3dParty/icu/nc-build.py index 65fc216658..84f77f9551 100644 --- a/Common/3dParty/icu/nc-build.py +++ b/Common/3dParty/icu/nc-build.py @@ -17,8 +17,8 @@ nc.init_for_dep( depname = "ICU", - workdir = Path( sys.argv[1] ), - installdir = Path( sys.argv[2] ), + workdir = Path( sys.argv[1] ).resolve(), + installdir = Path( sys.argv[2] ).resolve(), forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" ) diff --git a/Common/3dParty/md/nc-build.py b/Common/3dParty/md/nc-build.py index 4a830c5af2..2748b74af3 100644 --- a/Common/3dParty/md/nc-build.py +++ b/Common/3dParty/md/nc-build.py @@ -14,8 +14,8 @@ nc.init_for_dep( depname = "MD", - workdir = Path( sys.argv[2] ), # Work dir is intentionally the same as install dir - installdir = Path( sys.argv[2] ), + workdir = Path( sys.argv[2] ).resolve(), # Work dir is intentionally the same as install dir + installdir = Path( sys.argv[2] ).resolve(), forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" ) diff --git a/Common/3dParty/openssl-hash/nc-build.py b/Common/3dParty/openssl-hash/nc-build.py index be7d87e791..929ca684fc 100644 --- a/Common/3dParty/openssl-hash/nc-build.py +++ b/Common/3dParty/openssl-hash/nc-build.py @@ -19,8 +19,8 @@ nc.init_for_dep( depname = "OpenSSL-HASH", - workdir = Path( sys.argv[1] ), - installdir = Path( sys.argv[2] ), + workdir = Path( sys.argv[1] ).resolve(), + installdir = Path( sys.argv[2] ).resolve(), forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" ) diff --git a/Common/3dParty/openssl/nc-build.py b/Common/3dParty/openssl/nc-build.py index c071fdc49c..774e6efa86 100644 --- a/Common/3dParty/openssl/nc-build.py +++ b/Common/3dParty/openssl/nc-build.py @@ -15,8 +15,8 @@ nc.init_for_dep( depname = "OpenSSL", - workdir = Path( sys.argv[1] ), - installdir = Path( sys.argv[2] ), + workdir = Path( sys.argv[1] ).resolve(), + installdir = Path( sys.argv[2] ).resolve(), forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" ) diff --git a/Common/3dParty/socketio/nc-build.py b/Common/3dParty/socketio/nc-build.py index ec132cf35d..947c3ea452 100644 --- a/Common/3dParty/socketio/nc-build.py +++ b/Common/3dParty/socketio/nc-build.py @@ -15,8 +15,8 @@ nc.init_for_dep( depname = "SocketIO", - workdir = Path( sys.argv[2] ), # Work dir is intentionally the same as install dir - installdir = Path( sys.argv[2] ), + workdir = Path( sys.argv[2] ).resolve(), # Work dir is intentionally the same as install dir + installdir = Path( sys.argv[2] ).resolve(), forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" ) diff --git a/Common/3dParty/v8/nc-build.py b/Common/3dParty/v8/nc-build.py index f5b573fbea..dd8bc65d71 100644 --- a/Common/3dParty/v8/nc-build.py +++ b/Common/3dParty/v8/nc-build.py @@ -17,8 +17,8 @@ nc.init_for_dep( depname = "V8", - workdir = Path( sys.argv[1] ), - installdir = Path( sys.argv[2] ), + workdir = Path( sys.argv[1] ).resolve(), + installdir = Path( sys.argv[2] ).resolve(), forceredo = len(sys.argv) > 3 and sys.argv[3] == "force-redo" ) diff --git a/common.cmake b/common.cmake index d87e942ea2..d090b74a66 100644 --- a/common.cmake +++ b/common.cmake @@ -39,10 +39,6 @@ if( NOT DEFINED VCPKG_BINARY_REMOTE ) set(VCPKG_BINARY_REMOTE "https://cloud.nextcloud.com/public.php/dav/files/n9KYBcFYyLLCgEw" CACHE STRING "Base URL for vcpkg binary package remote") endif() -# if( NOT DEFINED PYTHON_BIN ) -# set(PYTHON_BIN "python" CACHE FILEPATH "Python binary to use.") -# endif() - if( NOT DEFINED PYTHON_BIN ) find_package(Python3 REQUIRED) set(PYTHON_BIN "${Python3_EXECUTABLE}" CACHE FILEPATH "Python binary to use.") From 9a6a00d0eac8cf94a040de40bf378b8d3887510d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Thu, 28 May 2026 15:45:11 +0200 Subject: [PATCH 73/80] fix(wasm): Adding extra compile flags for emscripten openssl build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Common/3dParty/openssl-hash/nc-build.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Common/3dParty/openssl-hash/nc-build.py b/Common/3dParty/openssl-hash/nc-build.py index 929ca684fc..504f04cca8 100644 --- a/Common/3dParty/openssl-hash/nc-build.py +++ b/Common/3dParty/openssl-hash/nc-build.py @@ -60,6 +60,11 @@ def build_and_install(): nc.abort_op( "Tool not found: emmake - Emsdk is probably not activated" ) if nc.is_linux(): + # Set compiler flags to handle OpenSSL 1.1.1f compatibility with newer Emscripten + env = os.environ.copy() + env["CFLAGS"] = "-Wno-implicit-int -Wno-error=implicit-int -Wno-deprecated-declarations" + env["CXXFLAGS"] = "-Wno-implicit-int -Wno-error=implicit-int -Wno-deprecated-declarations" + nc.run_command( [ "emconfigure", "./config", @@ -72,7 +77,8 @@ def build_and_install(): f"--openssldir={nc.install_dir}", ], "Configure", - nc.work_dir + nc.work_dir, + env = env ) # Fiddle with the makefile @@ -98,7 +104,8 @@ def build_and_install(): "libssl.a", ], "Build", - nc.work_dir + nc.work_dir, + env = env ) nc.run_command( From 06605667550b5fba2ae9929f6e177093e592cce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Thu, 28 May 2026 15:58:46 +0200 Subject: [PATCH 74/80] fix: Attempt to fix the wasm workflow #4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- .github/workflows/build-wasm.yml | 2 +- Common/3dParty/openssl-hash/nc-build.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-wasm.yml b/.github/workflows/build-wasm.yml index 517e3473a1..f83217ae83 100644 --- a/.github/workflows/build-wasm.yml +++ b/.github/workflows/build-wasm.yml @@ -16,7 +16,7 @@ jobs: build-wasm: runs-on: [ubuntu-latest, self-hosted] container: - image: emscripten/emsdk:latest + image: emscripten/emsdk:5.0.4 steps: - name: Checkout repository diff --git a/Common/3dParty/openssl-hash/nc-build.py b/Common/3dParty/openssl-hash/nc-build.py index 504f04cca8..bff509398e 100644 --- a/Common/3dParty/openssl-hash/nc-build.py +++ b/Common/3dParty/openssl-hash/nc-build.py @@ -72,6 +72,7 @@ def build_and_install(): "no-asm", "no-threads", "no-dso", + "no-deprecated", "enable-md2", f"--prefix={nc.install_dir}", f"--openssldir={nc.install_dir}", From b66d0feb16a1462eaf437d01188ba5dbbab79274 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Thu, 28 May 2026 16:27:50 +0200 Subject: [PATCH 75/80] fix: Attempt to fix the build workflow #1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- .github/workflows/build.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 375f876dfb..61398c9197 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -73,12 +73,9 @@ jobs: echo "clang and clang-13 are both v13" - - name: Set up vcpkg - uses: lukka/run-vcpkg@v11 - - name: Configure core, build third_party libs (ICU, V8, etc.) run: | - cmake -GNinja -S . -B build -DVCPKG_TARGET_TRIPLET=x64-linux-dynamic -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake -DVCPKG_MANIFEST_MODE=ON -DVCPKG_MANIFEST_DIR=. + cmake -GNinja -S . -B build - name: Build core (x2t, docbuilder, etc.) run: | From bd61e74c06f54e52bb11433c8e6f34d062b23028 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Thu, 28 May 2026 17:16:03 +0200 Subject: [PATCH 76/80] fix(python-deps): For V8, do not use bundled clang by default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Common/3dParty/v8/nc-build.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Common/3dParty/v8/nc-build.py b/Common/3dParty/v8/nc-build.py index dd8bc65d71..df6019c796 100644 --- a/Common/3dParty/v8/nc-build.py +++ b/Common/3dParty/v8/nc-build.py @@ -172,6 +172,7 @@ def get_gn_args_file_content() -> str: if nc.is_linux(): clang_path = Path(shutil.which("clang")) clang_dir = clang_path.parent.parent + use_bundled_clang = os.environ.get("V8_USE_BUNDLED_CLANG", "false").lower() == "true" gn_args=f""" target_os="linux" @@ -229,13 +230,13 @@ def get_gn_args_file_content() -> str: use_lld=true """ - if targetarch == "arm64": - gn_args = f"""{ gn_args } - cc="clang" - cxx="clang++" - clang_base_path="{ clang_dir }" - """ - + if targetarch == "arm64" or ( not use_bundled_clang ): + gn_args += f""" +clang_base_path="{clang_dir}" +cc="clang" +cxx="clang++" +""" + return gn_args elif nc.is_windows(): From 96cd2915a58b296b2feb09bba03a1dcff4280e3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Thu, 28 May 2026 22:14:37 +0200 Subject: [PATCH 77/80] fix: For Fb2File apply C standard only for C files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Fb2File/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Fb2File/CMakeLists.txt b/Fb2File/CMakeLists.txt index b0b6d8fe11..6de524bd33 100644 --- a/Fb2File/CMakeLists.txt +++ b/Fb2File/CMakeLists.txt @@ -86,7 +86,7 @@ target_include_directories(Fb2File PRIVATE ) if(UNIX) - target_compile_options(Fb2File PRIVATE -std=c99) + target_compile_options(Fb2File PRIVATE $<$:-std=c99>) endif() # dynamic libs From d6dd91c224ce69e83febdd5cb63432a982fed9a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Bari?= Date: Fri, 29 May 2026 09:40:30 +0200 Subject: [PATCH 78/80] fix: Review findings: typos, tiny fixes, stray comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás Bari --- Common/3dParty/build_3rdparty_common.py | 2 +- Common/3dParty/openssl-hash/nc-build.py | 2 +- Common/3dParty/v8/nc-build.py | 4 ++-- Common/CMakeLists.txt | 2 +- DesktopEditor/doctrenderer/CMakeLists.txt | 2 +- DesktopEditor/graphics/cmake/CMakeLists.txt | 2 +- OfficeUtils/CMakeLists.txt | 2 +- PdfFile/CMakeLists.txt | 16 ++-------------- X2tConverter/build/cmake/CMakeLists.txt | 3 --- common.cmake | 4 ++-- 10 files changed, 12 insertions(+), 27 deletions(-) diff --git a/Common/3dParty/build_3rdparty_common.py b/Common/3dParty/build_3rdparty_common.py index aa3b4ea919..799c85ac76 100644 --- a/Common/3dParty/build_3rdparty_common.py +++ b/Common/3dParty/build_3rdparty_common.py @@ -29,7 +29,7 @@ def init_for_dep( log_cleared = False def abort_op( message : str, keep_work : bool = False, error_is_fatal : bool = True ): - print( f"Aboring {dep_name}: {message}", file = sys.stderr ) + print( f"Aborting {dep_name}: {message}", file = sys.stderr ) if error_is_fatal: if not debug_mode: try: diff --git a/Common/3dParty/openssl-hash/nc-build.py b/Common/3dParty/openssl-hash/nc-build.py index bff509398e..85350b73b6 100644 --- a/Common/3dParty/openssl-hash/nc-build.py +++ b/Common/3dParty/openssl-hash/nc-build.py @@ -116,7 +116,7 @@ def build_and_install(): ) else: - abort_op( f"Unkown target platform: {sys.platform}" ) + nc.abort_op( f"Unkown target platform: {sys.platform}" ) nc.create_install_dir_ok_marker() diff --git a/Common/3dParty/v8/nc-build.py b/Common/3dParty/v8/nc-build.py index df6019c796..63b94e2a56 100644 --- a/Common/3dParty/v8/nc-build.py +++ b/Common/3dParty/v8/nc-build.py @@ -50,11 +50,11 @@ def apply_patches(): if patch[ "dir" ].is_dir(): nc.run_command( [ "git", "apply", patches_dir / patch[ "name" ] ], - f"Applying patch: { patch[ "name" ] }", + f"Applying patch: { patch[ 'name' ] }", patch[ "dir" ] ) else: - print( f"[WARNING] cannot apply patch ({ patch[ "name" ] }) because dir doesn't exist!" ) + print( f"[WARNING] cannot apply patch ({ patch[ 'name' ] }) because dir doesn't exist!" ) if nc.is_windows(): nc.run_command( diff --git a/Common/CMakeLists.txt b/Common/CMakeLists.txt index 85736ff82e..3ea0c087a5 100644 --- a/Common/CMakeLists.txt +++ b/Common/CMakeLists.txt @@ -88,7 +88,7 @@ target_compile_definitions(kernel PRIVATE if( NOT MSVC ) target_compile_options(kernel PRIVATE - -include${CMAKE_CURRENT_SOURCE_DIR}/posix_compat.h + "SHELL:-include ${CMAKE_CURRENT_SOURCE_DIR}/posix_compat.h" ) endif() diff --git a/DesktopEditor/doctrenderer/CMakeLists.txt b/DesktopEditor/doctrenderer/CMakeLists.txt index 32637d3f7b..855137834f 100644 --- a/DesktopEditor/doctrenderer/CMakeLists.txt +++ b/DesktopEditor/doctrenderer/CMakeLists.txt @@ -276,7 +276,7 @@ target_link_libraries(doctrenderer INTERFACE target_link_libraries(doctrenderer PRIVATE ${OPENSSL_LIBSSL} ${OPENSSL_LIBCRYPTO} - ${V8_MONILITH} + ${V8_MONOLITH} ) target_link_libraries(doctrenderer PUBLIC diff --git a/DesktopEditor/graphics/cmake/CMakeLists.txt b/DesktopEditor/graphics/cmake/CMakeLists.txt index 52e41e9291..98ce1dfc7b 100644 --- a/DesktopEditor/graphics/cmake/CMakeLists.txt +++ b/DesktopEditor/graphics/cmake/CMakeLists.txt @@ -655,7 +655,7 @@ add_library(graphics SHARED ${FONT_ENGINE_SOURCES_DIR}/FontsAssistant.h ${FONT_ENGINE_SOURCES_DIR}/FontsAssistant.cpp - # harfbuzz.pri_ABS + # harfbuzz.pri ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-aat-layout.cc ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-aat-map.cc ${HARFBUZZ_INSTALL_DIR_ABS}/src/hb-blob.cc diff --git a/OfficeUtils/CMakeLists.txt b/OfficeUtils/CMakeLists.txt index da4114a0cd..506a2be3c2 100644 --- a/OfficeUtils/CMakeLists.txt +++ b/OfficeUtils/CMakeLists.txt @@ -64,6 +64,6 @@ function(add_officeutils TARGET OFFICE_UTILS_DIR) ) if( NOT MSVC ) - target_compile_options( ${TARGET} PRIVATE -includeunistd.h) + target_compile_options( ${TARGET} PRIVATE "SHELL:-include unistd.h") endif() endfunction() diff --git a/PdfFile/CMakeLists.txt b/PdfFile/CMakeLists.txt index 60a10b4f2e..80d472b5a2 100644 --- a/PdfFile/CMakeLists.txt +++ b/PdfFile/CMakeLists.txt @@ -44,7 +44,7 @@ if(NOT TARGET CryptoPPLib) endif() # Note: -# This need brotli and freetype, but thos are already included in +# This needs brotli and freetype, but thos are already included in # graphics, so I'll just take the include paths and defines. add_library(PdfFile SHARED @@ -496,27 +496,15 @@ if(ANDROID) ) endif() -# if(WIN32) -# target_compile_options(PdfFile PRIVATE -# -UUNICODE -# -U_UNICODE -# ) -# endif() - target_link_libraries(PdfFile PUBLIC CryptoPPLib graphics kernel UnicodeConverter kernel_network - - # gdi32 # Windows - # advapi32 # Windows - # user32 # Windows - # shell32 # Windows - # Ole32 # Windows ) copy_artifacts_to_folder("PdfFile" "${EO_CORE_OUTPUT_DIR}") declare_victory( PdfFile ) + diff --git a/X2tConverter/build/cmake/CMakeLists.txt b/X2tConverter/build/cmake/CMakeLists.txt index 195299189d..29ea9e9415 100644 --- a/X2tConverter/build/cmake/CMakeLists.txt +++ b/X2tConverter/build/cmake/CMakeLists.txt @@ -6,9 +6,6 @@ set(CORE_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/../../..") include(${CORE_ROOT_DIR}/common.cmake) -set(BOOST_ROOT "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/boost/linux_64") -find_package(Boost REQUIRED COMPONENTS system filesystem regex date_time) - set(X2T_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/../..") add_subdirectory(library x2tlib) diff --git a/common.cmake b/common.cmake index d090b74a66..09a0c683cc 100644 --- a/common.cmake +++ b/common.cmake @@ -137,9 +137,9 @@ else() set(V8_INSTALL_DIR "${EO_CORE_3RD_PARTY_INSTALL_DIR}/v8") get_filename_component(V8_INSTALL_DIR_ABS "${V8_INSTALL_DIR}" ABSOLUTE) if( MSVC ) - set(V8_MONILITH "${V8_INSTALL_DIR_ABS}/v8_monolith.lib") + set(V8_MONOLITH "${V8_INSTALL_DIR_ABS}/v8_monolith.lib") else() - set(V8_MONILITH "${V8_INSTALL_DIR_ABS}/libv8_monolith.a") + set(V8_MONOLITH "${V8_INSTALL_DIR_ABS}/libv8_monolith.a") endif() # Setup openssl From f9bcf729a1015d4d937fe89581d23588f8345966 Mon Sep 17 00:00:00 2001 From: Hendrik Leidinger Date: Fri, 29 May 2026 13:33:22 -0700 Subject: [PATCH 79/80] fix: make build work for ubuntu 22.04, readd vcpkg for hunspell Signed-off-by: Hendrik Leidinger --- .docker/core.bake.Dockerfile | 6 ++---- .github/workflows/build.yml | 5 ++++- Common/3dParty/build_3rdparty.py | 2 +- Common/3dParty/build_3rdparty_common.py | 5 ++++- Common/3dParty/harfbuzz/nc-build.py | 2 +- PdfFile/Resources/CMapMemory/CMakeLists.txt | 1 + common.cmake | 6 +++++- vcpkg-configuration.json | 16 +--------------- vcpkg.json | 14 +------------- 9 files changed, 20 insertions(+), 37 deletions(-) diff --git a/.docker/core.bake.Dockerfile b/.docker/core.bake.Dockerfile index ccc470003b..667ebf1edb 100644 --- a/.docker/core.bake.Dockerfile +++ b/.docker/core.bake.Dockerfile @@ -141,19 +141,17 @@ FROM core-base AS core ARG TARGETARCH RUN --mount=type=cache,target=/build-cache \ --mount=type=bind,source=${NUGET_SOURCE_PATH},target=/nuget-cache,rw \ - VCPKG_TRIPLET=$([ "$TARGETARCH" = "arm64" ] && echo "arm64-linux-dynamic" || echo "x64-linux-dynamic") && \ mkdir -p ${BUILD_ROOT} && \ cd /build-cache && \ cmake -GNinja \ -DVCPKG_MANIFEST_MODE=ON \ -DVCPKG_MANIFEST_DIR=/core \ - -DVCPKG_TARGET_TRIPLET=${VCPKG_TRIPLET} \ -DCMAKE_TOOLCHAIN_FILE=/opt/vcpkg/scripts/buildsystems/vcpkg.cmake \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_CXX_FLAGS_RELEASE="-O3 -w" \ -DCMAKE_C_FLAGS_RELEASE="-O3 -w" \ - -DEO_CORE_OUTPUT_DIR=./package/bin \ - -DEO_CORE_TOOLS_DIR=./package/tools \ + -DEO_CORE_OUTPUT_DIR=/build-cache/package/bin \ + -DEO_CORE_TOOLS_DIR=/build-cache/package/tools \ /core && \ cmake --build . && \ cp -r package/* ${BUILD_ROOT} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 61398c9197..cedbf9ded2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -73,9 +73,12 @@ jobs: echo "clang and clang-13 are both v13" + - name: Set up vcpkg + uses: lukka/run-vcpkg@v11 + - name: Configure core, build third_party libs (ICU, V8, etc.) run: | - cmake -GNinja -S . -B build + cmake -GNinja -S . -B build -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake -DVCPKG_MANIFEST_MODE=ON -DVCPKG_MANIFEST_DIR=. - name: Build core (x2t, docbuilder, etc.) run: | diff --git a/Common/3dParty/build_3rdparty.py b/Common/3dParty/build_3rdparty.py index 9f1f0bdd2d..9ffc7f0e92 100644 --- a/Common/3dParty/build_3rdparty.py +++ b/Common/3dParty/build_3rdparty.py @@ -147,7 +147,7 @@ def print_help(): for subfolder in subfolders: force_redo = subfolder in force_redo_subfolders print( "---------------------------------------------------------------------------" ) - print( f"Working on {subfolder}{ " (redo forced)" if force_redo else "" }..." ) + print( f"Working on {subfolder}{ ' (redo forced)' if force_redo else '' }..." ) sub_script = Path( script_dir / subfolder / "nc-build.py" ) if sub_script.exists(): try: diff --git a/Common/3dParty/build_3rdparty_common.py b/Common/3dParty/build_3rdparty_common.py index 799c85ac76..a626ca076a 100644 --- a/Common/3dParty/build_3rdparty_common.py +++ b/Common/3dParty/build_3rdparty_common.py @@ -127,7 +127,10 @@ def onerror(func, path, exc_info): os.chmod(path, stat.S_IWRITE) func(path) try: - shutil.rmtree( repo_dir, onexc=onerror ) + if sys.version_info >= (3, 12): + shutil.rmtree( repo_dir, onexc=onerror ) + else: + shutil.rmtree( repo_dir, onerror=onerror ) except FileNotFoundError: pass diff --git a/Common/3dParty/harfbuzz/nc-build.py b/Common/3dParty/harfbuzz/nc-build.py index 2daad2b944..5984d2e279 100644 --- a/Common/3dParty/harfbuzz/nc-build.py +++ b/Common/3dParty/harfbuzz/nc-build.py @@ -26,7 +26,7 @@ def fetch_and_patch(): nc.shallow_checkout( nc.install_dir, "https://github.com/harfbuzz/harfbuzz.git", "894a1f72ee93a1fd8dc1d9218cb3fd8f048be29a" ) nc.run_command( - [ "git", "apply", f"{ patches_dir / "harfbuzz.patch" }" ], + [ "git", "apply", f"{ patches_dir / 'harfbuzz.patch' }" ], "Apply Harfbuzz patch", nc.install_dir ) diff --git a/PdfFile/Resources/CMapMemory/CMakeLists.txt b/PdfFile/Resources/CMapMemory/CMakeLists.txt index 9d00e29174..9381a67637 100644 --- a/PdfFile/Resources/CMapMemory/CMakeLists.txt +++ b/PdfFile/Resources/CMapMemory/CMakeLists.txt @@ -36,6 +36,7 @@ add_custom_command( COMMAND ${CMAKE_COMMAND} -E remove ${EO_CORE_OUTPUT_DIR}/$ DEPENDS CMapSerialize COMMENT "Executing CMapSerialize to create ${ARTIFACT_FILE}" + WORKING_DIRECTORY "${EO_CORE_OUTPUT_DIR}" VERBATIM ) diff --git a/common.cmake b/common.cmake index 09a0c683cc..4a476417a5 100644 --- a/common.cmake +++ b/common.cmake @@ -44,6 +44,10 @@ if( NOT DEFINED PYTHON_BIN ) set(PYTHON_BIN "${Python3_EXECUTABLE}" CACHE FILEPATH "Python binary to use.") endif() +if(NOT DEFINED LINUX AND CMAKE_SYSTEM_NAME STREQUAL "Linux") + set(LINUX TRUE) +endif() + message("3rdparty dir: " ${EO_CORE_3RD_PARTY_DIR}) message("workdir: " ${EO_CORE_3RD_PARTY_WORK_DIR}) message("install: " ${EO_CORE_3RD_PARTY_INSTALL_DIR}) @@ -343,7 +347,7 @@ function(copy_icu_libs artifact) else() add_custom_command(TARGET ${artifact} POST_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory "${EO_CORE_OUTPUT_DIR}" - COMMAND /bin/sh -c "cp -P --update=none \"${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu/lib\"/*.so* \"${EO_CORE_OUTPUT_DIR}/\"" + COMMAND /bin/sh -c "cp -P \"${EO_CORE_3RD_PARTY_INSTALL_DIR}/icu/lib\"/*.so* \"${EO_CORE_OUTPUT_DIR}/\"" COMMENT "Copying ICU libs to ${EO_CORE_OUTPUT_DIR}" ) endif() diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json index 834dc8f35a..bdfc3db308 100644 --- a/vcpkg-configuration.json +++ b/vcpkg-configuration.json @@ -3,19 +3,5 @@ "kind": "git", "repository": "https://github.com/microsoft/vcpkg", "baseline": "66c0373dc7fca549e5803087b9487edfe3aca0a1" - }, - "registries": [ - { - "kind": "git", - "repository": "https://github.com/microsoft/vcpkg", - "baseline": "53bef8994c541b6561884a8395ea35715ece75db", - "packages": [ "harfbuzz" ] - } - ], - "overlay-ports": [ - "./Common/3dParty/cef", - "./Common/3dParty/qt", - "./Common/3dParty/boost", - "./Common/3dParty/v8" - ] + } } \ No newline at end of file diff --git a/vcpkg.json b/vcpkg.json index ab2a047fe1..38dfd27dc4 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -2,20 +2,8 @@ "name": "euro-office", "version": "1.0.0", "dependencies": [ - "hunspell", - "boost", - "v8", - "harfbuzz" + "hunspell" ], - "features": { - "desktop-editors": { - "description": "Dependencies only needed by Desktop Editors", - "dependencies": [ - "cef", - "qt" - ] - } - }, "overrides": [ { "name": "hunspell", "version": "1.7.2" } ] From 7ecf9e1537b1b72e5befef23c76098183637371c Mon Sep 17 00:00:00 2001 From: Hendrik Leidinger Date: Fri, 29 May 2026 19:55:58 -0700 Subject: [PATCH 80/80] feat: 3dParty support for remote caching via nextcloud server Signed-off-by: Hendrik Leidinger --- Common/3dParty/apple/nc-build.py | 14 +- Common/3dParty/boost/nc-build.py | 23 +-- Common/3dParty/brotli/nc-build.py | 8 +- Common/3dParty/build_3rdparty_common.py | 137 ++++++++++++++++++ Common/3dParty/harfbuzz/nc-build.py | 10 +- Common/3dParty/hyphen/nc-build.py | 8 +- Common/3dParty/icu/nc-build.py | 11 +- Common/3dParty/md/nc-build.py | 10 +- Common/3dParty/openssl-hash/nc-build.py | 8 +- Common/3dParty/openssl/nc-build.py | 23 +-- Common/3dParty/v8/nc-build.py | 20 ++- .../xmlsec/src/wasm/hash/CMakeLists.txt | 1 + 12 files changed, 216 insertions(+), 57 deletions(-) diff --git a/Common/3dParty/apple/nc-build.py b/Common/3dParty/apple/nc-build.py index 971e78ebfb..f184587e6b 100644 --- a/Common/3dParty/apple/nc-build.py +++ b/Common/3dParty/apple/nc-build.py @@ -21,7 +21,7 @@ ) def fetch_and_patch(): - nc.create_install_dir() + nc.create_workdir() repos = [ { "name": "glm", "url": "https://github.com/g-truc/glm.git", "commit": "33b4a621a697a305bc3a7610d290677b96beb181" }, @@ -31,29 +31,29 @@ def fetch_and_patch(): { "name": "libetonyek", "url": "https://github.com/LibreOffice/libetonyek.git", "commit": "cb396b4a9453a457469b62a740d8fb933c9442c3" }, ] for repo in repos: - nc.shallow_checkout( nc.install_dir / repo[ "name" ], repo[ "url" ], repo[ "commit" ] ) + nc.shallow_checkout( nc.work_dir / repo[ "name" ], repo[ "url" ], repo[ "commit" ] ) nc.run_command( [ "git", "apply", patches_dir / "mdds.patch" ], "Patching mdds", - nc.install_dir / "mdds" + nc.work_dir / "mdds" ) nc.run_command( [ "git", "apply", patches_dir / "librevenge.patch" ], "Patching librevenge", - nc.install_dir / "librevenge" + nc.work_dir / "librevenge" ) nc.run_command( [ "git", "apply", patches_dir / "libetonyek.patch" ], "Patching libetonyek", - nc.install_dir / "libetonyek" + nc.work_dir / "libetonyek" ) - nc.create_install_dir_ok_marker() + nc.create_work_dir_ok_marker() print( "Fetch & patch completed" ) -if not nc.install_dir_looks_ok(): +if not nc.work_dir_looks_ok(): fetch_and_patch() diff --git a/Common/3dParty/boost/nc-build.py b/Common/3dParty/boost/nc-build.py index 01440e9d4a..a2c4c61b79 100644 --- a/Common/3dParty/boost/nc-build.py +++ b/Common/3dParty/boost/nc-build.py @@ -115,13 +115,16 @@ def build_and_install(): print( "Build and install completed" ) -if not nc.work_dir_looks_ok(): - fetch_and_patch() - -if not nc.install_dir_looks_ok(): - if nc.is_windows() and shutil.which("nmake") is None: - raise RuntimeError( - "MSVC environment is not set up: 'nmake' not found in PATH.\n" - "Run 'vcvarsx86_amd64.bat' or use 'x64 Native Tools Command Prompt'." - ) - build_and_install() +def build_all(): + if not nc.work_dir_looks_ok(): + fetch_and_patch() + + if not nc.install_dir_looks_ok(): + if nc.is_windows() and shutil.which("nmake") is None: + raise RuntimeError( + "MSVC environment is not set up: 'nmake' not found in PATH.\n" + "Run 'vcvarsx86_amd64.bat' or use 'x64 Native Tools Command Prompt'." + ) + build_and_install() + +nc.ensure_dep( build_all ) \ No newline at end of file diff --git a/Common/3dParty/brotli/nc-build.py b/Common/3dParty/brotli/nc-build.py index ad76f33a4d..807351a38d 100644 --- a/Common/3dParty/brotli/nc-build.py +++ b/Common/3dParty/brotli/nc-build.py @@ -20,13 +20,13 @@ ) def fetch_and_patch(): - nc.create_install_dir() + nc.create_workdir() - nc.shallow_checkout( nc.install_dir, "https://github.com/google/brotli.git", "a47d7475063eb223c87632eed806c0070e70da29" ) + nc.shallow_checkout( nc.work_dir, "https://github.com/google/brotli.git", "a47d7475063eb223c87632eed806c0070e70da29" ) - nc.create_install_dir_ok_marker() + nc.create_work_dir_ok_marker() print( "Fetch & patch completed" ) -if not nc.install_dir_looks_ok(): +if not nc.work_dir_looks_ok(): fetch_and_patch() diff --git a/Common/3dParty/build_3rdparty_common.py b/Common/3dParty/build_3rdparty_common.py index a626ca076a..bbe682c729 100644 --- a/Common/3dParty/build_3rdparty_common.py +++ b/Common/3dParty/build_3rdparty_common.py @@ -4,6 +4,8 @@ import subprocess import os import time +import platform +import tempfile from pathlib import Path dep_name = None @@ -179,3 +181,138 @@ def elapsed_string( self ) -> float: end = time.perf_counter() elapsed = end - self.start return f"{elapsed:.6f} second(s)" + + +# =========================================================================== +# Remote cache (Nextcloud WebDAV) +# +# One entry point: ensure_dep(build_fn). Call it from every nc-build.py instead +# of the manual `if not install_dir_looks_ok(): build_fn()` check. It will: +# 0. skip if the install dir already looks ok locally +# 1. else download + extract a prebuilt archive from the remote, if present +# 2. else run build_fn() (which must end by creating the ok-marker) and then +# archive the install dir and upload it for next time +# +# It relies on the module state that init_for_dep() already sets: +# - install_dir (the resolved install dir; confirmed used elsewhere) +# - install_dir_looks_ok() (the ok-marker check) +# - the force-redo flag (read defensively below) +# +# Credentials come from the environment so nothing is committed: +# NEXTCLOUD_USER, NEXTCLOUD_PASS. 'curl' must be on PATH when they are set. +# If either is empty the remote cache is disabled and ensure_dep behaves like +# the old manual check (build locally only). +# =========================================================================== + +NEXTCLOUD_USER = os.environ.get( "NEXTCLOUD_USER", "" ) +NEXTCLOUD_PASS = os.environ.get( "NEXTCLOUD_PASS", "" ) +NEXTCLOUD_REMOTE = "https://cloud.nextcloud.com/remote.php/dav/files" +BASE_REMOTE_PATH = "3DPARTY_DEPS_1" +# Keep OS/arch builds apart on the remote, e.g. "linux-x86_64", "win32-AMD64". +PLATFORM_TAG = f"{ sys.platform }-{ platform.machine() }" +USE_REMOTE_CACHE = bool( NEXTCLOUD_USER and NEXTCLOUD_PASS ) + + +def _force_redo_flag(): + # init_for_dep() stores the forceredo flag in a module global; accept a few + # likely names so this works without knowing the exact one. + g = globals() + for nm in ( "force_redo", "forceredo", "_force_redo" ): + if nm in g: + return bool( g[ nm ] ) + return False + + +def _cache_key(): + # Folder name of the install dir, e.g. "harfbuzz". Stable across runs and + # independent of the (sometimes capitalised) depname. + return install_dir.name + + +def _remote_file_url(): + key = _cache_key() + return ( f"{ NEXTCLOUD_REMOTE }/{ NEXTCLOUD_USER }/{ BASE_REMOTE_PATH }" + f"/{ PLATFORM_TAG }/{ key }/{ key }.tar.bz2" ) + + +def _curl( *args ): + return subprocess.run( + [ "curl", "-s", "-u", f"{ NEXTCLOUD_USER }:{ NEXTCLOUD_PASS }", *args ], + text=True, capture_output=True, + ) + + +def _remote_exists(): + # HEAD request: True only on a 2xx status code. + r = _curl( "-o", os.devnull, "-w", "%{http_code}", "--head", _remote_file_url() ) + return r.stdout.strip().startswith( "2" ) + + +def _remote_download_and_extract(): + with tempfile.TemporaryDirectory() as tmp: + archive = str( Path( tmp ) / "dep.tar.bz2" ) + if _curl( "-f", "-o", archive, _remote_file_url() ).returncode != 0: + return False + if install_dir.exists(): + shutil.rmtree( install_dir ) + install_dir.mkdir( parents=True, exist_ok=True ) + shutil.unpack_archive( archive, str( install_dir ) ) + return True + + +def _remote_upload(): + with tempfile.TemporaryDirectory() as tmp: + # Archive into a temp dir so the .tar.bz2 is never inside install_dir + # (important since work dir and install dir can be the same path). + archive = shutil.make_archive( str( Path( tmp ) / _cache_key() ), + "bztar", root_dir=str( install_dir ) ) + base = f"{ NEXTCLOUD_REMOTE }/{ NEXTCLOUD_USER }" + key = _cache_key() + # WebDAV does not create intermediate collections, so MKCOL each level + # (MKCOL on an existing collection just 405s, which we ignore). + for part in ( BASE_REMOTE_PATH, + f"{ BASE_REMOTE_PATH }/{ PLATFORM_TAG }", + f"{ BASE_REMOTE_PATH }/{ PLATFORM_TAG }/{ key }" ): + _curl( "-X", "MKCOL", f"{ base }/{ part }" ) + _curl( "-X", "DELETE", _remote_file_url() ) + return _curl( "-f", "-T", archive, _remote_file_url() ).returncode == 0 + + +def ensure_dep( build_fn, forceredo=None ): + """ + Drop-in replacement for `if not install_dir_looks_ok(): build_fn()`. + + Call once per dependency, after init_for_dep(). `build_fn` must create the + ok-marker (e.g. via create_install_dir_ok_marker()) when it finishes -- the + marker is what makes the dep count as "done" both locally and inside the + uploaded archive. + """ + force_redo = _force_redo_flag() if forceredo is None else bool( forceredo ) + name = _cache_key() + + # 0. Already built locally. install_dir_looks_ok() already returns False on + # a forced redo, so this correctly does NOT skip in that case. + if install_dir_looks_ok(): + print( f" \u2705 { name } already present locally, skipping" ) + return + + # 1. Prebuilt archive on the remote (skipped on a forced redo so we rebuild + # and refresh the remote instead of pulling a stale copy). + if USE_REMOTE_CACHE and not force_redo and _remote_exists(): + print( f" \u2b07\ufe0f Found { name } on remote, downloading..." ) + if _remote_download_and_extract() and install_dir_looks_ok(): + print( f" \u2705 { name } fetched from remote" ) + return + print( " \u26a0\ufe0f Remote copy missing/incomplete, building locally." ) + + # 2. Build locally, then archive + upload for next time. + build_fn() + if not install_dir_looks_ok(): + print( f" \u26a0\ufe0f { name }: build finished but no ok-marker was created" ) + return + if USE_REMOTE_CACHE: + print( f" \u2b06\ufe0f Uploading { name } to remote..." ) + if _remote_upload(): + print( f" \u2705 { name } uploaded" ) + else: + print( f" \u26a0\ufe0f Upload of { name } failed" ) \ No newline at end of file diff --git a/Common/3dParty/harfbuzz/nc-build.py b/Common/3dParty/harfbuzz/nc-build.py index 5984d2e279..1c6bfe985d 100644 --- a/Common/3dParty/harfbuzz/nc-build.py +++ b/Common/3dParty/harfbuzz/nc-build.py @@ -21,19 +21,19 @@ ) def fetch_and_patch(): - nc.create_install_dir() + nc.create_workdir() - nc.shallow_checkout( nc.install_dir, "https://github.com/harfbuzz/harfbuzz.git", "894a1f72ee93a1fd8dc1d9218cb3fd8f048be29a" ) + nc.shallow_checkout( nc.work_dir, "https://github.com/harfbuzz/harfbuzz.git", "894a1f72ee93a1fd8dc1d9218cb3fd8f048be29a" ) nc.run_command( [ "git", "apply", f"{ patches_dir / 'harfbuzz.patch' }" ], "Apply Harfbuzz patch", - nc.install_dir + nc.work_dir ) - nc.create_install_dir_ok_marker() + nc.create_work_dir_ok_marker() print( "Fetch & patch completed" ) -if not nc.install_dir_looks_ok(): +if not nc.work_dir_looks_ok(): fetch_and_patch() diff --git a/Common/3dParty/hyphen/nc-build.py b/Common/3dParty/hyphen/nc-build.py index 1222365288..b88ecf6fd3 100644 --- a/Common/3dParty/hyphen/nc-build.py +++ b/Common/3dParty/hyphen/nc-build.py @@ -20,16 +20,16 @@ ) def fetch_and_patch(): - nc.create_install_dir() + nc.create_workdir() nc.run_command( - [ "git", "clone", "https://github.com/hunspell/hyphen", nc.install_dir ], + [ "git", "clone", "https://github.com/hunspell/hyphen", nc.work_dir ], "Git clone", ) - nc.create_install_dir_ok_marker() + nc.create_work_dir_ok_marker() print( "Fetch & patch completed" ) -if not nc.install_dir_looks_ok(): +if not nc.work_dir_looks_ok(): fetch_and_patch() diff --git a/Common/3dParty/icu/nc-build.py b/Common/3dParty/icu/nc-build.py index 84f77f9551..8431d830cf 100644 --- a/Common/3dParty/icu/nc-build.py +++ b/Common/3dParty/icu/nc-build.py @@ -110,8 +110,11 @@ def build_and_install(): nc.fix_terminal_encoding() print( "Build and install completed" ) -if not nc.work_dir_looks_ok(): - fetch_and_patch() +def build_all(): + if not nc.work_dir_looks_ok(): + fetch_and_patch() -if not nc.install_dir_looks_ok(): - build_and_install() + if not nc.install_dir_looks_ok(): + build_and_install() + +nc.ensure_dep( build_all ) \ No newline at end of file diff --git a/Common/3dParty/md/nc-build.py b/Common/3dParty/md/nc-build.py index 2748b74af3..2b13eafb2d 100644 --- a/Common/3dParty/md/nc-build.py +++ b/Common/3dParty/md/nc-build.py @@ -20,22 +20,22 @@ ) def fetch_and_patch(): - nc.create_install_dir() + nc.create_workdir() nc.run_command( - [ "git", "clone", "https://github.com/mity/md4c.git", nc.install_dir ], + [ "git", "clone", "https://github.com/mity/md4c.git", nc.work_dir ], "Git clone", ) nc.run_command( [ "git", "checkout", "481fbfbdf72daab2912380d62bb5f2187d438408" ], "Checkout commit", - nc.install_dir + nc.work_dir ) - nc.create_install_dir_ok_marker() + nc.create_work_dir_ok_marker() print( "Fetch & patch completed" ) -if not nc.install_dir_looks_ok(): +if not nc.work_dir_looks_ok(): fetch_and_patch() diff --git a/Common/3dParty/openssl-hash/nc-build.py b/Common/3dParty/openssl-hash/nc-build.py index 85350b73b6..b2915dc357 100644 --- a/Common/3dParty/openssl-hash/nc-build.py +++ b/Common/3dParty/openssl-hash/nc-build.py @@ -129,5 +129,9 @@ def build_and_install(): if not nc.work_dir_looks_ok(): fetch_and_patch() -if not nc.install_dir_looks_ok(): - build_and_install() +def build_all(): + + if not nc.install_dir_looks_ok(): + build_and_install() + +nc.ensure_dep( build_all ) \ No newline at end of file diff --git a/Common/3dParty/openssl/nc-build.py b/Common/3dParty/openssl/nc-build.py index 774e6efa86..6191508309 100644 --- a/Common/3dParty/openssl/nc-build.py +++ b/Common/3dParty/openssl/nc-build.py @@ -100,13 +100,16 @@ def build_and_install(): print( "Build and install completed" ) -if not nc.work_dir_looks_ok(): - fetch_and_patch() - -if not nc.install_dir_looks_ok(): - if nc.is_windows() and shutil.which("nmake") is None: - raise RuntimeError( - "MSVC environment is not set up: 'nmake' not found in PATH.\n" - "Run 'vcvarsx86_amd64.bat' or use 'x64 Native Tools Command Prompt'." - ) - build_and_install() +def build_all(): + if not nc.work_dir_looks_ok(): + fetch_and_patch() + + if not nc.install_dir_looks_ok(): + if nc.is_windows() and shutil.which("nmake") is None: + raise RuntimeError( + "MSVC environment is not set up: 'nmake' not found in PATH.\n" + "Run 'vcvarsx86_amd64.bat' or use 'x64 Native Tools Command Prompt'." + ) + build_and_install() + +nc.ensure_dep( build_all ) diff --git a/Common/3dParty/v8/nc-build.py b/Common/3dParty/v8/nc-build.py index 63b94e2a56..2f6287d3da 100644 --- a/Common/3dParty/v8/nc-build.py +++ b/Common/3dParty/v8/nc-build.py @@ -535,15 +535,23 @@ def build_and_install(): print( "Build and install completed" ) -check_prequisites() +def build_all(): + # Everything required to produce the install dir locally. ensure_dep() only + # calls this when the install dir is neither present locally nor on the + # remote, so prerequisites and the large, host-specific work-dir fetch are + # skipped entirely on a cache hit (a download-only machine needs no compiler). + check_prequisites() -if not nc.work_dir_looks_ok(): - fetch_and_patch() + if not nc.work_dir_looks_ok(): + fetch_and_patch() -if not nc.install_dir_looks_ok(): - if nc.is_windows() and shutil.which("nmake") is None: + if nc.is_windows() and shutil.which( "nmake" ) is None: raise RuntimeError( "MSVC environment is not set up: 'nmake' not found in PATH.\n" "Run 'vcvarsx86_amd64.bat' or use 'x64 Native Tools Command Prompt'." ) - build_and_install() + + build_and_install() # ends by creating the install-dir ok-marker + + +nc.ensure_dep( build_all ) \ No newline at end of file diff --git a/DesktopEditor/xmlsec/src/wasm/hash/CMakeLists.txt b/DesktopEditor/xmlsec/src/wasm/hash/CMakeLists.txt index 1700ec6e27..0688be824b 100644 --- a/DesktopEditor/xmlsec/src/wasm/hash/CMakeLists.txt +++ b/DesktopEditor/xmlsec/src/wasm/hash/CMakeLists.txt @@ -62,6 +62,7 @@ set_target_properties(${PROJECT_NAME} PROPERTIES target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${EO_CORE_3RD_PARTY_WORK_DIR}/openssl-hash/include + ${EO_CORE_3RD_PARTY_INSTALL_DIR}/openssl-hash/include ) # -------------------------------------------------