Skip to content

Commit b209395

Browse files
committed
Build FFmpeg for musllinux in addition to manylinux
1 parent 9e59824 commit b209395

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

.github/workflows/build-ffmpeg.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ jobs:
6868
CIBW_BUILD: cp311-*
6969
CIBW_REPAIR_WHEEL_COMMAND_LINUX: LD_LIBRARY_PATH=/tmp/vendor/lib:$LD_LIBRARY_PATH auditwheel repair -w {dest_dir} {wheel}
7070
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: delvewheel repair --add-path C:\cibw\vendor\bin -w {dest_dir} {wheel}
71-
CIBW_SKIP: "*musllinux*"
7271
CIBW_TEST_COMMAND: python -c "import dummy"
7372
run: |
7473
pip install cibuildwheel delvewheel

scripts/build-ffmpeg.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from cibuildpkg import Builder, Package, When, fetch, get_platform, log_group, run
1111

1212
plat = platform.system()
13+
is_musllinux = plat == "Linux" and platform.libc_ver()[0] != "glibc"
1314

1415

1516
def calculate_sha256(filename: str) -> str:
@@ -211,6 +212,8 @@ def calculate_sha256(filename: str) -> str:
211212
Package(
212213
name="x264",
213214
source_url="https://code.videolan.org/videolan/x264/-/archive/master/x264-master.tar.bz2",
215+
# assembly contains textrels which are not supported by musl
216+
build_arguments=["--disable-asm"] if is_musllinux else [],
214217
# parallel build runs out of memory on Windows
215218
build_parallel=plat != "Windows",
216219
when=When.community_only,

scripts/cibuildpkg.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ def get_platform() -> str:
2525
system = platform.system()
2626
machine = platform.machine()
2727
if system == "Linux":
28-
return f"manylinux_{machine}"
28+
if platform.libc_ver()[0] == "glibc":
29+
return f"manylinux_{machine}"
30+
else:
31+
return f"musllinux_{machine}"
2932
elif system == "Darwin":
3033
return f"macosx_{machine}"
3134
elif system == "Windows":
@@ -310,7 +313,10 @@ def _build_with_cmake(self, package: Package, for_builder: bool) -> None:
310313
cmake_args.append("-DCMAKE_INSTALL_NAME_DIR=" + os.path.join(prefix, "lib"))
311314

312315
if package.name == "srt" and platform.system() == "Linux":
313-
run(["yum", "-y", "install", "openssl-devel"])
316+
if platform.libc_ver()[0] == "glibc":
317+
run(["yum", "-y", "install", "openssl-devel"])
318+
else:
319+
run(["apk", "add", "openssl-dev"])
314320

315321
# build package
316322
os.makedirs(package_build_path, exist_ok=True)

0 commit comments

Comments
 (0)