Skip to content

Commit bf9841a

Browse files
authored
Merge branch 'master' into gaurav-v1
2 parents 6ed09ea + fc4a14e commit bf9841a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+5637
-1631
lines changed

.dockerignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Build artifacts
2+
linux/ccextractor
3+
linux/rust/
4+
linux/*.o
5+
linux/*.a
6+
mac/ccextractor
7+
mac/rust/
8+
build/
9+
build_*/
10+
11+
# Git
12+
.git/
13+
.github/
14+
15+
# IDE
16+
.vscode/
17+
.idea/
18+
*.swp
19+
*.swo
20+
21+
# Docker
22+
docker/
23+
24+
# Documentation (not needed for build)
25+
docs/
26+
*.md
27+
!README.md
28+
29+
# Test files
30+
*.ts
31+
*.mp4
32+
*.mkv
33+
*.srt
34+
*.vtt
35+
36+
# Plans
37+
plans/
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
name: Build Linux AppImage
2+
3+
on:
4+
# Build on releases
5+
release:
6+
types: [published]
7+
# Allow manual trigger
8+
workflow_dispatch:
9+
inputs:
10+
build_type:
11+
description: 'Build type (all, minimal, ocr, hardsubx)'
12+
required: false
13+
default: 'all'
14+
# Build on pushes to workflow file for testing
15+
push:
16+
paths:
17+
- '.github/workflows/build_appimage.yml'
18+
- 'linux/build_appimage.sh'
19+
20+
jobs:
21+
build-appimage:
22+
runs-on: ubuntu-22.04
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
build_type: [minimal, ocr, hardsubx]
27+
28+
steps:
29+
- name: Check if should build this variant
30+
id: should_build
31+
run: |
32+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
33+
INPUT_TYPE="${{ github.event.inputs.build_type }}"
34+
if [ "$INPUT_TYPE" = "all" ] || [ "$INPUT_TYPE" = "${{ matrix.build_type }}" ]; then
35+
echo "should_build=true" >> $GITHUB_OUTPUT
36+
else
37+
echo "should_build=false" >> $GITHUB_OUTPUT
38+
fi
39+
else
40+
echo "should_build=true" >> $GITHUB_OUTPUT
41+
fi
42+
43+
- name: Checkout repository
44+
if: steps.should_build.outputs.should_build == 'true'
45+
uses: actions/checkout@v6
46+
47+
- name: Install base dependencies
48+
if: steps.should_build.outputs.should_build == 'true'
49+
run: |
50+
sudo apt-get update
51+
sudo apt-get install -y --no-install-recommends \
52+
build-essential \
53+
cmake \
54+
pkg-config \
55+
wget \
56+
file \
57+
libfuse2 \
58+
zlib1g-dev \
59+
libpng-dev \
60+
libjpeg-dev \
61+
libfreetype-dev \
62+
libxml2-dev \
63+
libcurl4-gnutls-dev \
64+
libssl-dev \
65+
clang \
66+
libclang-dev
67+
68+
- name: Install OCR dependencies
69+
if: steps.should_build.outputs.should_build == 'true' && (matrix.build_type == 'ocr' || matrix.build_type == 'hardsubx')
70+
run: |
71+
sudo apt-get install -y --no-install-recommends \
72+
tesseract-ocr \
73+
libtesseract-dev \
74+
libleptonica-dev \
75+
tesseract-ocr-eng
76+
77+
- name: Install FFmpeg dependencies (HardSubX)
78+
if: steps.should_build.outputs.should_build == 'true' && matrix.build_type == 'hardsubx'
79+
run: |
80+
sudo apt-get install -y --no-install-recommends \
81+
libavcodec-dev \
82+
libavformat-dev \
83+
libavutil-dev \
84+
libswscale-dev \
85+
libswresample-dev \
86+
libavfilter-dev \
87+
libavdevice-dev
88+
89+
- name: Install Rust toolchain
90+
if: steps.should_build.outputs.should_build == 'true'
91+
uses: dtolnay/rust-toolchain@stable
92+
93+
- name: Cache GPAC build
94+
if: steps.should_build.outputs.should_build == 'true'
95+
id: cache-gpac
96+
uses: actions/cache@v5
97+
with:
98+
path: /usr/local/lib/libgpac*
99+
key: gpac-v2.4.0-ubuntu22
100+
101+
- name: Build and install GPAC
102+
if: steps.should_build.outputs.should_build == 'true' && steps.cache-gpac.outputs.cache-hit != 'true'
103+
run: |
104+
git clone -b v2.4.0 --depth 1 https://github.com/gpac/gpac
105+
cd gpac
106+
./configure
107+
make -j$(nproc) lib
108+
sudo make install-lib
109+
sudo ldconfig
110+
111+
- name: Update library cache
112+
if: steps.should_build.outputs.should_build == 'true'
113+
run: sudo ldconfig
114+
115+
- name: Build AppImage
116+
if: steps.should_build.outputs.should_build == 'true'
117+
run: |
118+
cd linux
119+
chmod +x build_appimage.sh
120+
BUILD_TYPE=${{ matrix.build_type }} ./build_appimage.sh
121+
122+
- name: Get AppImage name
123+
if: steps.should_build.outputs.should_build == 'true'
124+
id: appimage_name
125+
run: |
126+
case "${{ matrix.build_type }}" in
127+
minimal)
128+
echo "name=ccextractor-minimal-x86_64.AppImage" >> $GITHUB_OUTPUT
129+
;;
130+
ocr)
131+
echo "name=ccextractor-x86_64.AppImage" >> $GITHUB_OUTPUT
132+
;;
133+
hardsubx)
134+
echo "name=ccextractor-hardsubx-x86_64.AppImage" >> $GITHUB_OUTPUT
135+
;;
136+
esac
137+
138+
- name: Test AppImage
139+
if: steps.should_build.outputs.should_build == 'true'
140+
run: |
141+
chmod +x linux/${{ steps.appimage_name.outputs.name }}
142+
linux/${{ steps.appimage_name.outputs.name }} --version
143+
144+
- name: Upload AppImage artifact
145+
if: steps.should_build.outputs.should_build == 'true'
146+
uses: actions/upload-artifact@v6
147+
with:
148+
name: ${{ steps.appimage_name.outputs.name }}
149+
path: linux/${{ steps.appimage_name.outputs.name }}
150+
151+
- name: Upload to Release
152+
if: steps.should_build.outputs.should_build == 'true' && github.event_name == 'release'
153+
uses: softprops/action-gh-release@v2
154+
with:
155+
files: linux/${{ steps.appimage_name.outputs.name }}
156+
env:
157+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/build_docker.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Build CCExtractor Docker Images
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
paths:
7+
- '.github/workflows/build_docker.yml'
8+
- 'docker/**'
9+
- '**.c'
10+
- '**.h'
11+
- 'src/rust/**'
12+
pull_request:
13+
types: [opened, synchronize, reopened]
14+
paths:
15+
- '.github/workflows/build_docker.yml'
16+
- 'docker/**'
17+
- '**.c'
18+
- '**.h'
19+
- 'src/rust/**'
20+
21+
jobs:
22+
build_minimal:
23+
name: Docker build (minimal)
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v6
27+
- name: Set up Docker Buildx
28+
uses: docker/setup-buildx-action@v3
29+
- name: Build minimal image
30+
uses: docker/build-push-action@v6
31+
with:
32+
context: .
33+
file: docker/Dockerfile
34+
build-args: |
35+
BUILD_TYPE=minimal
36+
USE_LOCAL_SOURCE=1
37+
tags: ccextractor:minimal
38+
load: true
39+
cache-from: type=gha,scope=docker-minimal
40+
cache-to: type=gha,mode=max,scope=docker-minimal
41+
- name: Test minimal image
42+
run: |
43+
docker run --rm ccextractor:minimal --version
44+
echo "Minimal build successful"
45+
46+
build_ocr:
47+
name: Docker build (ocr)
48+
runs-on: ubuntu-latest
49+
steps:
50+
- uses: actions/checkout@v6
51+
- name: Set up Docker Buildx
52+
uses: docker/setup-buildx-action@v3
53+
- name: Build OCR image
54+
uses: docker/build-push-action@v6
55+
with:
56+
context: .
57+
file: docker/Dockerfile
58+
build-args: |
59+
BUILD_TYPE=ocr
60+
USE_LOCAL_SOURCE=1
61+
tags: ccextractor:ocr
62+
load: true
63+
cache-from: type=gha,scope=docker-ocr
64+
cache-to: type=gha,mode=max,scope=docker-ocr
65+
- name: Test OCR image
66+
run: |
67+
docker run --rm ccextractor:ocr --version
68+
echo "OCR build successful"
69+
70+
build_hardsubx:
71+
name: Docker build (hardsubx)
72+
runs-on: ubuntu-latest
73+
steps:
74+
- uses: actions/checkout@v6
75+
- name: Set up Docker Buildx
76+
uses: docker/setup-buildx-action@v3
77+
- name: Build HardSubX image
78+
uses: docker/build-push-action@v6
79+
with:
80+
context: .
81+
file: docker/Dockerfile
82+
build-args: |
83+
BUILD_TYPE=hardsubx
84+
USE_LOCAL_SOURCE=1
85+
tags: ccextractor:hardsubx
86+
load: true
87+
cache-from: type=gha,scope=docker-hardsubx
88+
cache-to: type=gha,mode=max,scope=docker-hardsubx
89+
- name: Test HardSubX image
90+
run: |
91+
docker run --rm ccextractor:hardsubx --version
92+
echo "HardSubX build successful"

.github/workflows/build_linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
run: mkdir ./linux/artifacts
3939
- name: Copy release artifact
4040
run: cp ./linux/ccextractor ./linux/artifacts/
41-
- uses: actions/upload-artifact@v5
41+
- uses: actions/upload-artifact@v6
4242
with:
4343
name: CCExtractor Linux build
4444
path: ./linux/artifacts

.github/workflows/build_mac.yml

Lines changed: 64 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,23 @@ jobs:
3838
run: mkdir ./mac/artifacts
3939
- name: Copy release artifact
4040
run: cp ./mac/ccextractor ./mac/artifacts/
41-
- uses: actions/upload-artifact@v5
41+
- uses: actions/upload-artifact@v6
4242
with:
4343
name: CCExtractor mac build
4444
path: ./mac/artifacts
45+
build_shell_system_libs:
46+
# Test building with system libraries via pkg-config (for Homebrew formula compatibility)
47+
runs-on: macos-latest
48+
steps:
49+
- name: Install dependencies
50+
run: brew install pkg-config autoconf automake libtool tesseract leptonica gpac freetype libpng protobuf-c utf8proc zlib
51+
- uses: actions/checkout@v6
52+
- name: build with system libs
53+
run: ./build.command -system-libs
54+
working-directory: ./mac
55+
- name: Display version information
56+
run: ./ccextractor --version
57+
working-directory: ./mac
4558
build_autoconf:
4659
runs-on: macos-latest
4760
steps:
@@ -90,11 +103,59 @@ jobs:
90103
working-directory: build
91104
- name: Display version information
92105
run: ./build/ccextractor --version
106+
build_shell_hardsubx:
107+
# Test build.command with -hardsubx flag (burned-in subtitle extraction)
108+
runs-on: macos-latest
109+
steps:
110+
- name: Install dependencies
111+
run: brew install pkg-config autoconf automake libtool tesseract leptonica gpac ffmpeg
112+
- uses: actions/checkout@v6
113+
- name: build with hardsubx
114+
run: ./build.command -hardsubx
115+
working-directory: ./mac
116+
- name: Display version information
117+
run: ./ccextractor --version
118+
working-directory: ./mac
119+
- name: Verify hardsubx support
120+
run: |
121+
# Check that -hardsubx is recognized (will fail if not compiled in)
122+
./ccextractor -hardsubx --help 2>&1 | head -20 || true
123+
working-directory: ./mac
124+
build_autoconf_hardsubx:
125+
# Test autoconf build with HARDSUBX enabled (fixes issue #1173)
126+
runs-on: macos-latest
127+
steps:
128+
- uses: actions/checkout@v6
129+
- name: Install dependencies
130+
run: brew install pkg-config autoconf automake libtool tesseract leptonica gpac ffmpeg
131+
- name: run autogen
132+
run: ./autogen.sh
133+
working-directory: ./mac
134+
- name: configure with hardsubx
135+
run: |
136+
# Set Homebrew paths for configure to find libraries
137+
export HOMEBREW_PREFIX="$(brew --prefix)"
138+
export LDFLAGS="-L${HOMEBREW_PREFIX}/lib"
139+
export CPPFLAGS="-I${HOMEBREW_PREFIX}/include"
140+
export PKG_CONFIG_PATH="${HOMEBREW_PREFIX}/lib/pkgconfig"
141+
./configure --enable-hardsubx --enable-ocr
142+
working-directory: ./mac
143+
- name: make
144+
run: make
145+
working-directory: ./mac
146+
- name: Display version information
147+
run: ./ccextractor --version
148+
working-directory: ./mac
149+
- name: Verify hardsubx support
150+
run: |
151+
# Check that -hardsubx is recognized
152+
./ccextractor -hardsubx --help 2>&1 | head -20 || true
153+
working-directory: ./mac
93154
build_rust:
94155
runs-on: macos-latest
95156
steps:
96157
- uses: actions/checkout@v6
97-
- name: cache
158+
- name: cache
98159
uses: actions/cache@v5
99160
with:
100161
path: |
@@ -108,5 +169,5 @@ jobs:
108169
toolchain: stable
109170
override: true
110171
- name: build
111-
run: cargo build
172+
run: cargo build
112173
working-directory: ./src/rust

0 commit comments

Comments
 (0)