diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..65824f7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +*.sh text eol=lf linguist-language=Shell +*.txt eol=lf \ No newline at end of file diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 027e84d..bbead16 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -10,19 +10,24 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Check shell scripts are executable run: | - test -x libraries.sh - test -x scripts/get-config-scripts.sh - find scripts depends -name '*.sh' -exec test -x {} \; + bad=() + while IFS= read -r f; do + test -x "$f" || bad+=("$f") + done < <(find . -name '*.sh') + if (( ${#bad[@]} )); then + printf 'NOT executable: %s\n' "${bad[@]}" + exit 1 + fi - name: Check config helper cache path run: | mkdir -p build cd build - CONFIG_BASE_URL="https://127.0.0.1/pretend-savannah-is-down" CONFIG_TIMEOUT=1 ../scripts/get-config-scripts.sh + NO_SAVANNAH=1 ../utils/get-config-scripts.sh test -s ../archives/config.guess test -s ../archives/config.sub diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a9a4481..1cece17 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,42 +3,250 @@ name: Build libraries package on: [ push, pull_request, workflow_dispatch ] jobs: - build_ps3libraries: - runs-on: ubuntu-22.04 + build: + runs-on: ${{ matrix.runner }} + strategy: + fail-fast: false + matrix: + include: + - runner: ubuntu-latest + os: linux + + - runner: macos-15-intel + os: macos + + - runner: macos-26 + os: macos + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Set env vars + id: slug + run: | + echo "sha_name=$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_ENV + echo "NO_SAVANNAH=1" >> $GITHUB_ENV + + - name: Install Linux requirements + if: matrix.os == 'linux' + run: | + sudo apt-get -y install gcc libelf-dev autoconf automake bison flex make texinfo patch wget zlib1g-dev libtool-bin bzip2 pkg-config libssl-dev pv + + - name: Install MacOS requirements + if: matrix.os == 'macos' + shell: bash + env: + HOMEBREW_NO_AUTO_UPDATE: 1 + HOMEBREW_NO_INSTALL_CLEANUP: 1 + HOMEBREW_NO_ENV_HINTS: 1 + run: | + if ! command -v brew >/dev/null 2>&1; then + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + fi + + if [[ -d /opt/homebrew ]]; then + eval "$(/opt/homebrew/bin/brew shellenv)" + else + eval "$(/usr/local/bin/brew shellenv)" + fi + + brew install autoconf automake openssl libelf ncurses zlib gmp wget pkg-config texinfo pv + + - name: Create build folder + run: | + mkdir build + + - name: Cache downloaded archives + uses: actions/cache@v5 + with: + path: archives + key: archives-${{ hashFiles('archives/archives.txt') }} + + - name: Purge unverifiable archives + run: | + while IFS= read -r line; do + set -- $line + [ "${1:-}" = "-" ] || continue + # 3rd field is URL, 5th field (if "->") is rename + url="$3" + rename="" + [ "${4:-}" = "->" ] && rename="${5:-}" + file="${rename:-$(basename "$url")}" + rm -f "archives/$file" + done < archives/archives.txt + + # using pre-compiled PS3 toolchain + # to do: replace toolchain link + - name: Download PS3DEV Toolchain + run: | + curl -sL https://github.com/clienthax/ps3toolchain/releases/latest/download/ps3dev-${{ matrix.os }}-${{ runner.arch }}.tar.gz | tar xvz -C ./ + echo "PS3DEV=${GITHUB_WORKSPACE}/ps3dev" >> $GITHUB_ENV + echo "PSL1GHT=${GITHUB_WORKSPACE}/ps3dev" >> $GITHUB_ENV + echo "PATH=$PATH:$PWD/ps3dev/bin:$PWD/ps3dev/ppu/bin:$PWD/ps3dev/spu/bin" >> $GITHUB_ENV + + - name: Download files + working-directory: ./build + run: ../download.sh + + - name: Build Psl1ght + working-directory: ./build + run: ../scripts/000-psl1ght.sh + + - name: Build Zlib 1.2.13 + working-directory: ./build + run: ../scripts/001-zlib-1.2.13.sh + + - name: Build Libpng 1.4.4 + working-directory: ./build + run: ../scripts/002-libpng-1.4.4.sh + + - name: Build Jpeg 8b + working-directory: ./build + run: ../scripts/003-jpeg-8b.sh + + - name: Build Freetype 2.4.3 + working-directory: ./build + run: ../scripts/004-freetype-2.4.3.sh + + - name: Build Pixman 0.20.0 + working-directory: ./build + run: ../scripts/005-pixman-0.20.0.sh + + - name: Build Cairo 1.10.0 + working-directory: ./build + run: ../scripts/006-cairo-1.10.0.sh + + - name: Build Libogg 1.3.4 + working-directory: ./build + run: ../scripts/007-libogg-1.3.4.sh + + - name: Build Libvorbis 1.3.5 + working-directory: ./build + run: ../scripts/008-libvorbis-1.3.5.sh + + - name: Build Libzip 0.9.3 + working-directory: ./build + run: ../scripts/009-libzip-0.9.3.sh + + - name: Build Tiff 3.9.4 + working-directory: ./build + run: ../scripts/010-tiff-3.9.4.sh + + - name: Build Libmikmod 3.1.11 + working-directory: ./build + run: ../scripts/011-libmikmod-3.1.11.sh + + - name: Build Libxml2 2.7.8 + working-directory: ./build + run: ../scripts/012-libxml2-2.7.8.sh + + - name: Build Sdl_psl1ght + working-directory: ./build + run: ../scripts/013-sdl_psl1ght.sh + + - name: Build Sdl2_psl1ght + working-directory: ./build + run: ../scripts/014-sdl2_psl1ght.sh + + - name: Build Sdl_psl1ght_libs + working-directory: ./build + run: ../scripts/015-sdl_psl1ght_libs.sh + + - name: Build SDL2_mixer 2.0.4 + working-directory: ./build + run: ../scripts/016-SDL2_mixer-2.0.4.sh + + - name: Build Polarssl 1.3.9 + working-directory: ./build + run: ../scripts/017-polarssl-1.3.9.sh + + - name: Build Libcurl 7.64.1 + working-directory: ./build + run: ../scripts/018-libcurl-7.64.1.sh + + - name: Build Libmad 0.15.1b + working-directory: ./build + run: ../scripts/019-libmad-0.15.1b.sh + + - name: Build Flac 1.2.1 + working-directory: ./build + run: ../scripts/020-flac-1.2.1.sh + + - name: Build Faad2 2.7 + working-directory: ./build + run: ../scripts/021-faad2-2.7.sh + + - name: Build Libtheora 1.1.1 + working-directory: ./build + run: ../scripts/022-libtheora-1.1.1.sh + + - name: Build NoRSX + working-directory: ./build + run: ../scripts/023-NoRSX.sh + + - name: Build Libjson + working-directory: ./build + run: ../scripts/024-libjson.sh + + - name: Build Debugnet + working-directory: ./build + run: ../scripts/025-debugnet.sh + + - name: Build Ps3soundlib + working-directory: ./build + run: ../scripts/026-ps3soundlib.sh + + - name: Build Tiny3d_libfont + working-directory: ./build + run: ../scripts/027-tiny3d_libfont.sh + + - name: Build MbedTLS 2.28.10 + working-directory: ./build + run: ../scripts/028-mbedTLS-2.28.10.sh + + - name: Build Libunrar + working-directory: ./build + run: ../scripts/029-libunrar.sh + + - name: Build Libnfs + working-directory: ./build + run: ../scripts/030-libnfs.sh + + - name: Build Libsmb2 + working-directory: ./build + run: ../scripts/031-libsmb2.sh + + - name: Build Package + run: | + 7z a ps3libraries-${{ matrix.os }}-${{ runner.arch }}.zip $PSL1GHT/portlibs/ + + - name: Push package artifact + uses: actions/upload-artifact@v7 + with: + name: ps3libraries-${{ env.sha_name }}-${{ matrix.os }}-${{ runner.arch }} + path: ps3libraries-${{ matrix.os }}-${{ runner.arch }}.zip + if-no-files-found: error + + push_release: + if: | + github.event_name == 'push' && + github.repository == 'ps3dev/ps3libraries' + needs: build + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Download artifacts + uses: actions/download-artifact@v8 + with: + path: artifacts + merge-multiple: true - - name: Checkout - uses: actions/checkout@v4 - - - name: Set env vars - id: slug - run: | - echo "sha_name=$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_ENV - sudo apt install python2.7 - sudo apt-get -y install autoconf automake bison flex make texinfo patch wget zlib1g-dev libtool-bin bzip2 pkg-config - - # using pre-compiled PS3 toolchain - # to do: replace toolchain link - - name: Download PSL1GHT Toolchain - run: | - curl -sL https://github.com/bucanero/ps3toolchain/releases/download/ubuntu-latest-fad3b5fb/ps3dev-ubuntu-latest-2020-08-31.tar.gz | tar xvz -C ./ - curl -sL https://github.com/ps3dev/PSL1GHT/raw/master/ppu/include/sysutil/sysutil.h -o ps3dev/ppu/include/sysutil/sysutil.h - curl -sL https://gist.github.com/bucanero/150ec41325894bbd1b4513ecb9e1cfb6/raw/1814600a1b3c804209c4f71dd6316779e160cb25/utime.h -o ps3dev/ppu/ppu/include/sys/utime.h - echo "PS3DEV=${GITHUB_WORKSPACE}/ps3dev" >> $GITHUB_ENV - echo "PSL1GHT=${GITHUB_WORKSPACE}/ps3dev" >> $GITHUB_ENV - - - name: Install libraries - run: | - sed -i.bak '8d' libraries-sudo.sh - ./libraries-sudo.sh - - - name: Build Package - run: | - 7z a ps3libraries.zip $PSL1GHT/portlibs/ - - - name: Push package artifact - uses: actions/upload-artifact@v4 - with: - name: ps3libraries-build_${{ env.sha_name }} - path: ps3libraries.zip - if-no-files-found: error + - name: Create Release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh release create 1.0${{ GITHUB.RUN_NUMBER }} artifacts/*.zip --target ${{ GITHUB.SHA }} -t 1.0${{ GITHUB.RUN_NUMBER }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 65d9ae0..a592809 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ /build -/archives/*-[0-9]* -/archives/*.tar.gz -/archives/config.guess -/archives/config.sub +/archives/* +!/archives/manifest.txt +/ps3dev \ No newline at end of file diff --git a/archives/archives.txt b/archives/archives.txt index b6be568..75ac60a 100644 --- a/archives/archives.txt +++ b/archives/archives.txt @@ -1,31 +1,32 @@ -9b8aa094c4e5765dabf4da391f00d15c 1497445 https://github.com/madler/zlib/releases/download/v1.2.13/zlib-1.2.13.tar.gz -297b38f925e745061489b41b1f7c4bb1 829414 http://download.sourceforge.net/libpng/libpng-1.4.4.tar.gz -61ea7b0b1489b6a0315faedb081f5b45 935594 http://www.ijg.org/files/jpegsrc.v8b.tar.gz -649dd3c558278ae1d79a4e8e502c13e4 1907043 http://download.savannah.gnu.org/releases/freetype/freetype-old/freetype-2.4.3.tar.gz -c1a31d5cedfa97c5af7148a2d1fd4356 537274 http://cairographics.org/releases/pixman-0.20.0.tar.gz -70a2ece66cf473d976e2db0f75bf199e 24022822 http://cairographics.org/releases/cairo-1.10.0.tar.gz -b9a66c80bdf45363605e4aa75fa951a8 589570 http://downloads.xiph.org/releases/ogg/libogg-1.3.4.tar.gz -7220e089f3be3412a2317d6fde9e3944 1638779 http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.5.tar.gz -27610091ca27bf843a6646cd05de35b9 304965 http://www.nih.at/libzip/libzip-0.9.3.tar.bz2 -2006c1bdd12644dbf02956955175afd6 1436968 http://download.osgeo.org/libtiff/old/tiff-3.9.4.tar.gz -705106da305e8de191549f1e7393185c 611590 http://mikmod.raphnet.net/files/libmikmod-3.1.11.tar.gz -8127a65e8c3b08856093099b52599c86 4881808 http://xmlsoft.org/sources/libxml2-2.7.8.tar.gz -a36e8410cac46b00a4d01752b32c3eb1 11125077 http://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.4.tar.gz -48af7d1f0d5de512cbd6dacf5407884c 1741396 https://mirror2.openwrt.org/sources/polarssl-1.3.9-gpl.tgz -371239c13ed64ae4c56cd2480cde52f8 4008103 http://curl.haxx.se/download/curl-7.64.1.tar.gz -1be543bc30c56fb6bea1d7bf6a64e66c 502379 http://downloads.sourceforge.net/project/mad/libmad/0.15.1b/libmad-0.15.1b.tar.gz -153c8b15a54da428d1f0fadc756c22c7 2009217 http://downloads.sourceforge.net/project/flac/flac-src/flac-1.2.1-src/flac-1.2.1.tar.gz -ee1b4d67ea2d76ee52c5621bc6dbf61e 1137407 http://downloads.sourceforge.net/faac/faad2-2.7.tar.gz -292ab65cedd5021d6b7ddd117e07cd8e 1903175 http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2 -7013b2471a507942eb8ed72a5d872d16 455089 https://codeload.github.com/json-c/json-c/tar.gz/json-c-0.11-20130402 -d12e48309d6d1cfdc31a6ebf866c25db 3489179 https://github.com/Mbed-TLS/mbedtls/releases/download/mbedtls-2.28.10/mbedtls-2.28.10.tar.bz2 -- - https://github.com/zeldin/SDL_PSL1GHT/tarball/master -> sdl_psl1ght.tar.gz -- - https://github.com/zeldin/SDL_PSL1GHT_Libs/tarball/master -> sdl_psl1ght_libs.tar.gz -- - https://github.com/shagkur/SDL_PSL1GHT/archive/refs/heads/sdl2_master.tar.gz -> sdl2_psl1ght.tar.gz -- - https://github.com/wargio/NoRSX/tarball/master -> NoRSX.tar.gz -- - https://github.com/sergiou87/ps3debugnet/tarball/master -> ps3debugnet.tar.gz -- - https://github.com/wargio/ps3soundlib/tarball/master -> ps3soundlib.tar.gz -- - https://github.com/wargio/tiny3d/tarball/master -> tiny3d.tar.gz -- - https://github.com/bucanero/libunrar-ps3/tarball/master -> libunrar.tar.gz -- - https://github.com/sahlberg/libnfs/tarball/master -> libnfs.tar.gz -- - https://github.com/sahlberg/libsmb2/tarball/master -> libsmb2.tar.gz +b3a24de97a8fdbc835b9833169501030b8977031bcb54b3b3ac13740f846ab30 1497445 https://github.com/madler/zlib/releases/download/v1.2.13/zlib-1.2.13.tar.gz +d07616ba1e9c161017384feb3b576d70c160b970abfd9549ad39a622284b574a 829414 https://download.sourceforge.net/libpng/libpng-1.4.4.tar.gz +64be2429346b1aa84a014fc47264661ca2e6c786aea25afecb363d5973b4e6a9 935594 https://www.ijg.org/files/jpegsrc.v8b.tar.gz +33ec92273c2d809e51dece879c09d206e5dfa3d6deb7ce9e4c2bf0891b8111f9 1907043 https://download.savannah.gnu.org/releases/freetype/freetype-old/freetype-2.4.3.tar.gz +9c02c22c6cc3f28f3633d02ef6f0cac130518f621edb011ebbbf08cd1a81251a 537274 https://cairographics.org/releases/pixman-0.20.0.tar.gz +0f2ce4cc4615594088d74eb8b5360bad7c3cc3c3da9b61af9bfd979ed1ed94b2 24022822 https://cairographics.org/releases/cairo-1.10.0.tar.gz +fe5670640bd49e828d64d2879c31cb4dde9758681bb664f9bdbf159a01b0c76e 589570 https://downloads.xiph.org/releases/ogg/libogg-1.3.4.tar.gz +6efbcecdd3e5dfbf090341b485da9d176eb250d893e3eb378c428a2db38301ce 1638779 https://downloads.xiph.org/releases/vorbis/libvorbis-1.3.5.tar.gz +e63f5dc1b33fd1c02a881d5a819620634a69d1e4ce8637261ca0cb0fbc9f9dca 304965 https://www.nih.at/libzip/libzip-0.9.3.tar.bz2 +67b76d075fb74f7cb32e7e4b217701674755fe6cee0f463b259a753fce691da6 1436968 https://download.osgeo.org/libtiff/old/tiff-3.9.4.tar.gz +2d7598cd2a8c61c023f27c9c7c1aca8bbfd92aadbee2f98b7a6d421eae35c929 611590 https://mikmod.raphnet.net/files/libmikmod-3.1.11.tar.gz +cda23bc9ebd26474ca8f3d67e7d1c4a1f1e7106364b690d822e009fdc3c417ec 4881808 http://xmlsoft.org/sources/libxml2-2.7.8.tar.gz +b4cf5a382c061cd75081cf246c2aa2f9df8db04bdda8dcdc6b6cca55bede2419 11125077 https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.4.tar.gz +d3605afc28ed4b7d1d9e3142d72e42855e4a23c07c951bbb0299556b02d36755 1741396 https://mirror2.openwrt.org/sources/polarssl-1.3.9-gpl.tgz +432d3f466644b9416bc5b649d344116a753aeaa520c8beaf024a90cba9d3d35d 4008103 https://curl.haxx.se/download/curl-7.64.1.tar.gz +bbfac3ed6bfbc2823d3775ebb931087371e142bb0e9bb1bee51a76a6e0078690 502379 https://downloads.sourceforge.net/project/mad/libmad/0.15.1b/libmad-0.15.1b.tar.gz +9635a44bceb478bbf2ee8a785cf6986fba525afb5fad1fd4bba73cf71f2d3edf 2009217 https://downloads.sourceforge.net/project/flac/flac-src/flac-1.2.1-src/flac-1.2.1.tar.gz +ee26ed1e177c0cd8fa8458a481b14a0b24ca0b51468c8b4c8b676fd3ceccd330 1137407 https://downloads.sourceforge.net/faac/faad2-2.7.tar.gz +b6ae1ee2fa3d42ac489287d3ec34c5885730b1296f0801ae577a35193d3affbc 1903175 https://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2 +9988283408c71838d8d62e5418e5abb5eb5300bd84c385fdc96143b5e8f10ed5 455089 https://codeload.github.com/json-c/json-c/tar.gz/json-c-0.11-20130402 -> json-c-0.11-20130402.tar.gz +19e5b81fdac0fe22009b9e2bdcd52d7dcafbf62bc67fc59cf0a76b5b5540d149 3489179 https://github.com/Mbed-TLS/mbedtls/releases/download/mbedtls-2.28.10/mbedtls-2.28.10.tar.bz2 +- - https://github.com/zeldin/SDL_PSL1GHT/tarball/master -> sdl_psl1ght.tar.gz +- - https://github.com/zeldin/SDL_PSL1GHT_Libs/tarball/master -> sdl_psl1ght_libs.tar.gz +- - https://github.com/shagkur/SDL_PSL1GHT/archive/refs/heads/sdl2_master.tar.gz -> sdl2_psl1ght.tar.gz +- - https://github.com/wargio/NoRSX/tarball/master -> NoRSX.tar.gz +- - https://github.com/sergiou87/ps3debugnet/tarball/master -> ps3debugnet.tar.gz +- - https://github.com/wargio/ps3soundlib/tarball/master -> ps3soundlib.tar.gz +- - https://github.com/wargio/tiny3d/tarball/master -> tiny3d.tar.gz +- - https://github.com/bucanero/libunrar-ps3/tarball/master -> libunrar.tar.gz +- - https://github.com/sahlberg/libnfs/tarball/master -> libnfs.tar.gz +- - https://github.com/sahlberg/libsmb2/tarball/master -> libsmb2.tar.gz +- - https://github.com/clienthax/psl1ght/tarball/master -> psl1ght.tar.gz diff --git a/depends/check-pv.sh b/depends/check-pv.sh new file mode 100755 index 0000000..1c55df0 --- /dev/null +++ b/depends/check-pv.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +( pv -V ) 1>/dev/null 2>&1 || { echo "ERROR: Install pv before continuing."; exit 1; } \ No newline at end of file diff --git a/download.sh b/download.sh index b781722..54884d1 100755 --- a/download.sh +++ b/download.sh @@ -1,73 +1,149 @@ #!/bin/sh +set -eu +cd "$(dirname "$0")" +cd archives || exit 1 -cd `dirname $0` -cd archives || exit +ARCHIVE="archives.txt" +WGET="wget --tries=5 --timeout=15 --quiet --show-progress" -if [ $# -eq 0 ]; then - ../scripts/get-config-scripts.sh - sed -e 's:^.*/::g' -e 's/.* -> //g' < archives.txt | while read file; do - ../download.sh "$file" || exit - done - exit -fi +# ----------------------------------------------------------------------------- +# verify_sha256 +# Returns 0 on match, 1 on mismatch or error. +# ----------------------------------------------------------------------------- +verify_sha256() { + file="$1" + expected="$2" + out=$(sha256sum "$file" 2>/dev/null) || { + echo " !! sha256sum failed: $file" >&2 + return 1 + } + set -- $out + actual="$1" + if [ "$actual" != "$expected" ]; then + echo " !! SHA256 mismatch: $file" >&2 + echo " expected: $expected" >&2 + echo " got: $actual" >&2 + return 1 + fi + return 0 +} -if [ $# -ne 1 ]; then - echo >&2 "Usage: $0 filename" - exit 1 -fi -file="$1" +# ----------------------------------------------------------------------------- +# fetch +# ----------------------------------------------------------------------------- +fetch() { + url="$1" + dest="$2" + $WGET -O "$dest" "$url" || { + echo " !! Download failed: $url" >&2 + rm -f "$dest" + return 1 + } +} -set -- `grep "$1" archives.txt` -if [ $# -lt 3 ]; then - echo >&2 "Unable to find $file in archives.txt" - exit 1 -fi -remote_md5="$1" -remote_size="$2" -shift -shift +# ----------------------------------------------------------------------------- +# download [rename] +# ----------------------------------------------------------------------------- +download() { + sha="$1" + size="$2" + url="$3" + rename="${4:-}" + file="${rename:-$(basename "$url")}" -if [ -s "$file" ]; then - previous_file=yes - if [ "$remote_size" = "-" ]; then - local_size='-' - else - local_size=`stat 2>/dev/null -L -c'%s' "$file"` - fi -else - previous_file=no -fi + printf '==> %s\n' "$file" -if [ $previous_file = no -o "$remote_size" != "$local_size" ]; then - while [ "$#" -gt 0 ]; do - url="$1" - rename="" - if [ "${2:-}" = "->" ]; then - rename="$3" - shift - shift + # If already present, verify immediately — size alone is not enough. + if [ -f "$file" ]; then + if [ "$sha" = "-" ]; then + echo " -- no checksum, skipping re-download of existing file" + return 0 + fi + if verify_sha256 "$file" "$sha"; then + echo " -- already good" + return 0 + fi + echo " -- existing file failed verification, re-downloading..." + rm -f "$file" fi - if [ "$#" -gt 1 ]; then - wget ${rename:+-O} ${rename} --tries 5 --timeout 15 --continue "$url" && break - else - wget ${rename:+-O} ${rename} --continue "$url" || exit + + # First attempt + fetch "$url" "$file" + + # Verify, with one retry on mismatch + if [ "$sha" != "-" ]; then + if ! verify_sha256 "$file" "$sha"; then + echo " -- retrying download..." + rm -f "$file" + fetch "$url" "$file" + verify_sha256 "$file" "$sha" || { + rm -f "$file" + echo " !! Giving up on $file" >&2 + return 1 + } + fi fi - shift - done -fi -if [ "$remote_md5" = "-" ]; then - local_md5='-' + echo " -- ok" +} + +# ----------------------------------------------------------------------------- +# parse_line -> prints "sha\tsize\turl\trename" or returns 1 +# ----------------------------------------------------------------------------- +parse_line() { + line="$1" + [ -z "$line" ] && return 1 + set -- $line + [ "$#" -lt 3 ] && return 1 + sha="$1"; size="$2"; url="$3" + rename="" + shift 3 + if [ "${1:-}" = "->" ]; then + rename="${2:-}" + fi + printf '%s\t%s\t%s\t%s\n' "$sha" "$size" "$url" "$rename" +} + +# ----------------------------------------------------------------------------- +# run_all / run_one +# ----------------------------------------------------------------------------- +run_all() { + ../utils/get-config-scripts.sh + while IFS= read -r line; do + [ -z "$line" ] && continue + parsed=$(parse_line "$line") || continue + IFS="$(printf '\t')" read -r sha size url rename <&2 + exit 1 + } +} + +# ----------------------------------------------------------------------------- +if [ "$#" -eq 0 ]; then + run_all else - local_md5=`md5sum 2>/dev/null -b "$file" | cut -c 1-32` -fi -if [ -n "$local_md5" -a "$remote_md5" != "$local_md5" ]; then - echo >&2 "Incorrect MD5 for $file" - if [ $previous_file = yes ]; then - echo >&2 "Deleting the file and trying again..." - rm "$file" - exec ../download.sh "$file" - else - exit 1 - fi -fi + run_one "$1" +fi \ No newline at end of file diff --git a/libraries-sudo.sh b/libraries-sudo.sh index b322430..ab6ce3a 100755 --- a/libraries-sudo.sh +++ b/libraries-sudo.sh @@ -6,6 +6,7 @@ cd "`dirname $0`" || { echo "ERROR: Could not enter the ps3libraries directory." ## Set up the environment. export PS3DEV=/usr/local/ps3dev +export PSL1GHT=/usr/local/ps3dev export PATH=$PATH:$PS3DEV/bin export PATH=$PATH:$PS3DEV/ppu/bin export PATH=$PATH:$PS3DEV/spu/bin diff --git a/scripts/000-psl1ght.sh b/scripts/000-psl1ght.sh new file mode 100755 index 0000000..09f2905 --- /dev/null +++ b/scripts/000-psl1ght.sh @@ -0,0 +1,15 @@ +#!/bin/sh -e +# psl1ght.sh by Naomi Peori (naomi@peori.ca) + +## Download the source code. +../download.sh psl1ght.tar.gz + +## Unpack the source code. +rm -Rf psl1ght +mkdir psl1ght +echo "Unpacking psl1ght" +pv -pterab ../archives/psl1ght.tar.gz | tar --strip-components=1 --directory=psl1ght -xzf - +cd psl1ght + +## Compile and install. +${MAKE:-make} install-ctrl && ${MAKE:-make} && ${MAKE:-make} install diff --git a/scripts/001-zlib-1.2.13.sh b/scripts/001-zlib-1.2.13.sh index af25f85..d1acae3 100755 --- a/scripts/001-zlib-1.2.13.sh +++ b/scripts/001-zlib-1.2.13.sh @@ -6,7 +6,10 @@ ZLIB="zlib-1.2.13" ../download.sh ${ZLIB}.tar.gz ## Unpack the source code. -rm -Rf ${ZLIB} && tar xfvz ../archives/${ZLIB}.tar.gz && cd ${ZLIB} +rm -Rf ${ZLIB} +echo "Unpacking ${ZLIB}" +pv -pterab ../archives/${ZLIB}.tar.gz | tar -xzf - +cd ${ZLIB} ## Patch the source code. cat ../../patches/${ZLIB}-PPU.patch | patch -p1 diff --git a/scripts/002-libpng-1.4.4.sh b/scripts/002-libpng-1.4.4.sh index 7604aea..13b0276 100755 --- a/scripts/002-libpng-1.4.4.sh +++ b/scripts/002-libpng-1.4.4.sh @@ -1,14 +1,18 @@ #!/bin/sh -e # libpng-1.4.4.sh by Naomi Peori (naomi@peori.ca) +LIBPNG="libpng-1.4.4" ## Download the source code. -../download.sh libpng-1.4.4.tar.gz +../download.sh ${LIBPNG}.tar.gz ## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable -../scripts/get-config-scripts.sh +../utils/get-config-scripts.sh ## Unpack the source code. -rm -Rf libpng-1.4.4 && tar xfvz ../archives/libpng-1.4.4.tar.gz && cd libpng-1.4.4 +rm -Rf ${LIBPNG} +echo "Unpacking ${LIBPNG}" +pv -pterab ../archives/${LIBPNG}.tar.gz | tar -xzf - +cd ${LIBPNG} ## Replace config.guess and config.sub cp ../../archives/config.guess ../../archives/config.sub . diff --git a/scripts/003-jpeg-8b.sh b/scripts/003-jpeg-8b.sh index 2aa6233..6365c29 100755 --- a/scripts/003-jpeg-8b.sh +++ b/scripts/003-jpeg-8b.sh @@ -5,10 +5,13 @@ ../download.sh jpegsrc.v8b.tar.gz ## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable -../scripts/get-config-scripts.sh +../utils/get-config-scripts.sh ## Unpack the source code. -rm -Rf jpeg-8b && tar xfvz ../archives/jpegsrc.v8b.tar.gz && cd jpeg-8b +rm -Rf jpeg-8b +echo "Unpacking jpegsrc.v8b" +pv -pterab ../archives/jpegsrc.v8b.tar.gz | tar -xzf - +cd jpeg-8b ## Replace config.guess and config.sub cp ../../archives/config.guess ../../archives/config.sub . diff --git a/scripts/004-freetype-2.4.3.sh b/scripts/004-freetype-2.4.3.sh index d35c962..4bc3430 100755 --- a/scripts/004-freetype-2.4.3.sh +++ b/scripts/004-freetype-2.4.3.sh @@ -1,14 +1,18 @@ #!/bin/sh -e # freetype-2.4.3.sh by Naomi Peori (naomi@peori.ca) +FREETYPE="freetype-2.4.3" ## Download the source code. -../download.sh freetype-2.4.3.tar.gz +../download.sh ${FREETYPE}.tar.gz ## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable -../scripts/get-config-scripts.sh +../utils/get-config-scripts.sh ## Unpack the source code. -rm -Rf freetype-2.4.3 && tar xfvz ../archives/freetype-2.4.3.tar.gz && cd freetype-2.4.3 +rm -Rf ${FREETYPE} +echo "Unpacking ${FREETYPE}" +pv -pterab ../archives/${FREETYPE}.tar.gz | tar -xzf - +cd ${FREETYPE} ## Replace config.guess and config.sub cp ../../archives/config.guess ../../archives/config.sub builds/unix/ diff --git a/scripts/005-pixman-0.20.0.sh b/scripts/005-pixman-0.20.0.sh index 2cb860f..f4d24a7 100755 --- a/scripts/005-pixman-0.20.0.sh +++ b/scripts/005-pixman-0.20.0.sh @@ -1,14 +1,18 @@ #!/bin/sh -e # pixman-0.20.0.sh by Naomi Peori (naomi@peori.ca) +PIXMAN="pixman-0.20.0" ## Download the source code. -../download.sh pixman-0.20.0.tar.gz +../download.sh ${PIXMAN}.tar.gz ## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable -../scripts/get-config-scripts.sh +../utils/get-config-scripts.sh ## Unpack the source code. -rm -Rf pixman-0.20.0 && tar xfvz ../archives/pixman-0.20.0.tar.gz && cd pixman-0.20.0 +rm -Rf ${PIXMAN} +echo "Unpacking ${PIXMAN}" +pv -pterab ../archives/${PIXMAN}.tar.gz | tar -xzf - +cd ${PIXMAN} ## Replace config.guess and config.sub cp ../../archives/config.guess ../../archives/config.sub . diff --git a/scripts/006-cairo-1.10.0.sh b/scripts/006-cairo-1.10.0.sh index 8dd8b4a..39d7ce2 100755 --- a/scripts/006-cairo-1.10.0.sh +++ b/scripts/006-cairo-1.10.0.sh @@ -1,20 +1,24 @@ #!/bin/sh -e # cairo-1.10.0.sh by Naomi Peori (naomi@peori.ca) +CAIRO="cairo-1.10.0" ## Download the source code. -../download.sh cairo-1.10.0.tar.gz +../download.sh ${CAIRO}.tar.gz ## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable -../scripts/get-config-scripts.sh +../utils/get-config-scripts.sh ## Unpack the source code. -rm -Rf cairo-1.10.0 && tar xfvz ../archives/cairo-1.10.0.tar.gz && cd cairo-1.10.0 +rm -Rf ${CAIRO} +echo "Unpacking ${CAIRO}" +pv -pterab ../archives/${CAIRO}.tar.gz | tar -xzf - +cd ${CAIRO} ## Replace config.guess and config.sub cp ../../archives/config.guess ../../archives/config.sub build/ ## Patch the source code. -cat ../../patches/cairo-1.10.0.patch | patch -p1 +cat ../../patches/${CAIRO}.patch | patch -p1 ## Create the build directory. mkdir build-ppu && cd build-ppu diff --git a/scripts/007-libogg-1.3.4.sh b/scripts/007-libogg-1.3.4.sh index 2ca8bc4..a182c01 100755 --- a/scripts/007-libogg-1.3.4.sh +++ b/scripts/007-libogg-1.3.4.sh @@ -1,14 +1,18 @@ #!/bin/sh -e # libogg-1.3.4.sh by Naomi Peori (naomi@peori.ca) +LIBOGG="libogg-1.3.4" ## Download the source code. -../download.sh libogg-1.3.4.tar.gz +../download.sh ${LIBOGG}.tar.gz ## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable -../scripts/get-config-scripts.sh +../utils/get-config-scripts.sh ## Unpack the source code. -rm -Rf libogg-1.3.4 && tar xfvz ../archives/libogg-1.3.4.tar.gz && cd libogg-1.3.4 +rm -Rf ${LIBOGG} +echo "Unpacking ${LIBOGG}" +pv -pterab ../archives/${LIBOGG}.tar.gz | tar -xzf - +cd ${LIBOGG} ## Replace config.guess and config.sub cp ../../archives/config.guess ../../archives/config.sub . diff --git a/scripts/008-libvorbis-1.3.5.sh b/scripts/008-libvorbis-1.3.5.sh index 2a68a31..7aa63af 100755 --- a/scripts/008-libvorbis-1.3.5.sh +++ b/scripts/008-libvorbis-1.3.5.sh @@ -1,14 +1,18 @@ #!/bin/sh -e # libvorbis-1.3.5.sh by Naomi Peori (naomi@peori.ca) +LIBVORBIS="libvorbis-1.3.5" ## Download the source code. -../download.sh libvorbis-1.3.5.tar.gz +../download.sh ${LIBVORBIS}.tar.gz ## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable -../scripts/get-config-scripts.sh +../utils/get-config-scripts.sh ## Unpack the source code. -rm -Rf libvorbis-1.3.5 && tar xfvz ../archives/libvorbis-1.3.5.tar.gz && cd libvorbis-1.3.5 +rm -Rf ${LIBVORBIS} +echo "Unpacking ${LIBVORBIS}" +pv -pterab ../archives/${LIBVORBIS}.tar.gz | tar -xzf - +cd ${LIBVORBIS} ## Replace config.guess and config.sub cp ../../archives/config.guess ../../archives/config.sub . diff --git a/scripts/009-libzip-0.9.3.sh b/scripts/009-libzip-0.9.3.sh index ac808d5..14919a1 100755 --- a/scripts/009-libzip-0.9.3.sh +++ b/scripts/009-libzip-0.9.3.sh @@ -1,14 +1,18 @@ #!/bin/sh -e # libzip-0.9.3.sh by Naomi Peori (naomi@peori.ca) +LIBZIP="libzip-0.9.3" ## Download the source code. -../download.sh libzip-0.9.3.tar.bz2 +../download.sh ${LIBZIP}.tar.bz2 ## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable -../scripts/get-config-scripts.sh +../utils/get-config-scripts.sh ## Unpack the source code. -rm -Rf libzip-0.9.3 && tar xfvj ../archives/libzip-0.9.3.tar.bz2 && cd libzip-0.9.3 +rm -Rf ${LIBZIP} +echo "Unpacking ${LIBZIP}" +pv -pterab ../archives/${LIBZIP}.tar.bz2 | tar -xjf - +cd ${LIBZIP} ## Replace config.guess and config.sub cp ../../archives/config.guess ../../archives/config.sub . diff --git a/scripts/010-tiff-3.9.4.sh b/scripts/010-tiff-3.9.4.sh index af6bb57..bccb42b 100755 --- a/scripts/010-tiff-3.9.4.sh +++ b/scripts/010-tiff-3.9.4.sh @@ -1,20 +1,24 @@ #!/bin/sh -e # tiff-3.9.4.sh by Jon Limle +TIFF="tiff-3.9.4" ## Download the source code. -../download.sh tiff-3.9.4.tar.gz +../download.sh ${TIFF}.tar.gz ## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable -../scripts/get-config-scripts.sh +../utils/get-config-scripts.sh ## Unpack the source code. -rm -Rf tiff-3.9.4 && tar xfvz ../archives/tiff-3.9.4.tar.gz && cd tiff-3.9.4 +rm -Rf ${TIFF} +echo "Unpacking ${TIFF}" +pv -pterab ../archives/${TIFF}.tar.gz | tar -xzf - +cd ${TIFF} ## Replace config.guess and config.sub cp ../../archives/config.guess ../../archives/config.sub config/ ## Patch the source code. -cat ../../patches/tiff-3.9.4-PPU.patch | patch -p1 +cat ../../patches/${TIFF}-PPU.patch | patch -p1 ## Create the build directory. mkdir build-ppu && cd build-ppu diff --git a/scripts/011-libmikmod-3.1.11.sh b/scripts/011-libmikmod-3.1.11.sh index 446a0cd..4e67844 100755 --- a/scripts/011-libmikmod-3.1.11.sh +++ b/scripts/011-libmikmod-3.1.11.sh @@ -1,14 +1,18 @@ #!/bin/sh -e # libmikmod-3.1.11.sh by Marcus Comstedt +LIBMIKMOD="libmikmod-3.1.11" ## Download the source code. -../download.sh libmikmod-3.1.11.tar.gz +../download.sh ${LIBMIKMOD}.tar.gz ## Unpack the source code. -rm -Rf libmikmod-3.1.11 && tar xfvz ../archives/libmikmod-3.1.11.tar.gz && cd libmikmod-3.1.11 +rm -Rf ${LIBMIKMOD} +echo "Unpacking ${LIBMIKMOD}" +pv -pterab ../archives/${LIBMIKMOD}.tar.gz | tar -xzf - +cd ${LIBMIKMOD} ## Patch the source code. -cat ../../patches/libmikmod-3.1.11-PPU.patch | patch -p1 +cat ../../patches/${LIBMIKMOD}-PPU.patch | patch -p1 ## Create the build directory. mkdir build-ppu && cd build-ppu @@ -16,7 +20,7 @@ mkdir build-ppu && cd build-ppu ## Configure the build. CFLAGS="-I$PSL1GHT/ppu/include -I$PS3DEV/portlibs/ppu/include" \ LDFLAGS="-L$PSL1GHT/ppu/lib -L$PS3DEV/portlibs/ppu/lib -lrt -llv2" \ -CC="powerpc64-ps3-elf-gcc" LD="powerpc64-ps3-elf-ld" NM="powerpc64-ps3-elf-nm" \ +CC="powerpc64-ps3-elf-gcc" AR="powerpc64-ps3-elf-ar" LD="powerpc64-ps3-elf-ld" NM="powerpc64-ps3-elf-nm" \ RANLIB="powerpc64-ps3-elf-ranlib" STRIP="powerpc64-ps3-elf-strip" \ ../configure --prefix="$PS3DEV/portlibs/ppu" --host="powerpc64-ps3-elf" \ --disable-esd --disable-dl --disable-shared diff --git a/scripts/012-libxml2-2.7.8.sh b/scripts/012-libxml2-2.7.8.sh index c5ffe3a..82172d0 100755 --- a/scripts/012-libxml2-2.7.8.sh +++ b/scripts/012-libxml2-2.7.8.sh @@ -1,14 +1,18 @@ #!/bin/sh -e # libxml2-2.7.8.sh by Naomi Peori (naomi@peori.ca) +LIBXML2="libxml2-2.7.8" ## Download the source code. -../download.sh libxml2-2.7.8.tar.gz +../download.sh ${LIBXML2}.tar.gz ## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable -../scripts/get-config-scripts.sh +../utils/get-config-scripts.sh ## Unpack the source code. -rm -Rf libxml2-2.7.8 && tar xfvz ../archives/libxml2-2.7.8.tar.gz && cd libxml2-2.7.8 +rm -Rf ${LIBXML2} +echo "Unpacking ${LIBXML2}" +pv -pterab ../archives/${LIBXML2}.tar.gz | tar -xzf - +cd ${LIBXML2} ## Replace config.guess and config.sub cp ../../archives/config.guess ../../archives/config.sub . diff --git a/scripts/013-sdl_psl1ght.sh b/scripts/013-sdl_psl1ght.sh index 981d9b9..66e9afe 100755 --- a/scripts/013-sdl_psl1ght.sh +++ b/scripts/013-sdl_psl1ght.sh @@ -5,9 +5,10 @@ ../download.sh sdl_psl1ght.tar.gz ## Unpack the source code. -rm -Rf sdl_psl1ght && mkdir sdl_psl1ght && tar --strip-components=1 --directory=sdl_psl1ght -xvzf ../archives/sdl_psl1ght.tar.gz - -## Create the build directory. +rm -Rf sdl_psl1ght +mkdir sdl_psl1ght +echo "Unpacking sdl_psl1ght" +pv -pterab ../archives/sdl_psl1ght.tar.gz | tar --strip-components=1 --directory=sdl_psl1ght -xzf - cd sdl_psl1ght ## Compile and install. diff --git a/scripts/014-sdl2_psl1ght.sh b/scripts/014-sdl2_psl1ght.sh index ee44f64..018eae4 100755 --- a/scripts/014-sdl2_psl1ght.sh +++ b/scripts/014-sdl2_psl1ght.sh @@ -5,9 +5,10 @@ ../download.sh sdl2_psl1ght.tar.gz ## Unpack the source code. -rm -Rf sdl2_psl1ght && mkdir sdl2_psl1ght && tar --strip-components=1 --directory=sdl2_psl1ght -xvzf ../archives/sdl2_psl1ght.tar.gz - -## Create the build directory. +rm -Rf sdl2_psl1ght +mkdir sdl2_psl1ght +echo "Unpacking sdl2_psl1ght" +pv -pterab ../archives/sdl2_psl1ght.tar.gz | tar --strip-components=1 --directory=sdl2_psl1ght -xzf - cd sdl2_psl1ght ## Compile and install. diff --git a/scripts/015-sdl_psl1ght_libs.sh b/scripts/015-sdl_psl1ght_libs.sh index 22ac846..c8a885c 100755 --- a/scripts/015-sdl_psl1ght_libs.sh +++ b/scripts/015-sdl_psl1ght_libs.sh @@ -5,12 +5,13 @@ ../download.sh sdl_psl1ght_libs.tar.gz ## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable -../scripts/get-config-scripts.sh +../utils/get-config-scripts.sh ## Unpack the source code. -rm -Rf sdl_psl1ght_libs && mkdir sdl_psl1ght_libs && tar --strip-components=1 --directory=sdl_psl1ght_libs -xvzf ../archives/sdl_psl1ght_libs.tar.gz - -## Create the build directory. +rm -Rf sdl_psl1ght_libs +mkdir sdl_psl1ght_libs +echo "Unpacking sdl_psl1ght_libs" +pv -pterab ../archives/sdl_psl1ght_libs.tar.gz | tar --strip-components=1 --directory=sdl_psl1ght_libs -xzf - cd sdl_psl1ght_libs ## Preload config.guess and config.sub diff --git a/scripts/016-SDL2_mixer-2.0.4.sh b/scripts/016-SDL2_mixer-2.0.4.sh index 4323d97..21f4cbc 100755 --- a/scripts/016-SDL2_mixer-2.0.4.sh +++ b/scripts/016-SDL2_mixer-2.0.4.sh @@ -1,13 +1,18 @@ #!/bin/sh -e +SDL2_MIXER="SDL2_mixer-2.0.4" + ## Download the source code. -../download.sh SDL2_mixer-2.0.4.tar.gz +../download.sh ${SDL2_MIXER}.tar.gz ## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable -../scripts/get-config-scripts.sh +../utils/get-config-scripts.sh ## Unpack the source code. -rm -Rf SDL2_mixer-2.0.4 && tar xfvz ../archives/SDL2_mixer-2.0.4.tar.gz && cd SDL2_mixer-2.0.4 +rm -Rf ${SDL2_MIXER} +echo "Unpacking ${SDL2_MIXER}" +pv -pterab ../archives/${SDL2_MIXER}.tar.gz | tar -xzf - +cd ${SDL2_MIXER} ## Replace config.guess and config.sub cp ../../archives/config.guess ../../archives/config.sub build-scripts/ diff --git a/scripts/017-polarssl-1.3.9.sh b/scripts/017-polarssl-1.3.9.sh index c0cdd32..6b6e88b 100755 --- a/scripts/017-polarssl-1.3.9.sh +++ b/scripts/017-polarssl-1.3.9.sh @@ -35,14 +35,17 @@ PLATFORM="PS3" ../download.sh polarssl-${VERSION}-gpl.tgz ## Unpack the source code. -rm -Rf polarssl-${VERSION} && tar xfvz ../archives/polarssl-${VERSION}-gpl.tgz && cd polarssl-${VERSION} +rm -Rf polarssl-${VERSION} +echo "Unpacking polarssl-${VERSION}" +pv -pterab ../archives/polarssl-${VERSION}-gpl.tgz | tar -xzf - +cd polarssl-${VERSION} ## Patch the source code. echo "Patching net.c and timing.c for compatibility..." -cat ../../patches/polarssl-1.3.9-ipv6.patch | patch -p1 +cat ../../patches/polarssl-${VERSION}-ipv6.patch | patch -p1 cd library -cat ../../../patches/polarssl-1.3.9-net.patch | patch -p1 -cat ../../../patches/polarssl-1.3.9-timing.patch | patch -p1 +cat ../../../patches/polarssl-${VERSION}-net.patch | patch -p1 +cat ../../../patches/polarssl-${VERSION}-timing.patch | patch -p1 echo "Building polarssl for ${PLATFORM} ${SDKVERSION} ${ARCH}" diff --git a/scripts/018-libcurl-7.64.1.sh b/scripts/018-libcurl-7.64.1.sh index 912603c..44a4290 100755 --- a/scripts/018-libcurl-7.64.1.sh +++ b/scripts/018-libcurl-7.64.1.sh @@ -2,15 +2,18 @@ # libcurl-7.31.0 by KaKaRoTo # modified by mhaqs for 7.31.0 release and cpp compatibility -VERSION=7.64.1 +VERSION="7.64.1" ## Download the source code. ../download.sh curl-${VERSION}.tar.gz ## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable -../scripts/get-config-scripts.sh +../utils/get-config-scripts.sh ## Unpack the source code. -rm -Rf curl-${VERSION} && tar xfvz ../archives/curl-${VERSION}.tar.gz && cd curl-${VERSION} +rm -Rf curl-${VERSION} +echo "Unpacking curl-${VERSION}" +pv -pterab ../archives/curl-${VERSION}.tar.gz | tar -xzf - +cd curl-${VERSION} ## Replace config.guess and config.sub cp ../../archives/config.guess ../../archives/config.sub . diff --git a/scripts/019-libmad-0.15.1b.sh b/scripts/019-libmad-0.15.1b.sh index 17bc946..eaf89cf 100755 --- a/scripts/019-libmad-0.15.1b.sh +++ b/scripts/019-libmad-0.15.1b.sh @@ -1,14 +1,18 @@ #!/bin/sh -e # libmad-0.15.1b.sh by dhewg (dhewg@wiibrew.org) +LIBMAD="libmad-0.15.1b" ## Download the source code. -../download.sh libmad-0.15.1b.tar.gz +../download.sh ${LIBMAD}.tar.gz ## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable -../scripts/get-config-scripts.sh +../utils/get-config-scripts.sh ## Unpack the source code. -rm -Rf libmad-0.15.1b && tar xfvz ../archives/libmad-0.15.1b.tar.gz && cd libmad-0.15.1b +rm -Rf ${LIBMAD} +echo "Unpacking ${LIBMAD}" +pv -pterab ../archives/${LIBMAD}.tar.gz | tar -xzf - +cd ${LIBMAD} ## Replace config.guess and config.sub cp ../../archives/config.guess ../../archives/config.sub . diff --git a/scripts/020-flac-1.2.1.sh b/scripts/020-flac-1.2.1.sh index 94ab04c..5bb552f 100755 --- a/scripts/020-flac-1.2.1.sh +++ b/scripts/020-flac-1.2.1.sh @@ -1,14 +1,18 @@ #!/bin/sh -e # flac-1.2.1.sh by dhewg (dhewg@wiibrew.org) +FLAC="flac-1.2.1" ## Download the source code. -../download.sh flac-1.2.1.tar.gz +../download.sh ${FLAC}.tar.gz ## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable -../scripts/get-config-scripts.sh +../utils/get-config-scripts.sh ## Unpack the source code. -rm -Rf flac-1.2.1 && tar xfvz ../archives/flac-1.2.1.tar.gz && cd flac-1.2.1 +rm -Rf ${FLAC} +echo "Unpacking ${FLAC}" +pv -pterab ../archives/${FLAC}.tar.gz | tar -xzf - +cd ${FLAC} ## Replace config.guess and config.sub cp ../../archives/config.guess ../../archives/config.sub . diff --git a/scripts/021-faad2-2.7.sh b/scripts/021-faad2-2.7.sh index 3c6e251..372d3b1 100755 --- a/scripts/021-faad2-2.7.sh +++ b/scripts/021-faad2-2.7.sh @@ -1,14 +1,18 @@ #!/bin/sh -e # faad2-2.7.sh by dhewg (dhewg@wiibrew.org) +FAAD2="faad2-2.7" ## Download the source code. -../download.sh faad2-2.7.tar.gz +../download.sh ${FAAD2}.tar.gz ## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable -../scripts/get-config-scripts.sh +../utils/get-config-scripts.sh ## Unpack the source code. -rm -Rf faad2-2.7 && tar xfvz ../archives/faad2-2.7.tar.gz && cd faad2-2.7 +rm -Rf ${FAAD2} +echo "Unpacking ${FAAD2}" +pv -pterab ../archives/${FAAD2}.tar.gz | tar -xzf - +cd ${FAAD2} ## Replace config.guess and config.sub cp ../../archives/config.guess ../../archives/config.sub . diff --git a/scripts/022-libtheora-1.1.1.sh b/scripts/022-libtheora-1.1.1.sh index 1687580..2231000 100755 --- a/scripts/022-libtheora-1.1.1.sh +++ b/scripts/022-libtheora-1.1.1.sh @@ -1,14 +1,18 @@ #!/bin/sh -e # libtheora-1.1.1.sh by dhewg (dhewg@wiibrew.org) +LIBTHEORA="libtheora-1.1.1" ## Download the source code. -../download.sh libtheora-1.1.1.tar.bz2 +../download.sh ${LIBTHEORA}.tar.bz2 ## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable -../scripts/get-config-scripts.sh +../utils/get-config-scripts.sh ## Unpack the source code. -rm -Rf libtheora-1.1.1 && tar xfvj ../archives/libtheora-1.1.1.tar.bz2 && cd libtheora-1.1.1 +rm -Rf ${LIBTHEORA} +echo "Unpacking ${LIBTHEORA}" +pv -pterab ../archives/${LIBTHEORA}.tar.bz2 | tar -xjf - +cd ${LIBTHEORA} ## Replace config.guess and config.sub cp ../../archives/config.guess ../../archives/config.sub . diff --git a/scripts/023-NoRSX.sh b/scripts/023-NoRSX.sh index d4e05ea..33af87a 100755 --- a/scripts/023-NoRSX.sh +++ b/scripts/023-NoRSX.sh @@ -5,7 +5,11 @@ ../download.sh NoRSX.tar.gz ## Unpack the source code. -rm -Rf NoRSX && mkdir NoRSX && tar --strip-components=1 --directory=NoRSX -xvzf ../archives/NoRSX.tar.gz && cd NoRSX +rm -Rf NoRSX +mkdir NoRSX +echo "Unpacking NoRSX" +pv -pterab ../archives/NoRSX.tar.gz | tar --strip-components=1 --directory=NoRSX -xzf - +cd NoRSX ## Compile and install. ${MAKE:-make} diff --git a/scripts/024-libjson.sh b/scripts/024-libjson.sh index 4988f84..7f750e9 100755 --- a/scripts/024-libjson.sh +++ b/scripts/024-libjson.sh @@ -1,15 +1,16 @@ #!/bin/sh -e # libjson-c.sh by Mohammad Haseeb (mmhaqs@gmail.com) -../download.sh json-c-0.11-20130402 +../download.sh json-c-0.11-20130402.tar.gz ## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable -../scripts/get-config-scripts.sh +../utils/get-config-scripts.sh ## Unpack the source code. -rm -Rf jsonc && mkdir jsonc && tar --strip-components=1 --directory=jsonc -xvzf ../archives/json-c-0.11-20130402 - -## Create the build directory. +rm -Rf jsonc +mkdir jsonc +echo "Unpacking jsonc" +pv -pterab ../archives/json-c-0.11-20130402.tar.gz | tar --strip-components=1 --directory=jsonc -xzf - cd jsonc ## Replace config.guess and config.sub diff --git a/scripts/025-debugnet.sh b/scripts/025-debugnet.sh index f916ab6..8b6fcd3 100755 --- a/scripts/025-debugnet.sh +++ b/scripts/025-debugnet.sh @@ -5,8 +5,10 @@ ../download.sh ps3debugnet.tar.gz ## Unpack the source code. -rm -Rf ps3debugnet && mkdir ps3debugnet && tar --strip-components=1 --directory=ps3debugnet -xvzf ../archives/ps3debugnet.tar.gz - +rm -Rf ps3debugnet +mkdir ps3debugnet +echo "Unpacking ps3debugnet" +pv -pterab ../archives/ps3debugnet.tar.gz | tar --strip-components=1 --directory=ps3debugnet -xzf - cd ps3debugnet/libdebugnet ## Compile and install. diff --git a/scripts/026-ps3soundlib.sh b/scripts/026-ps3soundlib.sh index b70eafb..87ef208 100755 --- a/scripts/026-ps3soundlib.sh +++ b/scripts/026-ps3soundlib.sh @@ -6,7 +6,11 @@ ../download.sh ps3soundlib.tar.gz ## Unpack the source code. -rm -Rf ps3soundlib && mkdir ps3soundlib && tar --strip-components=1 --directory=ps3soundlib -xvzf ../archives/ps3soundlib.tar.gz && cd ps3soundlib +rm -Rf ps3soundlib +mkdir ps3soundlib +echo "Unpacking ps3soundlib" +pv -pterab ../archives/ps3soundlib.tar.gz | tar --strip-components=1 --directory=ps3soundlib -xzf - +cd ps3soundlib ## Compile and install. ${MAKE:-make} diff --git a/scripts/027-tiny3d_libfont.sh b/scripts/027-tiny3d_libfont.sh index 1299041..0b1cb3a 100755 --- a/scripts/027-tiny3d_libfont.sh +++ b/scripts/027-tiny3d_libfont.sh @@ -13,7 +13,11 @@ ../download.sh tiny3d.tar.gz ## Unpack the source code. -rm -Rf tiny3d && mkdir tiny3d && tar --strip-components=1 --directory=tiny3d -xvzf ../archives/tiny3d.tar.gz && cd tiny3d +rm -Rf tiny3d +mkdir tiny3d +echo "Unpacking tiny3d" +pv -pterab ../archives/tiny3d.tar.gz | tar --strip-components=1 --directory=tiny3d -xzf - +cd tiny3d ## Compile and install. ${MAKE:-make} install -C lib --no-print-directory diff --git a/scripts/028-mbedTLS-2.28.10.sh b/scripts/028-mbedTLS-2.28.10.sh index 6d5fa88..a41098e 100755 --- a/scripts/028-mbedTLS-2.28.10.sh +++ b/scripts/028-mbedTLS-2.28.10.sh @@ -37,7 +37,10 @@ PLATFORM="PS3" ../download.sh mbedtls-${VERSION}.tar.bz2 ## Unpack the source code. -rm -Rf mbedtls-${VERSION} && tar xfvj ../archives/mbedtls-${VERSION}.tar.bz2 && cd mbedtls-${VERSION} +rm -Rf mbedtls-${VERSION} +echo "Unpacking mbedtls-${VERSION}" +pv -pterab ../archives/mbedtls-${VERSION}.tar.bz2 | tar -xjf - +cd mbedtls-${VERSION} echo "Building mbedTLS ${VERSION} for ${PLATFORM} ${ARCH}" diff --git a/scripts/029-libunrar.sh b/scripts/029-libunrar.sh index e02ad49..7bdd38e 100755 --- a/scripts/029-libunrar.sh +++ b/scripts/029-libunrar.sh @@ -6,7 +6,11 @@ ../download.sh libunrar.tar.gz ## Unpack the source code. -rm -Rf libunrar && mkdir libunrar && tar --strip-components=1 --directory=libunrar -xvzf ../archives/libunrar.tar.gz && cd libunrar +rm -Rf libunrar +mkdir libunrar +echo "Unpacking libunrar" +pv -pterab ../archives/libunrar.tar.gz | tar --strip-components=1 --directory=libunrar -xzf - +cd libunrar ## Compile and install. ${MAKE:-make} install diff --git a/scripts/030-libnfs.sh b/scripts/030-libnfs.sh index 67dcd3e..d39a0d7 100755 --- a/scripts/030-libnfs.sh +++ b/scripts/030-libnfs.sh @@ -7,7 +7,11 @@ ../download.sh libnfs.tar.gz ## Unpack the source code. -rm -Rf libnfs && mkdir libnfs && tar --strip-components=1 --directory=libnfs -xvzf ../archives/libnfs.tar.gz && cd libnfs +rm -Rf libnfs +mkdir libnfs +echo "Unpacking libnfs" +pv -pterab ../archives/libnfs.tar.gz | tar --strip-components=1 --directory=libnfs -xzf - +cd libnfs ## Compile and install. ${MAKE:-make} -f ps3_ppu/Makefile.PS3_PPU install diff --git a/scripts/031-libsmb2.sh b/scripts/031-libsmb2.sh index 3e471f8..7f95914 100755 --- a/scripts/031-libsmb2.sh +++ b/scripts/031-libsmb2.sh @@ -2,12 +2,17 @@ # # libsmb2 by sahlberg # ported to PS3 by Bucanero +SMB2="libsmb2" ## Download the source code. -../download.sh libsmb2.tar.gz +../download.sh ${SMB2}.tar.gz ## Unpack the source code. -rm -Rf libsmb2 && mkdir libsmb2 && tar --strip-components=1 --directory=libsmb2 -xvzf ../archives/libsmb2.tar.gz && cd libsmb2/lib +rm -Rf ${SMB2} +mkdir ${SMB2} +echo "Unpacking ${SMB2}" +pv -pterab ../archives/${SMB2}.tar.gz | tar --strip-components=1 --directory=${SMB2} -xzf - +cd ${SMB2}/lib ## Compile and install. ${MAKE:-make} -f Makefile.PS3_PPU install diff --git a/utils/gen-github-actions-tasks.sh b/utils/gen-github-actions-tasks.sh new file mode 100755 index 0000000..64c0774 --- /dev/null +++ b/utils/gen-github-actions-tasks.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="../scripts" + +echo " # ------------------------" +echo " # Build steps" +echo " # ------------------------" + +for script in "$SCRIPT_DIR"/*.sh; do + filename="$(basename "$script" .sh)" + + # Remove numeric prefix and convert dashes to spaces + name="${filename#[0-9][0-9][0-9]-}" + name="${name//-/ }" + + # Capitalize first letter of each word + name="$(echo "$name" | sed -E 's/(^| )([a-z])/\1\u\2/g')" + + echo " - name: Build $name" + echo " working-directory: ./build" + echo " run: ../scripts/$(basename "$script")" + echo +done \ No newline at end of file diff --git a/scripts/get-config-scripts.sh b/utils/get-config-scripts.sh similarity index 78% rename from scripts/get-config-scripts.sh rename to utils/get-config-scripts.sh index a936a10..5d861d2 100755 --- a/scripts/get-config-scripts.sh +++ b/utils/get-config-scripts.sh @@ -1,4 +1,5 @@ -#!/bin/sh -e +#!/bin/sh +set -e CONFIG_TIMEOUT="${CONFIG_TIMEOUT:-15}" CONFIG_BASE_URL="https://git.savannah.gnu.org/cgit/config.git/plain" @@ -40,5 +41,11 @@ fetch_config_file() { chmod +x "${file}" } -fetch_config_file config.guess -fetch_config_file config.sub +if [ -z "${NO_SAVANNAH}" ]; then + fetch_config_file config.guess + fetch_config_file config.sub +else + echo "NO_SAVANNAH is set, skipping Savannah downloads." + cp "${ASSET_DIR}/config.guess" "config.guess" + cp "${ASSET_DIR}/config.sub" "config.sub" +fi \ No newline at end of file