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 b1e04ca commit 9baf5c4
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 13 deletions.
27 changes: 17 additions & 10 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,9 +87,9 @@ jobs:
build-qemu-stage-1:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
fail-fast: true
matrix:
arch: [aarch64, ppc64le]
arch: [aarch64]
os: [ubuntu-latest]
env:
stage: 1
Expand Down Expand Up @@ -111,9 +118,9 @@ jobs:
needs: build-qemu-stage-1
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
fail-fast: true
matrix:
arch: [aarch64, ppc64le]
arch: [aarch64]
os: [ubuntu-latest]
env:
stage: 2
Expand Down
32 changes: 30 additions & 2 deletions scripts/build-ffmpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@

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

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

try:
print(os.environ)
print(os.environ.get("OPENSSL_ROOT_DIR"))
except: pass

plat = platform.system()

library_group = [
Expand Down Expand Up @@ -35,7 +43,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 +190,23 @@
build_system="meson",
)

if plat == "Windows":
#srt_build_arg = [r"-DOPENSSL_ROOT_DIR=D:\a\_temp\msys64\usr\bin"]
#srt_build_arg = [r"-DOPENSSL_ROOT_DIR=C:\Program Files\OpenSSL"]
os.environ["OPENSSL_ROOT_DIR"] = r"C:\Program Files\OpenSSL"
try:
print(33333333333333333)
print(os.listdir(r"C:\Program Files\OpenSSL"))
print(os.listdir(r"D:\a\_temp\msys64\usr\bin"))
except: pass


srt_package = Package(
name="srt",
source_url="https://github.com/Haivision/srt/archive/refs/tags/v1.5.4.tar.gz",
build_system="cmake",
)

ffmpeg_package = Package(
name="ffmpeg",
source_url="https://ffmpeg.org/releases/ffmpeg-7.1.tar.xz",
Expand All @@ -206,6 +231,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 +346,7 @@ def main():
"--enable-libopencore-amrwb",
"--enable-libopus",
"--enable-libspeex",
"--enable-libsrt",
"--enable-libtwolame",
"--enable-libvorbis",
"--enable-libvpx",
Expand Down Expand Up @@ -350,7 +378,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 9baf5c4

Please sign in to comment.