Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
joepers committed Nov 19, 2024
1 parent 90a338e commit ac371b8
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 14 deletions.
33 changes: 22 additions & 11 deletions .github/workflows/build-ffmpeg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
fail-fast: true
matrix:
include:
- os: macos-14
Expand All @@ -32,9 +32,9 @@ jobs:
- os: ubuntu-latest
arch: x86_64
shell: bash
- os: windows-latest
arch: AMD64
shell: 'msys2 {0}'
# - os: windows-latest
# arch: AMD64
# shell: 'msys2 {0}'
defaults:
run:
shell: ${{ matrix.shell }}
Expand All @@ -43,15 +43,20 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Set deployment target
if: matrix.os == 'macos-13' || matrix.os == 'macos-14'
run: echo "MACOSX_DEPLOYMENT_TARGET=10.13" >> $GITHUB_ENV
- name: Set deployment target for macOS 13
if: matrix.os == 'macos-13'
run: echo "MACOSX_DEPLOYMENT_TARGET=13.0" >> $GITHUB_ENV
- name: Set deployment target for macOS 14
if: matrix.os == 'macos-14'
run: echo "MACOSX_DEPLOYMENT_TARGET=14.0" >> $GITHUB_ENV
- name: Install packages
if: matrix.os == 'macos-13' || matrix.os == 'macos-14'
run: |
echo 3434343434
brew update
brew install pkg-config
brew install pkg-config srt
brew unlink gettext libidn2 libpng libtiff libunistring libx11 libxau libxcb libxdmcp little-cms2 unbound
echo 4545454545
- uses: msys2/setup-msys2@v2
if: matrix.os == 'windows-latest'
with:
Expand All @@ -60,7 +65,13 @@ jobs:
- name: Build FFmpeg
env:
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_BEFORE_BUILD: python scripts/build-ffmpeg.py /tmp/vendor --disable-gpl
CIBW_BEFORE_BUILD_LINUX: |
echo 1212121212
yum update
yum install -y tcl cmake gcc gcc-c++
echo 2323232323
python scripts/build-ffmpeg.py /tmp/vendor --disable-gpl
CIBW_BEFORE_BUILD_MACOS: python scripts/build-ffmpeg.py /tmp/vendor --disable-gpl
CIBW_BEFORE_BUILD_WINDOWS: python scripts\build-ffmpeg.py C:\cibw\vendor --disable-gpl
CIBW_BUILD: cp39-*
CIBW_REPAIR_WHEEL_COMMAND_LINUX: LD_LIBRARY_PATH=/tmp/vendor/lib:$LD_LIBRARY_PATH auditwheel repair -w {dest_dir} {wheel}
Expand All @@ -80,7 +91,7 @@ jobs:
build-qemu-stage-1:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
fail-fast: true
matrix:
arch: [aarch64]
os: [ubuntu-latest]
Expand Down Expand Up @@ -111,7 +122,7 @@ jobs:
needs: build-qemu-stage-1
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
fail-fast: true
matrix:
arch: [aarch64]
os: [ubuntu-latest]
Expand Down
18 changes: 16 additions & 2 deletions scripts/build-ffmpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
requires=["xz"],
source_url="https://download.gnome.org/sources/libxml2/2.9/libxml2-2.9.13.tar.xz",
build_arguments=["--without-python"],
),
)
]

gnutls_group = [
Expand Down Expand Up @@ -182,6 +182,13 @@
build_system="meson",
)

srt_package = Package(
name="srt",
source_url="https://github.com/Haivision/srt/archive/refs/tags/v1.5.4.tar.gz",
build_system="cmake",
#build_arguments=["-DENABLE_STDCXX_SYNC=ON"],
)

ffmpeg_package = Package(
name="ffmpeg",
source_url="https://ffmpeg.org/releases/ffmpeg-7.1.tar.xz",
Expand All @@ -206,6 +213,10 @@ def download_tars(use_gnutls, stage):
else:
the_packages = []

print(f"{the_packages=}")
the_packages.append(srt_package)
print(f"{the_packages=}")

for package in the_packages:
tarball = os.path.join(
os.path.abspath("source"),
Expand Down Expand Up @@ -319,6 +330,7 @@ def main():
"--enable-libopencore-amrwb",
"--enable-libopus",
"--enable-libspeex",
"--enable-libsrt",
"--enable-libtwolame",
"--enable-libvorbis",
"--enable-libvpx",
Expand Down Expand Up @@ -350,12 +362,14 @@ def main():
if use_gnutls:
library_group += gnutls_group

package_groups = [library_group + codec_group, [ffmpeg_package]]
package_groups = [library_group + codec_group, [srt_package, ffmpeg_package]]
if build_stage is not None:
packages = package_groups[build_stage]
else:
packages = [p for p_list in package_groups for p in p_list]

print(f"{packages=}")

for package in packages:
if disable_gpl and package.gpl:
if package.name == "x264":
Expand Down
5 changes: 4 additions & 1 deletion scripts/cibuildpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def _build_with_autoconf(self, package: Package, for_builder: bool) -> None:
# https://cibuildwheel.readthedocs.io/en/stable/cpp_standards/#macos-and-deployment-target-versions
configure_args += ["--target=x86_64-darwin13-gcc"]
elif platform.system() == "Windows":
configure_args += ["--target=x86_64-win64-gcc"]
configure_args += ["--target=x86_64-win64-gcc"]

# build package
os.makedirs(package_build_path, exist_ok=True)
Expand All @@ -246,6 +246,9 @@ def _build_with_cmake(self, package: Package, for_builder: bool) -> None:
package_source_path = os.path.join(package_path, package.source_dir)
package_build_path = os.path.join(package_path, package.build_dir)

if package.name == "srt" and platform.system() == "Linux":
run(["yum", "-y", "install", "openssl-devel"])

# determine cmake arguments
env = self._environment(for_builder=for_builder)
prefix = self._prefix(for_builder=for_builder)
Expand Down

0 comments on commit ac371b8

Please sign in to comment.