FFmpeg-Builds/util/vars.sh

114 lines
1.9 KiB
Bash
Raw Permalink Normal View History

2020-09-02 23:03:23 +00:00
#!/bin/bash
2020-09-27 21:11:10 +00:00
if [[ $# -lt 2 ]]; then
2020-09-02 23:03:23 +00:00
echo "Invalid Arguments"
exit -1
fi
TARGET="$1"
2020-09-27 21:11:10 +00:00
VARIANT="$2"
shift 2
2020-09-27 20:10:05 +00:00
if ! [[ -f "variants/${TARGET}-${VARIANT}.sh" ]]; then
echo "Invalid target/variant"
exit -1
fi
2021-08-26 06:31:30 +00:00
LICENSE_FILE="COPYING.LGPLv2.1"
2020-09-27 21:11:10 +00:00
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="${REGISTRY_OVERRIDE:-ghcr.io}"
2020-09-27 21:11:10 +00:00
BASE_IMAGE="${REGISTRY}/${REPO}/base:latest"
TARGET_IMAGE="${REGISTRY}/${REPO}/base-${TARGET}:latest"
IMAGE="${REGISTRY}/${REPO}/${TARGET}-${VARIANT}${ADDINS_STR:+-}${ADDINS_STR}:latest"
2023-06-20 21:26:40 +00:00
DL_IMAGE_RAW="${REGISTRY}/${REPO}/dl_cache"
if [[ -n "$REGISTRY_OVERRIDE_DL" && -n "$GITHUB_REPOSITORY_DL" ]]; then
2023-06-20 21:26:40 +00:00
DL_IMAGE_RAW="${REGISTRY_OVERRIDE_DL}/${GITHUB_REPOSITORY_DL}/dl_cache"
DL_IMAGE_RAW="${DL_IMAGE_RAW,,}"
fi
2023-06-20 21:26:40 +00:00
DL_IMAGE="${DL_IMAGE_RAW}:unset"
ffbuild_dockerdl() {
default_dl "$SELF"
}
ffbuild_dockerlayer_dl() {
to_df "COPY --from=${SELFLAYER} \$FFBUILD_DLDIR/. \$FFBUILD_DLDIR"
}
2020-09-27 21:11:10 +00:00
ffbuild_dockerstage() {
2023-06-20 22:38:32 +00:00
to_df "RUN --mount=src=${SELF},dst=/stage.sh --mount=src=/,dst=\$FFBUILD_DLDIR,from=${DL_IMAGE},rw run_stage /stage.sh"
}
2021-04-06 01:41:36 +00:00
ffbuild_dockerlayer() {
to_df "COPY --from=${SELFLAYER} \$FFBUILD_PREFIX/. \$FFBUILD_PREFIX"
}
ffbuild_dockerfinal() {
to_df "COPY --from=${PREVLAYER} \$FFBUILD_PREFIX/. \$FFBUILD_PREFIX"
}
ffbuild_configure() {
return 0
}
ffbuild_unconfigure() {
return 0
}
ffbuild_cflags() {
return 0
}
ffbuild_uncflags() {
return 0
}
2020-09-03 20:49:43 +00:00
ffbuild_cxxflags() {
return 0
}
ffbuild_uncxxflags() {
return 0
}
ffbuild_ldexeflags() {
return 0
}
ffbuild_unldexeflags() {
return 0
}
ffbuild_ldflags() {
return 0
}
ffbuild_unldflags() {
return 0
}
2020-09-06 19:55:59 +00:00
ffbuild_libs() {
return 0
}
ffbuild_unlibs() {
return 0
}