Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Features

Currently FFmpeg 8.1.2 is built with the following packages enabled for all platforms:

- lame 3.100
- lame 3.100.1 (basswood-io/lamer)
- opus 1.6.1
- dav1d 1.5.3
- libsvtav1 4.1.0
Expand Down
21 changes: 0 additions & 21 deletions patches/lame.patch

This file was deleted.

35 changes: 34 additions & 1 deletion scripts/cibuildpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ def build(self, package: Package, *, for_builder: bool = False):

with log_group(f"build {package.name}"):
self._extract(package)
if package.name == "x265":
if package.name == "lamer":
self._build_lame(package, for_builder=for_builder)
elif package.name == "x265":
self._build_x265(package)
elif package.build_system == "cmake":
self._build_with_cmake(package, for_builder=for_builder)
Expand Down Expand Up @@ -161,6 +163,37 @@ def _build_with_make(self, package: Package, for_builder: bool) -> None:
run(make_command, env=env)
run(install_command, env=env)

def _build_lame(self, package: Package, for_builder: bool) -> None:
# basswood-io/lamer builds libmp3lame with a plain Makefile. Build only
# the static encoder library (the `lib` target, not the ncurses CLI
# frontend or mpglib decoder) as position-independent code -- it is
# linked into the shared libavcodec -- then install it where FFmpeg's
# configure looks (-lmp3lame, <lame/lame.h>).
package_source_path = os.path.join(
self.build_dir, package.name, package.source_dir
)
env = self._environment(for_builder=for_builder)
prefix = self._prefix(for_builder=for_builder)

make_vars = ["DECODER=0"]
if platform.system() == "Windows":
# The CLANGARM64 toolchain ships llvm-ar/llvm-ranlib, not ar/ranlib.
if platform.machine().lower() in {"arm64", "aarch64"}:
env.setdefault("AR", "llvm-ar")
env.setdefault("RANLIB", "llvm-ranlib")
else:
env.setdefault("CC", "gcc")
else:
# -fPIC is required to link the static archive into libavcodec.so.
make_vars.append("PIC=1")

with chdir(package_source_path):
run(["make", "-j", "4", "lib", *make_vars], env=env)
run(
["make", "install", f"PREFIX={self._mangle_path(prefix)}", *make_vars],
env=env,
)

def _build_with_autoconf(self, package: Package, for_builder: bool) -> None:
assert package.build_system == "autoconf"
package_path = os.path.join(self.build_dir, package.name)
Expand Down
9 changes: 5 additions & 4 deletions scripts/pkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@ def __lt__(self, other):

codec_group = [
Package(
name="lame",
source_url="http://deb.debian.org/debian/pool/main/l/lame/lame_3.100.orig.tar.gz",
sha256="ddfe36cab873794038ae2c1210557ad34857a4b6bdc515785d1da9e175b1da1e",
build_arguments=["--disable-gtktest"],
name="lamer",
source_url="https://github.com/basswood-io/lamer/archive/refs/tags/v3.100.1.tar.gz",
source_filename="lamer-3.100.1.tar.gz",
sha256="943eac863ff803b5a698cec0bdc483ce9081b1e74ca8978e94daafb44522c946",
build_system="make",
),
Package(
name="opus",
Expand Down
Loading