Skip to content

Commit

Permalink
Update cibuildpkg.py
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeSchiff authored Dec 3, 2024
1 parent 6844ba8 commit f07af19
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions scripts/cibuildpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,20 @@ def run(cmd, env=None):
print(f"stderr: {e.stderr}")
raise e

def correct_configure():
file_path = "D:/a/pyav-ffmpeg/pyav-ffmpeg/build/ffmpeg/configure"
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)
print("correct_configure complete")


@dataclass
class Package:
Expand Down Expand Up @@ -220,6 +234,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()

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

0 comments on commit f07af19

Please sign in to comment.