Skip to content

Instantly share code, notes, and snippets.

@irungentoo
Last active March 5, 2024 07:33
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save irungentoo/7011238 to your computer and use it in GitHub Desktop.
Save irungentoo/7011238 to your computer and use it in GitHub Desktop.
NOTE: DEPRECATED. Build script to cross compile Tox for windows with all of its dependencies.
#Note: This only works with mingw 3.0 or later (previous versions don't have pthreads)
#You need mingw 3.0 or later, yasm and cmake
#
#If you use something other than mingw-w64-i686 you must modify the script accordingly
#
#If you are on ubuntu 13.10:
#sudo apt-get install gcc-mingw-w64-i686 yasm cmake
mkdir prefix
cd prefix
PREFIX_DIR=$(pwd)
cd ..
mkdir bin
cd bin
BIN_DIR=$(pwd)
cd ..
git clone git://github.com/jedisct1/libsodium.git
cd libsodium
./autogen.sh
./configure --host=i686-w64-mingw32 --prefix="$PREFIX_DIR" --enable-shared=no
make -j3
#make check -j3
make install
make clean
cd ..
wget http://downloads.xiph.org/releases/opus/opus-1.0.3.tar.gz
tar xzvf opus-1.0.3.tar.gz
cd opus-1.0.3
./configure --host=i686-w64-mingw32 --prefix="$PREFIX_DIR" --disable-shared
make -j3
make install
make distclean
cd ..
git clone --depth 1 http://git.chromium.org/webm/libvpx.git
cd libvpx
CROSS=i686-w64-mingw32- ./configure --target=x86-win32-gcc --prefix="$PREFIX_DIR" --disable-examples
make -j3
make install
make clean
cd ..
wget http://kcat.strangesoft.net/openal-releases/openal-soft-1.15.1.tar.bz2
tar xvjf openal-soft-1.15.1.tar.bz2
cd openal-soft-1.15.1
cd build
echo "# the name of the target operating system
SET(CMAKE_SYSTEM_NAME Windows)
# which compilers to use for C and C++
SET(CMAKE_C_COMPILER i686-w64-mingw32-gcc)
SET(CMAKE_CXX_COMPILER i686-w64-mingw32-g++)
SET(CMAKE_RC_COMPILER i686-w64-mingw32-windres)
# here is the target environment located
SET(CMAKE_FIND_ROOT_PATH $PREFIX_DIR)
# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)" > ./Toolchain-i686-w64-mingw32.cmake
cmake .. -DCMAKE_TOOLCHAIN_FILE=./Toolchain-i686-w64-mingw32.cmake -DCMAKE_PREFIX_PATH="$PREFIX_DIR" -DCMAKE_INSTALL_PREFIX="$PREFIX_DIR"
make -j3
make install
make clean
cd ..
cd ..
wget http://www.libsdl.org/release/SDL-1.2.15.tar.gz
tar xzvf SDL-1.2.15.tar.gz
cd SDL-1.2.15
./configure --host=i686-w64-mingw32 --prefix="$PREFIX_DIR" --enable-shared=no
make -j3
make install
make clean
cd ..
git clone --depth 1 git://source.ffmpeg.org/ffmpeg
cd ffmpeg
PKG_CONFIG_PATH="$PREFIX_DIR/lib/pkgconfig" ./configure --extra-cflags="-I$PREFIX_DIR/include" --extra-ldflags="-L$PREFIX_DIR/lib" --arch=x86 --target-os=mingw32 --cross-prefix=i686-w64-mingw32- --prefix="$PREFIX_DIR" --bindir="$BIN_DIR" --enable-libvpx --enable-libopus --pkg-config=pkg-config
make -j3
make install
make distclean
cd ..
git clone https://github.com/irungentoo/ProjectTox-Core.git
cd ProjectTox-Core
./autogen.sh
./configure --with-dependency-search="$PREFIX_DIR" --host=i686-w64-mingw32 --prefix="$PREFIX_DIR" --bindir="$BIN_DIR" --disable-ntox --disable-dht-bootstrap-daemon --disable-tests --enable-shared=no
make -j3
make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment