cd /tmp export PREFIX=/opt/MinGW32 # Delete any current folder [ -d makeself-release-2.3.1 ] && rm -rf makeself-release-2.3.1* [ -f release-2.3.1.tar.gz ] && rm -f release-2.3.1.tar.gz* # Download the installer and its files wget https://github.com/megastep/makeself/archive/release-2.3.1.tar.gz tar xvzf release-2.3.1.tar.gz cd makeself-release-2.3.1/ release_date=$(date '+%Y%m%d_%H%M%S') installer_name="MinGW32-Distro-Linux-${release_date}_MinGW-w64-5.0.3_Gcc_7.2.0.xz.run" ls -clt $PREFIX/packages/ | awk '{print $NF}'|sort| grep -E '^[a-z]'|sed -e "s:_MinGW32-Linux-i686.xz.run::g" | awk 'BEGIN{s=1;}{printf("%s. %s\n",s,$NF);s=s+1;}' > packages.list # Generate a descriptive file cat << _EOF_ > mingw32.lsm Begin3 Title: ${installer_name} Version: ${release_date} Description: i686-w64-mingw32_MinGW-w64-5.0.3_Gcc_7.2.0_Linux32-bin.run is a shell script that generates a self-extractable PreBuilt Toolchain for Linux32 Bits (i686) - Compiler: GCC 7.2.0 - Thread: Posix - Languages: c/c++, Fortran, LTO, Objc/Obj-c++ - MinGW-w64 * MinGW-w64-headers: all * MinGW-w64-CRT: all * MinGW-w64-Tools: all * MinGW-w64-Libraries: WinPthread, pseh, winstorecompat URL http://www.davidgis.fr/documentation/Build_Prebuilt_Toolchain_MinGW-w64_for_Linux-32bits_GCC-7.2.0_Testing/ Keywords: CrossCompiling, MinGW-w64 5.0.3, GCC 7.2.0 Author: David Techer (davidtecher@yahoo.fr) Maintained-by: David Techer (davidtecher@yahoo.fr) Original-site: http://www.davidgis.fr Platform: Unix Copying-policy: GPL End _EOF_ cat << EOF > $PREFIX/setup.sh cat << _EOF_ ------------------------------------------------------------------------ [MinGW Prebuild Toolchain for Linux32 (i686)] has just been installed Release Date: ${release_date} The main idea of this toolchain is to backport some Arch packages to Debian/Ubuntu by building a minimal environment for Linux32. Based on Arch principles, this environment requires that Wine is installed 1) Please refer to 'README' file first in the extracted folder then source ${PREFIX}/README 2) To complete your environment, use your package manager and install * Required: Wine-Staging or Wine to build package * Required: GCC/G++ * Required: Cmake * Required: Python (base) * Required: Perl (base) * Required: Bison and Flex * Required: Meson * Recommended: Autotools * Recommended: Autoconf * Recommended: Automake Packages: $(cat packages.list|wc -l) --------- To install some packages there are two options a) You can try to build them manually following instructions at http://www.davidgis.fr/documentation/Build_Prebuilt_Toolchain_MinGW-w64_for_Linux-32bits_GCC-7.2.0_Testing/#packages b) You can try to install them by installing their respectives packages provided at $PREFIX/packages You need to be root to install them Dependancies between packages are not taken into account $(cat packages.list) Regards. ------------------------------------------------------------------------ _EOF_ EOF chmod +x $PREFIX/setup.sh #TARGETDIR=$PREFIX $PWD/makeself.sh \ --lsm mingw32.lsm \ --xz \ --complevel 9 \ --needroot \ --target $PREFIX \ $PREFIX \ ${installer_name} \ "[MinGW Prebuild Toolchain for Linux32 (i686)]..." \ .//setup.sh echo "If if OK then check file '$PWD/${installer_name}'"