diff --git a/.gitignore b/.gitignore index dabee98..6f53e76 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,8 @@ -/ffmpeg* -/libav* -build_*/ -sdk-*/ -sysroot +/ffmpeg* +/FFmpeg* +/libav* +build_*/ +sdk-*/ +sysroot +/winsdk* +/msvc* \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 349c9aa..51ceb1d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,274 +1,273 @@ -language: cpp -sudo: false -dist: trusty -cache: - apt: true - directories: - - ffmpeg-$FF_VERSION - - android-ndk-${NDK_VERSION}/platforms/android-{16,21} - - android-ndk-${NDK_VERSION}/toolchains/llvm - - android-ndk-${NDK_VERSION}/toolchains/aarch64-linux-android-4.9 - - android-ndk-${NDK_VERSION}/toolchains/arm-linux-androideabi-4.9 - - android-ndk-${NDK_VERSION}/toolchains/x86-4.9 -# TODO: libav - -git: - submodules: true - -matrix: - include: - - os: osx - compiler: clang - env: - - TARGET=raspberry-pi - - CC_VENDOR=apple - - os: osx - compiler: clang - osx_image: xcode10 - env: - - TARGET=host - - os: osx - compiler: clang - osx_image: xcode10 - env: - - TARGET=iOS - - os: linux - compiler: clang - env: - - TARGET=windows-desktop - - _CC=clang-8 - addons: #can be used in matrix, but required by every combination - apt: - sources: - - llvm-toolchain-trusty - - ubuntu-toolchain-r-test # llvm6.0 dep - packages: - - clang - - lld - - sshpass - - p7zip-full - - nasm - - yasm - - os: linux - compiler: clang - env: - - TARGET=windows-desktop - - _CC=clang-8 - - LIB_OPT=--enable-static - - ARCHS="x86 x64 arm64" - addons: #can be used in matrix, but required by every combination - apt: - sources: - - llvm-toolchain-trusty - - ubuntu-toolchain-r-test # llvm6.0 dep - packages: - - clang - - lld - - sshpass - - p7zip-full - - nasm - - yasm - - os: linux - compiler: clang - env: - - TARGET=windows-store - - _CC=clang-8 - - LIB_OPT=--enable-static - - ARCHS="x64 arm arm64" - addons: #can be used in matrix, but required by every combination - apt: - sources: - - llvm-toolchain-trusty - - ubuntu-toolchain-r-test # llvm6.0 dep - packages: - - clang - - lld - - sshpass - - p7zip-full - - nasm - - yasm - addons: #can be used in matrix, but required by every combination - apt: - sources: - - llvm-toolchain-trusty - - ubuntu-toolchain-r-test # llvm6.0 dep - packages: - - clang - - lld - - sshpass - - p7zip-full - - nasm - - yasm - - os: linux - compiler: clang - env: - - TARGET=raspberry-pi - - _CC=clang-8 - addons: #can be used in matrix, but required by every combination - apt: - sources: - - llvm-toolchain-trusty - - ubuntu-toolchain-r-test # llvm6.0 dep - packages: - - clang - - lld - - sshpass - - os: linux - compiler: clang - env: - - TARGET=sunxi - - _CC=clang-8 - addons: #can be used in matrix, but required by every combination - apt: - sources: - - llvm-toolchain-trusty - - ubuntu-toolchain-r-test # llvm6.0 dep - packages: - - clang - - lld - - sshpass - - os: linux - compiler: clang # host compiler is not used, just to tell build script to use which compiler to use from ndk. env: CC/CXX - env: - - TARGET=android - addons: #can be used in matrix, but required by every combination - apt: - packages: - - p7zip-full - - nasm - - yasm - - sshpass - - os: linux - compiler: gcc - env: - - TARGET=host - - _CC=gcc-8 #--cc=$_CC - addons: #can be used in matrix, but required by every combination - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - gcc-8 # gcc-8-multilib - - libstdc++-8-dev #libmfx - - p7zip-full - - nasm - - yasm - - libva-dev - - libvdpau-dev - - sshpass - - os: linux - compiler: clang - env: - - TARGET=host - - _CC=clang-8 #--cc=$_CC TODO: override CC - addons: #can be used in matrix, but required by every combination - apt: - sources: - - llvm-toolchain-trusty - - ubuntu-toolchain-r-test #libstdc++ - packages: - - clang - - lld - - libstdc++-8-dev #libmfx - - p7zip-full - - nasm - - yasm - - libva-dev - - libvdpau-dev - - sshpass - -before_install: - - $CC -v - - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update --all; fi -install: - - | - if [ "$TRAVIS_OS_NAME" == "osx" ]; then - xcrun --show-sdk-version - if [ "$TARGET" != "host" -a "$TARGET" != "iOS" ]; then EXTRA_BREW=llvm; fi - brew install ${EXTRA_BREW} nasm yasm perl hudochenkov/sshpass/sshpass xz p7zip - fi - - | - if [ "${TARGET:0:3}" == "win" ]; then - lld -flavor gnu -v - wget https://sourceforge.net/projects/avbuild/files/dep/msvcrt-dev.7z/download -O msvcrt-dev.7z - wget https://sourceforge.net/projects/avbuild/files/dep/winsdk.7z/download -O winsdk.7z - 7z x msvcrt-dev.7z &>/dev/null - export VCDIR=$PWD/msvcrt-dev - 7z x winsdk.7z &>/dev/null - ./winsdk/lowercase.sh - export WindowsSDKVersion=$(cat winsdk/.version) - export WindowsSdkDir=$PWD/winsdk - export PKG_CONFIG_PATH_MFX=$PWD/tools/ClangCL/lib/pkgconfig - fi - - | - if [ "$FF_VERSION" == "git" ]; then - if [ -f ffmpeg-${FF_VERSION}/configure ]; then - cd ffmpeg-${FF_VERSION} - git reset --hard HEAD - git fetch - git checkout origin/wang - cd - - else - git clone --depth 1 --no-tags -b wang https://github.com/wang-bin/FFmpeg.git ffmpeg-${FF_VERSION} - fi - fi - - | - if [ ! -f ffmpeg-${FF_VERSION}/configure ]; then - wget http://ffmpeg.org/releases/ffmpeg-${FF_VERSION}.tar.bz2 - tar jxf ffmpeg-${FF_VERSION}.tar.bz2 - fi - - | - if [ "${TARGET:0:7}" == "android" -a ! -f android-ndk-${NDK_VERSION}/ndk-build ]; then - wget https://dl.google.com/android/repository/android-ndk-${NDK_VERSION}-linux-x86_64.zip 2>/dev/null - 7z x -y android-ndk-${NDK_VERSION}-linux-x86_64.zip >/dev/null - fi - - | - if [ "$TRAVIS_OS_NAME" == "linux" -a "$TARGET" == "host" -o "$TARGET" == "windows-desktop" ]; then - wget https://sourceforge.net/projects/avbuild/files/dep/libmfx.7z/download -O libmfx.7z - 7z x -y libmfx.7z -otools &>/dev/null - if [ "$TARGET" == "host" ]; then - export PKG_CONFIG_PATH_MFX=$PWD/tools/linux64-gcc/lib/pkgconfig - fi - fi - - | - if [ "$TARGET" == "raspberry-pi" -o "$TARGET" == "sunxi" ]; then - wget https://sourceforge.net/projects/avbuild/files/$TARGET/${TARGET/r*pi/rpi}-sysroot.tar.xz/download -O sysroot.tar.xz - tar Jxf sysroot.tar.xz - export SYSROOT=$PWD/sysroot - fi - -script: - - export FFSRC=$PWD/ffmpeg-${FF_VERSION} - - export ANDROID_NDK=$PWD/android-ndk-${NDK_VERSION} - - if [ -n "$_CC" ]; then export USER_OPT="$USER_OPT --cc=$_CC"; fi # host build - - if [ -n "${CONFIG_SUFFIX}" ]; then ln -sf config{${CONFIG_SUFFIX},}.sh; fi - - USE_TOOLCHAIN=${_CC:-$CC} ./avbuild.sh $TARGET "$ARCHS" # CC(gcc/clang) is set by travis depending on compiler - -after_success: - - TARGET_OS=${TARGET} - - TARGET_OS=${TARGET_OS/#host/${TRAVIS_OS_NAME}} - - TARGET_OS=${TARGET_OS/#osx/macOS} - - SUFFIX=${TARGET_OS/%android/$TARGET_OS-$CC_VENDOR$CC} - - SUFFIX=${SUFFIX/%linux/$SUFFIX-$CC_VENDOR$CC} - - SUFFIX=${SUFFIX/%windows*/$SUFFIX-$CC_VENDOR$CC} - - SUFFIX=${SUFFIX/%raspberry-pi/$SUFFIX-$CC_VENDOR$CC} - - SUFFIX=${SUFFIX/%sunxi/$SUFFIX-$CC_VENDOR$CC} - - SUFFIX=${SUFFIX}${LIB_OPT//*-/-}${CONFIG_SUFFIX} - - mv sdk* ffmpeg-${FF_VERSION}-${SUFFIX} - - tar Jcf ffmpeg-${FF_VERSION}-${SUFFIX}{.tar.xz,} - - ls -hl ffmpeg-${FF_VERSION}-${SUFFIX}.tar.xz - - sshpass -p $SF_PW scp -o StrictHostKeyChecking=no ffmpeg-${FF_VERSION}-${SUFFIX}.tar.xz $SF_USER,avbuild@frs.sourceforge.net:/home/frs/project/a/av/avbuild/${TARGET_OS} - -branches: - only: - - master - - prelease - - ci - - /^travis.*$/ - -notifications: - email: - recipients: - - wbsecg1@gmail.com - on_success: change - on_failure: always +language: cpp +sudo: false +dist: trusty +cache: + apt: true + directories: + - ffmpeg-$FF_VERSION + - android-ndk-${NDK_VERSION}/platforms/android-{16,21} + - android-ndk-${NDK_VERSION}/toolchains/llvm + - android-ndk-${NDK_VERSION}/toolchains/aarch64-linux-android-4.9 + - android-ndk-${NDK_VERSION}/toolchains/arm-linux-androideabi-4.9 + - android-ndk-${NDK_VERSION}/toolchains/x86-4.9 +# TODO: libav + +git: + submodules: true + +matrix: + include: + - os: osx + compiler: clang + env: + - TARGET=raspberry-pi + - CC_VENDOR=apple + - os: osx + compiler: clang + osx_image: xcode10 + env: + - TARGET=host + - os: osx + compiler: clang + osx_image: xcode10 + env: + - TARGET=iOS + - os: linux + compiler: clang + env: + - TARGET=windows-desktop + - _CC=clang-8 + addons: #can be used in matrix, but required by every combination + apt: + sources: + - llvm-toolchain-trusty + - ubuntu-toolchain-r-test # llvm6.0 dep + packages: + - clang + - lld + - sshpass + - p7zip-full + - nasm + - yasm + - os: linux + compiler: clang + env: + - TARGET=windows-desktop + - _CC=clang-8 + - LIB_OPT=--enable-static + addons: #can be used in matrix, but required by every combination + apt: + sources: + - llvm-toolchain-trusty + - ubuntu-toolchain-r-test # llvm6.0 dep + packages: + - clang + - lld + - sshpass + - p7zip-full + - nasm + - yasm + - os: linux + compiler: clang + env: + - TARGET=windows-store + - _CC=clang-8 + - LIB_OPT=--enable-static + - ARCHS="x64 arm arm64" + addons: #can be used in matrix, but required by every combination + apt: + sources: + - llvm-toolchain-trusty + - ubuntu-toolchain-r-test # llvm6.0 dep + packages: + - clang + - lld + - sshpass + - p7zip-full + - nasm + - yasm + addons: #can be used in matrix, but required by every combination + apt: + sources: + - llvm-toolchain-trusty + - ubuntu-toolchain-r-test # llvm6.0 dep + packages: + - clang + - lld + - sshpass + - p7zip-full + - nasm + - yasm + - os: linux + compiler: clang + env: + - TARGET=raspberry-pi + - _CC=clang-8 + addons: #can be used in matrix, but required by every combination + apt: + sources: + - llvm-toolchain-trusty + - ubuntu-toolchain-r-test # llvm6.0 dep + packages: + - clang + - lld + - sshpass + - os: linux + compiler: clang + env: + - TARGET=sunxi + - _CC=clang-8 + addons: #can be used in matrix, but required by every combination + apt: + sources: + - llvm-toolchain-trusty + - ubuntu-toolchain-r-test # llvm6.0 dep + packages: + - clang + - lld + - sshpass + - os: linux + compiler: clang # host compiler is not used, just to tell build script to use which compiler to use from ndk. env: CC/CXX + env: + - TARGET=android + addons: #can be used in matrix, but required by every combination + apt: + packages: + - p7zip-full + - nasm + - yasm + - sshpass + - os: linux + compiler: gcc + env: + - TARGET=host + - _CC=gcc-8 #--cc=$_CC + addons: #can be used in matrix, but required by every combination + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - gcc-8 # gcc-8-multilib + - libstdc++-8-dev #libmfx + - p7zip-full + - nasm + - yasm + - libva-dev + - libvdpau-dev + - sshpass + - os: linux + compiler: clang + env: + - TARGET=host + - _CC=clang-8 #--cc=$_CC TODO: override CC + addons: #can be used in matrix, but required by every combination + apt: + sources: + - llvm-toolchain-trusty + - ubuntu-toolchain-r-test #libstdc++ + packages: + - clang + - lld + - libstdc++-8-dev #libmfx + - p7zip-full + - nasm + - yasm + - libva-dev + - libvdpau-dev + - sshpass + +before_install: + - $CC -v + - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update --all; fi +install: + - | + if [ "$TRAVIS_OS_NAME" == "osx" ]; then + xcrun --show-sdk-version + if [ "$TARGET" != "host" -a "$TARGET" != "iOS" ]; then EXTRA_BREW=llvm; fi + brew install ${EXTRA_BREW} nasm yasm perl hudochenkov/sshpass/sshpass xz p7zip + fi + - | + if [ "${TARGET:0:3}" == "win" ]; then + lld -flavor gnu -v + wget https://sourceforge.net/projects/avbuild/files/dep/msvcrt-dev.7z/download -O msvcrt-dev.7z + wget https://sourceforge.net/projects/avbuild/files/dep/winsdk.7z/download -O winsdk.7z + 7z x msvcrt-dev.7z &>/dev/null + export VCDIR=$PWD/msvcrt-dev + 7z x winsdk.7z &>/dev/null + ./winsdk/lowercase.sh + export WindowsSDKVersion=$(cat winsdk/.version) + export WindowsSdkDir=$PWD/winsdk + export PKG_CONFIG_PATH_MFX=$PWD/tools/ClangCL/lib/pkgconfig + fi + - | + if [ "$FF_VERSION" == "git" ]; then + if [ -f ffmpeg-${FF_VERSION}/configure ]; then + cd ffmpeg-${FF_VERSION} + git reset --hard HEAD + git fetch + git checkout origin/wang + cd - + else + git clone --depth 1 --no-tags -b wang https://github.com/wang-bin/FFmpeg.git ffmpeg-${FF_VERSION} + fi + fi + - | + if [ ! -f ffmpeg-${FF_VERSION}/configure ]; then + wget http://ffmpeg.org/releases/ffmpeg-${FF_VERSION}.tar.bz2 + tar jxf ffmpeg-${FF_VERSION}.tar.bz2 + fi + - | + if [ "${TARGET:0:7}" == "android" -a ! -f android-ndk-${NDK_VERSION}/ndk-build ]; then + wget https://dl.google.com/android/repository/android-ndk-${NDK_VERSION}-linux-x86_64.zip 2>/dev/null + 7z x -y android-ndk-${NDK_VERSION}-linux-x86_64.zip >/dev/null + fi + - | + if [ "$TRAVIS_OS_NAME" == "linux" -a "$TARGET" == "host" -o "$TARGET" == "windows-desktop" ]; then + wget https://sourceforge.net/projects/avbuild/files/dep/libmfx.7z/download -O libmfx.7z + 7z x -y libmfx.7z -otools &>/dev/null + if [ "$TARGET" == "host" ]; then + export PKG_CONFIG_PATH_MFX=$PWD/tools/linux64-gcc/lib/pkgconfig + fi + fi + - | + if [ "$TARGET" == "raspberry-pi" -o "$TARGET" == "sunxi" ]; then + wget https://sourceforge.net/projects/avbuild/files/$TARGET/${TARGET/r*pi/rpi}-sysroot.tar.xz/download -O sysroot.tar.xz + tar Jxf sysroot.tar.xz + export SYSROOT=$PWD/sysroot + fi + +script: + - export FFSRC=$PWD/ffmpeg-${FF_VERSION} + - export ANDROID_NDK=$PWD/android-ndk-${NDK_VERSION} + - if [ -n "$_CC" ]; then export USER_OPT="$USER_OPT --cc=$_CC"; fi # host build + - if [ -n "${CONFIG_SUFFIX}" ]; then ln -sf config{${CONFIG_SUFFIX},}.sh; fi + - USE_TOOLCHAIN=${_CC:-$CC} ./avbuild.sh $TARGET "$ARCHS" # CC(gcc/clang) is set by travis depending on compiler + +after_success: + - TARGET_OS=${TARGET} + - TARGET_OS=${TARGET_OS/#host/${TRAVIS_OS_NAME}} + - TARGET_OS=${TARGET_OS/#osx/macOS} + - SUFFIX=${TARGET_OS/%android/$TARGET_OS-$CC_VENDOR$CC} + - SUFFIX=${SUFFIX/%linux/$SUFFIX-$CC_VENDOR$CC} + - SUFFIX=${SUFFIX/%windows*/$SUFFIX-$CC_VENDOR$CC} + - SUFFIX=${SUFFIX/%raspberry-pi/$SUFFIX-$CC_VENDOR$CC} + - SUFFIX=${SUFFIX/%sunxi/$SUFFIX-$CC_VENDOR$CC} + - SUFFIX=${SUFFIX}${LIB_OPT//*-/-}${CONFIG_SUFFIX} + - mv sdk* ffmpeg-${FF_VERSION}-${SUFFIX} + - tar Jcf ffmpeg-${FF_VERSION}-${SUFFIX}{.tar.xz,} + - ls -hl ffmpeg-${FF_VERSION}-${SUFFIX}.tar.xz + - sshpass -p $SF_PW scp -o StrictHostKeyChecking=no ffmpeg-${FF_VERSION}-${SUFFIX}.tar.xz $SF_USER,avbuild@frs.sourceforge.net:/home/frs/project/a/av/avbuild/${TARGET_OS} + +branches: + only: + - master + - prelease + - ci + - /^travis.*$/ + +notifications: + email: + recipients: + - wbsecg1@gmail.com + on_success: change + on_failure: always diff --git a/appveyor.yml b/appveyor.yml index 4608700..0e4c971 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,102 +1,102 @@ -# can not have space before '&&', ')' when setting env var in multiple line commands -branches: - only: - - master - - prelease - - ci - - appveyor - -# https://www.appveyor.com/docs/build-environment/#using-multiple-images-for-the-same-build -# APPVEYOR_BUILD_WORKER_IMAGE is used in environment matrix, image is not -environment: - matrix: - - _CC: VS2017 - _PLATFORM: desktop - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - - _CC: VS2017 - _PLATFORM: store - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - - _CC: MINGW - _PLATFORM: desktop - _CACHE: msys64 - - _ARCH: arm - _CC: VS2013 - _PLATFORM: phone - - _ARCH: x86 - _CC: VS2013 - _PLATFORM: store - - _ARCH: x86 - _CC: VS2013 - _PLATFORM: desktop - -matrix: - fast_finish: false - -init: - - echo NUMBER_OF_PROCESSORS=%NUMBER_OF_PROCESSORS% - - echo PROCESSOR_IDENTIFIER=%PROCESSOR_IDENTIFIER% - - set MSYS2_PATH_TYPE=inherit - - set MSYS2_DIR=C:\msys64 - -#https://stackoverflow.com/questions/37627248/how-to-split-a-command-over-multiple-lines-in-appveyor-yml - -install: -# can not starts with % - - git submodule update --init - - if /i %_CC%==MinGW ( - C:\msys64\usr\bin\pacman -Syyuu --noconfirm && - C:\msys64\usr\bin\pacman -Suu --noconfirm && - C:\msys64\usr\bin\pacman -S --noconfirm --needed mingw-w64-i686-gcc mingw-w64-x86_64-gcc && - C:\msys64\usr\bin\pacman -Sc --noconfirm - ) - - C:\msys64\usr\bin\pacman -S --noconfirm --needed diffutils patch pkg-config nasm yasm - - if [%FF_VERSION%] == [git] ( - git clone --depth 1 --no-tags -b wang https://github.com/wang-bin/FFmpeg.git ffmpeg-%FF_VERSION% - ) - - if not exist ffmpeg-%FF_VERSION% ( - appveyor DownloadFile "http://ffmpeg.org/releases/ffmpeg-%FF_VERSION%.tar.xz" && - 7z x -y ffmpeg-%FF_VERSION%.tar.xz && - 7z x -y ffmpeg-%FF_VERSION%.tar > NUL - ) - - if /i %_PLATFORM%==desktop ( - appveyor DownloadFile "https://sourceforge.net/projects/avbuild/files/dep/libmfx.7z/download" -FileName libmfx.7z && - 7z x -y libmfx.7z -otools && - set PKG_CONFIG_PATH_MFX=%CD%\tools\%_CC%%_ARCH%\lib\pkgconfig) - -before_build: - - set HOME=%CD% - - set MSYSTEM=%_CC%%_ARCH% # ffmpeg configure refuses to build for mingw in pure msys. so we lie. MUST use upper case. ommited by msvc - - if not [%CONFIG_SUFFIX%]==[] copy /y config%CONFIG_SUFFIX%.sh config.sh - - set FFSRC=%CD%\ffmpeg-%FF_VERSION% - -build_script: -# V=1 to check libmfx error, but the error disappears if V=1. WTF - - if /i not %_CC%==MinGW if /i not %_PLATFORM%==store set V=1 - - if /i %_CC%==MinGW ( - set VC_BUILD=false&& - set MSYS2_PATH_TYPE=&& - C:\msys64\usr\bin\bash.exe --login avbuild.sh mingw - ) else ( - set BUILD_NOW=true&& - tools\vcbuild.bat %_CC% %_PLATFORM% %_ARCH% all - ) - -after_build: - - set SDK_NAME=ffmpeg-%FF_VERSION%-%_PLATFORM%-%_CC%%_ARCH%%CONFIG_SUFFIX% - - move sdk* %SDK_NAME% - - 7z a %SDK_NAME%.7z %SDK_NAME% - -test: off - -artifacts: - - path: '%SDK_NAME%.7z' # relative to repo root - -deploy: - provider: FTP - protocol: sftp - host: frs.sourceforge.net - username: novesky - password: - secure: 2mQg4oxdX8S7rMJz2TCGGg== - folder: /home/frs/project/avbuild/windows-%_PLATFORM% # why always relative path even if starts with / ? I have to make a link home/frs/project/avbuild/xxx => /home/frs/project/avbuild/xxx +# can not have space before '&&', ')' when setting env var in multiple line commands +branches: + only: + - master + - prelease + - ci + - appveyor + +# https://www.appveyor.com/docs/build-environment/#using-multiple-images-for-the-same-build +# APPVEYOR_BUILD_WORKER_IMAGE is used in environment matrix, image is not +environment: + matrix: + - _CC: VS2017 + _PLATFORM: desktop + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + - _CC: VS2017 + _PLATFORM: store + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + - _CC: MINGW + _PLATFORM: desktop + _CACHE: msys64 + - _ARCH: arm + _CC: VS2013 + _PLATFORM: phone + - _ARCH: x86 + _CC: VS2013 + _PLATFORM: store + - _ARCH: x86 + _CC: VS2013 + _PLATFORM: desktop + +matrix: + fast_finish: false + +init: + - echo NUMBER_OF_PROCESSORS=%NUMBER_OF_PROCESSORS% + - echo PROCESSOR_IDENTIFIER=%PROCESSOR_IDENTIFIER% + - set MSYS2_PATH_TYPE=inherit + - set MSYS2_DIR=C:\msys64 + +#https://stackoverflow.com/questions/37627248/how-to-split-a-command-over-multiple-lines-in-appveyor-yml + +install: +# can not starts with % + - git submodule update --init + - if /i %_CC%==MinGW ( + C:\msys64\usr\bin\pacman -Syyuu --noconfirm && + C:\msys64\usr\bin\pacman -Suu --noconfirm && + C:\msys64\usr\bin\pacman -S --noconfirm --needed mingw-w64-i686-gcc mingw-w64-x86_64-gcc && + C:\msys64\usr\bin\pacman -Sc --noconfirm + ) + - C:\msys64\usr\bin\pacman -S --noconfirm --needed diffutils patch pkg-config nasm yasm + - if [%FF_VERSION%] == [git] ( + git clone --depth 1 --no-tags -b wang https://github.com/wang-bin/FFmpeg.git ffmpeg-%FF_VERSION% + ) + - if not exist ffmpeg-%FF_VERSION% ( + appveyor DownloadFile "http://ffmpeg.org/releases/ffmpeg-%FF_VERSION%.tar.xz" && + 7z x -y ffmpeg-%FF_VERSION%.tar.xz && + 7z x -y ffmpeg-%FF_VERSION%.tar > NUL + ) + - if /i %_PLATFORM%==desktop ( + appveyor DownloadFile "https://sourceforge.net/projects/avbuild/files/dep/libmfx.7z/download" -FileName libmfx.7z && + 7z x -y libmfx.7z -otools && + set PKG_CONFIG_PATH_MFX=%CD%\tools\%_CC%%_ARCH%\lib\pkgconfig) + +before_build: + - set HOME=%CD% + - set MSYSTEM=%_CC%%_ARCH% # ffmpeg configure refuses to build for mingw in pure msys. so we lie. MUST use upper case. ommited by msvc + - if not [%CONFIG_SUFFIX%]==[] copy /y config%CONFIG_SUFFIX%.sh config.sh + - set FFSRC=%CD%\ffmpeg-%FF_VERSION% + +build_script: +# V=1 to check libmfx error, but the error disappears if V=1. WTF + - if /i not %_CC%==MinGW if /i not %_PLATFORM%==store set V=1 + - if /i %_CC%==MinGW ( + set VC_BUILD=false&& + set MSYS2_PATH_TYPE=&& + C:\msys64\usr\bin\bash.exe --login avbuild.sh mingw + ) else ( + set BUILD_NOW=true&& + tools\vcbuild.bat %_CC% %_PLATFORM% %_ARCH% all + ) + +after_build: + - set SDK_NAME=ffmpeg-%FF_VERSION%-%_PLATFORM%-%_CC%%_ARCH%%CONFIG_SUFFIX% + - move sdk* %SDK_NAME% + - 7z a %SDK_NAME%.7z %SDK_NAME% + +test: off + +artifacts: + - path: '%SDK_NAME%.7z' # relative to repo root + +deploy: + provider: FTP + protocol: sftp + host: frs.sourceforge.net + username: novesky + password: + secure: 2mQg4oxdX8S7rMJz2TCGGg== + folder: /home/frs/project/avbuild/windows-%_PLATFORM% # why always relative path even if starts with / ? I have to make a link home/frs/project/avbuild/xxx => /home/frs/project/avbuild/xxx active_mode: false \ No newline at end of file diff --git a/avbuild.sh b/avbuild.sh index 900e24f..ac1d8d7 100755 --- a/avbuild.sh +++ b/avbuild.sh @@ -392,6 +392,7 @@ echo PKG_CONFIG_PATH_MFX_UNIX=$PKG_CONFIG_PATH_MFX_UNIX PKG_CONFIG_PATH_MFX=$PKG # change static lib name to %.a. lld-link can be used by both msvc(%.lib) target and mingw(%.a) target, it's impossible to tell the static lib. check target os instead # LD_LIB: as dll/exe dependencies, default is 'lib%.a' for lld-link +# FIXME: affects vc build grep -q "patch win clang static lib" "$FFSRC/configure" || sed -i $sed_bak "/ win32|win64)/a\\ \ LIBPREF= # patch win clang static lib\\ \ LIBSUF=.lib\\ @@ -1273,7 +1274,7 @@ build_all(){ [ "${os:0:3}" == "rpi" -o "${os:0:9}" == "raspberry" ] && archs=(armv6zk armv7-a) [[ "$os" == "sunxi" ]] && archs=(armv7) [ "${os:0:5}" == "mingw" ] && archs=(x86 x86_64) - [ "${os:0:2}" == "vc" -o "${os:0:3}" == "win" ] && archs=(x86 x64) + [ "${os:0:2}" == "vc" -o "${os:0:3}" == "win" ] && archs=(x86 x64 arm64) [[ "${os:0:5}" == "winrt" || "${os:0:3}" == "uwp" || "$os" == win*store* || "$os" == win*phone* ]] && archs=(x86 x64 arm arm64) #[ "${os:0:5}" == "macos" ] && archs=(x86_64 i386) }