Skip to content

Commit c4ec768

Browse files
committed
cicd: add support bmf build for mac
Signed-off-by: Jack Lau <[email protected]>
1 parent fc86e5a commit c4ec768

File tree

2 files changed

+62
-3
lines changed

2 files changed

+62
-3
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- name: Build with CMake
3838
run: |
3939
export PATH=$PATH:$FFMPEG_ROOT_PATH/bin
40-
(cd src && cmake -B build -DENABLE_TESTS=ON -DENABLE_GUI=OFF && cd build && make -j$(nproc))
40+
(cd src && cmake -B build -DENABLE_TESTS=ON -DBMF_TRANSCODER=OFF -DENABLE_GUI=OFF && cd build && make -j$(nproc))
4141
4242
- name: Run tests
4343
run: |

.github/workflows/review.yaml

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ jobs:
137137
- name: Install FFmpeg and Qt via Homebrew
138138
run: |
139139
# Install FFmpeg 5 with x264, x265 support (pre-built from Homebrew)
140-
brew install ffmpeg@5 qt@5
140+
brew install ffmpeg@5 qt@5 [email protected]
141141
142142
# Set FFmpeg path
143143
export FFMPEG_ROOT_PATH=$(brew --prefix ffmpeg@5)
@@ -148,6 +148,65 @@ jobs:
148148
$FFMPEG_ROOT_PATH/bin/ffmpeg -version | head -n 1
149149
$FFMPEG_ROOT_PATH/bin/ffmpeg -encoders 2>/dev/null | grep -E "libx264|libx265" || echo "Warning: x264/x265 not found"
150150
151+
- name: Checkout BMF repository(specific branch)
152+
run: |
153+
git clone https://github.com/OpenConverterLab/bmf.git
154+
155+
wget https://invisible-island.net/archives/ncurses/ncurses-6.5.tar.gz
156+
wget https://ftp.gnu.org/gnu/binutils/binutils-2.43.1.tar.bz2
157+
158+
- name: Cache ncurses build
159+
uses: actions/cache@v3
160+
with:
161+
path: opt/ncurses
162+
key: ${{ runner.os }}-ncurses-${{ hashFiles('ncurses-6.5.tar.gz') }}
163+
restore-keys: |
164+
${{ runner.os }}-ncurses-
165+
166+
- name: Cache binutils build
167+
uses: actions/cache@v3
168+
with:
169+
path: opt/binutils
170+
key: ${{ runner.os }}-binutils-${{ hashFiles('binutils-2.43.1.tar.bz2') }}
171+
restore-keys: |
172+
${{ runner.os }}-binutils-
173+
174+
- name: compile dependencies
175+
run: |
176+
if [ ! -d "$(pwd)/opt/ncurses" ]; then
177+
tar -xzvf ncurses-6.5.tar.gz
178+
(cd ncurses-6.5 && ./configure --prefix=/Users/runner/work/OpenConverter/OpenConverter/opt/ncurses && make -j$(sysctl -n hw.ncpu) && sudo make install)
179+
else
180+
echo "ncurses is already installed, skipping build."
181+
fi
182+
183+
if [ ! -d "$(pwd)/opt/binutils" ]; then
184+
tar xvf binutils-2.43.1.tar.bz2
185+
(cd binutils-2.43.1 && ./configure --prefix=/Users/runner/work/OpenConverter/OpenConverter/opt/binutils --enable-install-libiberty && make -j$(sysctl -n hw.ncpu) && sudo make install)
186+
else
187+
echo "binutils is already installed, skipping build."
188+
fi
189+
190+
- name: Cache BMF build
191+
uses: actions/cache@v3
192+
with:
193+
path: bmf/output/
194+
key: ${{ runner.os }}-bmf-${{ hashFiles('bmf/build.sh') }}
195+
restore-keys: |
196+
${{ runner.os }}-bmf-macos-arm-
197+
198+
- name: Set up BMF if not cached
199+
run: |
200+
if [ ! -d "$(pwd)/bmf/output/" ]; then
201+
export LIBRARY_PATH=$(pwd)/opt/binutils/lib:$LIBRARY_PATH
202+
export CMAKE_PREFIX_PATH=$(pwd)/opt/binutils:$CMAKE_PREFIX_PATH
203+
pip install setuptools
204+
(cd bmf && git checkout oc && git submodule update --init --recursive && ./build_osx.sh)
205+
else
206+
echo "BMF is already installed, skipping build."
207+
fi
208+
echo "BMF_ROOT_PATH=$(pwd)/bmf/output/bmf" >> $GITHUB_ENV
209+
151210
- name: Build and Deploy
152211
run: |
153212
export PATH="$(brew --prefix ffmpeg@5)/bin:$PATH"
@@ -228,7 +287,7 @@ jobs:
228287
- name: Build Qt project
229288
run: |
230289
(cd src &&
231-
cmake -S . -B build "-DFFMPEG_ROOT_PATH=../ffmpeg/ffmpeg-n5.1.6-11-gcde3c5fc0c-win64-gpl-shared-5.1" -DFFTOOL_TRANSCODER=OFF &&
290+
cmake -S . -B build "-DFFMPEG_ROOT_PATH=../ffmpeg/ffmpeg-n5.1.6-11-gcde3c5fc0c-win64-gpl-shared-5.1" -DFFTOOL_TRANSCODER=OFF -DBMF_TRANSCODER=OFF &&
232291
cmake --build build --config Release --parallel)
233292
234293
- name : Deploy project

0 commit comments

Comments
 (0)