diff --git a/.github/workflows/build_mac.yml b/.github/workflows/build_mac.yml index 2ecc81f4..92d505d6 100644 --- a/.github/workflows/build_mac.yml +++ b/.github/workflows/build_mac.yml @@ -103,11 +103,53 @@ jobs: working-directory: build - name: Display version information run: ./build/ccextractor --version + build_shell_hardsubx: + # Test build.command with -hardsubx flag (burned-in subtitle extraction) + runs-on: macos-latest + steps: + - name: Install dependencies + run: brew install pkg-config autoconf automake libtool tesseract leptonica gpac ffmpeg + - uses: actions/checkout@v6 + - name: build with hardsubx + run: ./build.command -hardsubx + working-directory: ./mac + - name: Display version information + run: ./ccextractor --version + working-directory: ./mac + - name: Verify hardsubx support + run: | + # Check that -hardsubx is recognized (will fail if not compiled in) + ./ccextractor -hardsubx --help 2>&1 | head -20 || true + working-directory: ./mac + build_autoconf_hardsubx: + # Test autoconf build with HARDSUBX enabled (fixes issue #1173) + runs-on: macos-latest + steps: + - uses: actions/checkout@v6 + - name: Install dependencies + run: brew install pkg-config autoconf automake libtool tesseract leptonica gpac ffmpeg + - name: run autogen + run: ./autogen.sh + working-directory: ./mac + - name: configure with hardsubx + run: ./configure --enable-hardsubx --enable-ocr + working-directory: ./mac + - name: make + run: make + working-directory: ./mac + - name: Display version information + run: ./ccextractor --version + working-directory: ./mac + - name: Verify hardsubx support + run: | + # Check that -hardsubx is recognized + ./ccextractor -hardsubx --help 2>&1 | head -20 || true + working-directory: ./mac build_rust: runs-on: macos-latest steps: - uses: actions/checkout@v6 - - name: cache + - name: cache uses: actions/cache@v5 with: path: | @@ -121,5 +163,5 @@ jobs: toolchain: stable override: true - name: build - run: cargo build + run: cargo build working-directory: ./src/rust \ No newline at end of file diff --git a/docs/HARDSUBX.txt b/docs/HARDSUBX.txt index 0622b07b..a3683257 100644 --- a/docs/HARDSUBX.txt +++ b/docs/HARDSUBX.txt @@ -54,6 +54,32 @@ To build the program with hardsubx support, NOTE: The build has been tested with FFMpeg version 3.1.0, and Tesseract 3.04. +macOS +----- + +Install the required dependencies using Homebrew: + brew install tesseract leptonica ffmpeg + +To build the program with hardsubx support, use one of these methods: + +== Using build.command (Recommended): + cd ccextractor/mac + ./build.command -hardsubx + +== Using autoconf: + cd ccextractor/mac + ./autogen.sh + ./configure --enable-hardsubx --enable-ocr + make + +== Using cmake: + cd ccextractor + mkdir build && cd build + cmake -DWITH_OCR=ON -DWITH_HARDSUBX=ON ../src/ + make + +NOTE: The -hardsubx parameter uses a single dash (not --hardsubx). + Windows ------- diff --git a/linux/configure.ac b/linux/configure.ac index 985e33de..0adfb3bc 100644 --- a/linux/configure.ac +++ b/linux/configure.ac @@ -154,7 +154,7 @@ AS_IF([ (test x$ocr = xtrue || test x$hardsubx = xtrue) && test ! $HAS_LEPT -gt AM_CONDITIONAL(HARDSUBX_IS_ENABLED, [ test x$hardsubx = xtrue ]) AM_CONDITIONAL(OCR_IS_ENABLED, [ test x$ocr = xtrue || test x$hardsubx = xtrue ]) AM_CONDITIONAL(FFMPEG_IS_ENABLED, [ test x$ffmpeg = xtrue ]) -AM_CONDITIONAL(TESSERACT_PRESENT, [ test ! -z $(pkg-config --libs-only-l --silence-errors tesseract) ]) +AM_CONDITIONAL(TESSERACT_PRESENT, [ test ! -z "$(pkg-config --libs-only-l --silence-errors tesseract)" ]) AM_CONDITIONAL(TESSERACT_PRESENT_RPI, [ test -d "/usr/include/tesseract" && test $(ls -A /usr/include/tesseract | wc -l) -gt 0 ]) AM_CONDITIONAL(SYS_IS_LINUX, [ test $(uname -s) = "Linux"]) AM_CONDITIONAL(SYS_IS_MAC, [ test $(uname -s) = "Darwin"]) diff --git a/mac/configure.ac b/mac/configure.ac index a5a52739..f2e96502 100644 --- a/mac/configure.ac +++ b/mac/configure.ac @@ -148,7 +148,7 @@ AS_IF([ (test x$ocr = xtrue || test x$hardsubx = xtrue) && test ! $HAS_LEPT -gt AM_CONDITIONAL(HARDSUBX_IS_ENABLED, [ test x$hardsubx = xtrue ]) AM_CONDITIONAL(OCR_IS_ENABLED, [ test x$ocr = xtrue || test x$hardsubx = xtrue ]) AM_CONDITIONAL(FFMPEG_IS_ENABLED, [ test x$ffmpeg = xtrue ]) -AM_CONDITIONAL(TESSERACT_PRESENT, [ test ! -z $(pkg-config --libs-only-l --silence-errors tesseract) ]) +AM_CONDITIONAL(TESSERACT_PRESENT, [ test ! -z "$(pkg-config --libs-only-l --silence-errors tesseract)" ]) AM_CONDITIONAL(TESSERACT_PRESENT_RPI, [ test -d "/usr/include/tesseract" && test $(ls -A /usr/include/tesseract | wc -l) -gt 0 ]) AM_CONDITIONAL(SYS_IS_LINUX, [ test $(uname -s) = "Linux"]) AM_CONDITIONAL(SYS_IS_MAC, [ test $(uname -s) = "Darwin"])