Skip to content

Commit

Permalink
enable srt
Browse files Browse the repository at this point in the history
  • Loading branch information
joepers committed Nov 15, 2024
1 parent ef6da67 commit cce5c32
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 16 deletions.
45 changes: 30 additions & 15 deletions .github/workflows/build-ffmpeg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ jobs:
fail-fast: false
matrix:
include:
- os: macos-14
arch: arm64
shell: bash
- os: macos-13
arch: x86_64
shell: bash
- os: ubuntu-latest
arch: i686
shell: bash
# - os: macos-14
# arch: arm64
# shell: bash
# - os: macos-13
# arch: x86_64
# shell: bash
# - os: ubuntu-latest
# arch: i686
# shell: bash
- 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 @@ -46,17 +46,32 @@ jobs:
- name: Set deployment target
if: matrix.os == 'macos-13' || matrix.os == 'macos-14'
run: echo "MACOSX_DEPLOYMENT_TARGET=10.13" >> $GITHUB_ENV
- name: Install packages
- name: Install packages for macos
if: matrix.os == 'macos-13' || matrix.os == 'macos-14'
run: |
brew update
brew install pkg-config
brew install pkg-config [email protected]
brew unlink gettext libidn2 libpng libtiff libunistring libx11 libxau libxcb libxdmcp little-cms2 unbound
- name: Install packages for linux
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install autoconf automake build-essential cmake libtool pkg-config nasm zlib1g-dev libvorbis-dev libx264-dev 'libgnutls.*-dev' libsrt-gnutls-dev gnutls-bin srt-tools 'libsrt.*-gnutls' libssl-dev
- uses: msys2/setup-msys2@v2
if: matrix.os == 'windows-latest'
with:
install: base-devel mingw-w64-x86_64-gcc mingw-w64-x86_64-gperf mingw-w64-x86_64-nasm
path-type: inherit
- name: list
run: |
echo 1111111
dpkg -L libsrt1.4-gnutls
echo 2222222
dpkg -L libsrt-gnutls-dev
echo 3333333
ls -a /usr/lib/x86_64-linux-gnu/pkgconfig || echo 123123
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/x86_64-linux-gnu/pkgconfig
echo $PKG_CONFIG_PATH
- name: Build FFmpeg
env:
CIBW_ARCHS: ${{ matrix.arch }}
Expand All @@ -76,7 +91,7 @@ jobs:
with:
name: output-${{ matrix.os }}-${{ matrix.arch }}
path: output/

build-qemu-stage-1:
runs-on: ${{ matrix.os }}
strategy:
Expand Down
4 changes: 4 additions & 0 deletions scripts/build-ffmpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@ def download_tars(use_gnutls, stage):


def main():
print(5555555555)
os.environ["PKG_CONFIG_PATH"] = os.environ["PKG_CONFIG_PATH"] + os.pathsep + "/usr/lib/x86_64-linux-gnu/pkgconfig"
print(os.getenv("PKG_CONFIG_PATH"))
global library_group

parser = argparse.ArgumentParser("build-ffmpeg")
Expand Down Expand Up @@ -317,6 +320,7 @@ def main():
"--enable-libopencore-amrwb",
"--enable-libopus",
"--enable-libspeex",
"--enable-libsrt",
"--enable-libtwolame",
"--enable-libvorbis",
"--enable-libvpx",
Expand Down
34 changes: 33 additions & 1 deletion scripts/cibuildpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
from dataclasses import dataclass, field, replace


print(66666666)
print(os.getenv("PKG_CONFIG_PATH"))
os.environ["PKG_CONFIG_PATH"] = os.environ["PKG_CONFIG_PATH"] + os.pathsep + "/usr/lib/x86_64-linux-gnu/pkgconfig"
print(os.getenv("PKG_CONFIG_PATH"))


def fetch(url: str, path: str) -> None:
run(["curl", "-L", "-o", path, url])

Expand Down Expand Up @@ -102,10 +108,25 @@ def run(cmd, env=None):
try:
subprocess.run(cmd, check=True, env=env, stderr=subprocess.PIPE, text=True)
except subprocess.CalledProcessError as e:
print(f"stderr: {e.stderr}")
print(f"1111111stderr: {e.stderr}")
print(os.getenv("PKG_CONFIG_PATH"))
find_file("ffbuild/config.log")
raise e


def find_file(target_path):
target_dir, target_file = os.path.split(target_path)
for root, dirs, files in os.walk("/"):
if target_dir in dirs:
potential_dir = os.path.join(root, target_dir)
if target_file in os.listdir(potential_dir):
full_path = os.path.join(potential_dir, target_file)
print(f"2222222Found: {full_path}")
with open(full_path, 'r') as log_file:
print(log_file.read())



@dataclass
class Package:
name: str
Expand Down Expand Up @@ -224,8 +245,19 @@ def _build_with_autoconf(self, package: Package, for_builder: bool) -> None:
configure_args += ["--target=x86_64-win64-gcc"]

# build package
print(77777777777)
os.makedirs(package_build_path, exist_ok=True)
run(['dpkg', '-L', 'libsrt-gnutls-dev'])
run(['ls', '-a', '/usr/lib/x86_64-linux-gnu/pkgconfig'])
for i in env["PKG_CONFIG_PATH"].split(':'):
print(88888888, i)
try:
print(os.listdir(i))
except Exception as err:
print('88888888b', err)

with chdir(package_build_path):
print(99999999, self._mangle_path(os.path.join(package_source_path, "configure")))
run(
[
"sh",
Expand Down

0 comments on commit cce5c32

Please sign in to comment.