diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fffb197..2bdc046 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,6 +19,10 @@ jobs: matrix: arch: [x86, x64] + defaults: + run: + shell: cmd + steps: - uses: actions/checkout@v3 @@ -30,10 +34,13 @@ jobs: # install MSYS packages install: make autoconf automake libtool pkg-config - - name: Delete MinGW gmake - # delete /c/Strawberry/c/bin/gmake built for MinGW that is found on runners, because we must use make built for MSYS - run: if GMAKE_PATH=`which gmake`; then rm -f "$GMAKE_PATH"; fi - shell: msys2 {0} + - name: Remove Perl Strawberry installation + # C:\Strawberry contains various MinGW libraries and binaries like pkg-config + # that can get picked up by configure/CMake and don't necessarily behave + # correctly when not using a MinGW environment, and more specifically we cannot + # use MinGW gmake but must use MSYS make for correctly handling of Windows paths, + # so we delete everything that could mess up our builds + run: rmdir /S /Q C:\Strawberry - name: Install Windows packages run: choco install ninja @@ -49,7 +56,6 @@ jobs: :: use msys2.cmd from setup-msys2 as Bash shell, as it doesn't have msys2_shell.cmd used normally by build.bat set "BASH=msys2 -c" build.bat - shell: cmd - name: Package release run: | diff --git a/README.md b/README.md index c6e9bc3..e977c3b 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This project comprises a collection of scripts to build a modern GNUstep toolcha ## Libraries -The toolchain currently consists of the following libraries: +The toolchain consists of the following libraries: - [GNUstep Base Library](https://github.com/gnustep/libs-base) (Foundation) - [GNUstep CoreBase Library](https://github.com/gnustep/libs-corebase) (CoreFoundation) @@ -18,6 +18,7 @@ The toolchain currently consists of the following libraries: - [libiconv](https://github.com/kiyolee/libiconv-win-build) - [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) diff --git a/patches/libdispatch-fix-socket-closed.patch b/patches/libdispatch-fix-socket-closed.patch new file mode 100644 index 0000000..df7b10b --- /dev/null +++ b/patches/libdispatch-fix-socket-closed.patch @@ -0,0 +1,19 @@ +https://github.com/apple/swift-corelibs-libdispatch/pull/772 +--- +diff --git a/src/event/event_windows.c b/src/event/event_windows.c +index 94674a3..148c9de 100644 +--- a/src/event/event_windows.c ++++ b/src/event/event_windows.c +@@ -219,7 +219,11 @@ _dispatch_muxnote_disarm_events(dispatch_muxnote_t dmn, + iResult = WSAEventSelect((SOCKET)dmn->dmn_ident, NULL, 0); + } + if (iResult != 0) { +- DISPATCH_INTERNAL_CRASH(WSAGetLastError(), "WSAEventSelect"); ++ // ignore error if socket was already closed ++ int err = WSAGetLastError(); ++ if (err != WSAENOTSOCK) { ++ DISPATCH_INTERNAL_CRASH(err, "WSAEventSelect"); ++ } + } + dmn->dmn_network_events = lNetworkEvents; + if (!lNetworkEvents && dmn->dmn_threadpool_wait) { diff --git a/phases/19-libcurl.bat b/phases/19-libcurl.bat new file mode 100644 index 0000000..368dd1d --- /dev/null +++ b/phases/19-libcurl.bat @@ -0,0 +1,46 @@ +@echo off +setlocal + +set PROJECT=libcurl +set GITHUB_REPO=curl/curl + +:: get the latest release tag from GitHub +cd %~dp0 +for /f "usebackq delims=" %%i in (`call %BASH% '../scripts/get-latest-github-release-tag.sh %GITHUB_REPO% curl-'`) do ( + set TAG=%%i +) + +:: load environment and prepare project +call "%~dp0\..\scripts\common.bat" prepare_project || exit /b 1 + +cd "%SRCROOT%\%PROJECT%" || exit \b 1 + +:: generate build config +call "buildconf.bat" || exit \b 1 + +set BUILD_DIR="%SRCROOT%\%PROJECT%\build-%ARCH%-%BUILD_TYPE%" +if exist "%BUILD_DIR%" (rmdir /S /Q "%BUILD_DIR%" || exit /b 1) +mkdir "%BUILD_DIR%" || exit /b 1 +cd "%BUILD_DIR%" || exit /b 1 + +echo. +echo ### Running cmake +cmake .. %CMAKE_OPTIONS% ^ + -D BUILD_SHARED_LIBS=YES ^ + -D CURL_USE_SCHANNEL=YES ^ + -D BUILD_CURL_EXE=NO ^ + || exit /b 1 + +echo. +echo ### Building +ninja || exit /b 1 + +echo. +echo ### Installing +ninja install || exit /b 1 + +:: install PDB file +xcopy /Y /F lib\libcurl*.pdb "%INSTALL_PREFIX%\bin\" || exit /b 1 + +:: rename libcurl-d_imp.lib to curl.lib to allow linking using -lcurl +move /y "%INSTALL_PREFIX%\lib\libcurl*.lib" "%INSTALL_PREFIX%\lib\curl.lib" || exit /b 1 diff --git a/scripts/common.bat b/scripts/common.bat index d5102d4..2166dd8 100644 --- a/scripts/common.bat +++ b/scripts/common.bat @@ -49,7 +49,7 @@ exit /b %errorlevel% echo. :: check out tag/branch if any if not "%TAG%" == "" ( - echo ### Checking out %TAG% + echo ### Checking out "%TAG%" git fetch --tags || exit /b 1 git checkout -q %TAG% || exit /b 1 )