diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index c756859..7db350d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -176,7 +176,7 @@ jobs: id: cache_key run: | cd scripts - python get_cache_key.py --prefix=win zlib pkgconf exiv2 openssl || exit 1 + python get_cache_key.py --prefix=win zlib pkgconf expat exiv2 openssl || exit 1 - name: Cache id: cache uses: actions/cache@v2 @@ -213,6 +213,11 @@ jobs: run: | COPY /Y scripts\build_win_pkgconf.bat || exit 1 CALL build_win_pkgconf.bat || exit 1 + - name: Build expat + if: steps.cache.outputs.cache-hit != 'true' + run: | + COPY /Y scripts\build_win_expat.bat || exit 1 + CALL build_win_expat.bat || exit 1 - name: Build exiv2 if: steps.cache.outputs.cache-hit != 'true' run: | diff --git a/patch/zlib-msvc/zconf.h.patch b/patch/zlib-msvc/zconf.h.patch index f4ad002..0f03549 100644 --- a/patch/zlib-msvc/zconf.h.patch +++ b/patch/zlib-msvc/zconf.h.patch @@ -1,9 +1,9 @@ ---- zconf.h.orig 2022-04-26 09:20:44 +0000 -+++ zconf.h 2022-04-26 09:23:39 +0000 -@@ -474,7 +474,7 @@ +--- zconf.h.orig 2022-10-20 11:06:04 +0000 ++++ zconf.h 2022-10-20 11:06:56 +0000 +@@ -487,7 +487,7 @@ #endif #ifndef Z_SOLO - # if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE) + # if defined(Z_HAVE_UNISTD_H) -# include /* for SEEK_*, off_t, and _LFS64_LARGEFILE */ +//# include /* for SEEK_*, off_t, and _LFS64_LARGEFILE */ # ifdef VMS diff --git a/scripts/build_win_expat.bat b/scripts/build_win_expat.bat new file mode 100644 index 0000000..7adb104 --- /dev/null +++ b/scripts/build_win_expat.bat @@ -0,0 +1,23 @@ +@ECHO OFF +SETLOCAL +SET PREFIX=%CD%\clib +SET PKG_CONFIG_DIR=%PREFIX%\lib\pkgconfig +IF NOT EXIST cbuild ( + MD cbuild || EXIT /B 1 +) +CD cbuild || EXIT /B 1 +git clone --depth 1 "https://github.com/libexpat/libexpat" || EXIT /B %ERRORLEVEL% +CD libexpat && CD expat || EXIT /B %ERRORLEVEL% +IF NOT EXIST build ( + MD build || EXIT /B 1 +) +CD build || EXIT /B 1 +cmake ^ + -G Ninja ^ + -DCMAKE_PREFIX_PATH=%PREFIX% ^ + -DCMAKE_BUILD_TYPE=Release ^ + -DCMAKE_INSTALL_PREFIX=%PREFIX% ^ + -DINSTALL_PKGCONFIG_DIR=%PKG_CONFIG_DIR% ^ + ../ || EXIT /B %ERRORLEVEL% +ninja && ninja install || ninja && ninja install || EXIT /B %ERRORLEVEL% +ENDLOCAL diff --git a/scripts/build_win_openssl.bat b/scripts/build_win_openssl.bat index 0172e1e..7a6bd9b 100644 --- a/scripts/build_win_openssl.bat +++ b/scripts/build_win_openssl.bat @@ -14,6 +14,9 @@ CALL %DOWNLOAD_RESOURCE% -o "openssl-3.0.5.tar.gz" "https://www.openssl.org/sour tar -xzvf "openssl-3.0.5.tar.gz" || EXIT /B %ERRORLEVEL% CD openssl-3.0.5 || EXIT /B 1 perl Configure shared zlib-dynamic --prefix=%PREFIX% --openssldir=%OPENSSLDIR% || EXIT /B %ERRORLEVEL% +SET "PATH=%PREFIX%\bin;%PATH%" +SET "INCLUDE=%PREFIX%\include;%INCLUDE%" +SET "LIB=%PREFIX%\lib;%LIB%" nmake || EXIT /B %ERRORLEVEL% nmake install || EXIT /B %ERRORLEVEL% ENDLOCAL diff --git a/scripts/get_cache_key.py b/scripts/get_cache_key.py index 3226592..279a705 100644 --- a/scripts/get_cache_key.py +++ b/scripts/get_cache_key.py @@ -6,7 +6,7 @@ from time import gmtime, time, strftime from typing import List -ALL_FEATURES = ['exiv2', 'ffmpeg', 'libzip', 'openssl', 'pkgconf', 'x264', 'zlib'] +ALL_FEATURES = ['exiv2', 'expat', 'ffmpeg', 'libzip', 'openssl', 'pkgconf', 'x264', 'zlib'] def sha256(data) -> str: if isinstance(data, str):