Преглед изворни кода

Rewrite the windows build script

tags/v1.8.0
Xerbo пре 4 година
родитељ
комит
ad3b9ed0ed
2 измењених фајлова са 33 додато и 32 уклоњено
  1. +32
    -31
      build_windows.sh
  2. +1
    -1
      cmake/FindLibSndFile.cmake

+ 32
- 31
build_windows.sh Прегледај датотеку

@@ -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

+ 1
- 1
cmake/FindLibSndFile.cmake Прегледај датотеку

@@ -1,7 +1,7 @@
# Find libsndfile
FIND_PATH(LIBSNDFILE_INCLUDE_DIR sndfile.h)

SET(LIBSNDFILE_NAMES ${LIBSNDFILE_NAMES} sndfile libsndfile libsndfile-1)
SET(LIBSNDFILE_NAMES ${LIBSNDFILE_NAMES} sndfile libsndfile)
FIND_LIBRARY(LIBSNDFILE_LIBRARY NAMES ${LIBSNDFILE_NAMES} PATH)

IF(LIBSNDFILE_INCLUDE_DIR AND LIBSNDFILE_LIBRARY)


Loading…
Откажи
Сачувај