diff --git a/.github/workflows/build-ffmpeg.yml b/.github/workflows/build-ffmpeg.yml index 0a16da1..62cafe2 100644 --- a/.github/workflows/build-ffmpeg.yml +++ b/.github/workflows/build-ffmpeg.yml @@ -29,7 +29,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: 3.12 + python-version: 3.8 - name: Install packages if: matrix.os == 'macos-latest' run: | @@ -56,111 +56,111 @@ jobs: cibuildwheel --output-dir output rm -f output/*.whl - name: Upload FFmpeg - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: output-wheel-${{ matrix.os }}-${{ matrix.arch }} path: output/ - # build-qemu-stage-1: - # runs-on: ubuntu-latest - # strategy: - # fail-fast: false - # matrix: - # arch: [aarch64, ppc64le] - # env: - # stage: 1 - # steps: - # - uses: actions/checkout@v4 - # - uses: actions/setup-python@v4 - # with: - # python-version: 3.8 - # - name: Set up QEMU - # uses: docker/setup-qemu-action@v3 - # - name: Build FFmpeg dependencies - # run: | - # docker run -v $PWD:/project:rw --workdir=/project quay.io/pypa/manylinux2014_${{ matrix.arch }} bash -exc ' - # export PATH=/opt/python/cp38-cp38/bin:$PATH; - # export CIBUILDWHEEL=1; - # python scripts/build-ffmpeg.py /tmp/vendor --stage ${{ env.stage }}; - # cp -ar /tmp/vendor /project; - # ' - # shell: bash - # - uses: actions/upload-artifact@v3 - # with: - # name: artifacts-${{ matrix.arch }} - # path: vendor + build-qemu-stage-1: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + arch: [aarch64, ppc64le] + env: + stage: 1 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3.8 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Build FFmpeg dependencies + run: | + docker run -v $PWD:/project:rw --workdir=/project quay.io/pypa/manylinux2014_${{ matrix.arch }} bash -exc ' + export PATH=/opt/python/cp38-cp38/bin:$PATH; + export CIBUILDWHEEL=1; + python scripts/build-ffmpeg.py /tmp/vendor --stage ${{ env.stage }}; + cp -ar /tmp/vendor /project; + ' + shell: bash + - uses: actions/upload-artifact@v4 + with: + name: artifacts-${{ matrix.arch }} + path: vendor - # build-qemu-stage-2: - # needs: build-qemu-stage-1 - # runs-on: ubuntu-latest - # strategy: - # fail-fast: false - # matrix: - # arch: [aarch64, ppc64le] - # env: - # stage: 2 - # steps: - # - uses: actions/checkout@v4 - # - uses: actions/setup-python@v4 - # with: - # python-version: 3.8 - # - name: Set up QEMU - # uses: docker/setup-qemu-action@v3 - # - uses: actions/download-artifact@v3 - # with: - # name: artifacts-${{ matrix.arch }} - # path: vendor - # - name: Build FFmpeg dependencies - # run: | - # docker run -v $PWD:/project:rw --workdir=/project quay.io/pypa/manylinux2014_${{ matrix.arch }} bash -exc ' - # export PATH=/opt/python/cp38-cp38/bin:$PATH; - # export CIBUILDWHEEL=1; - # cp -ar vendor /tmp; - # python scripts/build-ffmpeg.py /tmp/vendor --stage ${{ env.stage }}; - # cp -ar /tmp/vendor /project; - # ' - # shell: bash - # - uses: actions/upload-artifact@v3 - # with: - # name: artifacts-${{ matrix.arch }} - # path: vendor + build-qemu-stage-2: + needs: build-qemu-stage-1 + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + arch: [aarch64, ppc64le] + env: + stage: 2 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3.8 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - uses: actions/download-artifact@v4 + with: + name: artifacts-${{ matrix.arch }} + path: vendor + - name: Build FFmpeg dependencies + run: | + docker run -v $PWD:/project:rw --workdir=/project quay.io/pypa/manylinux2014_${{ matrix.arch }} bash -exc ' + export PATH=/opt/python/cp38-cp38/bin:$PATH; + export CIBUILDWHEEL=1; + cp -ar vendor /tmp; + python scripts/build-ffmpeg.py /tmp/vendor --stage ${{ env.stage }}; + cp -ar /tmp/vendor /project; + ' + shell: bash + - uses: actions/upload-artifact@v4 + with: + name: artifacts-${{ matrix.arch }} + path: vendor - # build-qemu-stage-3: - # needs: build-qemu-stage-2 - # runs-on: ubuntu-latest - # strategy: - # fail-fast: false - # matrix: - # arch: [aarch64, ppc64le] - # env: - # stage: 3 - # steps: - # - uses: actions/checkout@v4 - # - uses: actions/setup-python@v4 - # with: - # python-version: 3.8 - # - name: Set up QEMU - # uses: docker/setup-qemu-action@v3 - # - uses: actions/download-artifact@v3 - # with: - # name: artifacts-${{ matrix.arch }} - # path: vendor - # - name: Build FFmpeg - # env: - # CIBW_ARCHS: ${{ matrix.arch }} - # CIBW_BEFORE_ALL_LINUX: cp -ar vendor /tmp - # CIBW_BEFORE_BUILD: python scripts/build-ffmpeg.py /tmp/vendor --stage ${{ env.stage }} - # CIBW_BUILD: cp38-* - # CIBW_REPAIR_WHEEL_COMMAND_LINUX: LD_LIBRARY_PATH=/tmp/vendor/lib:$LD_LIBRARY_PATH auditwheel repair -w {dest_dir} {wheel} - # CIBW_SKIP: "*musllinux*" - # CIBW_TEST_COMMAND: python -c "import dummy" - # run: | - # pip install cibuildwheel - # cibuildwheel --output-dir output - # rm -f output/*.whl - # shell: bash - # - name: Upload FFmpeg - # uses: actions/upload-artifact@v3 - # with: - # name: output - # path: output/ + build-qemu-stage-3: + needs: build-qemu-stage-2 + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + arch: [aarch64, ppc64le] + env: + stage: 3 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3.8 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - uses: actions/download-artifact@v4 + with: + name: artifacts-${{ matrix.arch }} + path: vendor + - name: Build FFmpeg + env: + CIBW_ARCHS: ${{ matrix.arch }} + CIBW_BEFORE_ALL_LINUX: cp -ar vendor /tmp + CIBW_BEFORE_BUILD: python scripts/build-ffmpeg.py /tmp/vendor --stage ${{ env.stage }} + CIBW_BUILD: cp38-* + CIBW_REPAIR_WHEEL_COMMAND_LINUX: LD_LIBRARY_PATH=/tmp/vendor/lib:$LD_LIBRARY_PATH auditwheel repair -w {dest_dir} {wheel} + CIBW_SKIP: "*musllinux*" + CIBW_TEST_COMMAND: python -c "import dummy" + run: | + pip install cibuildwheel + cibuildwheel --output-dir output + rm -f output/*.whl + shell: bash + - name: Upload FFmpeg + uses: actions/upload-artifact@v4 + with: + name: output + path: output/ diff --git a/scripts/build-ffmpeg.py b/scripts/build-ffmpeg.py index 7c47988..d1f448d 100644 --- a/scripts/build-ffmpeg.py +++ b/scripts/build-ffmpeg.py @@ -183,31 +183,31 @@ ] codec_group = [ - # Package( - # name="aom", - # requires=["cmake"], - # source_url="https://storage.googleapis.com/aom-releases/libaom-3.2.0.tar.gz", - # source_strip_components=0, - # build_system="cmake", - # build_arguments=[ - # "-DENABLE_DOCS=0", - # "-DENABLE_EXAMPLES=0", - # "-DENABLE_TESTS=0", - # "-DENABLE_TOOLS=0", - # ], - # build_parallel=False, - # ), - # Package( - # name="ass", - # requires=["fontconfig", "freetype", "fribidi", "harfbuzz", "nasm", "png"], - # source_url="https://github.com/libass/libass/releases/download/0.15.2/libass-0.15.2.tar.gz", - # ), - # Package( - # name="bluray", - # requires=["fontconfig"], - # source_url="https://download.videolan.org/pub/videolan/libbluray/1.3.4/libbluray-1.3.4.tar.bz2", - # build_arguments=["--disable-bdjava-jar"], - # ), + Package( + name="aom", + requires=["cmake"], + source_url="https://storage.googleapis.com/aom-releases/libaom-3.2.0.tar.gz", + source_strip_components=0, + build_system="cmake", + build_arguments=[ + "-DENABLE_DOCS=0", + "-DENABLE_EXAMPLES=0", + "-DENABLE_TESTS=0", + "-DENABLE_TOOLS=0", + ], + build_parallel=False, + ), + Package( + name="ass", + requires=["fontconfig", "freetype", "fribidi", "harfbuzz", "nasm", "png"], + source_url="https://github.com/libass/libass/releases/download/0.15.2/libass-0.15.2.tar.gz", + ), + Package( + name="bluray", + requires=["fontconfig"], + source_url="https://download.videolan.org/pub/videolan/libbluray/1.3.4/libbluray-1.3.4.tar.bz2", + build_arguments=["--disable-bdjava-jar"], + ), Package( name="dav1d", requires=["meson", "nasm", "ninja"], @@ -222,12 +222,12 @@ name="ogg", source_url="http://downloads.xiph.org/releases/ogg/libogg-1.3.5.tar.gz", ), - # Package( - # name="opencore-amr", - # source_url="http://deb.debian.org/debian/pool/main/o/opencore-amr/opencore-amr_0.1.5.orig.tar.gz", - # # parallel build hangs on Windows - # build_parallel=plat != "Windows", - # ), + Package( + name="opencore-amr", + source_url="http://deb.debian.org/debian/pool/main/o/opencore-amr/opencore-amr_0.1.5.orig.tar.gz", + # parallel build hangs on Windows + build_parallel=plat != "Windows", + ), Package( name="openjpeg", requires=["cmake"], @@ -307,14 +307,14 @@ "--enable-fontconfig", "--enable-gmp", "--enable-gnutls" if use_gnutls else "--disable-gnutls", - #"--enable-libaom", - #"--enable-libass", - #"--enable-libbluray", + "--enable-libaom", + "--enable-libass", + "--enable-libbluray", "--enable-libdav1d", "--enable-libfreetype", "--enable-libmp3lame", - #"--enable-libopencore-amrnb", - #"--enable-libopencore-amrwb", + "--enable-libopencore-amrnb", + "--enable-libopencore-amrwb", "--enable-libopenjpeg", "--enable-libopus", "--enable-libspeex",