|
|
@@ -1,44 +1,45 @@ |
|
|
|
WINE_LIBSNDFILE_PATH=~/.wine/drive_c/Program\ Files/Mega-Nerd/libsndfile |
|
|
|
TEMP_PATH=/tmp/windows_build |
|
|
|
TEMP_PATH="$(pwd)/winpath" |
|
|
|
set -e |
|
|
|
|
|
|
|
# Compile zlib |
|
|
|
git clone https://github.com/madler/zlib && cd zlib |
|
|
|
mkdir build && cd build |
|
|
|
# Compile and build zlib |
|
|
|
if [ -d "zlib" ]; then |
|
|
|
cd zlib && git pull |
|
|
|
else |
|
|
|
git clone https://github.com/madler/zlib && cd zlib |
|
|
|
fi |
|
|
|
|
|
|
|
mkdir -p build && cd build |
|
|
|
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../../cmake/toolchain-mingw32.cmake -DCMAKE_INSTALL_PREFIX=$TEMP_PATH .. |
|
|
|
make -j4 |
|
|
|
make install |
|
|
|
cd ../../ |
|
|
|
cd ../.. |
|
|
|
|
|
|
|
# Clone and build ligpng |
|
|
|
if [ -d "libpng" ]; then |
|
|
|
cd libpng && git pull |
|
|
|
else |
|
|
|
git clone https://github.com/glennrp/libpng && cd libpng |
|
|
|
fi |
|
|
|
|
|
|
|
# Compile libpng |
|
|
|
git clone https://github.com/glennrp/libpng && cd libpng |
|
|
|
mkdir build && cd build |
|
|
|
mkdir -p build && cd build |
|
|
|
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../../cmake/toolchain-mingw32.cmake -DCMAKE_INSTALL_PREFIX=$TEMP_PATH .. |
|
|
|
make -j4 |
|
|
|
make install |
|
|
|
cd ../../ |
|
|
|
cd ../.. |
|
|
|
|
|
|
|
# Download libsndfile (compiling from source is an absolute bitch) |
|
|
|
if [[ ! -e $WINE_LIBSNDFILE_PATH ]]; then |
|
|
|
wget http://www.mega-nerd.com/libsndfile/files/libsndfile-1.0.28-w64-setup.exe |
|
|
|
echo "This build script has guessed that you don't have libsndfile installed under wine, the libsndfile installer will be launched" |
|
|
|
read |
|
|
|
wine libsndfile-1.0.28-w64-setup.exe |
|
|
|
# Download libsndfile |
|
|
|
if [ ! -d "libsndfile-1.0.29-win64" ]; then |
|
|
|
wget https://github.com/erikd/libsndfile/releases/download/v1.0.29/libsndfile-1.0.29-win64.zip |
|
|
|
unzip libsndfile-1.0.29-win64.zip |
|
|
|
fi |
|
|
|
if [[ ! -e $WINE_LIBSNDFILE_PATH ]]; then |
|
|
|
echo "Something went wrong installing libsndfile" |
|
|
|
exit |
|
|
|
fi |
|
|
|
|
|
|
|
cp "$WINE_LIBSNDFILE_PATH/lib/libsndfile-1.def" $TEMP_PATH/lib/libsndfile-1.def |
|
|
|
cp "$WINE_LIBSNDFILE_PATH/lib/libsndfile-1.lib" $TEMP_PATH/lib/libsndfile-1.lib |
|
|
|
cp "$WINE_LIBSNDFILE_PATH/lib/pkgconfig/sndfile.pc" $TEMP_PATH/lib/pkgconfig/sndfile.pc |
|
|
|
cp "$WINE_LIBSNDFILE_PATH/bin/libsndfile-1.dll" $TEMP_PATH/bin/libsndfile-1.dll |
|
|
|
cp "$WINE_LIBSNDFILE_PATH/include/sndfile.h" $TEMP_PATH/include/sndfile.h |
|
|
|
cp "libsndfile-1.0.29-win64/bin/sndfile.dll" $TEMP_PATH/bin/libsndfile-1.dll |
|
|
|
cp "libsndfile-1.0.29-win64/include/sndfile.h" $TEMP_PATH/include/sndfile.h |
|
|
|
|
|
|
|
sed -i "s/c:\/devel\/target\/libsndfile/$(echo $TEMP_PATH | sed 's/\//\\\//g')/g" $TEMP_PATH/lib/pkgconfig/sndfile.pc |
|
|
|
# Copy DLL's into root for CPack |
|
|
|
cp $TEMP_PATH/bin/*.dll ../ |
|
|
|
|
|
|
|
mkdir build && cd build |
|
|
|
# Build aptdec |
|
|
|
mkdir -p winbuild && cd winbuild |
|
|
|
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain-mingw32.cmake -DCMAKE_INSTALL_PREFIX=$TEMP_PATH .. |
|
|
|
cp $TEMP_PATH/bin/*.dll ./ |
|
|
|
|
|
|
|
echo "Done, you should have a executable called aptdec.exe" |
|
|
|
make -j 4 |
|
|
|
make package |