From 53bbdcfa1618644a64375158d67dc167b7baa8f7 Mon Sep 17 00:00:00 2001 From: Taner Sener Date: Sun, 25 Sep 2022 20:20:42 +0100 Subject: [PATCH] add the source link to the bundles --- android.sh | 10 +++++++--- scripts/function-apple.sh | 4 ++++ scripts/function-linux.sh | 28 +++++++++++++++++++++++++--- tools/source/SOURCE | 14 ++++++++++++++ 4 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 tools/source/SOURCE diff --git a/android.sh b/android.sh index 73a9b77..3658367 100755 --- a/android.sh +++ b/android.sh @@ -289,7 +289,7 @@ if [[ -n ${ANDROID_ARCHITECTURES} ]]; then cd "${BASEDIR}"/android 1>>"${BASEDIR}"/build.log 2>&1 || exit 1 - # COPY LIBRARY LICENSES + # COPY EXTERNAL LIBRARY LICENSES LICENSE_BASEDIR="${BASEDIR}"/android/ffmpeg-kit-android-lib/src/main/res/raw rm -f "${LICENSE_BASEDIR}"/*.txt 1>>"${BASEDIR}"/build.log 2>&1 || exit 1 for library in {0..49}; do @@ -331,13 +331,17 @@ if [[ -n ${ANDROID_ARCHITECTURES} ]]; then # COPY LIBRARY LICENSES if [[ ${GPL_ENABLED} == "yes" ]]; then - cp "${BASEDIR}"/LICENSE.GPLv3 "${LICENSE_BASEDIR}"/license.txt 1>>"${BASEDIR}"/build.log 2>&1 + cp "${BASEDIR}"/LICENSE.GPLv3 "${LICENSE_BASEDIR}"/license.txt 1>>"${BASEDIR}"/build.log 2>&1 || exit 1 else - cp "${BASEDIR}"/LICENSE.LGPLv3 "${LICENSE_BASEDIR}"/license.txt 1>>"${BASEDIR}"/build.log 2>&1 + cp "${BASEDIR}"/LICENSE.LGPLv3 "${LICENSE_BASEDIR}"/license.txt 1>>"${BASEDIR}"/build.log 2>&1 || exit 1 fi echo -e "DEBUG: Copied the ffmpeg-kit license successfully\n" 1>>"${BASEDIR}"/build.log 2>&1 + overwrite_file "${BASEDIR}"/tools/source/SOURCE "${LICENSE_BASEDIR}"/source.txt 1>>"${BASEDIR}"/build.log 2>&1 || exit 1 + + echo -e "DEBUG: Copied source.txt successfully\n" 1>>"${BASEDIR}"/build.log 2>&1 + # BUILD NATIVE LIBRARY if [[ ${SKIP_ffmpeg_kit} -ne 1 ]]; then if [ "$(is_darwin_arm64)" == "1" ]; then diff --git a/scripts/function-apple.sh b/scripts/function-apple.sh index 9428732..c47a01b 100755 --- a/scripts/function-apple.sh +++ b/scripts/function-apple.sh @@ -326,6 +326,8 @@ create_ffmpeg_kit_universal_library() { cp "${BASEDIR}"/LICENSE.LGPLv3 "${FFMPEG_KIT_UNIVERSAL_LIBRARY_DIRECTORY}"/LICENSE 1>>"${BASEDIR}"/build.log 2>&1 || exit 1 fi + cp "${BASEDIR}"/tools/source/SOURCE "${FFMPEG_KIT_UNIVERSAL_LIBRARY_DIRECTORY}"/SOURCE 1>>"${BASEDIR}"/build.log 2>&1 || exit 1 + echo -e "DEBUG: ${LIBRARY_NAME} universal library built for $(get_apple_architecture_variant "${ARCHITECTURE_VARIANT}") platform successfully\n" 1>>"${BASEDIR}"/build.log 2>&1 } @@ -508,6 +510,8 @@ create_ffmpeg_kit_framework() { cp "${BASEDIR}/LICENSE.LGPLv3" "${FFMPEG_KIT_FRAMEWORK_RESOURCE_PATH}/LICENSE" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1 fi + cp "${BASEDIR}/tools/source/SOURCE" "${FFMPEG_KIT_FRAMEWORK_RESOURCE_PATH}/SOURCE" 1>>"${BASEDIR}"/build.log 2>&1 || exit 1 + # COPYING STRIP SCRIPT FOR SHARED LIBRARY cp ${BASEDIR}/tools/apple/strip-frameworks.sh ${FFMPEG_KIT_FRAMEWORK_RESOURCE_PATH} 1>>${BASEDIR}/build.log 2>&1 || exit 1 diff --git a/scripts/function-linux.sh b/scripts/function-linux.sh index b2a6518..679c979 100755 --- a/scripts/function-linux.sh +++ b/scripts/function-linux.sh @@ -154,7 +154,7 @@ create_linux_bundle() { install_pkg_config_file "libavutil.pc" install_pkg_config_file "ffmpeg-kit.pc" - # COPY LIBRARY LICENSES + # COPY EXTERNAL LIBRARY LICENSES LICENSE_BASEDIR="${BASEDIR}/prebuilt/$(get_bundle_directory)/ffmpeg-kit/lib" rm -f "${LICENSE_BASEDIR}"/*.txt 1>>"${BASEDIR}"/build.log 2>&1 || exit 1 for library in {0..49}; do @@ -174,13 +174,35 @@ create_linux_bundle() { fi done + # COPY CUSTOM LIBRARY LICENSES + for custom_library_index in "${CUSTOM_LIBRARIES[@]}"; do + library_name="CUSTOM_LIBRARY_${custom_library_index}_NAME" + relative_license_path="CUSTOM_LIBRARY_${custom_library_index}_LICENSE_FILE" + + destination_license_path="${LICENSE_BASEDIR}/license_${!library_name}.txt" + + cp "${BASEDIR}/src/${!library_name}/${!relative_license_path}" "${destination_license_path}" 1>>"${BASEDIR}"/build.log 2>&1 + + RC=$? + + if [[ ${RC} -ne 0 ]]; then + echo -e "DEBUG: Failed to copy the license file of custom library ${!library_name}\n" 1>>"${BASEDIR}"/build.log 2>&1 + echo -e "failed\n\nSee build.log for details\n" + exit 1 + fi + + echo -e "DEBUG: Copied the license file of custom library ${!library_name} successfully\n" 1>>"${BASEDIR}"/build.log 2>&1 + done + # COPY LIBRARY LICENSES if [[ ${GPL_ENABLED} == "yes" ]]; then - cp "${BASEDIR}"/LICENSE.GPLv3 "${LICENSE_BASEDIR}"/license.txt 1>>"${BASEDIR}"/build.log 2>&1 + cp "${BASEDIR}"/LICENSE.GPLv3 "${LICENSE_BASEDIR}"/license.txt 1>>"${BASEDIR}"/build.log 2>&1 || exit 1 else - cp "${BASEDIR}"/LICENSE.LGPLv3 "${LICENSE_BASEDIR}"/license.txt 1>>"${BASEDIR}"/build.log 2>&1 + cp "${BASEDIR}"/LICENSE.LGPLv3 "${LICENSE_BASEDIR}"/license.txt 1>>"${BASEDIR}"/build.log 2>&1 || exit 1 fi + cp "${BASEDIR}"/tools/source/SOURCE "${LICENSE_BASEDIR}"/source.txt 1>>"${BASEDIR}"/build.log 2>&1 || exit 1 + echo -e "DEBUG: Copied the ffmpeg-kit license successfully\n" 1>>"${BASEDIR}"/build.log 2>&1 } diff --git a/tools/source/SOURCE b/tools/source/SOURCE new file mode 100644 index 0000000..53af6e9 --- /dev/null +++ b/tools/source/SOURCE @@ -0,0 +1,14 @@ +The source code of "FFmpegKit", "FFmpeg" and external libraries enabled within +"FFmpeg" for this release can be downloaded from +https://github.com/tanersener/ffmpeg-kit/wiki/Source page. + +If you want to receive the source code on physical media submit your request +to "open-source@arthenica.com" email address. + +Your request should include "FFmpegKit" version, "FFmpegKit" platform, your +name, your company name, your mailing address, the phone number and the date +you started using "FFmpegKit". + +Note that we may charge you a fee to cover physical media printing and +shipping costs. Your request must be sent within the first three years of the +date you received "FFmpegKit" with "GPL v3.0" license.