Skip to content

Commit 301bbcc

Browse files
committed
Remove "commercial" builds. Only build one version.
The 'when' enum is removed. For MacOS: strip with -x -S (recommended in man)
1 parent 6bf4c2a commit 301bbcc

File tree

4 files changed

+9
-39
lines changed

4 files changed

+9
-39
lines changed

.github/workflows/build-ffmpeg.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ jobs:
7070
- name: Build FFmpeg
7171
env:
7272
CIBW_ARCHS: ${{ matrix.msys_prefix && 'AMD64' || matrix.arch }}
73-
CIBW_BEFORE_BUILD: python scripts/build-ffmpeg.py /tmp/vendor --community
74-
CIBW_BEFORE_BUILD_WINDOWS: python scripts\build-ffmpeg.py C:\cibw\vendor --community
73+
CIBW_BEFORE_BUILD: python scripts/build-ffmpeg.py /tmp/vendor
74+
CIBW_BEFORE_BUILD_WINDOWS: python scripts\build-ffmpeg.py C:\cibw\vendor
7575
CIBW_BUILD: cp311-*
7676
CIBW_REPAIR_WHEEL_COMMAND_LINUX: LD_LIBRARY_PATH=/tmp/vendor/lib:$LD_LIBRARY_PATH auditwheel repair --exclude libmvec.so.1 --exclude libmvec-2.so --exclude libmvec.so --exclude libmvec -w {dest_dir} {wheel}
7777
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: delvewheel repair --add-path C:\cibw\vendor\bin -w {dest_dir} {wheel}
@@ -104,7 +104,7 @@ jobs:
104104
env:
105105
CIBW_ARCHS: ${{ matrix.arch }}
106106
CIBW_BEFORE_ALL_LINUX: ./scripts/install-static-clang.sh
107-
CIBW_BEFORE_BUILD_LINUX: python scripts/build-ffmpeg.py /tmp/vendor --community
107+
CIBW_BEFORE_BUILD_LINUX: python scripts/build-ffmpeg.py /tmp/vendor
108108
CIBW_BUILD: cp311-${{ matrix.build }}${{ matrix.arch }}
109109
CIBW_ENVIRONMENT_LINUX: >
110110
CC="/opt/clang/bin/clang"

scripts/build-ffmpeg.py

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import subprocess
99
import sys
1010

11-
from cibuildpkg import Builder, Package, When, fetch, log_group, run
11+
from cibuildpkg import Builder, Package, fetch, log_group, run
1212

1313
plat = platform.system()
1414
is_musllinux = plat == "Linux" and platform.libc_ver()[0] != "glibc"
@@ -155,7 +155,6 @@ def calculate_sha256(filename: str) -> str:
155155
source_url="https://downloads.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-0.1.6.tar.gz",
156156
sha256="483eb4061088e2b34b358e47540b5d495a96cd468e361050fae615b1809dc4a1",
157157
build_arguments=["--disable-dependency-tracking"],
158-
when=When.community_only,
159158
),
160159
Package(
161160
name="x264",
@@ -277,20 +276,12 @@ def make_tarball_name() -> str:
277276
def main():
278277
parser = argparse.ArgumentParser("build-ffmpeg")
279278
parser.add_argument("destination")
280-
parser.add_argument("--community", action="store_true")
281279

282280
args = parser.parse_args()
283-
284281
dest_dir = os.path.abspath(args.destination)
285-
community = args.community
286282

287-
# Use ALSA only on Linux.
288283
use_alsa = plat == "Linux"
289-
290-
# Use CUDA if supported.
291284
use_cuda = plat in {"Linux", "Windows"}
292-
293-
# Use AMD AMF if supported.
294285
use_amf = plat in {"Linux", "Windows"}
295286

296287
# Use Intel VPL (Video Processing Library) if supported to enable Intel QSV (Quick Sync Video)
@@ -355,8 +346,8 @@ def main():
355346
"--enable-gnutls" if use_gnutls else "--disable-gnutls",
356347
"--enable-libdav1d",
357348
"--enable-libmp3lame",
358-
"--enable-libopencore-amrnb" if community else "--disable-libopencore-amrnb",
359-
"--enable-libopencore-amrwb" if community else "--disable-libopencore-amrwb",
349+
"--enable-libopencore-amrnb",
350+
"--enable-libopencore-amrwb",
360351
"--enable-libopus",
361352
"--enable-libspeex",
362353
"--enable-libsvtav1",
@@ -423,18 +414,10 @@ def main():
423414
packages += codec_group
424415
packages += [ffmpeg_package]
425416

426-
filtered_packages = []
427-
for package in packages:
428-
if package.when == When.community_only and not community:
429-
continue
430-
if package.when == When.commercial_only and community:
431-
continue
432-
filtered_packages.append(package)
433-
434-
download_tars(build_tools + filtered_packages)
417+
download_tars(build_tools + packages)
435418
for tool in build_tools:
436419
builder.build(tool, for_builder=True)
437-
for package in filtered_packages:
420+
for package in packages:
438421
builder.build(package)
439422

440423
if plat == "Windows":
@@ -479,10 +462,8 @@ def main():
479462
elif plat == "Windows":
480463
libraries = glob.glob(os.path.join(dest_dir, "bin", "*.dll"))
481464

482-
# strip libraries
483465
if plat == "Darwin":
484-
run(["strip", "-S"] + libraries)
485-
run(["otool", "-L"] + libraries)
466+
run(["strip", "-x", "-S"] + libraries)
486467
else:
487468
run(["strip", "-s"] + libraries)
488469

scripts/cibuildpkg.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import time
1212
from collections.abc import Iterator
1313
from dataclasses import dataclass, field, replace
14-
from enum import IntEnum
1514

1615

1716
def fetch(url: str, path: str) -> None:
@@ -78,12 +77,6 @@ def run(cmd: list[str], env=None) -> None:
7877
raise e
7978

8079

81-
class When(IntEnum):
82-
always = 0
83-
community_only = 1
84-
commercial_only = 2
85-
86-
8780
@dataclass(slots=True)
8881
class Package:
8982
name: str
@@ -96,7 +89,6 @@ class Package:
9689
requires: list[str] = field(default_factory=list)
9790
source_dir: str = ""
9891
source_filename: str = ""
99-
when: When = When.always
10092

10193
def __lt__(self, other):
10294
return self.name < other.name

scripts/sbom.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ def main():
4141
f"Currently FFmpeg {get_version(ffmpeg_package)} is built with the following packages enabled for all platforms:\n"
4242
)
4343

44-
for package in sorted(library_group):
45-
print(f"- {package.name} {get_version(package)}")
46-
4744
for package in codec_group:
4845
print(f"- {package.name} {get_version(package)}")
4946

0 commit comments

Comments
 (0)