You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

преди 1 година
преди 4 години
преди 4 години
преди 1 година
преди 4 години
преди 1 година
преди 4 години
преди 4 години
преди 4 години
преди 1 година
преди 4 години
преди 1 година
преди 1 година
преди 4 години
преди 4 години
преди 1 година
123456789101112131415161718192021222324252627282930313233343536373839404142
  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