Skip to content

Commit

Permalink
fix: add patch (see jonathanong#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
proudlygeek committed Aug 21, 2023
1 parent 25e435c commit a40592b
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@ header() {
echo "-----> $*" || true
}

export_env_dir() {
env_dir=$1
acceptlist_regex=${2:-''}
denylist_regex=${3:-'^(PATH|GIT_DIR|CPATH|CPPATH|LD_PRELOAD|LIBRARY_PATH)$'}
if [ -d "$env_dir" ]; then
for e in $(ls $env_dir); do
echo "$e" | grep -E "$acceptlist_regex" | grep -qvE "$denylist_regex" &&
export "$e=$(cat $env_dir/$e)"
:
done
fi
}

output() {
while IFS= read -r LINE; do
# do not indent headers that are being piped through the output
Expand All @@ -20,9 +33,12 @@ output() {
header "Installing ffmpeg"

BUILD_DIR=${1:-}
ENV_DIR=${3:-}
VENDOR_DIR="vendor"
FFMPEG_ARCHIVE_NAME="ffmpeg.tar.xz"

export_env_dir $ENV_DIR

cd $BUILD_DIR
mkdir -p $VENDOR_DIR
cd $VENDOR_DIR
Expand All @@ -31,7 +47,7 @@ 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"
FFMPEG_DOWNLOAD_URL="https://www.johnvansickle.com/ffmpeg/old-releases/ffmpeg-4.2.2-amd64-static.tar.xz"
fi

echo "Downloading $FFMPEG_DOWNLOAD_URL" | output
Expand All @@ -56,4 +72,4 @@ PROFILE_PATH="$BUILD_DIR/.profile.d/ffmpeg.sh"
mkdir -p $(dirname $PROFILE_PATH)
echo 'export PATH="$PATH:${HOME}/vendor/ffmpeg"' >> $PROFILE_PATH

echo "Installation successful" | output
echo "Installation successful" | output

0 comments on commit a40592b

Please sign in to comment.