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 867b0c2
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 11 deletions.
23 changes: 15 additions & 8 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 @@ -43,14 +43,17 @@ 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: |
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
- uses: msys2/setup-msys2@v2
if: matrix.os == 'windows-latest'
Expand All @@ -60,7 +63,11 @@ 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: |
yum update
yum install -y tcl cmake gcc gcc-c++
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 +87,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 +118,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
27 changes: 25 additions & 2 deletions scripts/build-ffmpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,21 @@

from cibuildpkg import Builder, Package, fetch, get_platform, log_group, run

print(5555555555555555555555)
print(shutil.which("openssl"))

try:
print(os.environ['OPENSSL_ROOT_DIR'])
print(os.environ)
except:
pass

plat = platform.system()

if plat == "Windows":
import sys
sys.exit()

library_group = [
Package(
name="xz",
Expand All @@ -35,7 +48,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 +195,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", "-DOPENSSL_ROOT_DIR=$IDIR_BASE"],
)

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

the_packages.append(srt_package)

for package in the_packages:
tarball = os.path.join(
os.path.abspath("source"),
Expand Down Expand Up @@ -319,6 +341,7 @@ def main():
"--enable-libopencore-amrwb",
"--enable-libopus",
"--enable-libspeex",
"--enable-libsrt",
"--enable-libtwolame",
"--enable-libvorbis",
"--enable-libvpx",
Expand Down Expand Up @@ -350,7 +373,7 @@ 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:
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 867b0c2

Please sign in to comment.