-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The static builds are not compatible w/ Debian 12
- Loading branch information
1 parent
30ca939
commit 6ee7b40
Showing
2 changed files
with
4 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,4 @@ | ||
#!/usr/bin/env bash | ||
# bin/compile <build-dir> <cache-dir> <env-dir> | ||
#!/bin/bash | ||
set -xeo pipefail | ||
|
||
# adapted from https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest/blob/master/bin/compile | ||
|
||
header() { | ||
echo "" || true | ||
echo "-----> $*" || true | ||
} | ||
|
||
output() { | ||
while IFS= read -r LINE; do | ||
# do not indent headers that are being piped through the output | ||
if [[ "$LINE" =~ ^-----\>.* ]]; then | ||
echo "$LINE" || true | ||
else | ||
echo " $LINE" || true | ||
fi | ||
done | ||
} | ||
|
||
header "Installing ffmpeg" | ||
|
||
BUILD_DIR=${1:-} | ||
FFMPEG_ARCHIVE_NAME="ffmpeg.tar.xz" | ||
|
||
cd $BUILD_DIR | ||
mkdir -p ffmpeg | ||
cd ffmpeg | ||
|
||
# if [[ -z $FFMPEG_DOWNLOAD_URL ]]; then | ||
# echo "Variable FFMPEG_DOWNLOAD_URL isn't set, using default value" | output | ||
# FFMPEG_DOWNLOAD_URL="https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz" | ||
# fi | ||
|
||
FFMPEG_DOWNLOAD_URL="https://denkungsart.s3.eu-west-1.amazonaws.com/ffmpeg-git-${TARGETPLATFORM#*/}-static.tar.xz" | ||
|
||
echo "Downloading $FFMPEG_DOWNLOAD_URL" | output | ||
|
||
code=$(curl "$FFMPEG_DOWNLOAD_URL" -L --silent --fail --retry 5 --retry-max-time 15 -o ./$FFMPEG_ARCHIVE_NAME --write-out "%{http_code}") | ||
|
||
if [ "$code" != "200" ]; then | ||
echo "Unable to download ffmpeg: $code" | output && exit 1 | ||
fi | ||
|
||
echo "Unpacking the archive" | output | ||
|
||
tar xJf "./$FFMPEG_ARCHIVE_NAME" --strip-components=1 | ||
|
||
if [ "$?" != "0" ]; then | ||
echo "Failed to unpack" | output && exit 1 | ||
fi | ||
|
||
rm $FFMPEG_ARCHIVE_NAME | ||
|
||
mv ffprobe /usr/local/bin | ||
mv ffmpeg /usr/local/bin | ||
|
||
echo "Installation successful" | output | ||
apt-get install -y ffmpeg |