andre@0: /** @file INSTALL
andre@0: @brief Installation Instructions
andre@0: *******************************
andre@0: 
andre@0: For Debian based GNU / Linux
andre@0: ============================
andre@0: Tested development platform: Ubuntu 14.4 amd64.
andre@0: 
andre@0: Build dependencies are:
andre@65: 
andre@0:     build-essential cmake libqt5core5a qttools5-dev-tools qt5-default \
andre@69:     qtbase5-dev qtbase5-dev-tools qttools5-dev inkscape mercurial curl
andre@0: 
andre@0: This document expects the following setup for build and installation.
andre@0: It is recommended to set a custom installation prefix to avoid root
andre@0: privileges.
andre@0: 
andre@0:     export CUSTOM_PREFIX=<Prefix of your choice (default /usr)>
andre@0:     mkdir -p $CUSTOM_PREFIX/bin
andre@0:     export PATH=$CUSTOM_PREFIX/bin:$PATH
andre@0: 
andre@65: Configure the according Root CA if necessary:
andre@65: 
andre@65:     echo "[web]" >> ~/.hgrc
andre@65:     echo "cacerts=~/wald-ca.pem" >>  ~/.hgrc
andre@65:     curl https://ssl.intevation.de/Intevation-Root-CA-2010.crt > ~/wald-ca.pem
andre@65: 
andre@65: Checkout retraceit sources:
andre@65: 
andre@65:     hg clone https://wald.intevation.org/hg/retraceit/
andre@65: 
andre@0: Building the Software:
andre@65: 
andre@65:     cd retraceit
andre@0:     mkdir build-native
andre@0:     cd build-native
andre@0:     cmake .. -DCMAKE_PREFIX_PATH=$CUSTOM_PREFIX
andre@0: 
andre@0: For Microsoft Windows
andre@0: =====================
andre@0: The Windows variant should be cross compiled from a Debian based GNU/Linux
andre@0: system. The minimum requirement is Debian stable.
andre@0: 
andre@0: Tested development platform is Ubuntu 14.4
andre@0: 
andre@0: Dependencies on the Host system:
andre@0: 
andre@65:     git autoconf automake bash bison bzip2 \
andre@0:     cmake flex gettext git g++ intltool \
andre@0:     libffi-dev libtool libltdl-dev libssl-dev \
andre@0:     libxml-parser-perl make openssl patch perl \
andre@0:     pkg-config scons sed unzip curl xz-utils autopoint \
andre@78:     gperf ruby libtool qttools5-dev-tools
andre@73: 
andre@73: Under debian you might additionall need:
andre@73: 
andre@73:     libtool-bin
andre@0: 
andre@0: Build the windows binaries:
andre@0: 
andre@0:     MXEPATH=$CUSTOM_PREFIX/win
andre@0:     git clone https://github.com/Intevation/mxe.git $MXEPATH
andre@0:     cd $MXEPATH
andre@73:     git checkout retraceit
andre@0:     echo "MXE_TARGETS := i686-w64-mingw32.static" > settings.mk
andre@0:     make qtbase
andre@0: 
andre@0: Add CMAKE_STRIP to the toolchain file:
andre@0: 
andre@0:     echo "set(CMAKE_STRIP $MXEPATH/usr/bin/i686-w64-mingw32.static-strip)" >> \
andre@0:         "$MXEPATH/usr/i686-w64-mingw32.static/share/cmake/mxe-conf.cmake"
andre@0: 
andre@76: Workaround Qt CMake Bugs:
andre@76: 
andre@76:     find $MXEPATH/usr/i686-w64-mingw32.static/qt5/lib/cmake -name \*.cmake | \
andre@76:         xargs sed -i 's/\/\([a-z]*\)\.lib/\/lib\1\.a/g'
andre@78:     sed -i 's@^_qt5gui_find_extra_libs.*@@' \
andre@76:         $MXEPATH/usr/i686-w64-mingw32.static/qt5/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake
andre@76: 
andre@74: Compile the software (assuming the source code is already checked out. If not
andre@74: please refer to the GNU/Linux build documentation how to obtain the source
andre@74: code):
andre@0: 
andre@74:     cd <Path-to-retraceit-source>
andre@0:     mkdir build-windows
andre@0:     cd build-windows
andre@0:     MXETARGET=$MXEPATH/usr/i686-w64-mingw32.static/
andre@0:     cmake .. \
andre@0:         -DCMAKE_PREFIX_PATH="$MXETARGET/qt5;$MXETARGET;" \
andre@0:         -DCMAKE_TOOLCHAIN_FILE="$MXETARGET/share/cmake/mxe-conf.cmake" \
andre@0:         -DCMAKE_VERBOSE_MAKEFILE=True
andre@65:     make
andre@65: 
andre@65: The binary is created under:
andre@65: 
andre@65:     build-windows/src/retraceit.exe
andre@65: 
andre@65: This binary can be compressed with UPX or directly used. Without further
andre@65: dependencies.
andre@57: 
andre@57: For MacOSX
andre@57: ==========
andre@57: Install the usual development tools / xcode.
andre@57: 
andre@57: Define some paths for the build environment:
andre@57: 
andre@65:     export CUSTOM_PREFIX=~/retraceit
andre@57: 
andre@65:     export PATH=$CUSTOM_PREFIX/bin:$PATH
andre@65:     export DYLD_LIBRARY_PATH=$CUSTOM_PREFIX/lib:$DYLD_LIBRARY_PATH
andre@65:     export PKG_CONFIG_PATH=$CUSTOM_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH
andre@57: 
andre@57: Download qt:
andre@57: 
andre@57:     curl -O http://qt-mirror.dannhauer.de/official_releases/qt/5.3/5.3.2/single/qt-everywhere-opensource-src-5.3.2.tar.xz
andre@57:     shasum qt-everywhere-opensource-src-5.3.2.tar.xz
andre@57: 
andre@57: Should match: fb156a87a193c9a7a2fa51efc89660a3b619ace5
andre@57: 
andre@57: Build and extract:
andre@57: 
andre@57:     tar -xf qt-everywhere-opensource-src-5.3.2.tar.xz
andre@57:     cd qt-everywhere-opensource-src-5.3.2/qtbase
andre@57: 
andre@57:     ./configure \
andre@57:        -release  -nomake tests  -nomake examples  -confirm-license \
andre@57:        -static -no-cups -no-nis -no-icu -no-fontconfig -qt-freetype \
andre@57:        -no-directfb -no-kms -no-openssl -no-glib \
andre@57:        -no-nis -no-libjpeg -qt-libpng \
andre@57:        -qt-zlib -no-gif -no-xinput2 -opensource -confirm-license \
andre@57:        -prefix $CUSTOM_PREFIX -no-framework
andre@57: 
andre@70:     make -j `sysctl -n hw.ncpu`
andre@57:     make install
andre@57: 
andre@71:     cd .. && \
andre@71:     cd qttools/src/designer/src/uitools && \
andre@71:     qmake && \
andre@71:     make -j `sysctl -n hw.ncpu` && \
andre@71:     make install
andre@71: 
andre@71:     cd ../../../linguist && \
andre@71:     qmake && \
andre@71:     make -j `sysctl -n hw.ncpu` && \
andre@71:     make install
andre@71: 
andre@71: 
andre@57: Download mercurial:
andre@65: 
andre@57:     wget https://mercurial.selenic.com/mac/binaries/Mercurial-3.4-py2.7-macosx10.10.zip
andre@57:     shasum Mercurial-3.4-py2.7-macosx10.10.zip
andre@57: 
andre@57: Should match: 1380790ae7f7d8060e937d386be3103c173e450d
andre@57: 
andre@57:     unzip  Mercurial-3.4-py2.7-macosx10.10.zip
andre@57: 
andre@65: Install the .mpkg
andre@57: 
andre@65: Configure to be usable with wald certificate:
andre@65: 
andre@57:     echo "[web]" >> ~/.hgrc
andre@57:     echo "cacerts=~/wald-ca.pem" >>  ~/.hgrc
andre@57:     curl https://ssl.intevation.de/Intevation-Root-CA-2010.crt > ~/wald-ca.pem
andre@57: 
andre@57: Download cmake:
andre@57:     curl -O http://www.cmake.org/files/v3.2/cmake-3.2.2-Darwin-x86_64.dmg
andre@57:     shasum cmake-3.2.2-Darwin-x86_64.dmg
andre@57: 
andre@57: Should match: d0f4172a3c72764f06146e4f949367c8029e71ed
andre@57: 
andre@57: Install the .dmg and add cmake to the path.
andre@57: 
andre@57:     export PATH=/Volumes/Macintosh\ HD/Applications/CMake.app/Contents/bin/:$PATH
andre@57: 
andre@57: Now for retraceit:
andre@57: 
andre@57:     hg clone https://wald.intevation.org/hg/retraceit/
andre@57:     cd retraceit
andre@72:     mkdir build && cd build
andre@57:     cmake .. \
andre@57:         -DCMAKE_PREFIX_PATH=$CUSTOM_PREFIX \
andre@57:         -DCMAKE_INSTALL_PREFIX=$CUSTOM_PREFIX \
andre@57:         -DCMAKE_VERBOSE_MAKEFILE=True
andre@63:     make
andre@63:     make install
andre@63: 
andre@63: The make install will create a retraceit.app in your $CUSTOM_PREFIX directory.
andre@63: This is the deployable application bundle
andre@63: 
andre@65: You can now create a .dmg image for distribution:
andre@65: 
andre@71:     mv retraceit.app RetraceIT.app
andre@63:     hdiutil create -ov -format UDZO -volname RetraceIT -srcfolder RetraceIT.app \
andre@63:         -o RetraceIT.dmg -imagekey zlib-level=9
andre@57: 
andre@0: */