fix: Add missing deps for exiv2 library in build scripts

This commit is contained in:
2025-01-09 16:19:33 +08:00
parent 25b56fb406
commit 9dfa1d46f2
6 changed files with 49 additions and 5 deletions

View File

@@ -41,7 +41,7 @@ jobs:
id: cache_key id: cache_key
run: | run: |
cd scripts cd scripts
python3 get_cache_key.py exiv2 || exit 1 python3 get_cache_key.py fmt exiv2 || exit 1
- name: Cache - name: Cache
id: cache id: cache
uses: actions/cache@v4 uses: actions/cache@v4
@@ -52,6 +52,7 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true' if: steps.cache.outputs.cache-hit != 'true'
run: | run: |
cp scripts/build_*.sh -v ./ || exit 1 cp scripts/build_*.sh -v ./ || exit 1
./build_fmt.sh || exit 1
./build_exiv2.sh || exit 1 ./build_exiv2.sh || exit 1
- name: Build - name: Build
run: | run: |
@@ -137,7 +138,7 @@ jobs:
id: cache_key id: cache_key
run: | run: |
cd scripts cd scripts
python3 get_cache_key.py exiv2 libzip x264 ffmpeg rapidjson || exit 1 python3 get_cache_key.py fmt exiv2 libzip x264 ffmpeg rapidjson || exit 1
- name: Cache - name: Cache
id: cache id: cache
uses: actions/cache@v4 uses: actions/cache@v4
@@ -152,6 +153,7 @@ jobs:
run: | run: |
export PKG_CONFIG_PATH=`pwd`/clib/lib/pkgconfig export PKG_CONFIG_PATH=`pwd`/clib/lib/pkgconfig
cp scripts/build_*.sh -v ./ || exit 1 cp scripts/build_*.sh -v ./ || exit 1
./build_fmt.sh || exit 1
./build_exiv2.sh || exit 1 ./build_exiv2.sh || exit 1
./build_libzip.sh || exit 1 ./build_libzip.sh || exit 1
./build_x264.sh || exit 1 ./build_x264.sh || exit 1
@@ -186,7 +188,7 @@ jobs:
id: cache_key id: cache_key
run: | run: |
cd scripts cd scripts
python get_cache_key.py --prefix=win zlib pkgconf expat exiv2 openssl libzip x264 ffmpeg rapidjson || exit 1 python get_cache_key.py --prefix=win zlib pkgconf fmt expat exiv2 openssl libzip x264 ffmpeg rapidjson || exit 1
- name: Cache - name: Cache
id: cache id: cache
uses: actions/cache@v4 uses: actions/cache@v4
@@ -223,6 +225,11 @@ jobs:
run: | run: |
COPY /Y scripts\build_win_pkgconf.bat || exit 1 COPY /Y scripts\build_win_pkgconf.bat || exit 1
CALL build_win_pkgconf.bat || exit 1 CALL build_win_pkgconf.bat || exit 1
- name: Build fmt
if: steps.cache.outputs.cache-hit != 'true'
run: |
COPY /Y scripts\build_win_fmt.bat || exit 1
CALL build_win_fmt.bat || exit 1
- name: Build expat - name: Build expat
if: steps.cache.outputs.cache-hit != 'true' if: steps.cache.outputs.cache-hit != 'true'
run: | run: |

View File

@@ -58,7 +58,7 @@ jobs:
id: cache_key id: cache_key
run: | run: |
cd scripts cd scripts
python3 get_cache_key.py exiv2 libzip x264 ffmpeg rapidjson || exit 1 python3 get_cache_key.py fmt exiv2 libzip x264 ffmpeg rapidjson || exit 1
- name: Cache - name: Cache
id: cache id: cache
uses: actions/cache@v4 uses: actions/cache@v4
@@ -73,6 +73,7 @@ jobs:
run: | run: |
export PKG_CONFIG_PATH=`pwd`/clib/lib/pkgconfig export PKG_CONFIG_PATH=`pwd`/clib/lib/pkgconfig
cp scripts/build_*.sh -v ./ || exit 1 cp scripts/build_*.sh -v ./ || exit 1
./build_fmt.sh || exit 1
./build_exiv2.sh || exit 1 ./build_exiv2.sh || exit 1
./build_libzip.sh || exit 1 ./build_libzip.sh || exit 1
./build_x264.sh || exit 1 ./build_x264.sh || exit 1

View File

@@ -25,6 +25,12 @@ RUN apt-get update && apt-get install -y \
RUN curl https://sh.rustup.rs -sSf | \ RUN curl https://sh.rustup.rs -sSf | \
sh -s -- --default-toolchain nightly -y sh -s -- --default-toolchain nightly -y
ENV PATH=/root/.cargo/bin:$PATH ENV PATH=/root/.cargo/bin:$PATH
RUN cd ~ && git clone --depth 1 'https://github.com/fmtlib/fmt' \
&& cd fmt && mkdir -p build && cd build \
&& cmake -DCMAKE_BUILD_TYPE=Release .. "-DCMAKE_INSTALL_PREFIX=/clib" \
-DFMT_DOC=OFF -DFMT_TEST=OFF \
&& make -j$(grep -c ^processor /proc/cpuinfo) && make install \
&& cd ~ && rm -rf fmt
RUN cd ~ && git clone --depth 1 'https://github.com/Exiv2/exiv2' \ RUN cd ~ && git clone --depth 1 'https://github.com/Exiv2/exiv2' \
&& cd exiv2 && mkdir -p build && cd build \ && cd exiv2 && mkdir -p build && cd build \
&& cmake -DCMAKE_BUILD_TYPE=Release .. "-DCMAKE_INSTALL_PREFIX=/clib" \ && cmake -DCMAKE_BUILD_TYPE=Release .. "-DCMAKE_INSTALL_PREFIX=/clib" \

6
scripts/build_fmt.sh Executable file
View File

@@ -0,0 +1,6 @@
export PREFIX=`pwd`/clib
mkdir -p cbuild && cd cbuild || exit 1
git clone --depth 1 'https://github.com/fmtlib/fmt' && cd fmt || exit 1
mkdir -p build && cd build || exit 1
cmake -DCMAKE_BUILD_TYPE=Release "-DCMAKE_INSTALL_PREFIX=$PREFIX" -DFMT_DOC=OFF -DFMT_TEST=OFF ../ || exit 1
make -j8 && make install || exit 1

24
scripts/build_win_fmt.bat Normal file
View File

@@ -0,0 +1,24 @@
@ECHO OFF
SETLOCAL
SET TOP=%CD%
SET PREFIX=%CD%\clib
IF NOT EXIST cbuild (
MD cbuild || EXIT /B 1
)
CD cbuild || EXIT /B 1
git clone --depth 1 "https://github.com/fmtlib/fmt" || EXIT /B %ERRORLEVEL%
CD fmt || 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% ^
-DFMT_DOC=OFF ^
-DFMT_TEST=OFF ^
../ || EXIT /B %ERRORLEVEL%
ninja && ninja install || ninja && ninja install || EXIT /B %ERRORLEVEL%
ENDLOCAL

View File

@@ -7,7 +7,7 @@ from time import gmtime, time, strftime
from typing import List from typing import List
ALL_FEATURES = ['exiv2', 'expat', 'ffmpeg', 'libzip', 'openssl', 'pkgconf', 'rapidjson', 'x264', 'zlib'] ALL_FEATURES = ['exiv2', 'expat', 'ffmpeg', 'fmt', 'libzip', 'openssl', 'pkgconf', 'rapidjson', 'x264', 'zlib']
def sha256(data) -> str: def sha256(data) -> str:
if isinstance(data, str): if isinstance(data, str):