Add Addin-System
This commit is contained in:
parent
795d8a739f
commit
e90d9436fc
9 changed files with 36 additions and 14 deletions
2
addins/debug.sh
Normal file
2
addins/debug.sh
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/bash
|
||||||
|
FF_CONFIGURE="${FF_CONFIGURE/--disable-debug/} --optflags='-Og' --disable-stripping"
|
4
build.sh
4
build.sh
|
@ -17,6 +17,10 @@ get_output() {
|
||||||
|
|
||||||
source "variants/${TARGET}-${VARIANT}.sh"
|
source "variants/${TARGET}-${VARIANT}.sh"
|
||||||
|
|
||||||
|
for addin in ${ADDINS[*]}; do
|
||||||
|
source "addins/${addin}.sh"
|
||||||
|
done
|
||||||
|
|
||||||
export FFBUILD_PREFIX="$(docker run --rm "$IMAGE" bash -c 'echo $FFBUILD_PREFIX')"
|
export FFBUILD_PREFIX="$(docker run --rm "$IMAGE" bash -c 'echo $FFBUILD_PREFIX')"
|
||||||
|
|
||||||
for script in scripts.d/*.sh; do
|
for script in scripts.d/*.sh; do
|
||||||
|
|
|
@ -11,7 +11,7 @@ to_df() {
|
||||||
}
|
}
|
||||||
|
|
||||||
to_df "FROM docker.pkg.github.com/${REPO}/base-${TARGET}:latest"
|
to_df "FROM docker.pkg.github.com/${REPO}/base-${TARGET}:latest"
|
||||||
to_df "ENV TARGET=$TARGET VARIANT=$VARIANT REPO=$REPO"
|
to_df "ENV TARGET=$TARGET VARIANT=$VARIANT REPO=$REPO ADDINS_STR=$ADDINS_STR"
|
||||||
|
|
||||||
for script in scripts.d/*.sh; do
|
for script in scripts.d/*.sh; do
|
||||||
(
|
(
|
||||||
|
|
|
@ -6,6 +6,6 @@ source util/vars.sh
|
||||||
docker build --cache-from "$BASE_IMAGE" --tag "$BASE_IMAGE" images/base
|
docker build --cache-from "$BASE_IMAGE" --tag "$BASE_IMAGE" images/base
|
||||||
docker build --build-arg GH_REPO="$REPO" --cache-from "$TARGET_IMAGE" --tag "$TARGET_IMAGE" "images/base-${TARGET}"
|
docker build --build-arg GH_REPO="$REPO" --cache-from "$TARGET_IMAGE" --tag "$TARGET_IMAGE" "images/base-${TARGET}"
|
||||||
|
|
||||||
./generate.sh "$TARGET" "$VARIANT"
|
./generate.sh "$TARGET" "$VARIANT" "${ADDINS[@]}"
|
||||||
|
|
||||||
exec docker build --cache-from "$IMAGE" --tag "$IMAGE" .
|
exec docker build --cache-from "$IMAGE" --tag "$IMAGE" .
|
||||||
|
|
32
util/vars.sh
32
util/vars.sh
|
@ -1,24 +1,40 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [[ $# -lt 1 || $# -gt 2 ]]; then
|
if [[ $# -lt 2 ]]; then
|
||||||
echo "Invalid Arguments"
|
echo "Invalid Arguments"
|
||||||
exit -1
|
exit -1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TARGET="$1"
|
TARGET="$1"
|
||||||
VARIANT="${2:-gpl}"
|
VARIANT="$2"
|
||||||
REPO="${GITHUB_REPOSITORY:-btbn/ffmpeg-builds}"
|
shift 2
|
||||||
REPO="${REPO,,}"
|
|
||||||
REGISTRY="docker.pkg.github.com"
|
|
||||||
BASE_IMAGE="${REGISTRY}/${REPO}/base:latest"
|
|
||||||
TARGET_IMAGE="${REGISTRY}/${REPO}/base-${TARGET}:latest"
|
|
||||||
IMAGE="${REGISTRY}/${REPO}/${TARGET}-${VARIANT}:latest"
|
|
||||||
|
|
||||||
if ! [[ -f "variants/${TARGET}-${VARIANT}.sh" ]]; then
|
if ! [[ -f "variants/${TARGET}-${VARIANT}.sh" ]]; then
|
||||||
echo "Invalid target/variant"
|
echo "Invalid target/variant"
|
||||||
exit -1
|
exit -1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
ADDINS=()
|
||||||
|
ADDINS_STR=""
|
||||||
|
while [[ "$#" -gt 0 ]]; do
|
||||||
|
if ! [[ -f "addins/${1}.sh" ]]; then
|
||||||
|
echo "Invalid addin: $1"
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
|
||||||
|
ADDINS+=( "$1" )
|
||||||
|
ADDINS_STR="${ADDINS_STR}${ADDINS_STR:+-}$1"
|
||||||
|
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
REPO="${GITHUB_REPOSITORY:-btbn/ffmpeg-builds}"
|
||||||
|
REPO="${REPO,,}"
|
||||||
|
REGISTRY="docker.pkg.github.com"
|
||||||
|
BASE_IMAGE="${REGISTRY}/${REPO}/base:latest"
|
||||||
|
TARGET_IMAGE="${REGISTRY}/${REPO}/base-${TARGET}:latest"
|
||||||
|
IMAGE="${REGISTRY}/${REPO}/${TARGET}-${VARIANT}${ADDINS_STR:+-}${ADDINS_STR}:latest"
|
||||||
|
|
||||||
ffbuild_configure() {
|
ffbuild_configure() {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
source "$(dirname "$BASH_SOURCE")"/defaults-gpl.sh
|
source "$(dirname "$BASH_SOURCE")"/defaults-gpl.sh
|
||||||
FF_CONFIGURE+=" --enable-shared --disable-static"
|
FF_CONFIGURE+=" --enable-shared --disable-static --disable-debug"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FF_CONFIGURE="--enable-gpl --enable-version3"
|
FF_CONFIGURE="--enable-gpl --enable-version3 --disable-debug"
|
||||||
FF_CFLAGS=""
|
FF_CFLAGS=""
|
||||||
FF_CXXFLAGS=""
|
FF_CXXFLAGS=""
|
||||||
FF_LDFLAGS=""
|
FF_LDFLAGS=""
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
source "$(dirname "$BASH_SOURCE")"/defaults-lgpl.sh
|
source "$(dirname "$BASH_SOURCE")"/defaults-lgpl.sh
|
||||||
FF_CONFIGURE+=" --enable-shared --disable-static"
|
FF_CONFIGURE+=" --enable-shared --disable-static --disable-debug"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FF_CONFIGURE="--enable-version3"
|
FF_CONFIGURE="--enable-version3 --disable-debug"
|
||||||
FF_CFLAGS=""
|
FF_CFLAGS=""
|
||||||
FF_CXXFLAGS=""
|
FF_CXXFLAGS=""
|
||||||
FF_LDFLAGS=""
|
FF_LDFLAGS=""
|
||||||
|
|
Loading…
Reference in a new issue