Skip to content

Instantly share code, notes, and snippets.

@irungentoo
Last active January 4, 2016 07:39
Show Gist options
  • Save irungentoo/8590007 to your computer and use it in GitHub Desktop.
Save irungentoo/8590007 to your computer and use it in GitHub Desktop.
NOTE: DEPRECATED. Script to statically cross compile https://github.com/nurupo/ProjectTox-Qt-GUI for windows from linux.
#You need mingw with gcc version 4.7 or higher because ProjectTox-Qt-GUI uses C++11
#change WINDOWS_TOOLCHAIN from i686-w64-mingw32 to whatever your toolchain is.
WINDOWS_TOOLCHAIN=i686-w64-mingw32
mkdir prefix
cd prefix
PREFIX_DIR=$(pwd)
cd ..
wget http://mirror.csclub.uwaterloo.ca/qtproject/official_releases/qt/5.2/5.2.0/single/qt-everywhere-opensource-src-5.2.0.tar.xz
tar xvf qt-everywhere-opensource-src-5.2.0.tar.xz
cd qt-everywhere-opensource-src-5.2.0
./configure -xplatform win32-g++ -device-option CROSS_COMPILE="$WINDOWS_TOOLCHAIN"- -static -release -opensource -confirm-license -prefix $PREFIX_DIR -nomake examples -nomake tools -skip translations -skip doc -nomake tests -no-openssl -no-dbus -skip webkit -skip webkit-examples -no-icu
make -j3
make -j3 install
#make clean #this is way too long
cd ..
git clone git://github.com/jedisct1/libsodium.git
cd libsodium
./autogen.sh
./configure --host="$WINDOWS_TOOLCHAIN" --prefix="$PREFIX_DIR" --enable-shared=no
make -j3
#make check -j3
make install
make clean
cd ..
git clone --recursive https://github.com/nurupo/ProjectTox-Qt-GUI.git
cd ProjectTox-Qt-GUI
echo "diff --git a/projectfiles/QtCreator/TOX-Qt-GUI.pro b/projectfiles/QtCreator/TOX-Qt-GUI.pro
index 717e331..d67d274 100644
--- a/projectfiles/QtCreator/TOX-Qt-GUI.pro
+++ b/projectfiles/QtCreator/TOX-Qt-GUI.pro
@@ -36,18 +36,7 @@ TEMPLATE = app
CONFIG += c++11
INCLUDEPATH += ../../src/ ../../submodules/ProjectTox-Core/toxcore/
-win32:INCLUDEPATH += ../../libs/sodium/include/
-macx:INCLUDEPATH += /usr/local/include
-
-win32 {
- LIBS += -lWS2_32 ../../libs/sodium/lib/libsodium.a
-} else {
- macx {
- LIBS += -L/usr/local/lib -lsodium
- } else {
- LIBS += -lsodium
- }
-}
+LIBS += -lsodium -static-libgcc
win32:DEFINES += WIN32
diff --git a/resources/win32_appicon.rc b/resources/win32_appicon.rc
index b26bc34..50014b8 100644
--- a/resources/win32_appicon.rc
+++ b/resources/win32_appicon.rc
@@ -1 +1 @@
-IDI_ICON1 ICON DISCARDABLE \"icons\\\\icon.ico\"
\ No newline at end of file
+IDI_ICON1 ICON DISCARDABLE \"icons/icon.ico\"
\ No newline at end of file
--
1.8.3.2" > fix.patch
patch -p1 < fix.patch
mkdir build && cd build
"$PREFIX_DIR"/bin/qmake -Wall ../projectfiles/QtCreator/TOX-Qt-GUI.pro
make -j3
#cp release/TOX-Qt-GUI.exe /whatever/dir/to/shove/it/to
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment