[PR #1955] [MERGED] fix(build): Support FFMPEG_INCLUDE_DIR on Linux for hardsubx #2754

Open
opened 2026-01-29 17:23:45 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/CCExtractor/ccextractor/pull/1955
Author: @cfsmp3
Created: 1/1/2026
Status: Merged
Merged: 1/2/2026
Merged by: @cfsmp3

Base: masterHead: fix/ffmpeg-include-linux


📝 Commits (1)

  • 303bec8 fix(build): Support FFMPEG_INCLUDE_DIR on Linux for hardsubx

📊 Changes

1 file changed (+13 additions, -4 deletions)

View changed files

📝 src/rust/build.rs (+13 -4)

📄 Description

Summary

Fixes compilation with hardsubx on Linux systems where FFmpeg headers are installed in non-standard locations (e.g., /usr/include/ffmpeg on Fedora with rpmfusion).

The Problem

The FFMPEG_INCLUDE_DIR environment variable was only checked inside the macOS-specific block in build.rs, so setting it had no effect on Linux builds:

// Old code - FFMPEG_INCLUDE_DIR only checked on macOS
if cfg!(target_os = "macos") {
    // ... Homebrew detection ...
    if let Ok(ffmpeg_include) = env::var("FFMPEG_INCLUDE_DIR") {
        builder = builder.clang_arg(format!("-I{}", ffmpeg_include));
    }
}

The Fix

  1. Move FFMPEG_INCLUDE_DIR check outside platform-specific blocks - Now works on all platforms
  2. Add pkg-config fallback on Linux - Automatically finds FFmpeg include paths via pkg-config

Usage

Users can now build on Fedora/systems with non-standard FFmpeg paths:

export FFMPEG_INCLUDE_DIR='/usr/include/ffmpeg'
./build -hardsubx

Or rely on pkg-config if FFmpeg is properly configured.

Fixes #1954

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/CCExtractor/ccextractor/pull/1955 **Author:** [@cfsmp3](https://github.com/cfsmp3) **Created:** 1/1/2026 **Status:** ✅ Merged **Merged:** 1/2/2026 **Merged by:** [@cfsmp3](https://github.com/cfsmp3) **Base:** `master` ← **Head:** `fix/ffmpeg-include-linux` --- ### 📝 Commits (1) - [`303bec8`](https://github.com/CCExtractor/ccextractor/commit/303bec8d5d3e91da92f370dca110858e2df378ad) fix(build): Support FFMPEG_INCLUDE_DIR on Linux for hardsubx ### 📊 Changes **1 file changed** (+13 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `src/rust/build.rs` (+13 -4) </details> ### 📄 Description ## Summary Fixes compilation with hardsubx on Linux systems where FFmpeg headers are installed in non-standard locations (e.g., `/usr/include/ffmpeg` on Fedora with rpmfusion). ### The Problem The `FFMPEG_INCLUDE_DIR` environment variable was only checked inside the macOS-specific block in `build.rs`, so setting it had no effect on Linux builds: ```rust // Old code - FFMPEG_INCLUDE_DIR only checked on macOS if cfg!(target_os = "macos") { // ... Homebrew detection ... if let Ok(ffmpeg_include) = env::var("FFMPEG_INCLUDE_DIR") { builder = builder.clang_arg(format!("-I{}", ffmpeg_include)); } } ``` ### The Fix 1. **Move `FFMPEG_INCLUDE_DIR` check outside platform-specific blocks** - Now works on all platforms 2. **Add pkg-config fallback on Linux** - Automatically finds FFmpeg include paths via pkg-config ### Usage Users can now build on Fedora/systems with non-standard FFmpeg paths: ```bash export FFMPEG_INCLUDE_DIR='/usr/include/ffmpeg' ./build -hardsubx ``` Or rely on pkg-config if FFmpeg is properly configured. Fixes #1954 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 17:23:45 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#2754