5353 OPUS_VERSION : ' 1.5.2'
5454 LAME_VERSION : ' 3.100'
5555 FFMPEG_VERSION : ' n8.0'
56+ # SHA256 checksums for tarball downloads (hermetic build verification)
57+ # These MUST be updated when changing versions above
58+ # Sources: https://opus-codec.org/downloads/, https://sourceforge.net/projects/lame/
59+ # NASM uses GitHub source archive (more reliable than nasm.us)
60+ NASM_VERSION : ' 2.16.03'
61+ NASM_SHA256 : ' e7f77b8247de72f3c2a2c57a9c72b2a0c847ec5e99ce6e68c1e225fa2e37c04c' # GitHub source archive
62+ OPUS_SHA256 : ' 65c1d2f78b9f2fb20082c38cbe47c951ad5839345876e46941612ee87f9a7ce1'
63+ LAME_SHA256 : ' ddfe36cab873794038ae2c1210557ad34857a4b6bdc515785d1da9e175b1da1e'
5664 # npm scope for platform packages
5765 NPM_SCOPE : ' @pproenca/ffmpeg'
5866 # Bump this to invalidate all caches
@@ -287,37 +295,34 @@ jobs:
287295 rm -rf x264 x265_git libvpx aom aom_build opus-* lame-* nasm-*
288296
289297 echo "=== Building nasm ==="
290- NASM_VERSION="2.16.03"
291- NASM_URL="https://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.bz2"
292- NASM_GITHUB="https://github.com/netwide-assembler/nasm/archive/refs/tags/nasm-${NASM_VERSION}.tar.gz"
293-
294- # Try primary source with retries, fallback to GitHub mirror
295- NASM_FROM_GITHUB=false
296- if curl -fSL --retry 3 --retry-delay 5 "$NASM_URL" -o nasm.tar.bz2; then
297- echo "Downloaded nasm from primary source"
298- tar xjf nasm.tar.bz2
299- cd nasm-${NASM_VERSION}
300- else
301- echo "Primary nasm download failed, trying GitHub mirror..."
302- curl -fSL --retry 3 "$NASM_GITHUB" -o nasm.tar.gz
303- tar xzf nasm.tar.gz
304- cd nasm-nasm-${NASM_VERSION}
305- NASM_FROM_GITHUB=true
306- # GitHub source archive requires autogen.sh to create configure script
307- ./autogen.sh
308- fi
298+ # Use GitHub source archive (more reliable than nasm.us which often has connectivity issues)
299+ NASM_URL="https://github.com/netwide-assembler/nasm/archive/refs/tags/nasm-${{ env.NASM_VERSION }}.tar.gz"
300+
301+ echo "Downloading NASM from GitHub..."
302+ curl -fSL --retry 3 --retry-delay 5 "$NASM_URL" -o nasm.tar.gz || {
303+ echo "ERROR: Failed to download NASM from $NASM_URL"
304+ exit 1
305+ }
306+
307+ # SHA256 verification (hermetic build)
308+ echo "${{ env.NASM_SHA256 }} nasm.tar.gz" | shasum -a 256 -c - || {
309+ echo "ERROR: NASM checksum verification failed!"
310+ echo "Expected: ${{ env.NASM_SHA256 }}"
311+ echo "Got: $(shasum -a 256 nasm.tar.gz | cut -d' ' -f1)"
312+ exit 1
313+ }
314+ echo "NASM checksum verified"
309315
316+ tar xzf nasm.tar.gz
317+ cd nasm-nasm-${{ env.NASM_VERSION }}
318+ # GitHub source archive requires autogen.sh to create configure script
319+ ./autogen.sh
310320 ./configure --prefix="$TARGET"
311321 make -j$(sysctl -n hw.ncpu)
312-
313322 # GitHub source doesn't include pre-generated man pages (requires asciidoc)
314323 # Install binaries directly to avoid man page install failure
315- if [ "$NASM_FROM_GITHUB" = true ]; then
316- mkdir -p "$TARGET/bin"
317- install -c nasm ndisasm "$TARGET/bin/"
318- else
319- make install
320- fi
324+ mkdir -p "$TARGET/bin"
325+ install -c nasm ndisasm "$TARGET/bin/"
321326 cd ..
322327
323328 echo "=== Building x264 (GPL) ==="
@@ -415,7 +420,21 @@ jobs:
415420 cd ..
416421
417422 echo "=== Building libopus (BSD) ==="
418- curl -sL https://downloads.xiph.org/releases/opus/opus-${{ env.OPUS_VERSION }}.tar.gz | tar xz
423+ curl -fSL --retry 3 https://downloads.xiph.org/releases/opus/opus-${{ env.OPUS_VERSION }}.tar.gz -o opus.tar.gz || {
424+ echo "ERROR: Failed to download Opus from xiph.org"
425+ exit 1
426+ }
427+
428+ # SHA256 verification (hermetic build)
429+ echo "${{ env.OPUS_SHA256 }} opus.tar.gz" | shasum -a 256 -c - || {
430+ echo "ERROR: Opus checksum verification failed!"
431+ echo "Expected: ${{ env.OPUS_SHA256 }}"
432+ echo "Got: $(shasum -a 256 opus.tar.gz | cut -d' ' -f1)"
433+ exit 1
434+ }
435+ echo "Opus checksum verified"
436+
437+ tar xzf opus.tar.gz
419438 cd opus-${{ env.OPUS_VERSION }}
420439 ./configure \
421440 --prefix="$TARGET" \
@@ -428,7 +447,21 @@ jobs:
428447 cd ..
429448
430449 echo "=== Building libmp3lame (LGPL) ==="
431- curl -sL "https://downloads.sourceforge.net/project/lame/lame/${{ env.LAME_VERSION }}/lame-${{ env.LAME_VERSION }}.tar.gz" | tar xz
450+ curl -fSL --retry 3 "https://downloads.sourceforge.net/project/lame/lame/${{ env.LAME_VERSION }}/lame-${{ env.LAME_VERSION }}.tar.gz" -o lame.tar.gz || {
451+ echo "ERROR: Failed to download LAME from SourceForge"
452+ exit 1
453+ }
454+
455+ # SHA256 verification (hermetic build)
456+ echo "${{ env.LAME_SHA256 }} lame.tar.gz" | shasum -a 256 -c - || {
457+ echo "ERROR: LAME checksum verification failed!"
458+ echo "Expected: ${{ env.LAME_SHA256 }}"
459+ echo "Got: $(shasum -a 256 lame.tar.gz | cut -d' ' -f1)"
460+ exit 1
461+ }
462+ echo "LAME checksum verified"
463+
464+ tar xzf lame.tar.gz
432465 cd lame-${{ env.LAME_VERSION }}
433466 ./configure \
434467 --prefix="$TARGET" \
0 commit comments