diff --git a/.github/workflows/build-ffmpeg.yml b/.github/workflows/build-ffmpeg.yml index 25ca8ab1..2ac517f6 100644 --- a/.github/workflows/build-ffmpeg.yml +++ b/.github/workflows/build-ffmpeg.yml @@ -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 }} @@ -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 srt@1.4 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 }} @@ -76,7 +91,7 @@ jobs: with: name: output-${{ matrix.os }}-${{ matrix.arch }} path: output/ - + build-qemu-stage-1: runs-on: ${{ matrix.os }} strategy: diff --git a/scripts/build-ffmpeg.py b/scripts/build-ffmpeg.py index 818847a8..1f2671c0 100644 --- a/scripts/build-ffmpeg.py +++ b/scripts/build-ffmpeg.py @@ -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") @@ -317,6 +320,7 @@ def main(): "--enable-libopencore-amrwb", "--enable-libopus", "--enable-libspeex", + "--enable-libsrt", "--enable-libtwolame", "--enable-libvorbis", "--enable-libvpx", diff --git a/scripts/cibuildpkg.py b/scripts/cibuildpkg.py index abe52d9a..d2682138 100644 --- a/scripts/cibuildpkg.py +++ b/scripts/cibuildpkg.py @@ -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]) @@ -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 @@ -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",