vars.sh 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. #!/bin/bash
  2. if [[ $# -lt 2 ]]; then
  3. echo "Invalid Arguments"
  4. exit -1
  5. fi
  6. TARGET="$1"
  7. VARIANT="$2"
  8. shift 2
  9. if ! [[ -f "variants/${TARGET}-${VARIANT}.sh" ]]; then
  10. echo "Invalid target/variant"
  11. exit -1
  12. fi
  13. LICENSE_FILE="COPYING.LGPLv2.1"
  14. ADDINS=()
  15. ADDINS_STR=""
  16. while [[ "$#" -gt 0 ]]; do
  17. if ! [[ -f "addins/${1}.sh" ]]; then
  18. echo "Invalid addin: $1"
  19. exit -1
  20. fi
  21. ADDINS+=( "$1" )
  22. ADDINS_STR="${ADDINS_STR}${ADDINS_STR:+-}$1"
  23. shift
  24. done
  25. REPO="${GITHUB_REPOSITORY:-yt-dlp/ffmpeg-builds}"
  26. REPO="${REPO,,}"
  27. REGISTRY="${REGISTRY_OVERRIDE:-ghcr.io}"
  28. BASE_IMAGE="${REGISTRY}/${REPO}/base:latest"
  29. TARGET_IMAGE="${REGISTRY}/${REPO}/base-${TARGET}:latest"
  30. IMAGE="${REGISTRY}/${REPO}/${TARGET}-${VARIANT}${ADDINS_STR:+-}${ADDINS_STR}:latest"
  31. ffbuild_ffver() {
  32. case "$ADDINS_STR" in
  33. *4.4*)
  34. echo 404
  35. ;;
  36. *5.0*)
  37. echo 500
  38. ;;
  39. *5.1*)
  40. echo 501
  41. ;;
  42. *6.0*)
  43. echo 600
  44. ;;
  45. *6.1*)
  46. echo 601
  47. ;;
  48. *7.0*)
  49. echo 700
  50. ;;
  51. *)
  52. echo 99999999
  53. ;;
  54. esac
  55. }
  56. ffbuild_dockerstage() {
  57. if [[ -n "$SELFCACHE" ]]; then
  58. to_df "RUN --mount=src=${SELF},dst=/stage.sh --mount=src=${SELFCACHE},dst=/cache.tar.xz run_stage /stage.sh"
  59. else
  60. to_df "RUN --mount=src=${SELF},dst=/stage.sh run_stage /stage.sh"
  61. fi
  62. }
  63. ffbuild_dockerlayer() {
  64. to_df "COPY --link --from=${SELFLAYER} \$FFBUILD_PREFIX/. \$FFBUILD_PREFIX"
  65. }
  66. ffbuild_dockerfinal() {
  67. to_df "COPY --link --from=${PREVLAYER} \$FFBUILD_PREFIX/. \$FFBUILD_PREFIX"
  68. }
  69. ffbuild_configure() {
  70. return 0
  71. }
  72. ffbuild_unconfigure() {
  73. return 0
  74. }
  75. ffbuild_cflags() {
  76. return 0
  77. }
  78. ffbuild_uncflags() {
  79. return 0
  80. }
  81. ffbuild_cxxflags() {
  82. return 0
  83. }
  84. ffbuild_uncxxflags() {
  85. return 0
  86. }
  87. ffbuild_ldexeflags() {
  88. return 0
  89. }
  90. ffbuild_unldexeflags() {
  91. return 0
  92. }
  93. ffbuild_ldflags() {
  94. return 0
  95. }
  96. ffbuild_unldflags() {
  97. return 0
  98. }
  99. ffbuild_libs() {
  100. return 0
  101. }
  102. ffbuild_unlibs() {
  103. return 0
  104. }