diff --git a/README.md b/README.md index d69dbf8..cd944ab 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ This project comprises a collection of scripts to build a modern GNUstep toolchain for x64 or arm64 architectures using the Visual Studio toolchain and LLVM/Clang. The toolchain supports Objective-C 2.0 features like blocks and Automatic Reference Counting (ARC) and can be used to integrate Objective-C code in any native Windows app — including Visual Studio projects — using LLVM/Clang (without using MinGW). +The toolchain supports Windows 10 version 1903 or later. + ## Libraries @@ -19,7 +21,6 @@ The toolchain consists of the following libraries: - [libxml2](https://github.com/GNOME/libxml2) - [libxslt](https://github.com/GNOME/libxslt) - [libcurl](https://github.com/curl/curl) -- [ICU](https://docs.microsoft.com/en-us/windows/win32/intl/international-components-for-unicode--icu-) (using system-provided DLL on Windows 10 version 1903 or later) ## Installation diff --git a/patches/opt-libxml2-windows-icu.patch b/patches/libxml2-windows-icu.patch similarity index 100% rename from patches/opt-libxml2-windows-icu.patch rename to patches/libxml2-windows-icu.patch diff --git a/phases/15-icu.bat b/phases/15-icu.bat deleted file mode 100644 index 9b8fe38..0000000 --- a/phases/15-icu.bat +++ /dev/null @@ -1,91 +0,0 @@ -@echo off -setlocal - -set GITHUB_REPO=unicode-org/icu - -call "%~dp0\..\scripts\common.bat" loadenv || exit /b 1 - -:: determine whether we can use the Windows-provided ICU -:: (requires Windows 10 version 1903 / build 18362 or later) -for /f "tokens=4-6 delims=. " %%i in ('ver') do ( - set WIN_VERSION=%%i - set WIN_BUILD=%%k -) -if %WIN_VERSION% GTR 10 ( - :: Windows 11 or later - set SKIP_ICU=1 -) else if %WIN_VERSION% EQU 10 ( - if %WIN_BUILD% GEQ 18362 ( - :: Windows 10 version 1903 / build 18362 or later - set SKIP_ICU=1 - ) -) -if defined SKIP_ICU ( - echo Using system-provided ICU DLL ^(requires Windows 10 version 1903 or later^) - exit /b 0 -) - -:: get the latest release tag from GitHub -cd %~dp0 -if not defined ICU_VERSION ( - for /f "usebackq delims=" %%i in (`call %BASH% '../scripts/get-latest-github-release-tag.sh %GITHUB_REPO% release-'`) do ( - for /f "tokens=2,3 delims=-" %%j in ("%%i") do ( - set ICU_VERSION=%%j.%%k - ) - ) -) -if not defined ICU_VERSION ( - echo Error getting latest ICU release - exit /b 1 -) -echo Using ICU %ICU_VERSION% - -:: build download URL -if "%ARCH%" == "x86" set ICU_ARCH=Win32 -if "%ARCH%" == "x64" set ICU_ARCH=Win64 -set ICU_RELEASE_URL=https://github.com/%GITHUB_REPO%/releases/download/release-%ICU_VERSION:.=-%/icu4c-%ICU_VERSION:.=_%-%ICU_ARCH%-MSVC2019.zip - -for %%a in ("%ICU_RELEASE_URL%") do ( - set ICU_RELEASE_FILE=%%~nxa -) -set ICU_RELEASE_FOLDER=%CACHE_ROOT%\icu - -if not exist "%CACHE_ROOT%" (mkdir "%CACHE_ROOT%" || exit /b 1) -cd "%CACHE_ROOT%" || exit /b 1 - -if not exist %ICU_RELEASE_FILE% ( - echo. - echo ### Downloading release - curl -L -O# %ICU_RELEASE_URL% || exit /b 1 -) - -if exist "%ICU_RELEASE_FOLDER%" (rmdir /S /Q "%ICU_RELEASE_FOLDER%" || exit 1) - -echo. -echo ### Extracting release -powershell Expand-Archive -DestinationPath "%ICU_RELEASE_FOLDER%" "%ICU_RELEASE_FILE%" || exit /b 1 - -:: sometimes ICU releases just contain another ZIP file, so we need to extract that -for /D %%d in ("%ICU_RELEASE_FOLDER%\*ICU*") do ( - for /F %%f in ("%%~d\*.zip") do ( - echo. - echo ### Extracting nested release %%~nxf - powershell Expand-Archive -DestinationPath "%ICU_RELEASE_FOLDER%" "%%f" || exit /b 1 - ) -) - -echo. -echo ### Installing -cd %ICU_RELEASE_FOLDER% || exit /b 1 -pushd bin* || exit /b 1 -xcopy /Y /F "icu*.dll" "%INSTALL_PREFIX%\bin\" || exit /b 1 -popd -pushd lib* || exit /b 1 -xcopy /Y /F "icu*.lib" "%INSTALL_PREFIX%\lib\" || exit /b 1 -popd -xcopy /Y /F /S "include\*" "%INSTALL_PREFIX%\include\" || exit /b 1 - -:: write pkgconfig files -call "%~dp0\..\scripts\common.bat" write_pkgconfig icu-i18n %ICU_VERSION% "" -licuin "" icu-uc || exit /b 1 -call "%~dp0\..\scripts\common.bat" write_pkgconfig icu-io %ICU_VERSION% "" -licuio "" icu-i18n || exit /b 1 -call "%~dp0\..\scripts\common.bat" write_pkgconfig icu-uc %ICU_VERSION% "" "-licuuc -licudt" || exit /b 1 diff --git a/phases/16-libxml2.bat b/phases/16-libxml2.bat index 2134bc5..cf34f93 100644 --- a/phases/16-libxml2.bat +++ b/phases/16-libxml2.bat @@ -14,16 +14,6 @@ for /f "usebackq delims=" %%i in (`call %BASH% '../scripts/get-latest-github-rel call "%~dp0\..\scripts\common.bat" prepare_project || exit /b 1 cd "%SRCROOT%\%PROJECT%" || exit \b 1 - -:: check which ICU libraries to link -if exist "%INSTALL_PREFIX%\lib\icuin.lib" ( - set "LIBS_PRIVATE=-licuin -licuuc -licudt" -) else ( - echo Using system-provided ICU DLL ^(requires Windows 10 version 1903 or later^) - git apply "%ROOT_DIR%\patches\opt-libxml2-windows-icu.patch" || exit /b 1 - set "LIBS_PRIVATE=-licu" -) - cd "win32" || exit /b 1 echo. @@ -55,4 +45,4 @@ xcopy /Y /F "bin.msvc\libxml2_a.lib" "%INSTALL_PREFIX%\lib\xml2.lib*" || exit /b xcopy /Y /F "%SRCROOT%\%PROJECT%\include\libxml\*.h" "%INSTALL_PREFIX%\include\libxml\" || exit /b 1 :: write pkgconfig file -call "%~dp0\..\scripts\common.bat" write_pkgconfig libxml-2.0 %TAG% -DLIBXML_STATIC -lxml2 "%LIBS_PRIVATE%" || exit /b 1 +call "%~dp0\..\scripts\common.bat" write_pkgconfig libxml-2.0 %TAG% -DLIBXML_STATIC -lxml2 -licu || exit /b 1