From b6ff992a95ef242a7046b13e3086aa0294d84d64 Mon Sep 17 00:00:00 2001 From: Alexander Piskun Date: Fri, 5 Nov 2021 13:31:37 +0200 Subject: [PATCH] New GitHub Actions for building with cache using for linux binary wheels. --- .github/workflows/build-cache-deps.yml | 143 +++++++++++++++++++++ .github/workflows/create-release-draft.yml | 137 +++++++++++++++----- CHANGELOG.md | 8 +- MANIFEST.in | 7 +- build_scripts/linux/aom.sh | 18 +++ build_scripts/linux/autoconf.sh | 19 +++ build_scripts/linux/automake.sh | 19 +++ build_scripts/linux/cmake.sh | 15 +++ build_scripts/linux/libde265.sh | 19 +++ build_scripts/linux/libffi.sh | 18 +++ build_scripts/linux/libheif.sh | 18 +++ build_scripts/linux/libressl.sh | 19 +++ build_scripts/linux/nasm.sh | 20 +++ build_scripts/linux/pkg-config.sh | 19 +++ build_scripts/linux/x265.sh | 18 +++ pyproject.toml | 7 - scripts/init_linux.sh | 138 -------------------- 17 files changed, 461 insertions(+), 181 deletions(-) create mode 100644 .github/workflows/build-cache-deps.yml create mode 100644 build_scripts/linux/aom.sh create mode 100644 build_scripts/linux/autoconf.sh create mode 100644 build_scripts/linux/automake.sh create mode 100644 build_scripts/linux/cmake.sh create mode 100644 build_scripts/linux/libde265.sh create mode 100644 build_scripts/linux/libffi.sh create mode 100644 build_scripts/linux/libheif.sh create mode 100644 build_scripts/linux/libressl.sh create mode 100644 build_scripts/linux/nasm.sh create mode 100644 build_scripts/linux/pkg-config.sh create mode 100644 build_scripts/linux/x265.sh delete mode 100644 scripts/init_linux.sh diff --git a/.github/workflows/build-cache-deps.yml b/.github/workflows/build-cache-deps.yml new file mode 100644 index 00000000..856e550a --- /dev/null +++ b/.github/workflows/build-cache-deps.yml @@ -0,0 +1,143 @@ +name: Build cache for dependecies + +on: + workflow_dispatch: + +jobs: + dependencies_linux: + strategy: + fail-fast: true + matrix: + include: + - runs-on: ubuntu-latest + cibw-arch: manylinux_x86_64 + - runs-on: ubuntu-latest + cibw-arch: manylinux_aarch64 + name: Dependecies • ${{ matrix.cibw-arch }} + runs-on: ${{ matrix.runs-on }} + env: + BUILD_STUFF: "/build-stuff" + SCRIPTS: "./build_scripts/linux/" + BUILD_ORDER: "pkg-config,cmake,autoconf,automake,libressl,nasm,libde265,aom,libheif,libffi" + OS_PACKAGES: "wget libtool git-all" + + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Make preparations + run: | + sudo mkdir "$BUILD_STUFF" && sudo chmod 777 "$BUILD_STUFF" + BUILD_STUFF_CMD="&& sh $(echo "$BUILD_ORDER" | sed 's/,/.sh \&\& sh /g').sh" + echo BUILD_COMMAND="yum install -y -q $OS_PACKAGES && set -ex && cd $SCRIPTS $BUILD_STUFF_CMD" >> $GITHUB_ENV + + - uses: actions/cache@v2 + with: + path: ${{ env.BUILD_STUFF }}/${{ env.NAME }} + key: ${{ matrix.runs-on }}-${{ matrix.cibw-arch }}-${{ hashFiles(format('{0}{1}.sh', env.SCRIPTS, env.NAME)) }} + env: + NAME: pkg-config + + - uses: actions/cache@v2 + with: + path: ${{ env.BUILD_STUFF }}/${{ env.NAME }} + key: ${{ matrix.runs-on }}-${{ matrix.cibw-arch }}-${{ hashFiles(format('{0}{1}.sh', env.SCRIPTS, env.NAME)) }} + env: + NAME: cmake + + - uses: actions/cache@v2 + with: + path: ${{ env.BUILD_STUFF }}/${{ env.NAME }} + key: ${{ matrix.runs-on }}-${{ matrix.cibw-arch }}-${{ hashFiles(format('{0}{1}.sh', env.SCRIPTS, env.NAME)) }} + env: + NAME: autoconf + + - uses: actions/cache@v2 + with: + path: ${{ env.BUILD_STUFF }}/${{ env.NAME }} + key: ${{ matrix.runs-on }}-${{ matrix.cibw-arch }}-${{ hashFiles(format('{0}{1}.sh', env.SCRIPTS, env.NAME)) }} + env: + NAME: automake + + - uses: actions/cache@v2 + with: + path: ${{ env.BUILD_STUFF }}/${{ env.NAME }} + key: ${{ matrix.runs-on }}-${{ matrix.cibw-arch }}-${{ hashFiles(format('{0}{1}.sh', env.SCRIPTS, env.NAME)) }} + env: + NAME: libressl + + - uses: actions/cache@v2 + with: + path: ${{ env.BUILD_STUFF }}/${{ env.NAME }} + key: ${{ matrix.runs-on }}-${{ matrix.cibw-arch }}-${{ hashFiles(format('{0}{1}.sh', env.SCRIPTS, env.NAME)) }} + env: + NAME: nasm + + - uses: actions/cache@v2 + with: + path: ${{ env.BUILD_STUFF }}/${{ env.NAME }} + key: ${{ matrix.runs-on }}-${{ matrix.cibw-arch }}-${{ hashFiles(format('{0}{1}.sh', env.SCRIPTS, env.NAME)) }} + env: + NAME: libde265 + + - uses: actions/cache@v2 + with: + path: ${{ env.BUILD_STUFF }}/${{ env.NAME }} + key: ${{ matrix.runs-on }}-${{ matrix.cibw-arch }}-${{ hashFiles(format('{0}{1}.sh', env.SCRIPTS, env.NAME)) }} + env: + NAME: aom + + - uses: actions/cache@v2 + with: + path: ${{ env.BUILD_STUFF }}/${{ env.NAME }} + key: ${{ matrix.runs-on }}-${{ matrix.cibw-arch }}-${{ hashFiles(format('{0}{1}.sh', env.SCRIPTS, env.NAME)) }} + env: + NAME: libheif + + - uses: actions/cache@v2 + with: + path: ${{ env.BUILD_STUFF }}/${{ env.NAME }} + key: ${{ matrix.runs-on }}-${{ matrix.cibw-arch }}-${{ hashFiles(format('{0}{1}.sh', env.SCRIPTS, env.NAME)) }} + env: + NAME: libffi + + - name: Set up QEMU + if: matrix.cibw-arch == 'manylinux_aarch64' + uses: docker/setup-qemu-action@v1 + with: + platforms: arm64 + + - name: x64 linux pre configure enviroment + if: matrix.cibw-arch == 'manylinux_x86_64' + run: | + echo "CIBW_ARCHS=x86_64" >> $GITHUB_ENV + echo "CIBW_MANYLINUX_X86_64_IMAGE=manylinux2014" >> $GITHUB_ENV + echo "CIBW_BUILD=cp38-manylinux_x86_64" >> $GITHUB_ENV + + - name: Arm linux pre configure enviroment + if: matrix.cibw-arch == 'manylinux_aarch64' + run: | + echo "CIBW_ARCHS=aarch64" >> $GITHUB_ENV + echo "CIBW_BUILD=cp38-manylinux_aarch64" >> $GITHUB_ENV + + - name: Start test build + run: | + python -m pip install cibuildwheel twine + cibuildwheel + env: + CIBW_TEST_SKIP: "*" + CIBW_BEFORE_ALL: ${{ env.BUILD_COMMAND }} + CIBW_ENVIRONMENT: BUILD_STUFF=${{ env.BUILD_STUFF }} + + - name: Check builded wheel + run: | + twine check wheelhouse/* + + - name: Upload builded wheel + uses: actions/upload-artifact@v2 + with: + name: wheels + path: wheelhouse/*.whl + if-no-files-found: error diff --git a/.github/workflows/create-release-draft.yml b/.github/workflows/create-release-draft.yml index e1dcdccb..c5de0c00 100644 --- a/.github/workflows/create-release-draft.yml +++ b/.github/workflows/create-release-draft.yml @@ -82,27 +82,21 @@ jobs: python-version: '3.8' architecture: ${{ matrix.python-arch }} - - name: Install requirements - run: | - python -m pip install cibuildwheel twine - - name: macOS x64 pre configure enviroment if: matrix.cibw-arch == 'macosx_x86_64' - shell: bash run: | echo "CIBW_ARCHS_MACOS=x86_64" >> $GITHUB_ENV - - name: Configure cibuildwheel - shell: bash - run: | - echo "CIBW_BUILD=*-${{ matrix.cibw-arch }}" >> $GITHUB_ENV - echo "CIBW_SKIP=pp*" >> $GITHUB_ENV - echo "CIBW_TEST_REQUIRES=pytest piexif" >> $GITHUB_ENV - echo "CIBW_TEST_COMMAND=pytest {project}" >> $GITHUB_ENV - - name: Run cibuildwheel run: | + python -m pip install cibuildwheel twine cibuildwheel + env: + CIBW_BUILD: ${{ format('*-{0}', matrix.cibw-arch) }} + CIBW_SKIP: "pp*" + CIBW_TEST_COMMAND: "pytest {project}" + CIBW_TEST_REQUIRES: "pytest piexif" + CIBW_BUILD_VERBOSITY: 1 - name: Check built wheels run: | @@ -126,52 +120,129 @@ jobs: cibw-arch: manylinux_aarch64 name: Wheels • ${{ matrix.cibw-arch }} runs-on: ${{ matrix.runs-on }} + env: + BUILD_STUFF: "/build-stuff" + SCRIPTS: "./build_scripts/linux/" + BUILD_ORDER: "pkg-config,cmake,autoconf,automake,libressl,nasm,libde265,aom,libheif,libffi" + OS_PACKAGES: "wget libtool git-all" steps: - - name: Set up QEMU - if: matrix.cibw-arch == 'manylinux_aarch64' - uses: docker/setup-qemu-action@v1 - with: - platforms: arm64 - - name: Checkout code uses: actions/checkout@v2 with: submodules: recursive - - name: Install requirements + - name: Make preparations run: | - python -m pip install cibuildwheel twine + sudo mkdir "$BUILD_STUFF" && sudo chmod 777 "$BUILD_STUFF" + BUILD_STUFF_CMD="&& sh $(echo "$BUILD_ORDER" | sed 's/,/.sh \&\& sh /g').sh" + echo BUILD_COMMAND="yum install -y -q $OS_PACKAGES && set -ex && cd $SCRIPTS $BUILD_STUFF_CMD" >> $GITHUB_ENV + + - uses: actions/cache@v2 + with: + path: ${{ env.BUILD_STUFF }}/${{ env.NAME }} + key: ${{ matrix.runs-on }}-${{ matrix.cibw-arch }}-${{ hashFiles(format('{0}{1}.sh', env.SCRIPTS, env.NAME)) }} + env: + NAME: pkg-config + + - uses: actions/cache@v2 + with: + path: ${{ env.BUILD_STUFF }}/${{ env.NAME }} + key: ${{ matrix.runs-on }}-${{ matrix.cibw-arch }}-${{ hashFiles(format('{0}{1}.sh', env.SCRIPTS, env.NAME)) }} + env: + NAME: cmake + + - uses: actions/cache@v2 + with: + path: ${{ env.BUILD_STUFF }}/${{ env.NAME }} + key: ${{ matrix.runs-on }}-${{ matrix.cibw-arch }}-${{ hashFiles(format('{0}{1}.sh', env.SCRIPTS, env.NAME)) }} + env: + NAME: autoconf + + - uses: actions/cache@v2 + with: + path: ${{ env.BUILD_STUFF }}/${{ env.NAME }} + key: ${{ matrix.runs-on }}-${{ matrix.cibw-arch }}-${{ hashFiles(format('{0}{1}.sh', env.SCRIPTS, env.NAME)) }} + env: + NAME: automake + + - uses: actions/cache@v2 + with: + path: ${{ env.BUILD_STUFF }}/${{ env.NAME }} + key: ${{ matrix.runs-on }}-${{ matrix.cibw-arch }}-${{ hashFiles(format('{0}{1}.sh', env.SCRIPTS, env.NAME)) }} + env: + NAME: libressl + + - uses: actions/cache@v2 + with: + path: ${{ env.BUILD_STUFF }}/${{ env.NAME }} + key: ${{ matrix.runs-on }}-${{ matrix.cibw-arch }}-${{ hashFiles(format('{0}{1}.sh', env.SCRIPTS, env.NAME)) }} + env: + NAME: nasm + + - uses: actions/cache@v2 + with: + path: ${{ env.BUILD_STUFF }}/${{ env.NAME }} + key: ${{ matrix.runs-on }}-${{ matrix.cibw-arch }}-${{ hashFiles(format('{0}{1}.sh', env.SCRIPTS, env.NAME)) }} + env: + NAME: libde265 + + - uses: actions/cache@v2 + with: + path: ${{ env.BUILD_STUFF }}/${{ env.NAME }} + key: ${{ matrix.runs-on }}-${{ matrix.cibw-arch }}-${{ hashFiles(format('{0}{1}.sh', env.SCRIPTS, env.NAME)) }} + env: + NAME: aom + + - uses: actions/cache@v2 + with: + path: ${{ env.BUILD_STUFF }}/${{ env.NAME }} + key: ${{ matrix.runs-on }}-${{ matrix.cibw-arch }}-${{ hashFiles(format('{0}{1}.sh', env.SCRIPTS, env.NAME)) }} + env: + NAME: libheif + + - uses: actions/cache@v2 + with: + path: ${{ env.BUILD_STUFF }}/${{ env.NAME }} + key: ${{ matrix.runs-on }}-${{ matrix.cibw-arch }}-${{ hashFiles(format('{0}{1}.sh', env.SCRIPTS, env.NAME)) }} + env: + NAME: libffi + + - name: Set up QEMU + if: matrix.cibw-arch == 'manylinux_aarch64' + uses: docker/setup-qemu-action@v1 + with: + platforms: arm64 - name: x64 linux pre configure enviroment if: matrix.cibw-arch == 'manylinux_x86_64' run: | echo "CIBW_ARCHS=x86_64" >> $GITHUB_ENV - echo "CIBW_TEST_COMMAND=pytest {project}" >> $GITHUB_ENV echo "CIBW_MANYLINUX_X86_64_IMAGE=manylinux2014" >> $GITHUB_ENV - name: Arm linux pre configure enviroment if: matrix.cibw-arch == 'manylinux_aarch64' run: | echo "CIBW_ARCHS=aarch64" >> $GITHUB_ENV - echo "CIBW_TEST_COMMAND=pytest -k '__everywhere' {project}" >> $GITHUB_ENV - - - name: Configure cibuildwheel - shell: bash - run: | - echo "CIBW_BUILD=*-${{ matrix.cibw-arch }}" >> $GITHUB_ENV - echo "CIBW_SKIP=pp*" >> $GITHUB_ENV - echo "CIBW_TEST_REQUIRES=pytest piexif" >> $GITHUB_ENV - name: Run cibuildwheel run: | + python -m pip install cibuildwheel twine cibuildwheel - - - name: Check built wheels + env: + CIBW_BEFORE_ALL: ${{ env.BUILD_COMMAND }} + CIBW_ENVIRONMENT: BUILD_STUFF=${{ env.BUILD_STUFF }} + CIBW_BUILD: ${{ format('*-{0}', matrix.cibw-arch) }} + CIBW_SKIP: "pp*" + CIBW_TEST_COMMAND: "pytest {project}" + CIBW_TEST_REQUIRES: "pytest piexif" + CIBW_BUILD_VERBOSITY: 1 + + - name: Check builded wheels run: | twine check wheelhouse/* - - name: Upload built wheels + - name: Upload builded wheels uses: actions/upload-artifact@v2 with: name: wheels diff --git a/CHANGELOG.md b/CHANGELOG.md index c3f2ebe9..a9597063 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,13 @@ All notable changes to this project will be documented in this file. -## [0.1.4 - 2021-11-01] +## [0.1.4 - 2021-11-05] + +### Added + +- GitHub build Actions now use cache. +- Added `libaom` library to linux build. +- More tests. ### Changed diff --git a/MANIFEST.in b/MANIFEST.in index 4f438ea4..56ffb236 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -3,7 +3,10 @@ include README.md include CHANGELOG.md include pytest.ini include requirements.txt -include requirements-dev.txt +include requirements_dev.txt -graft scripts graft tests + +exclude .pylintrc + +prune build_scripts \ No newline at end of file diff --git a/build_scripts/linux/aom.sh b/build_scripts/linux/aom.sh new file mode 100644 index 00000000..d3020680 --- /dev/null +++ b/build_scripts/linux/aom.sh @@ -0,0 +1,18 @@ +VERSION="bb35ba9148543f22ba7d8642e4fbd29ae301f5dc" +NAME=$(basename "$BASH_SOURCE" | cut -f 1 -d '.') +URL="https://aomedia.googlesource.com/aom/+archive/$VERSION.tar.gz" +cd "/host/$BUILD_STUFF" || exit 2 +if [[ -d "$NAME" ]]; then + echo "Cache found for lib$NAME, install it..." + cd "$NAME/build" || exit 102 +else + echo "No cache found for lib$NAME, build it..." + mkdir "$NAME" "$NAME/build" "$NAME/$NAME" && cd "$NAME" || exit 104 + wget -q --no-check-certificate -O "$NAME.tar.gz" "$URL" \ + && tar xf "$NAME.tar.gz" -C "$NAME" \ + && rm -f "$NAME.tar.gz" \ + && cd "./build" \ + && cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib -DBUILD_SHARED_LIBS=1 "../$NAME" \ + && make -j4 +fi +make install && ldconfig \ No newline at end of file diff --git a/build_scripts/linux/autoconf.sh b/build_scripts/linux/autoconf.sh new file mode 100644 index 00000000..b18be1cd --- /dev/null +++ b/build_scripts/linux/autoconf.sh @@ -0,0 +1,19 @@ +VERSION="2.71" +NAME=$(basename "$BASH_SOURCE" | cut -f 1 -d '.') +URL="https://ftp.gnu.org/gnu/autoconf/$NAME-$VERSION.tar.gz" +cd "/host/$BUILD_STUFF" || exit 2 +if [[ -d "$NAME" ]]; then + echo "Cache found for $NAME, install it..." + cd "$NAME" || exit 102 +else + echo "No cache found for $NAME, build it..." + mkdir "$NAME" + wget -q --no-check-certificate -O "$NAME.tar.gz" "$URL" \ + && tar xf "$NAME.tar.gz" -C "$NAME" --strip-components 1 \ + && rm -f "$NAME.tar.gz" \ + && cd "$NAME" \ + && ./configure \ + && make -j4 +fi +make install \ +&& autoconf --version \ No newline at end of file diff --git a/build_scripts/linux/automake.sh b/build_scripts/linux/automake.sh new file mode 100644 index 00000000..c5984801 --- /dev/null +++ b/build_scripts/linux/automake.sh @@ -0,0 +1,19 @@ +VERSION="1.16.4" +NAME=$(basename "$BASH_SOURCE" | cut -f 1 -d '.') +URL="https://ftp.gnu.org/gnu/automake/$NAME-$VERSION.tar.gz" +cd "/host/$BUILD_STUFF" || exit 2 +if [[ -d "$NAME" ]]; then + echo "Cache found for $NAME, install it..." + cd "$NAME" || exit 102 +else + echo "No cache found for $NAME, build it..." + mkdir "$NAME" + wget -q --no-check-certificate -O "$NAME.tar.gz" "$URL" \ + && tar xf "$NAME.tar.gz" -C "$NAME" --strip-components 1 \ + && rm -f "$NAME.tar.gz" \ + && cd "$NAME" \ + && ./configure \ + && make -j4 +fi +make install \ +&& automake --version \ No newline at end of file diff --git a/build_scripts/linux/cmake.sh b/build_scripts/linux/cmake.sh new file mode 100644 index 00000000..cab0d47f --- /dev/null +++ b/build_scripts/linux/cmake.sh @@ -0,0 +1,15 @@ +VERSION="3.21.2" +NAME=$(basename "$BASH_SOURCE" | cut -f 1 -d '.') +URL="https://github.com/Kitware/CMake/releases/download/v$VERSION/$NAME-$VERSION-linux-$(uname -m).sh" +cd "/host/$BUILD_STUFF" || exit 2 +if [[ -d "$NAME" ]]; then + echo "Cache found for $NAME, install it..." + cd "$NAME" || exit 102 +else + echo "No cache found for $NAME, download it..." + mkdir "$NAME" && cd "$NAME" || exit 104 + wget -q -O "$NAME.sh" "$URL" +fi +chmod +x "$NAME.sh" +sh "$NAME.sh" --prefix=/usr/local/ --exclude-subdir +/usr/local/bin/cmake --version \ No newline at end of file diff --git a/build_scripts/linux/libde265.sh b/build_scripts/linux/libde265.sh new file mode 100644 index 00000000..87070b44 --- /dev/null +++ b/build_scripts/linux/libde265.sh @@ -0,0 +1,19 @@ +VERSION="1.0.8" +NAME=$(basename "$BASH_SOURCE" | cut -f 1 -d '.') +URL="https://github.com/strukturag/libde265/releases/download/v$VERSION/$NAME-$VERSION.tar.gz" +cd "/host/$BUILD_STUFF" || exit 2 +if [[ -d "$NAME" ]]; then + echo "Cache found for $NAME, install it..." + cd "$NAME" || exit 102 +else + echo "No cache found for $NAME, build it..." + mkdir "$NAME" + wget -q --no-check-certificate -O "$NAME.tar.gz" "$URL" \ + && tar xf "$NAME.tar.gz" -C "$NAME" --strip-components 1 \ + && rm -f "$NAME.tar.gz" \ + && cd "$NAME" \ + && ./autogen.sh \ + && ./configure --disable-sherlock265 --prefix /usr \ + && make -j4 +fi +make install && ldconfig \ No newline at end of file diff --git a/build_scripts/linux/libffi.sh b/build_scripts/linux/libffi.sh new file mode 100644 index 00000000..98f9ea41 --- /dev/null +++ b/build_scripts/linux/libffi.sh @@ -0,0 +1,18 @@ +VERSION="3.3" +NAME=$(basename "$BASH_SOURCE" | cut -f 1 -d '.') +URL="ftp://sourceware.org/pub/libffi/$NAME-$VERSION.tar.gz" +cd "/host/$BUILD_STUFF" || exit 2 +if [[ -d "$NAME" ]]; then + echo "Cache found for $NAME, install it..." + cd "$NAME" || exit 102 +else + echo "No cache found for $NAME, build it..." + mkdir "$NAME" + wget -q --no-check-certificate -O "$NAME.tar.gz" "$URL" \ + && tar xf "$NAME.tar.gz" -C "$NAME" --strip-components 1 \ + && rm -f "$NAME.tar.gz" \ + && cd "$NAME" \ + && ./configure --prefix /usr \ + && make -j4 +fi +make install && ldconfig \ No newline at end of file diff --git a/build_scripts/linux/libheif.sh b/build_scripts/linux/libheif.sh new file mode 100644 index 00000000..24a4027e --- /dev/null +++ b/build_scripts/linux/libheif.sh @@ -0,0 +1,18 @@ +VERSION="1.12.0" +NAME=$(basename "$BASH_SOURCE" | cut -f 1 -d '.') +URL="https://github.com/strukturag/libheif/releases/download/v$VERSION/$NAME-$VERSION.tar.gz" +cd "/host/$BUILD_STUFF" || exit 2 +if [[ -d "$NAME" ]]; then + echo "Cache found for $NAME, install it..." + cd "$NAME" || exit 102 +else + echo "No cache found for $NAME, build it..." + mkdir "$NAME" + wget -q --no-check-certificate -O "$NAME.tar.gz" "$URL" \ + && tar xf "$NAME.tar.gz" -C "$NAME" --strip-components 1 \ + && rm -f "$NAME.tar.gz" \ + && cd "$NAME" \ + && ./configure --prefix /usr \ + && make -j4 +fi +make install && ldconfig \ No newline at end of file diff --git a/build_scripts/linux/libressl.sh b/build_scripts/linux/libressl.sh new file mode 100644 index 00000000..2fc101bd --- /dev/null +++ b/build_scripts/linux/libressl.sh @@ -0,0 +1,19 @@ +VERSION="3.1.5" +NAME=$(basename "$BASH_SOURCE" | cut -f 1 -d '.') +URL="https://github.com/libressl-portable/portable/archive/v$VERSION.tar.gz" +cd "/host/$BUILD_STUFF" || exit 2 +if [[ -d "$NAME" ]]; then + echo "Cache found for $NAME, install it..." + cd "$NAME" || exit 102 +else + echo "No cache found for $NAME, build it..." + mkdir "$NAME" + wget -q --no-check-certificate -O "$NAME.tar.gz" "$URL" \ + && tar xf "$NAME.tar.gz" -C "$NAME" --strip-components 1 \ + && rm -f "$NAME.tar.gz" \ + && cd "$NAME" \ + && ./autogen.sh \ + && ./configure \ + && make -j4 +fi +make install \ No newline at end of file diff --git a/build_scripts/linux/nasm.sh b/build_scripts/linux/nasm.sh new file mode 100644 index 00000000..1fd7f601 --- /dev/null +++ b/build_scripts/linux/nasm.sh @@ -0,0 +1,20 @@ +VERSION="2.15.05" +NAME=$(basename "$BASH_SOURCE" | cut -f 1 -d '.') +URL="https://www.nasm.us/pub/nasm/releasebuilds/$VERSION/$NAME-$VERSION.tar.gz" +cd "/host/$BUILD_STUFF" || exit 2 +if [[ -d "$NAME" ]]; then + echo "Cache found for $NAME, install it..." + cd "$NAME" || exit 102 +else + echo "No cache found for $NAME, build it..." + mkdir "$NAME" + wget -q --no-check-certificate -O "$NAME.tar.gz" "$URL" \ + && tar xf "$NAME.tar.gz" -C "$NAME" --strip-components 1 \ + && rm -f "$NAME.tar.gz" \ + && cd "$NAME" \ + && ./configure \ + && make -j4 +fi +make install \ +&& nasm --version +chmod -R 777 . \ No newline at end of file diff --git a/build_scripts/linux/pkg-config.sh b/build_scripts/linux/pkg-config.sh new file mode 100644 index 00000000..670786a1 --- /dev/null +++ b/build_scripts/linux/pkg-config.sh @@ -0,0 +1,19 @@ +VERSION="0.29.2" +NAME=$(basename "$BASH_SOURCE" | cut -f 1 -d '.') +URL="https://pkg-config.freedesktop.org/releases/$NAME-$VERSION.tar.gz" +cd "/host/$BUILD_STUFF" || exit 2 +if [[ -d "$NAME" ]]; then + echo "Cache found for $NAME, install it..." + cd "$NAME" || exit 102 +else + echo "No cache found for $NAME, build it..." + mkdir "$NAME" + wget -q --no-check-certificate -O "$NAME.tar.gz" "$URL" \ + && tar xf "$NAME.tar.gz" -C "$NAME" --strip-components 1 \ + && rm -f "$NAME.tar.gz" \ + && cd "$NAME" \ + && ./configure --with-internal-glib \ + && make -j4 +fi +make install \ +&& pkg-config --version \ No newline at end of file diff --git a/build_scripts/linux/x265.sh b/build_scripts/linux/x265.sh new file mode 100644 index 00000000..bf451d4d --- /dev/null +++ b/build_scripts/linux/x265.sh @@ -0,0 +1,18 @@ +VERSION="3.5" +NAME=$(basename "$BASH_SOURCE" | cut -f 1 -d '.') +URL="https://bitbucket.org/multicoreware/x265_git/get/$VERSION.tar.gz" +cd "/host/$BUILD_STUFF" || exit 2 +if [[ -d "$NAME" ]]; then + echo "Cache found for $NAME, install it..." + cd "$NAME" || exit 102 +else + echo "No cache found for $NAME, build it..." + mkdir "$NAME" + wget -q --no-check-certificate -O "$NAME.tar.gz" "$URL" \ + && tar xf "$NAME.tar.gz" -C "$NAME" --strip-components 1 \ + && rm -f "$NAME.tar.gz" \ + && cd "$NAME" \ + && cmake -DCMAKE_INSTALL_PREFIX=/usr -G "Unix Makefiles" ./source \ + && make -j4 +fi +make install && ldconfig \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 645b3b2b..c29ec519 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,3 @@ -[tool.cibuildwheel.linux] -before-all = [ - "yum install -y wget libtool git-all openssl-devel", - "chmod +x ./scripts/init_linux.sh", - "./scripts/init_linux.sh", -] - [tool.cibuildwheel.macos] before-all = [ "brew install x265 libjpeg libde265 libheif", diff --git a/scripts/init_linux.sh b/scripts/init_linux.sh deleted file mode 100644 index ca4a5330..00000000 --- a/scripts/init_linux.sh +++ /dev/null @@ -1,138 +0,0 @@ -os_architecture=$(uname -m) -CMAKE_VERSION="3.21.2" - -set -ex && mkdir /build-tools && mkdir /build-deps - -set -ex \ - && cd /build-tools \ - && PKG_CONFIG_VERSION="0.29.2" \ - && wget --no-check-certificate https://pkg-config.freedesktop.org/releases/pkg-config-${PKG_CONFIG_VERSION}.tar.gz \ - && tar xvf pkg-config-${PKG_CONFIG_VERSION}.tar.gz \ - && cd pkg-config-${PKG_CONFIG_VERSION} \ - && ./configure --with-internal-glib \ - && make -j4 \ - && make install \ - && pkg-config --version - -if [[ $os_architecture == "x86_64" ]] -then - set -ex \ - && cd /build-tools \ - && wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.sh \ - && chmod +x cmake-${CMAKE_VERSION}-linux-x86_64.sh \ - && sh cmake-${CMAKE_VERSION}-linux-x86_64.sh --prefix=/usr/local/ --exclude-subdir \ - && /usr/local/bin/cmake --version -elif [[ $os_architecture == "aarch64" ]] -then - set -ex \ - && cd /build-tools \ - && wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-aarch64.sh \ - && chmod +x cmake-${CMAKE_VERSION}-linux-aarch64.sh \ - && sh cmake-${CMAKE_VERSION}-linux-aarch64.sh --prefix=/usr/local/ --exclude-subdir \ - && /usr/local/bin/cmake --version -else - echo "$os_architecture" - echo "Cant determine CPU architecture for CMAKE install!" -fi - -set -ex \ - && cd /build-tools \ - && AUTOCONF_VERSION="2.71" \ - && wget --no-check-certificate https://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.gz \ - && tar xvf autoconf-${AUTOCONF_VERSION}.tar.gz \ - && cd autoconf-${AUTOCONF_VERSION} \ - && ./configure \ - && make -j4 \ - && make install \ - && autoconf --version - -set -ex \ - && cd /build-tools \ - && AUTOMAKE_VERSION="1.16.4" \ - && wget --no-check-certificate https://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.gz \ - && tar xvf automake-${AUTOMAKE_VERSION}.tar.gz \ - && cd automake-${AUTOMAKE_VERSION} \ - && ./configure \ - && make -j4 \ - && make install \ - && automake --version - -set -ex \ - && cd /build-tools \ - && LIBRESSL_VERSION="3.1.5" \ - && wget https://github.com/libressl-portable/portable/archive/v${LIBRESSL_VERSION}.tar.gz \ - && tar xvf v${LIBRESSL_VERSION}.tar.gz \ - && cd portable-${LIBRESSL_VERSION} \ - && ./autogen.sh \ - && ./configure \ - && make -j4 \ - && make install - -set -ex \ - && cd /build-tools \ - && NASM_VERSION="2.15.05" \ - && wget https://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.gz \ - && tar xvf nasm-${NASM_VERSION}.tar.gz \ - && cd nasm-${NASM_VERSION} \ - && ./configure \ - && make -j4 \ - && make install \ - && nasm --version - -set -ex \ - && cd /build-deps \ - && mkdir x265 \ - && X265_VERSION="3.5" \ - && wget -O ${X265_VERSION}.tar.gz https://bitbucket.org/multicoreware/x265_git/get/${X265_VERSION}.tar.gz \ - && tar xvf ${X265_VERSION}.tar.gz -C x265 --strip-components 1 \ - && cd x265 \ - && cmake -DCMAKE_INSTALL_PREFIX=/usr -G "Unix Makefiles" ./source \ - && make -j4 \ - && make install \ - && ldconfig - -set -ex \ - && cd /build-deps \ - && LIBDE265_VERSION="1.0.8" \ - && wget https://github.com/strukturag/libde265/releases/download/v${LIBDE265_VERSION}/libde265-${LIBDE265_VERSION}.tar.gz \ - && tar xvf libde265-${LIBDE265_VERSION}.tar.gz \ - && cd libde265-${LIBDE265_VERSION} \ - && ./autogen.sh \ - && ./configure --disable-dec265 --disable-sherlock265 --prefix /usr \ - && make -j4 \ - && make install \ - && ldconfig - -#set -ex \ -# && cd /build-deps \ -# && LIBAOM_COMMIT="bb35ba9148543f22ba7d8642e4fbd29ae301f5dc" \ -# && mkdir -v aom && mkdir -v aom_build && cd aom \ -# && wget "https://aomedia.googlesource.com/aom/+archive/${LIBAOM_COMMIT}.tar.gz" \ -# && tar xvf ${LIBAOM_COMMIT}.tar.gz \ -# && cd ../aom_build \ -# && cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib -DBUILD_SHARED_LIBS=1 ../aom \ -# && make -j4 \ -# && make install \ -# && ldconfig - -set -ex \ - && cd /build-deps \ - && LIBHEIF_VERSION="1.12.0" \ - && wget https://github.com/strukturag/libheif/releases/download/v${LIBHEIF_VERSION}/libheif-${LIBHEIF_VERSION}.tar.gz \ - && tar xvf libheif-${LIBHEIF_VERSION}.tar.gz \ - && cd libheif-${LIBHEIF_VERSION} \ - && ./configure --prefix /usr \ - && make -j4 \ - && make install \ - && ldconfig - -set -ex \ - && cd /build-deps \ - && LIBFFI_VERSION="3.3" \ - && wget ftp://sourceware.org/pub/libffi/libffi-${LIBFFI_VERSION}.tar.gz \ - && tar xvf libffi-${LIBFFI_VERSION}.tar.gz \ - && cd libffi-${LIBFFI_VERSION} \ - && ./configure --prefix /usr \ - && make -j4 \ - && make install \ - && ldconfig