Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 
 

43 řádky
1.6 KiB

  1. #!/usr/bin/env bash
  2. # Cross compile for Windows from Linux
  3. set -e
  4. TEMP_PATH="$(pwd)/winpath"
  5. BUILD_DIR="winbuild"
  6. # Build zlib from source
  7. if [ ! -d "zlib" ]; then
  8. git clone -b v1.2.13 https://github.com/madler/zlib && cd zlib
  9. cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain-mingw32.cmake -DCMAKE_INSTALL_PREFIX=$TEMP_PATH
  10. cmake --build build -j$(nproc)
  11. cmake --build build --target install
  12. cd ..
  13. fi
  14. # Build libpng from source
  15. if [ ! -d "libpng" ]; then
  16. git clone -b v1.6.39 https://github.com/glennrp/libpng && cd libpng
  17. cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain-mingw32.cmake -DCMAKE_INSTALL_PREFIX=$TEMP_PATH
  18. cmake --build build -j$(nproc)
  19. cmake --build build --target install
  20. cd ..
  21. fi
  22. # Download libsndfile
  23. if [ ! -d libsndfile-1.2.0-win64 ]; then
  24. wget https://github.com/libsndfile/libsndfile/releases/download/1.2.0/libsndfile-1.2.0-win64.zip
  25. unzip libsndfile-1.2.0-win64.zip
  26. cp "libsndfile-1.2.0-win64/bin/sndfile.dll" $TEMP_PATH/bin
  27. cp "libsndfile-1.2.0-win64/include/sndfile.h" $TEMP_PATH/include
  28. cp "libsndfile-1.2.0-win64/lib/sndfile.lib" $TEMP_PATH/lib
  29. fi
  30. # Copy required GCC libs
  31. cp $(find /usr | grep libgcc_s_seh-1.dll | head -n 1) $TEMP_PATH/bin
  32. cp $(find /usr | grep libwinpthread-1.dll | head -n 1) $TEMP_PATH/bin
  33. # Build aptdec
  34. cmake -B $BUILD_DIR -DCMAKE_BUILD_TYPE=$1 -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-mingw32.cmake -DCMAKE_INSTALL_PREFIX=$TEMP_PATH
  35. cmake --build $BUILD_DIR -j$(nproc)
  36. cmake --build $BUILD_DIR --target package