Skip to content

Commit

Permalink
edit ffmpeg configure file
Browse files Browse the repository at this point in the history
  • Loading branch information
joepers authored and WyattBlue committed Dec 6, 2024
1 parent 7b36439 commit c7376d2
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions scripts/cibuildpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,22 @@ def run(cmd, env=None):
raise e


def correct_configure(file_path):
"""
Edit ffmpeg's configure file. Properly quote `$pkg_version` in function `test_pkg_config()`.
"""
old_string = 'test_cmd $pkg_config --exists --print-errors $pkg_version || return'
new_string = 'test_cmd $pkg_config --exists --print-errors "$pkg_version" || return'

with open(file_path, 'r') as file:
content = file.read()

updated_content = content.replace(old_string, new_string)

with open(file_path, 'w') as file:
file.write(updated_content)


@dataclass
class Package:
name: str
Expand Down Expand Up @@ -220,6 +236,9 @@ def _build_with_autoconf(self, package: Package, for_builder: bool) -> None:
elif platform.system() == "Windows":
configure_args += ["--target=x86_64-win64-gcc"]

if package.name == "ffmpeg" and platform.system() == "Windows":
correct_configure(os.path.join(package_source_path, "configure"))

# build package
os.makedirs(package_build_path, exist_ok=True)
with chdir(package_build_path):
Expand Down

0 comments on commit c7376d2

Please sign in to comment.