MinGW32_Linux_Distro_Logo MinGW32 Linux Distro: A MinGW-w64 Prebuilt Toolchain for Linux-32Bits Targetting Win32 (Posix Thread)

GCC 7.2.0 - MinGW-w64 5.0.3

Info:My Web Site: http://www.davidgis.fr ,
Author: David TECHER, <davidtecher@yahoo.fr>
Date: 2018-09-11
Revision: 254-062748

Note

info This document deals with collecting some notes about setting up a prebuil toochain. Info taken from the Web. This prebuilt toolchain has been built only for fun not for performance!!!

The main idea of this document is to backport some Arch packages for MinGW-w64 to any distribution based on Debian/Ubuntu for Linux32 (i686)

  • Packages: more than 200!
  • Both dynamic and static libraries are built -- whenever we could --
  • SSL support: we choose LibreSSL

Listed in below table are some binaries built using this toolchain

Tool Version Package Comments Download Date
APNGASM 3.16 Internal Package Tested on ReactOS 4.10-dev apng-3.1.16-bin-win32.exe 2018-07-08
UPX 3.94 Internal Package Tested on ReactOS 4.10-dev Upx-3.94_ReactOS.exe 2018-08-14
Mpv 0.29.0.r29.g48c38f7 External Package built with almost options we could add (+libmpv shared) mpv-i686-20180910_0.29.0-r29.g48c38f7_win32.7z 2018-09-10
Mpv 0.29.0.r28.ga5b0d59 External Package built with almost options we could add mpv-0.29.0.r28.ga5b0d59_win32.7z 2018-09-03
Mpv 0.29.0-r26.g91786fa External Package built with almost options we could add mpv-0.29.0-r26.g91786fa_win32.zip 2018-08-29

Table of contents

1   Notes for me

# ACLOCAL for X and friends
ACLOCAL_PATH=/opt/MinGW32/i686-w64-mingw32/share/aclocal/

# To compress using UPX
wineconsole --backend=curses upx.exe --best --strip-relocs=0 *.dll *.exe

2   Prerequisites

export PREFIX=/opt/MinGW32
export PATH=$PREFIX/bin:$PATH
export target=i686-w64-mingw32

mkdir /build
cd /build

git clone --depth=1 --branch v5.0.3 git://git.code.sf.net/p/mingw-w64/mingw-w64

wget http://ftp.gnu.org/gnu/binutils/binutils-2.29.tar.bz2
wget ftp://ftp.uvsq.fr/pub/gcc/releases/gcc-7.2.0/gcc-7.2.0.tar.xz
wget https://ftp.gnu.org/gnu/mpfr/mpfr-3.1.6.tar.gz
wget https://gmplib.org/download/gmp/gmp-6.1.1.tar.xz
wget ftp://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz
wget http://isl.gforge.inria.fr/isl-0.18.tar.gz

tar -jxf binutils-2.29.tar.bz2
tar -xf gcc-7.2.0.tar.xz
tar xf mpc-1.0.3.tar.gz && tar xf mpfr-3.1.6.tar.gz && tar xf gmp-6.1.1.tar.xz && tar xf isl-0.18.tar.gz

ln -s /build/mpfr-3.1.6 /build/binutils-2.29/mpfr
ln -s /build/gmp-6.1.1/ /build/binutils-2.29/gmp
ln -s /build/mpc-1.0.3/ /build/binutils-2.29/mpc
ln -s /build/isl-0.18/ /build/binutils-2.29/isl

ln -s /build/gmp-6.1.1 /build/gcc-7.2.0/gmp
ln -s /build/isl-0.18 /build/gcc-7.2.0/isl
ln -s /build/mpc-1.0.3 /build/gcc-7.2.0/mpc
ln -s /build/mpfr-3.1.6 /build/gcc-7.2.0/mpfr

3   Build Toolchain

Note

info All commands provided in this section are done being ``root`` user

3.1   Binutils 2.29

cd /build/binutils-2.29
sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in
sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure
cd /build
mkdir binutils-2.29-build32/ && cd binutils-2.29-build32/
/build/binutils-2.29/configure --prefix=$PREFIX --target=$target  --enable-lto --disable-nls --infodir=$PREFIX/share/info/$target --enable-plugins \
        --disable-multilib --disable-nls --disable-werror --without-system-zlib
make -j$(nproc) && make install
ln -s $PREFIX/$target $PREFIX/mingw

3.2   MinGW-w64-Headers (ALL)

cd /build/mingw-w64/mingw-w64-headers
/build/mingw-w64/mingw-w64-headers/configure --host=$target --prefix=$PREFIX/$target/ --includedir=$PREFIX/$target/include --enable-sdk=all --enable-secure-api --enable-idl
make -j$(nproc)  && make install

3.3   GCC 7.2.0 - Pass #01

cd /build
mkdir gcc-7.2.0-mingw32 && cd gcc-7.2.0-mingw32
/build/gcc-7.2.0/configure --prefix=$PREFIX --target=$target  --enable-shared --enable-static --disable-multilib --enable-threads=posix \
        --enable-fully-dynamic-string --enable-libstdcxx-time=yes --enable-lto --enable-languages=c,c++,objc,obj-c++,fortran,lto \
        --without-system-zlib --enable-cloog-backend=isl --disable-dw2-exceptions --disable-nls --enable-libgomp --enable-checking=release \
        --with-as=$PREFIX/bin/i686-w64-mingw32-as --with-ld=$PREFIX/bin/i686-w64-mingw32-ld
make -j$(nproc) all-gcc && make install-gcc

3.4   MinGW-w64-Crt (ALL)

cd /build
mkdir mingw-w64-crt32 && cd mingw-w64-crt32
/build/mingw-w64/mingw-w64-crt/configure --host=$target --prefix=$PREFIX/$target/
make -j$(nproc)  && make install

3.5   MinGW-w64-Libraries: winpthreads

for library in winpthreads
do
        mkdir -pv /build/mingw-w64-$library
        cd /build/mingw-w64-$library
        /build/mingw-w64/mingw-w64-libraries/$library/configure --host=$target --prefix=$PREFIX/$target/
        make -j$(nproc)  && make install
done

3.6   GCC 7.2.0 - Pass #02

cd /build/gcc-7.2.0-mingw32/
make -j$(nproc) all && make install
strip -v $PREFIX/bin/$target-*
strip -v $PREFIX/libexec/gcc/i686-w64-mingw32/7.2.0/{cc1*,collect2,f951,lto*}
mv -vf  $PREFIX/$target/lib/*.dll $PREFIX/$target/bin/

3.7   MinGW-w64-Libraries: pseh, winstorecompat

for library in pseh winstorecompat
do
        mkdir -pv /build/mingw-w64-$library
        cd /build/mingw-w64-$library
        /build/mingw-w64/mingw-w64-libraries/$library/configure --host=$target --prefix=$PREFIX/$target/ > build.log 2>&1
        make -j$(nproc)  >> build.log 2>&1 && make install >> build.log 2>&1
done

3.8   MinGW-w64 Tools: gendef, genidl, genlib, genpeimg, i686-w64-mingw32-widl

for tools in gendef genidl genlib genpeimg;
do
        mkdir -pv /build/mingw-w64-tools32/build-$tools
        cd /build/mingw-w64-tools32/build-$tools
        /build/mingw-w64/mingw-w64-tools/$tools/configure --prefix=$PREFIX
        make -j$(nproc) && make install;
done

cd /build
mkdir widl32 && cd widl32
/build/mingw-w64/mingw-w64-tools/widl/configure --prefix=$PREFIX --target=$target --includedir=$PREFIX/$target/include
make -j$(nproc)  && make install && strip $PREFIX/bin/$target-widl

4   Additional steps

4.1   Cmake 3.10.2 (optional)

Note

info If your cmake version -- provided by your package (apt, yum etc) -- is too old then you can build a recent cmake version using commands below

cd /build
wget https://cmake.org/files/v3.10/cmake-3.10.2.tar.gz
tar xvzf cmake-3.10.2.tar.gz
cd cmake-3.10.2
./configure --prefix=/opt/cmake/3.10.2 --parallel=$(nproc) --no-system-libs --no-system-curl --no-system-expat --no-system-jsoncpp \
        --no-system-zlib --no-system-bzip2 --no-system-liblzma --no-system-libarchive --no-system-librhash --no-qt-gui
make -j$(nproc) && make install
strip $PREFIX/bin/cmake
strip $PREFIX/bin/cmake
strip $PREFIX/bin/ccmake
strip $PREFIX/bin/cpack
strip $PREFIX/bin/ctest

4.2   Environments variables and scripts : mingw-w64-cmake, mingw-w64-makeself, mingw-w64-meson, i686-w64-mingw32-pkg-config, mingw-w64-makeself-MinGW32-Distro

Note

info WINEPATH is filled in /opt/MinGW32/bin/i686-w64-mingw32-wine. Don't forget to modify its value to point to your local wine location.

 export PREFIX=/opt/MinGW32
 export target=i686-w64-mingw32
 cat << _EOF_ > $PREFIX/README
 ##################################################################################################################
 #
 #            MinGW64: Prebuilt Toolchain for Linux-32Bits Targetting Win32 (Posix Thread)
 #
 ##################################################################################################################
 #
 # You have to source this file to set up the environment. By default it should be installed at /opt/MinGW32
 #
 # Note: if wine is installed on your system then you have to modify the file /opt/MinGW32/bin/i686-w64-mingw32-wine
 #
 # - GCC 7.2.0:
 #               Thread Posix,
 #               Languages c,lto,c++,objc,obj-c++,fortran
 # - MinGW-w64 5.0.3 (Headers, CRT,  Tools and Libraries)
 #
 export PREFIX=${PREFIX}
 export target=${target}
 export PATH=\$PREFIX/bin:\${PATH}
 export CPPFLAGS=-I\$PREFIX/$target/include
 export LDFLAGS=-L\$PREFIX/$target/lib
 export mingw_c_flags="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4"
 export CFLAGS="\$mingw_c_flags \$CFLAGS"
 export CXXFLAGS="\$mingw_c_flags \$CXXFLAGS"
 export PKG_CONFIG=\$PREFIX/bin/\$target-pkg-config
 export PKG_CONFIG_LIBDIR=\$PREFIX/\$target/lib/pkgconfig
 export LD_LIBRARY_PATH=/opt/MinGW32/bin/:$LD_LIBRARY_PATH
 _EOF_

 cat << _EOF_ > $PREFIX/bin/$target-pkg-config
 export PKG_CONFIG_PATH="/opt/MinGW32/i686-w64-mingw32/lib/pkgconfig/"
 export PKG_CONFIG_LIBDIR="/opt/MinGW32/i686-w64-mingw32/lib/pkgconfig:/usr/share/pkgconfig"

 exec pkg-config \$@
 _EOF_

 chmod 777 $PREFIX/bin/$target-pkg-config

 cat << _EOF_ > $PREFIX/bin/dlltool
 $PREFIX/bin/$target-dlltool --as=$PREFIX/bin/$target-as "\$@"
 _EOF_

 chmod 777 $PREFIX/bin/dlltool

 mkdir -pv $PREFIX/share/cmake/Toochains;
 wget "https://aur.archlinux.org/cgit/aur.git/plain/toolchain-mingw.cmake?h=mingw-w64-cmake" -O  - |sed -e "s:@PROCESSOR@:${target:0:4}:g;s:@TRIPLE@:${target}:g;s:/usr:${PREFIX}:g" > $PREFIX/share/cmake/Toochains/toolchain-MinGW32.cmake
 wget "https://aur.archlinux.org/cgit/aur.git/plain/mingw-cmake.sh?h=mingw-w64-cmake" -O - | sed -e "s:@TRIPLE@:${target}:g;s:/usr:${PREFIX}:g;s:/opt/MinGW32/share/mingw/toolchain-i686-w64-mingw32.cmake:$PREFIX/share/cmake/Toochains/toolchain-MinGW32.cmake:g" > $PREFIX/bin/mingw-w64-cmake
 wget "https://aur.archlinux.org/cgit/aur.git/plain/mingw-wine.sh?h=mingw-w64-cmake" -O - | sed -e "s:@TRIPLE@:${target}:g;s:/usr:${PREFIX}:g;s:export WINEPATH.*:export WINEPATH=/opt/wine/apps/MinGW32_Environment/bin/:g" > $PREFIX/bin/$target-wine
 chmod 777 $PREFIX/bin/mingw-w64-cmake
 chmod 777 $PREFIX/bin/$target-wine
 wget http://techer.pascal.free.fr/mingw-w64-makeself-MinGW32-Distro -O $PREFIX/bin/mingw-w64-makeself-MinGW32-Distro
 chmod 777 $PREFIX/bin/mingw-w64-makeself-MinGW32-Distro
 wget http://techer.pascal.free.fr/mingw-w64-makeself -O $PREFIX/bin/mingw-w64-makeself
 chmod 777 $PREFIX/bin/mingw-w64-makeself

 #
 # mingw-w64-meson
 #
[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
 cd /tmp/sources/

 git clone https://aur.archlinux.org/mingw-w64-meson.git
 cd mingw-w64-meson/

 [ ! -d "$PREFIX/share/mingw" ] && { mkdir -pv "$PREFIX/share/mingw"; }
 sed -e "s:@TRIPLE@:${PREFIX}/bin/${target}:g;s:@CPU_FAMILY@:x86:g;s:@PROCESSOR@:x86:g;s:root =.*:root = '${target}':g" toolchain-mingw.meson > toolchain-${target}.meson
 sed -e "s:@TRIPLE@:${PREFIX}/bin/${target}:g;s:@CPU_FAMILY@:x86:g;s:@PROCESSOR@:x86:g;s:root =.*:root = '${target}':g" toolchain-mingw.meson > toolchain-${target}-wine.meson
 sed -i '/^exe_wrapper/ d' toolchain-${target}.meson
 sed -e "s:/usr:${PREFIX}:g;s:@TRIPLE@:${target}:g;s:/var:${PREFIX}/${target}/var:g" meson-mingw-wrapper > ${target}-meson

 install -m755 ${target}-meson $PREFIX/bin
 install -m644 toolchain-${target}.meson $PREFIX/share/mingw
 install -m644 toolchain-${target}-wine.meson $PREFIX/share/mingw

 chmod 777 -R $PREFIX

4.3   Folders for Source

mkdir /tmp/sources

5   Core Packages - Part 1

Note

info All packages will be built inside /tmp folder. A couple of packages are built using instruction from Arch.

  • These packages are self-extractable archives, generated using makeself

5.1   Zlib 1.2.11

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget http://zlib.net/zlib-1.2.11.tar.gz
tar xvzf zlib-1.2.11.tar.gz
cd zlib-1.2.11
sed -ie "s,dllwrap,${_arch}-dllwrap," win32/Makefile.gcc
CFLAGS="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4" ./configure --prefix=$PREFIX/$target -shared -static
make -f win32/Makefile.gcc CC=$target-gcc AR=$target-ar RC=$target-windres STRIP=$target-strip IMPLIB=libz.dll.a CFLAGS="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4"

install -d $DESTDIR/$PREFIX/$target/{bin,include,lib}
install -m644 -t $DESTDIR/$PREFIX/$target/include zlib.h zconf.h
install -m644 -t $DESTDIR/$PREFIX/$target/lib libz.a libz.dll.a
install -m755 -t $DESTDIR/$PREFIX/$target/bin zlib1.dll
install -d $DESTDIR/$PREFIX/$target/lib/pkgconfig
sed "s,@prefix@,/${PREFIX}/${target},;s,@exec_prefix@,\${prefix},;s,@libdir@,\${exec_prefix}/lib,;s,@sharedlibdir@,\${libdir},;s,@includedir@,\${prefix}/include,;s,@VERSION@,$pkgver," < zlib.pc.in > $DESTDIR/$PREFIX/$target/lib/pkgconfig/zlib.pc
i686-w64-mingw32-strip -x $DESTDIR/$PREFIX/$target/bin/zlib1.dll
i686-w64-mingw32-strip -g $DESTDIR/$PREFIX/$target/lib/libz.a $PREFIX/$target/lib/libz.dll.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target
mingw-w64-makeself zlib 1.2.11 $DESTDIR/$PREFIX/$target delete

Download http://techer.pascal.free.fr/MinGW32/2018/packages/zlib-1.2.11_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.2   Bzip2 1.0.6

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz
tar xvzf bzip2-1.0.6.tar.gz
cd bzip2-1.0.6/
git clone https://aur.archlinux.org/mingw-w64-bzip2.git
patch -p1 -i mingw-w64-bzip2/bzip2-1.0.5-autoconfiscated.patch
patch -p1 -i mingw-w64-bzip2/bzip2-use-cdecl-calling-convention.patch
patch -p1 -i mingw-w64-bzip2/mingw32-bzip2-1.0.5-slash.patch
sh autogen.sh
./configure --host=$target --prefix=$PREFIX/$target
make -j4

make DESTDIR=$DESTDIR install
rm -rf $DESTDIR/$PREFIX/$target/bin/*exe
rm -rf $DESTDIR/$PREFIX/$target/bin/bz*
rm -rf $DESTDIR//$PREFIX/$target/share
i686-w64-mingw32-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll
i686-w64-mingw32-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR//$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself bzip2 1.0.6 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR/

Download http://techer.pascal.free.fr/MinGW32/2018/packages/bzip2-1.0.6_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.3   Dlfcn (Win32) 1.1.1

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget https://github.com/dlfcn-win32/dlfcn-win32/archive/v1.1.1.tar.gz
tar xzf v1.1.1.tar.gz
cd dlfcn-win32-1.1.1/
./configure --prefix=$PREFIX/$target/ --libdir=$PREFIX/$target/lib --incdir=$PREFIX/$target/include --enable-shared --enable-static --cross-prefix=$target-
make -j$(nproc)

make DESTDIR=$DESTDIR install
i686-w64-mingw32-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll
i686-w64-mingw32-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself dlfcn 1.1.1 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/dlfcn-1.1.1_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.4   Xz 5.2.3

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build
wget --no-check-certificate http://tukaani.org/xz/xz-5.2.3.tar.gz
tar xzf xz-5.2.3.tar.gz
cd xz-5.2.3/
./configure --host=$target  --prefix=$PREFIX/$target/  --enable-shared --enable-static
make -j$(nproc)

make DESTDIR=$DESTDIR install-strip
find $DESTDIR/$PREFIX/$target -name '*.exe' | xargs -rtl1 rm
find $DESTDIR/$PREFIX/$target -name '*.dll' | xargs -rtl1 $target-strip -x
find $DESTDIR/$PREFIX/$target -name '*.a' -o -name '*.dll' | xargs -rtl1 $target-strip -g
rm -vf $DESTDIR/$PREFIX/$target/bin/{lz{cmp,diff,egrep,fgrep,grep,less,more},xz{cmp,diff,egrep,fgrep,grep,less,more}}
rm -rvf $DESTDIR/$PREFIX/$target/share

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself xz 5.2.3 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/xz-5.2.3_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.5   Lzo 2.10

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build
wget http://www.oberhumer.com/opensource/lzo/download/lzo-2.10.tar.gz
tar xzf lzo-2.10.tar.gz
cd lzo-2.10/
mkdir build && cd build
../configure --host=$target  --prefix=$PREFIX/$target/  --enable-shared --enable-static
make -j$(nproc)
$target-gcc $CFLAGS -fpic -I../include/lzo -o minilzo/minilzo.o -c ../minilzo/minilzo.c
$target-ar rcs libminilzo.a minilzo/minilzo.o
$target-gcc -shared -o libminilzo-0.dll -Wl,--out-implib,libminilzo.dll.a minilzo/minilzo.o

make DESTDIR=$DESTDIR install

install -m644 libminilzo-0.dll $DESTDIR/$PREFIX/$target/bin
install -m644 libminilzo.dll.a  $DESTDIR/$PREFIX/$target/lib
install -m644 libminilzo.a $DESTDIR/$PREFIX/$target/lib
install -p -m644 ../minilzo/minilzo.h $DESTDIR/$PREFIX/$target/include
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec $target-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself lzo 2.10 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/lzo-2.10_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.6   Expat 2.2.5

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget https://github.com/libexpat/libexpat/releases/download/R_2_2_5/expat-2.2.5.tar.bz2
tar xjf expat-2.2.5.tar.bz2
cd expat-2.2.5/
./configure --host=$target  --prefix=$PREFIX/$target/  --enable-shared --enable-static
make -j$(nproc)

make DESTDIR=$DESTDIR install-strip
rm -vf $DESTDIR/$PREFIX/$target/bin/*exe
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a
rm -rf $DESTDIR/$PREFIX/$target/share

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself expat 2.2.5 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/expat-2.2.5_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.7   Libpng 1.6.34

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget http://downloads.sourceforge.net/project/libpng/libpng16/1.6.34/libpng-1.6.34.tar.gz
tar xzf libpng-1.6.34.tar.gz
cd libpng-1.6.34/
wget http://downloads.sourceforge.net/project/apng/libpng/libpng16/libpng-1.6.34-apng.patch.gz
gunzip libpng-1.6.34-apng.patch.gz
patch -p0 -i libpng-1.6.34-apng.patch
./configure --host=$target  --prefix=$PREFIX/$target/  --enable-shared --enable-static --enable-hardware-optimizations=yes --enable-intel-sse=yes
make -j$(nproc)

make DESTDIR=$DESTDIR install
rm -vf $DESTDIR/$PREFIX/$target/bin/*exe
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a
rm -rf $DESTDIR/$PREFIX/$target/share
cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
ln -s $PREFIX/$target/bin/libpng16-config $PREFIX/bin
ln -s $PREFIX/$target/bin/libpng-config $PREFIX/bin

mingw-w64-makeself libpng 1.6.34 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/libpng-1.6.34_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.8   Libiconv 1.15

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build
wget https://ftp.gnu.org/gnu/libiconv/libiconv-1.15.tar.gz
tar xzf libiconv-1.15.tar.gz
cd libiconv-1.15/
./configure --host=$target  --prefix=$PREFIX/$target/  --enable-shared=yes --enable-static=yes --enable-extra-encodings --enable-relocatable --disable-rpath --enable-silent-rules --enable-nls --docdir=$PREFIX/$target/share/doc/libiconv
make -j$(nproc)

make DESTDIR=$DESTDIR install
rm -vf $DESTDIR/$PREFIX/$target/bin/*exe
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a
rm -rf $DESTDIR/$PREFIX/$target/share
rm -vf $DESTDIR/$PREFIX/$target/lib/charset.alias

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libiconv 1.15 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/libiconv-1.15_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.9   Termcap 1.3.1

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget http://ftp.gnu.org/gnu/termcap/termcap-1.3.1.tar.gz
tar xvzf termcap-1.3.1.tar.gz
cd termcap-1.3.1/
autoconf
./configure --host=$target  --prefix=$PREFIX/$target/
make -j$(nproc)
$target-gcc -shared -Wl,--out-implib,libtermcap.dll.a -o libtermcap-0.dll termcap.o tparam.o version.o

make install prefix=$DESTDIR/$PREFIX/$target exec_prefix=$DESTDIR/$PREFIX/$target oldincludedir=
mkdir -pv $DESTDIR/$PREFIX/$target/{bin,lib}
install -m 0755 libtermcap-0.dll $DESTDIR/$PREFIX/$target/bin
install -m 0644 libtermcap.dll.a $DESTDIR/$PREFIX/$target/lib
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself termcap 1.3.1 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/termcap-1.3.1_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.10   Libjpeg-turbo 1.5.3

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

git clone https://aur.archlinux.org/mingw-w64-libjpeg-turbo.git
wget https://github.com/libjpeg-turbo/libjpeg-turbo/archive/1.5.3.tar.gz
tar xvzf 1.5.3.tar.gz
cd libjpeg-turbo-1.5.3/
patch -p1 -i ../mingw-w64-libjpeg-turbo/0001-header-compat.mingw.patch
patch -p1 -i ../mingw-w64-libjpeg-turbo/libjpeg-turbo-1.3.1-libmng-compatibility.patch
aclocal
autoheader
libtoolize --force
automake --force-missing --add-missing
autoconf
./configure --host=$target  --prefix=$PREFIX/$target/  --enable-shared=yes --enable-static=yes --with-jpeg8
make -j$(nproc)

make DESTDIR=$DESTDIR docdir=$DESTDIR/$PREFIX/$target/share/doc/libjpeg-turbo exampledir=$DESTDIR/$PREFIX/$target/share/doc/libjpeg-turbo install
cp -avf {jinclude,jpegint,transupp}.h $DESTDIR/$PREFIX/$target/include
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libjpeg-turbo 1.5.3 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/libjpeg-turbo-1.5.3_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.11   Libunistring 0.9.9

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget http://ftp.gnu.org/gnu/libunistring/libunistring-0.9.9.tar.gz
tar xvzf libunistring-0.9.9.tar.gz
cd libunistring-0.9.9/
./configure --host=$target  --prefix=$PREFIX/$target/  --enable-shared --enable-static --enable-threads=windows
make -j$(nproc)

make DESTDIR=$DESTDIR install
rm -rf $DESTDIR/$PREFIX/$target/share
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libunistring 0.9.9 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/libunistring-0.9.9_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.12   Gettext 0.19.8.1

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

git clone https://aur.archlinux.org/mingw-w64-gettext.git
wget https://ftp.gnu.org/gnu/gettext/gettext-0.19.8.1.tar.gz
tar xzf gettext-0.19.8.1.tar.gz
cd gettext-0.19.8.1/
patch -p0 -i /tmp/sources/mingw-w64-gettext/05-always-use-libintl-vsnprintf.mingw.patch
patch -p0 -i /tmp/sources/mingw-w64-gettext/06-dont-include-ctype-after-gnulibs-wctype.mingw.patch
patch -p0 -i /tmp/sources/mingw-w64-gettext/07-fix-asprintf-conflict.mingw.patch
patch -p0 -i /tmp/sources/mingw-w64-gettext/08-vs-compatible.patch
patch -p0 -i /tmp/sources/mingw-w64-gettext/09-gnulib-fix-underscore-cond.patch

#export underscore_flag='-DUSER_LABEL_PREFIX_UNDERSCORE'
#export CFLAGS="$underscore_flag"
#export CXXFLAGS="$underscore_flag"
#unset LDFLAGS
./configure --host=$target --prefix=$PREFIX/$target/ --enable-shared --enable-static --disable-java --disable-native-java --disable-csharp --enable-threads=win32
make -j$(nproc)

make DESTDIR=$DESTDIR install
rm -vf $DESTDIR/$PREFIX/$target/bin/{autopoint,gettext.sh,gettextize}
rm -vf $DESTDIR/$PREFIX/$target/bin/*exe
rm -rf $DESTDIR/$PREFIX/$target/lib/gettext
rm -rf $DESTDIR/$PREFIX/$target/share
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a
install -dm755 $DESTDIR/$PREFIX/$target/lib/pkgconfig
install -m644 /tmp/sources/mingw-w64-gettext/intl.pc $DESTDIR/$PREFIX/$target/lib/pkgconfig
sed -i "s:@PREFIX@:$PREFIX/$target:g;s:@VERSION@:0.19.8.1:g" $DESTDIR/$PREFIX/$target/lib/pkgconfig/intl.pc

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself gettext 0.19.8.1 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/gettext-0.19.8.1_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.13   Freetype 2.8 (wihtout Harfbuzz)

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget https://download-mirror.savannah.gnu.org/releases/freetype/freetype-2.8.tar.bz2
tar xvjf freetype-2.8.tar.bz2
cd freetype-2.8/
git clone https://aur.archlinux.org/mingw-w64-freetype2-minimal.git
patch -Np1 -i mingw-w64-freetype2-minimal/0001-Enable-table-validation-modules.patch
patch -Np1 -i mingw-w64-freetype2-minimal/0002-Enable-subpixel-rendering.patch
patch -Np1 -i mingw-w64-freetype2-minimal/0003-Enable-infinality-subpixel-hinting.patch
patch -Np1 -i mingw-w64-freetype2-minimal/0004-Enable-long-PCF-family-names.patch
./configure --host=$target  --prefix=$PREFIX/$target/  --enable-shared=yes --enable-static=yes --with-bzip2=yes --with-zlib=yes --with-png=yes --without-harfbuzz
make -j$(nproc)

make DESTDIR=$DESTDIR install
rm -rf $DESTDIR/$PREFIX/$target/share
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
ln -s $PREFIX/$target/bin/freetype-config $PREFIX/bin/
mingw-w64-makeself freetype-noharfbuzz 2.8 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/freetype-noharfbuzz-2.8_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.14   Libzip 1.0.4

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget https://libzip.org/download/libzip-1.4.0.tar.xz
tar xvJf libzip-1.4.0.tar.xz
cd libzip-1.4.0/
sed -i "s|ADD_SUBDIRECTORY(regress)||g" CMakeLists.txt
sed -i "s|ADD_SUBDIRECTORY(examples)||g" CMakeLists.txt
mkdir build_shared && cd build_shared
mingw-w64-cmake ..
make -j$(nproc)
cd ..
mkdir build_static && cd build_static
mingw-w64-cmake -DBUILD_SHARED_LIBS=OFF ..
make -j$(nproc)

cd /tmp/sources/libzip-1.4.0/build_shared/ && make DESTDIR=$DESTDIR install
cd /tmp/sources/libzip-1.4.0/build_static/ && make DESTDIR=$DESTDIR install
rm -rf $DESTDIR/$PREFIX/$target/share
rm -vf $DESTDIR/$PREFIX/$target/bin/*exe
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libzip 1.0.4 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/libzip-1.0.4_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.15   Libffi 3.2.1

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources
export DESTDIR=/tmp/build

git clone https://aur.archlinux.org/mingw-w64-libffi.git
wget "https://github.com/libffi/libffi/archive/v3.2.1.tar.gz"
tar xvzf v3.2.1.tar.gz
cd libffi-3.2.1/
patch -p2 -i ../mingw-w64-libffi/fix_return_size.patch
sh autogen.sh;
./configure --host=$target --prefix=$PREFIX/$target --enable-shared --enable-static HOST=$target --enable-pax_emutramp
make -j$(nproc)

make DESTDIR=$DESTDIR install
rm -rf  $DESTDIR/$PREFIX/$target/share/info/dir
rm -rf  $DESTDIR/$PREFIX/$target/share/man
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libffi 3.2.1 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/libffi-3.2.1_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.16   PDcurses 4.0.2 - Win32a

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources
export DESTDIR=/tmp/build

git clone https://aur.archlinux.org/mingw-w64-pdcurses-win32a.git
wget https://github.com/Bill-Gray/PDCurses/archive/v4.0.2.tar.gz
tar xvzf v4.0.2.tar.gz
cd PDCurses-4.0.2/
patch -Np1 -i ../mingw-w64-pdcurses-win32a/pdcurses.diff
cp -a win32a build_shared
cd build_shared/
make -f mingwin32.mak PREFIX=$target- WIDE=Y UTF8=Y DLL=Y
cd ..
cp -a win32a build_static
cd build_static/
make -f mingwin32.mak PREFIX=$target- WIDE=Y UTF8=Y

cd ..
install -d $DESTDIR/$PREFIX/$target/{bin,lib,include}
install build_shared/pdcurses.dll $DESTDIR/$PREFIX/$target/bin
install build_static/pdcurses.a $DESTDIR/$PREFIX/$target/lib/libpdcurses.dll.a
install build_static/pdcurses.a $DESTDIR/$PREFIX/$target/lib/libpdcurses.a
install -m 0644 curses.h panel.h term.h acs_defs.h $DESTDIR/$PREFIX/$target/include/
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself pdcurses 4.02-win32a $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/pdcurses-4.02-win32a_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.17   Readline 7.0

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources
export DESTDIR=/tmp/build

git clone https://aur.archlinux.org/mingw-w64-readline.git
wget https://ftp.gnu.org/gnu/readline/readline-7.0.tar.gz
tar xvzf readline-7.0.tar.gz
cd readline-7.0/
for((i=1;i<=3;i++));do wget https://ftp.gnu.org/gnu/readline/readline-7.0-patches/readline70-00$i -O - | patch -Np0 ;done
patch -Np1 -i ../mingw-w64-readline/readline-1.patch
sed -i 's|-Wl,-rpath,$(libdir) ||g' support/shobj-conf
bash_cv_wcwidth_broken=no ./configure --host=$target --prefix=$PREFIX/$target --enable-shared --enable-static --enable-multibyte --with-curses
make -j$(nproc) SHLIB_LIBS="-mwindows -lpdcurses"

make install DESTDIR=$DESTDIR SHLIB_LIBS="-mwindows -lpdcurses" # First time
make install DESTDIR=$DESTDIR SHLIB_LIBS="-mwindows -lpdcurses" # Second time
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself readline 7.0 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/readline-7.0_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.18   Wineditline 2.201 (optional)

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources
export DESTDIR=/tmp/build

wget https://github.com/winlibs/wineditline/archive/WinEditLine-2.201.tar.gz
tar xvzf WinEditLine-2.201.tar.gz
cd wineditline-WinEditLine-2.201/
mkdir build && cd build
mingw-w64-cmake  ..
make -j$(nproc)

make PREFIX=$DESTDIR install
$target-strip $DESTDIR/tmp/sources/wineditline-WinEditLine-2.201/bin32/*exe
$target-strip --strip-unneeded $DESTDIR/tmp/sources/wineditline-WinEditLine-2.201/bin32/edit.dll
$target-strip -g $DESTDIR/tmp/sources/wineditline-WinEditLine-2.201/bin32/libedit.dll.a
$target-strip -g $DESTDIR/tmp/sources/wineditline-WinEditLine-2.201/lib32/libedit_a.a
cp -vf $DESTDIR/tmp/sources/wineditline-WinEditLine-2.201/bin32/*exe $PREFIX/$target/bin/
cp -vf $DESTDIR/tmp/sources/wineditline-WinEditLine-2.201/bin32/edit.dll $PREFIX/$target/bin/
cp -vf $DESTDIR/tmp/sources/wineditline-WinEditLine-2.201/bin32/libedit.dll.a $PREFIX/$target/lib
cp -vf $DESTDIR/tmp/sources/wineditline-WinEditLine-2.201/lib32/libedit_a.a $PREFIX/$target/lib
cp -avf $DESTDIR/tmp/sources/wineditline-WinEditLine-2.201/include/* $PREFIX/$target/include

# Some fixes in order to build the package
rm -rf $DESTDIR
mkdir -p $DESTDIR/$PREFIX/$target/{bin,lib,include}
cp -vf $PREFIX/$target/bin/{edit_test.exe,edit_test_dll.exe} $DESTDIR/$PREFIX/$target/bin/
cp -vf $PREFIX/$target/bin/edit.dll $DESTDIR/$PREFIX/$target/bin/
cp -vf $PREFIX/$target/lib/libedit.dll.a $DESTDIR/$PREFIX/$target/lib/
cp -vf $PREFIX/$target/lib/libedit_a.a $DESTDIR/$PREFIX/$target/lib/
cp -r $PREFIX/$target/include/editline/ $DESTDIR/$PREFIX/$target/include/
mingw-w64-makeself wineditline 2.201 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/wineditline-2.201_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.19   Pcre 8.41

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
export DESTDIR=/tmp/build
cd /tmp/sources/

wget "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.41.tar.bz2"
tar xvjf pcre-8.41.tar.bz2
cd pcre-8.41/
./configure --host=$target  --prefix=$PREFIX/$target/  --enable-shared=yes --enable-static=yes --enable-unicode-properties --enable-jit --enable-pcre16 --enable-pcre32 --enable-pcregrep-libz --enable-pcregrep-libbz2 --enable-pcretest-libreadline
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
ln -s $PREFIX/$target/bin/pcre-config $PREFIX/bin
mingw-w64-makeself pcre 8.41 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/pcre-8.41_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.20   Fontconfig 2.12.6

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
export DESTDIR=/tmp/build
cd /tmp/sources

git clone https://aur.archlinux.org/mingw-w64-fontconfig.git
wget "https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.12.6.tar.bz2"
tar xjf fontconfig-2.12.6.tar.bz2
cd fontconfig-2.12.6/
#patch -p1 -i ../mingw-w64-fontconfig/0007-pkgconfig.mingw.patch
./configure --host=$target  --prefix=$PREFIX/$target/  --enable-shared=yes --enable-static=yes --disable-docs --with-arch=i686
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself fontconfig 2.12.6 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/fontconfig-2.12.6_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.21   Pixman 0.34.0

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
export DESTDIR=/tmp/build
cd /tmp/sources/

wget https://www.cairographics.org/releases/pixman-0.34.0.tar.gz
tar xzf pixman-0.34.0.tar.gz
cd pixman-0.34.0/
./configure --host=$target  --prefix=$PREFIX/$target/  --enable-shared=yes --enable-static=yes
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself pixman 0.34.0 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/pixman-0.34.0_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.22   Glib 2.54.3

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
export DESTDIR=/tmp/build
cd /tmp/sources

wget http://ftp.gnome.org/pub/gnome/sources/glib/2.54/glib-2.54.3.tar.xz
tar xvJf glib-2.54.3.tar.xz
cd glib-2.54.3
patch -p1 -i  /opt/Sources/MINGW-packages/mingw-w64-glib2/0001-Use-CreateFile-on-Win32-to-make-sure-g_unlink-always.patch
patch -p1 -i  /opt/Sources/MINGW-packages/mingw-w64-glib2/0004-glib-prefer-constructors-over-DllMain.patch
patch -p1 -i  /opt/Sources/MINGW-packages/mingw-w64-glib2/0017-glib-use-gnu-print-scanf.patch
patch -p1 -i  /opt/Sources/MINGW-packages/mingw-w64-glib2/0023-print-in-binary-more-for-testing.all.patch
patch -p1 -i  /opt/Sources/MINGW-packages/mingw-w64-glib2/0027-no_sys_if_nametoindex.patch
patch -p1 -i  /opt/Sources/MINGW-packages/mingw-w64-glib2/0028-inode_directory.patch
NOCONFIGURE=1 ./autogen.sh
mkdir build_shared && cd build_shared/
../configure --host=$target --prefix=$PREFIX/$target  --disable-static --enable-shared --disable-libelf  -with-threads=posix HOST=$target
make -j$(nproc)
cd ..
mkdir build_static && cd build_static
../configure --host=$target --prefix=$PREFIX/$target  --enable-static --disable-shared --disable-libelf  -with-threads=posix HOST=$target
make -j$(nproc)

make DESTDIR=$DESTDIR install
cd ../build_shared/
make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself glib 2.54.3 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/glib-2.54.3_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.23   Cairo 1.14.12 (minimal)

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
export DESTDIR=/tmp/build
cd /tmp/sources

wget "https://cairographics.org/releases/cairo-1.14.12.tar.xz"
tar xJf cairo-1.14.12.tar.xz
cd cairo-1.14.12/
./configure --host=$target  --prefix=$PREFIX/$target/  --enable-shared=yes --enable-static=yes
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself cairo-minimal 1.14.12 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/cairo-minimal-1.14.12_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.24   Libogg 1.3.3

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
export DESTDIR=/tmp/build
cd /tmp/sources

wget https://ftp.osuosl.org/pub/xiph/releases/ogg/libogg-1.3.3.tar.gz
tar xvzf libogg-1.3.3.tar.gz
cd libogg-1.3.3/
./configure --host=$target --prefix=$PREFIX/$target/ --enable-shared --enable-static
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libogg 1.3.3 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/libogg-1.3.3_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.25   Libvorbis 1.3.5

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
export DESTDIR=/tmp/build
cd /tmp/sources/

wget https://ftp.osuosl.org/pub/xiph/releases/vorbis/libvorbis-1.3.5.tar.xz
tar xvJf libvorbis-1.3.5.tar.xz
cd libvorbis-1.3.5/
./configure --host=$target --prefix=$PREFIX/$target/ --enable-shared --enable-static
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libvorbis 1.3.5 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/libvorbis-1.3.5_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.26   Mpg123 1.25.8

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
export DESTDIR=/tmp/build
cd /tmp/sources

wget --no-check-certificate "https://sourceforge.net/projects/mpg123/files/mpg123/1.25.8/mpg123-1.25.8.tar.bz2/download" -O mpg123-1.25.8.tar.bz2
tar xvjf mpg123-1.25.8.tar.bz2
cd mpg123-1.25.8/
./configure --host=$target --prefix=$PREFIX/$target/ --enable-shared --enable-static
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself mpg123 1.25.8 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/mpg123-1.25.8_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.27   Flac 1.3.2

  • Depends: libogg
[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
export DESTDIR=/tmp/build
cd /tmp/sources/

wget https://ftp.osuosl.org/pub/xiph/releases/flac/flac-1.3.2.tar.xz
tar xvJf flac-1.3.2.tar.xz
cd flac-1.3.2/
./configure --host=$target --prefix=$PREFIX/$target/ --enable-shared --enable-static  --disable-xmms-plugin
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself flac 1.3.2 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/flac-1.3.2_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.28   Libmodplug 0.8.8.5

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
export DESTDIR=/tmp/build
cd /tmp/sources

wget --no-check-certificate  "https://sourceforge.net/projects/modplug-xmms/files/libmodplug/0.8.8.5/libmodplug-0.8.8.5.tar.gz/download" -O libmodplug-0.8.8.5.tar.gz
tar xvzf libmodplug-0.8.8.5.tar.gz
cd libmodplug-0.8.8.5/
./configure --host=$target --prefix=$PREFIX/$target/ --enable-shared --enable-static
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libmodplug 0.8.8.5 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/libmodplug-0.8.8.5_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.29   SpeedxDSP 1.2RC3

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
export DESTDIR=/tmp/build
cd /tmp/sources

wget http://downloads.xiph.org/releases/speex/speexdsp-1.2rc3.tar.gz
tar xvzf speexdsp-1.2rc3.tar.gz
cd speexdsp-1.2rc3/
./configure --host=$target --prefix=$PREFIX/$target/  --enable-static --enable-shared
make -j$(nproc)

 make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself speedxDSP 1.2rc3 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/speedxDSP-1.2rc3_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.30   Speex 1.2.0

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
export DESTDIR=/tmp/build
cd /tmp/sources/

wget "http://downloads.us.xiph.org/releases/speex/speex-1.2.0.tar.gz"
tar xvzf speex-1.2.0.tar.gz
cd speex-1.2.0/
./configure --host=$target --prefix=$PREFIX/$target/  --enable-static --enable-shared
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself speex 1.2.0 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/speex-1.2.0_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.31   Libsndfile 1.0.28

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
export DESTDIR=/tmp/build
cd /tmp/sources/

wget http://www.mega-nerd.com/libsndfile/files/libsndfile-1.0.28.tar.gz
tar xvzf libsndfile-1.0.28.tar.gz
cd libsndfile-1.0.28/
./configure --host=$target --prefix=$PREFIX/$target/  --enable-static --enable-shared --disable-sqlite --disable-test-coverage --enable-external-libs --enable-experimental
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libsndfile 1.0.28 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/libsndfile-1.0.28_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.32   Boost 1.66.0

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

git clone https://aur.archlinux.org/mingw-w64-boost.git
wget https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.bz2
tar xvjf boost_1_66_0.tar.bz2
cd boost_1_66_0/
patch -Np0 -i ../mingw-w64-boost/boost-mingw.patch
cd ..
cp -r boost_1_66_0 build-i686-w64-mingw32
cd build-i686-w64-mingw32/
cat > user-config.jam << _EOF_
using gcc : mingw64 : i686-w64-mingw32-g++
        :
        <rc>i686-w64-mingw32-windres
        <archiver>i686-w64-mingw32-ar
;
_EOF_
./bootstrap.sh --with-toolset=gcc --with-python=/usr/bin/python2
./b2 -d+2 -q target-os=windows variant=release threading=multi threadapi=win32 link=shared,static runtime-link=shared --prefix=$DESTDIR/$PREFIX/$target \
        --user-config=user-config.jam --without-python --without-mpi --without-graph_parallel \
        cxxflags="-std=c++11 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4" \
        address-model=32 architecture=x86 binary-format=pe --layout=tagged install > build.log 2>&1

mkdir $DESTDIR/$PREFIX/$target/bin
mv $DESTDIR/$PREFIX/$target/lib/*dll $DESTDIR/$PREFIX/$target/bin/
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself boost 1.66.0 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/boost-1.66.0_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.33   LibreSSL 2.6.4

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources
export DESTDIR=/tmp/build

wget https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-2.6.4.tar.gz
tar xzf libressl-2.6.4.tar.gz
cd libressl-2.6.4/
#CC=$target-gcc ./configure --host=$target --prefix=$PREFIX/$target/  CPPFLAGS="-I/$PREFIX/$target/include -D__MINGW_USE_VC2005_COMPAT" --enable-shared=yes --enable-static=yes
CC=$target-gcc ./configure --host=$target --target=$target --build=i686-pc-linux-gnu --prefix=$PREFIX/$target/  CPPFLAGS="-I/$PREFIX/$target/include -D__MINGW_USE_VC2005_COMPAT" --enable-shared=yes --enable-static=yes --enable-windows-ssp
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g
rm -rf $DESTDIR/$PREFIX/$target/share/man

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libressl 2.6.4 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/libressl-2.6.4_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.34   Asio 1.12.0 (with LibreSSL support)

Note

info As of writing, Arch provides mingw-w64-asio package for asio 1.10.8 without OpenSSL support. Here I will provide Asio 1.12.0

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget https://github.com/chriskohlhoff/asio/archive/asio-1-12-0.tar.gz
tar xzf asio-1-12-0.tar.gz
cd asio-asio-1-12-0/asio
NOCONFIGURE=1 ./autogen.sh
./configure --host=$target --prefix=$PREFIX/$target/
make -j$(nproc)

make DESTDIR=$DESTDIR install

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself asio 1.12.0 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/asio-1.12.0_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.35   Portaudio v190600_20161030

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
export DESTDIR=/tmp/build
cd /tmp/sources

wget http://www.steinberg.net/sdk_downloads/asiosdk2.3.zip
unzip  asiosdk2.3.zip
wget http://www.portaudio.com/archives/pa_stable_v190600_20161030.tgz
tar xvzf pa_stable_v190600_20161030.tgz
cd portaudio/
#wget "https://aur.archlinux.org/cgit/aur.git/plain/fix_static_linking.patch?h=mingw-w64-portaudio" -O - |patch -p1
patch -p0 -i /opt/Sources/MINGW-packages/mingw-w64-portaudio/fix-build.patch
patch -p0 -i /opt/Sources/MINGW-packages/mingw-w64-portaudio/wdmks-wasapi-dsound.patch
autoconf
./configure --host=$target --prefix=$PREFIX/$target/  --enable-static --disable-shared --with-winapi=wmme,directx,wasapi,wdmks,asio --with-dxdir=$PREFIX/$target/ --with-asiodir=/tmp/sources/ASIOSDK2.3/ ac_cv_path_AR=$target-ar
make -j$(nproc)
# Generate two DLL with different suffixes. Hope it helps!
$target-gcc -O2 -shared -o libportaudio32.dll -Wl,--whole-archive lib/.libs/libportaudio.a -Wl,--no-whole-archive -lstdc++ -lwinmm -lole32 -lsetupapi
$target-gcc -O2 -shared -o libportaudio-2.dll -Wl,--whole-archive lib/.libs/libportaudio.a -Wl,--no-whole-archive -lstdc++ -lwinmm -lole32 -lsetupapi

make DESTDIR=$DESTDIR install
mkdir $DESTDIR/$PREFIX/$target/bin
cp libportaudio32.dll libportaudio-2.dll $DESTDIR/$PREFIX/$target/bin
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself portaudio v190600_20161030-with-Asio-Support $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/portaudio-v190600_20161030-with-Asio-Support_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.36   FluidSynthh 1.1.9

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
export DESTDIR=/tmp/build
cd /tmp/sources

wget "https://github.com/FluidSynth/fluidsynth/archive/v1.1.9.tar.gz"
tar xvzf v1.1.9.tar.gz
cd fluidsynth-1.1.9/
mkdir build && cd build/
mingw-w64-cmake -Denable-portaudio=ON  -Denable-dbus=OFF ..
# Dirty hack to fix build for 'libfluidsynth-1.dll'
sed -i "s:$: -lstdc++:g" ./src/CMakeFiles/libfluidsynth.dir/linklibs.rsp
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself fluidsynth 1.1.9 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/fluidsynth-1.1.9_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.37   Libtool 2.4.6

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
export DESTDIR=/tmp/build
cd /tmp/sources

wget ftp://ftp.gnu.org/pub/gnu/libtool/libtool-2.4.6.tar.xz
tar xvJf libtool-2.4.6.tar.xz
cd libtool-2.4.6/
./configure --host=$target --prefix=$PREFIX/$target/  --enable-static --enable-shared lt_cv_sys_lib_dlsearch_path_spec=$PREFIX/$target/lib

make DESTDIR=$DESTDIR install
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libtool 2.4.6 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/libtool-2.4.6_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.38   SDL2 2.0.7

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
export DESTDIR=/tmp/build
cd /tmp/sources

wget https://www.libsdl.org/release/SDL2-2.0.7.tar.gz
tar xvzf SDL2-2.0.7.tar.gz
cd SDL2-2.0.7
mkdir build_sdl  && cd build_sdl
../configure --host=$target --prefix=$PREFIX/$target/ --enable-shared --enable-static
make -j$(nproc) LDFLAGS=-no-undefined

make DESTDIR=$DESTDIR install
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
ln -s $PREFIX/$target/bin/sdl2-config $PREFIX/bin/
mingw-w64-makeself sdl2 2.0.7 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/sdl2-2.0.7_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.39   Smpeg 2.0.0

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
export DESTDIR=/tmp/build
cd /tmp/sources

svn co svn://svn.icculus.org/smpeg/tags/release_2_0_0
cd release_2_0_0
NOCONFIGURE=1 ./autogen.sh
CFLAGS="--std=gnu++98" ./configure --host=$target --prefix=$PREFIX/$target/ --enable-shared --enable-static
make -j$(nproc)

make DESTDIR=$DESTDIR install
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
ln -s $PREFIX/$target/bin/smpeg2-config $PREFIX/bin/
mingw-w64-makeself smpeg 2.0.0 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

5.40   SDL2_mixer 2.0.2

  • Dependancies: fluidsynth, libmodplug, flac, mpg123, vorbis
[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
export DESTDIR=/tmp/build
cd /tmp/sources

wget https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.2.tar.gz
tar xvzf SDL2_mixer-2.0.2.tar.gz
cd SDL2_mixer-2.0.2
./configure --host=$target --prefix=$PREFIX/$target/ --enable-shared --enable-static
make -j$(nproc)

make DESTDIR=$DESTDIR install
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself sdl2_mixer 2.0.2 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/sdl2_mixer-2.0.2_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.41   Twolame 0.3.13

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
export DESTDIR=/tmp/build
cd /tmp/sources

wget "http://downloads.sourceforge.net/twolame/twolame-0.3.13.tar.gz"
tar xvzf twolame-0.3.13.tar.gz
cd twolame-0.3.13/
patch -p -i /opt/Sources/MINGW-packages/mingw-w64-twolame/0001-mingw32-does-not-need-handholding.all.patch
patch -p1 -i /opt/Sources/MINGW-packages/mingw-w64-twolame/0001-mingw32-does-not-need-handholding.all.patch
patch -p1 -i /opt/Sources/MINGW-packages/mingw-w64-twolame/0002-no-undefined-on.mingw.patch
patch -p1 -i /opt/Sources/MINGW-packages/mingw-w64-twolame/0003-binary-stdin.all.patch
patch -p1 -i /opt/Sources/MINGW-packages/mingw-w64-twolame/0004-no-need-for-dllexport.mingw.patch
WANT_AUTOMAKE=latest autoreconf -fi
./configure --host=$target --prefix=$PREFIX/$target/ --enable-shared --enable-static
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g
rm -rf $DESTDIR/$PREFIX/$target/share/{man,doc}

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself twolame 0.3.13 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/twolame-0.3.13_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.42   Wavpack 5.10

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
export DESTDIR=/tmp/build
cd /tmp/sources

wget http://www.wavpack.com/wavpack-5.1.0.tar.bz2
tar xvjf wavpack-5.1.0.tar.bz2
cd wavpack-5.1.0/
./configure --host=$target --prefix=$PREFIX/$target/ --enable-shared --enable-static
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g
rm -rf $DESTDIR/$PREFIX/$target/share/man

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself wavpack 5.1.0 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/wavpack-5.1.0_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.43   Libao 1.2.0

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
export DESTDIR=/tmp/build
cd /tmp/sources

wget http://downloads.xiph.org/releases/ao/libao-1.2.0.tar.gz
tar xvzf libao-1.2.0.tar.gz
cd libao-1.2.0/
./configure --host=$target --prefix=$PREFIX/$target/ --enable-shared --enable-static
make -j$(nproc)

make DESTDIR=$DESTDIR install
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll
rm -rf $DESTDIR/$PREFIX/$target/share/{man,doc}

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libao 1.2.0 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/libao-1.2.0_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.44   LibTimidity 0.2.5

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
export DESTDIR=/tmp/build
cd /tmp/sources

wget https://github.com/sezero/libtimidity/archive/libtimidity-0.2.5.tar.gz
tar xvzf libtimidity-0.2.5.tar.gz
cd libtimidity-libtimidity-0.2.5/
aclocal
autoheader
libtoolize --force
automake --force-missing --add-missing
autoconf
./configure --host=$target --prefix=$PREFIX/$target/ --enable-shared --enable-static
make -j$(nproc)

make DESTDIR=$DESTDIR install
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libtimidity 0.2.5 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/libtimidity-0.2.5_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.45   SDL 1.2.15

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
export DESTDIR=/tmp/build
cd /tmp/sources

wget https://www.libsdl.org/release/SDL-1.2.15.tar.gz
tar xvzf SDL-1.2.15.tar.gz
cd SDL-1.2.15/
./configure --host=$target --target=$target --build=i686-pc-linux-gnu --prefix=$PREFIX/$target/ --enable-shared --enable-static
make -j$(nproc)

make DESTDIR=$DESTDIR install
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll
rm -rf $DESTDIR/$PREFIX/$target/share/{man,doc}
#sed -e "s|-mwindows||g" -i  $DESTDIR/$PREFIX/$target/lib/pkgconfig/sdl.pc

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
ln -s $PREFIX/$target/bin/sdl-config $PREFIX/bin/
mingw-w64-makeself sdl 1.2.15 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/sdl-1.2.15_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.46   Libjpeg v9

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
export DESTDIR=/tmp/build
cd /tmp/sources/

wget http://www.ijg.org/files/jpegsrc.v9c.tar.gz
tar xvzf jpegsrc.v9c.tar.gz
cd jpeg-9c/
./configure --host=$target --target=$target --build=i686-pc-linux-gnu --prefix=$PREFIX/$target/ --enable-shared --enable-static
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g
cp jpegint.h $DESTDIR/$PREFIX/$target/include
rm -rf $DESTDIR/$PREFIX/$target/share/{man,doc}

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libjpeg v9 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/libjpeg-v9_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.47   Tiff 4.0.9

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
export DESTDIR=/tmp/build
cd /tmp/sources/

wget "http://download.osgeo.org/libtiff/tiff-4.0.9.tar.gz"
tar xvzf tiff-4.0.9.tar.gz
cd tiff-4.0.9/
export CFLAGS+=" -fno-strict-aliasing"
export CXXFLAGS+=" -fno-strict-aliasing"
./configure --host=$target --target=$target --build=i686-pc-linux-gnu --prefix=$PREFIX/$target/ --enable-shared --enable-static -disable-jbig --without-x
make -j$(nproc)

make DESTDIR=$DESTDIR install
cp -vf libtiff/{tiffiop,tif_dir}.h $DESTDIR/$PREFIX/$target/include
cp libtiff/tif_config.h $DESTDIR/$PREFIX/$target/include
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g
rm -rf $DESTDIR/$PREFIX/$target/share/{man,doc}

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself tiff 4.0.9 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/tiff-4.0.9_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.48   GibLib 5.1.4

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
export DESTDIR=/tmp/build
cd /tmp/sources/

git clone https://aur.archlinux.org/mingw-w64-giflib.git
wget http://downloads.sourceforge.net/sourceforge/giflib/giflib-5.1.4.tar.bz2
tar xjf giflib-5.1.4.tar.bz2
cd giflib-5.1.4
patch -Np1 -i ../mingw-w64-giflib/giflib-5.0.4-include-stddef.patch
./configure --host=$target --target=$target --build=i686-pc-linux-gnu --prefix=$PREFIX/$target/ --enable-shared --enable-static
make -j$(nproc) bin_PROGRAMS=''

make DESTDIR=$DESTDIR bin_PROGRAMS='' install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g
rm -rf $DESTDIR/$PREFIX/$target/share/{man,doc}

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself giflib 5.1.4 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/giflib-5.1.4_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.49   LibWebp 0.6.1

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
export DESTDIR=/tmp/build
cd /tmp/sources/

wget "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-0.6.1.tar.gz"
tar xvzf libwebp-0.6.1.tar.gz
cd libwebp-0.6.1/
./configure --host=$target --target=$target --build=i686-pc-linux-gnu --prefix=$PREFIX/$target/ --enable-shared --enable-static --enable-swap-16bit-csp -enable-experimental --enable-libwebp{mux,demux,decoder,extras}
make -j$(nproc) SDL_LIBS="-lmingw32 -lSDLmain -lSDL -mwindows -liconv -lm -luser32 -lgdi32 -lwinmm -ldxguid"

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g
rm -rf $DESTDIR/$PREFIX/$target/share/{man,doc}

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libwebp 0.6.1 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/libwebp-0.6.1_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.50   SDL_image 1.2.12

  • Dependancies: libwebp, libtiff, libjpeg, libpng, SDL
[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
export DESTDIR=/tmp/build
cd /tmp/sources/

wget https://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.12.tar.gz
tar xvzf SDL_image-1.2.12.tar.gz
cd SDL_image-1.2.12/
./configure --host=$target --target=$target --build=i686-pc-linux-gnu --prefix=$PREFIX/$target/ --enable-shared --enable-static --disable-sdltest
make -j$(nproc)

make DESTDIR=$DESTDIR install
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself sdl_image 1.2.12 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/sdl_image-1.2.12_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.51   LibMikmod 3.3.11

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
export DESTDIR=/tmp/build
cd /tmp/sources

wget http://downloads.sourceforge.net/mikmod/libmikmod-3.3.11.tar.gz
tar xvzf libmikmod-3.3.11.tar.gz
cd libmikmod-3.3.11/
sed -i "s,#define HAVE_SSE2,,g" "include/mikmod_internals.h"
./configure --host=$target --prefix=$PREFIX/$target/ --enable-shared --enable-static --enable-threads=win32
make -j$(nproc)

make DESTDIR=$DESTDIR install
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll
rm -rf $DESTDIR/$PREFIX/$target/share/man

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
ln -s $PREFIX/$target/bin/libmikmod-config $PREFIX/bin/
mingw-w64-makeself libmiknod 3.3.11 $DESTDIR/$PREFIX/$target delete
rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/libmiknod-3.3.11_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.52   Smpeg 0.4.5

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
export DESTDIR=/tmp/build
cd /tmp/sources

svn co svn://svn.icculus.org/smpeg/tags/release_0_4_5
# Patch for GCC 6
cd release_0_4_5
wget "https://bugs.archlinux.org/task/51926?getfile=14765" -O - |patch -p1
./autogen.sh
./configure --host=$target --prefix=$PREFIX/$target/ --enable-shared --enable-static -disable-sdltest --disable-gtk-player --disable-gtktest --without-x --with-sdl-prefix=$PREFIX/$target/ --enable-opengl-player=no
 make -j$(nproc) LDFLAGS+="-lstdc++"
i686-w64-mingw32-gcc -shared .libs/*.o -lSDL -lstdc++ -o smpeg.dll -Xlinker --out-implib -Xlinker libsmpeg.dll.a

make DESTDIR=$DESTDIR install
cp smpeg.dll $DESTDIR/$PREFIX/$target/bin/
cp -vf libsmpeg.dll.a $DESTDIR/$PREFIX/$target/lib/
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g
rm -rf $DESTDIR/$PREFIX/$target/share/man

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
ln -s  $PREFIX/$target/bin/smpeg-config $PREFIX/bin/
mingw-w64-makeself smpeg 0.4.5 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

5.53   SDL_mixer 1.2.12

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
export DESTDIR=/tmp/build
cd /tmp/sources

wget http://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-1.2.12.tar.gz
tar xvzf SDL_mixer-1.2.12.tar.gz
cd SDL_mixer-1.2.12/
./configure --host=$target --prefix=$PREFIX/$target/ --enable-shared --enable-static
sed -e "s:^SDL_LIB.* :SDL_LIBS = $PREFIX/$target/lib/libmingw32.a $PREFIX/$target/lib/libSDLmain.a $PREFIX/$target/lib/libSDL.a:g" -i Makefile
make -j$(nproc)

make DESTDIR=$DESTDIR install
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself sdl_mixer 1.2.12 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/sdl_mixer-1.2.12_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.54   Icu(4c) 57.1

Old way (OpenTTD recommendations) - NOT TESTED

cd /tmp/sources
wget wget http://download.icu-project.org/files/icu4c/57.1/icu4c-57_1-src.tgz
tar xvzf icu4c-57_1-src.tgz
cd icu

unset CPPFLAGS
unset LDFLAGS

# Create folders
mkdir -pv {native,cross}

# Build natively. DON'T INSTALL
cd native/
../source/configure --enable-static --disable-shared
# JUST RUN MAKE! DON'T INSTALL!!! THIS IS JUST NEEDED FOR CROSSCOMPILATION
make -j$(nproc)

# Build for Win32 and INSTALL
cd ../cross
../source/runConfigureICU MinGW --host=$target --prefix=$PREFIX/$target/ --enable-static --disable-shared --disable-strict --with-cross-build=/tmp/sources/icu/native
make -j$(nproc) && make install

mv $PREFIX/$target/lib/libsicudt.a $PREFIX/$target/lib/libsicudt.a.old
cp lib/libsicudt.a $PREFIX/$target/lib/libsicudt.a

Arch way

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

git clone https://aur.archlinux.org/mingw-w64-icu.git
wget http://download.icu-project.org/files/icu4c/57.1/icu4c-57_1-src.tgz
tar xvzf icu4c-57_1-src.tgz
cd icu/
patch -p1 -i /tmp/sources/mingw-w64-icu/0004-move-to-bin.mingw.patch
patch -p1 -i /tmp/sources/mingw-w64-icu/0007-actually-move-to-bin.mingw.patch
patch -p1 -i /tmp/sources/mingw-w64-icu/0008-data-install-dir.mingw.patch
patch -p1 -i /tmp/sources/mingw-w64-icu/0009-fix-bindir-in-config.mingw.patch
patch -p1 -i /tmp/sources/mingw-w64-icu/0010-msys-rules-for-makefiles.mingw.patch
patch -p1 -i /tmp/sources/mingw-w64-icu/0011-sbin-dir.mingw.patch
patch -p1 -i /tmp/sources/mingw-w64-icu/0012-libprefix.mingw.patch
patch -p1 -i /tmp/sources/mingw-w64-icu/0014-mingwize-pkgdata.mingw.patch
patch -p1 -i /tmp/sources/mingw-w64-icu/0015-debug.mingw.patch
patch -p1 -i /tmp/sources/mingw-w64-icu/0016-icu-pkgconfig.patch
patch -p1 -i /tmp/sources/mingw-w64-icu/0017-icu-config-versioning.patch
cd source
autoreconf -fi
#
# Phase 1: Build natively on Linux
#
mkdir -p nativebuild && pushd nativebuild
CFLAGS=-fno-stack-protector
unset CPPFLAGS
unset LDFLAGS
CC=gcc CXX=g++ ../configure --enable-static --disable-shared
make -j$(nproc)
popd
#
# Phase 2: Cross-Compil
#
mkdir build-$target
cd build-$target
export CPPFLAGS=-I$PREFIX/$target//include
export LDFLAGS=-L$PREFIX/$target/lib
../configure --host=$target  --prefix=$PREFIX/$target/ --with-cross-build=$PWD/../nativebuild --with-data-packaging=library --disable-rpath --enable-release --disable-tests --disable-samples --enable-static --enable-shared
make -j$(nproc)

make install DESTDIR=$DESTDIR
mv -vf $DESTDIR/$PREFIX/$target/lib/*dll $DESTDIR/$PREFIX/$target/bin/
# Fix for OpenTTD
mv $DESTDIR/$PREFIX/$target/lib/libsicudt.a $DESTDIR/$PREFIX/$target/lib/libsicudt.a.old
cp lib/libsicudt.a $DESTDIR/$PREFIX/$target/lib/libsicudt.a
find $DESTDIR/$PREFIX/$target -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g
rm -rf $DESTDIR/$PREFIX/$target/share/man

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
ln -s $PREFIX/$target/bin/icu-config $PREFIX/bin/
mingw-w64-makeself icu 57.1 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/icu-57.1_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.55   OpenAL(Soft) 1.18.2

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget http://kcat.strangesoft.net/openal-releases/openal-soft-1.18.2.tar.bz2
tar xjf openal-soft-1.18.2.tar.bz2
cd openal-soft-1.18.2/
mkdir build-$target && cd build-$target
mingw-w64-cmake  -DALSOFT_EXAMPLES=OFF -DALSOFT_TESTS=OFF -DALSOFT_UTILS=OFF ..
make -j$(nproc)

make DESTDIR=$DESTDIR install
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself openal 1.18.2 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/openal-1.18.2_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.56   Libtheora 1.1.1

  • URL https://aur.archlinux.org/packages/mingw-w64-libtheora/

    Note

    info BEFORE BUILDING -- While compiling, a exe file has to be executed. Just

    # As root
    sudo echo ':DOSWin:M::MZ::/opt/wine/apps/MinGW32_Environment/bin//wine:' > /proc/sys/fs/binfmt_misc/register
    

    OR

    # AS simple user
    sudo echo "':DOSWin:M::MZ::/opt/wine/apps/MinGW32_Environment/bin//wine:'" > /tmp/wine.conf
    sudo mv /tmp/wine.conf /etc/binfmt.d/wine.conf
    sudo service binfmt-support restart
    

    Note

    info AFTER BUILDING -- you can remove the automatic execution for a exe fil by wine

    # As simple user
    sudo rm /etc/binfmt.d/wine.conf
    sudo service binfmt-support restart
    
[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

git clone https://aur.archlinux.org/mingw-w64-libtheora.git
cd mingw-w64-libtheora/
wget http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2
tar xjf libtheora-1.1.1.tar.bz2
cd libtheora-1.1.1/
patch -p1 -i ../libtheora-1.1.1-fix-pp_sharp_mod-calc.patch
patch -p0 -i ../libtheora-1.1.1-libpng16.patch
patch -p1 -i ../libtheora-1.1.1-libm.patch
patch -p1 -i ../libtheora-1.1.1-libadd.patch
patch -p1 -i  ../mingw-libtheora-1.1.1-rint.patch
sed -i 's/CFLAGS="$CFLAGS $cflags_save"/CFLAGS="$cflags_save"/g' configure.ac
sed -i 's/^EXPORTS//' win32/xmingw32/*.def
autoreconf -fi -I m4
./configure --host=$target --target=$target  --prefix=$PREFIX/$target/ --enable-shared --enable-static
make -j$(nproc)

make DESTDIR=$DESTDIR install
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a
rm -rf $DESTDIR/$PREFIX/$target/share/doc

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libtheora 1.1.1 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/libtheora-1.1.1_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.57   Gmp 6.1.2

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget https://gmplib.org/download/gmp/gmp-6.1.2.tar.xz
tar xJf gmp-6.1.2.tar.xz
cd gmp-6.1.2/
./configure --host=$target --target=$target  --prefix=$PREFIX/$target/ --enable-shared --disable-static --enable-cxx
make -j$(nproc)

make DESTDIR=$DESTDIR install
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself gmp 6.1.2 $DESTDIR/$PREFIX/$target delete
# rm $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/gmp-6.1.2_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.58   Nettle 3.4

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget https://ftp.gnu.org/gnu/nettle/nettle-3.4.tar.gz
tar xvzf nettle-3.4.tar.gz
cd nettle-3.4/
./configure --host=$target --target=$target  --prefix=$PREFIX/$target/ --enable-shared --enable-static
make -j$(nproc)

make DESTDIR=$DESTDIR install
rm -f  $DESTDIR/$PREFIX/$target/bin/*.exe
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself nettle 3.4 $DESTDIR/$PREFIX/$target delete
# rm $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/nettle-3.4_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.59   Lame 3.100

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

git clone https://aur.archlinux.org/mingw-w64-lame.git
wget http://downloads.sourceforge.net/lame/lame-3.100.tar.gz
tar xvzf lame-3.100.tar.gz
cd lame-3.100/
#unset LDFLAGS CPPFLAGS
patch -Np1 -i ../mingw-w64-lame/mingw.patch
patch -p1 -i /opt/Sources/MINGW-packages/mingw-w64-lame/0007-revert-posix-code.patch
CFLAGS="-msse" CPPFLAGS="$CPPFLAGS -msse" ./configure --host=$target  --prefix=$PREFIX/$target/ --enable-shared --enable-static --enable-nasm

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g
rm -rf $DESTDIR/$PREFIX/$target/share/{doc,man}

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself lame 3.100 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/lame-3.100_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.60   Opus 1.2.1

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
export DESTDIR=/tmp/build
cd /tmp/sources

wget https://ftp.osuosl.org/pub/xiph/releases/opus/opus-1.2.1.tar.gz
tar xvzf opus-1.2.1.tar.gz
cd opus-1.2.1/
./configure --host=$target  --prefix=$PREFIX/$target/ --enable-shared --enable-static --enable-custom-modes --disable-doc  --disable-extra-programs --enable-check-asm --enable-ambisonics --enable-fuzzing
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself opus 1.2.1 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/opus-1.2.1_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.61   Opusfile 0.10

  • Dependancies: ogg, opus, libressl (with patch)
[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
export DESTDIR=/tmp/build
cd /tmp/sources

wget https://ftp.osuosl.org/pub/xiph/releases/opus/opusfile-0.10.tar.gz
tar xzf opusfile-0.10.tar.gz
cd opusfile-0.10/
# Patch for LibreSSL support
wget "https://patchwork.ozlabs.org/patch/827411/raw/" -O - |patch -p1
patch -p1 -i package/opusfile/0001-fix-libressl-support.patch
./configure --host=$target  --prefix=$PREFIX/$target/ --enable-shared --enable-static --disable-doc --enable-fixed-point
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself opusfile 0.10 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/opusfile-0.10_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.62   Fftw 3.3.7

Note

info Options were used following recommendations from http://www.fftw.org/install/windows.html

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
export DESTDIR=/tmp/build
cd /tmp/sources

wget http://www.fftw.org/fftw-3.3.7.tar.gz
tar xvzf fftw-3.3.7.tar.gz
cd fftw-3.3.7/
export confflags="--host=$target --prefix=$PREFIX/$target/ --enable-shared --enable-static --with-windows-f77-mangling --disable-dependency-tracking  --enable-threads --with-combined-threads --with-our-malloc --with-incoming-stack-boundary=2"
# Run 1
mkdir build-$target--double && cd build-$target--double
../configure $confflags --enable-sse2 --enable-avx
make -j$(nproc)
# Run 2
cd ..
mkdir build-$target--long-double && cd build-$target--long-double
../configure $confflags --enable-long-double
make -j$(nproc)
# Run 3
cd ..
mkdir build-$target-single && cd build-$target-single
../configure $confflags --enable-sse --enable-avx --enable-float
make -j$(nproc)
# Run 4
cd ..
mkdir build-$target-quad-precision && cd build-$target-quad-precision
../configure $confflags --enable-quad-precision
make -j$(nproc)
# Run check using wine
cd ..
sed -i "s|\$program=\$arglist\[0\]|\$program=\"wine \$arglist[0]\"|g" tests/check.pl
cd build-$target--double
make check

for dir in build-i686-w64-mingw32--double/ build-i686-w64-mingw32--long-double/ build-i686-w64-mingw32-quad-precision/ build-i686-w64-mingw32-single/;
do
        cd $dir;
        make DESTDIR=$DESTDIR install;
        cd /tmp/sources/fftw-3.3.7;
done
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself fftw 3.3.7 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/fftw-3.3.7_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.63   Libaacplus 2.0.2

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
export DESTDIR=/tmp/build
cd /tmp/sources

wget http://tipok.org.ua/downloads/media/aacplus/libaacplus/libaacplus-2.0.2.tar.gz
tar xvzf libaacplus-2.0.2.tar.gz
cd libaacplus-2.0.2
wget "https://aur.archlinux.org/cgit/aur.git/plain/au.patch?h=libaacplus" -O - | patch -p1
./autogen.sh --fail-early
# Note: we use 'ac_cv_file__bin_bash=true' so we can cross-compil :)
./configure --host=$target --target=$target  --prefix=$PREFIX/$target/ --enable-shared --enable-static --with-fftw3 --with-fftw3-prefix=$PREFIX/$target ac_cv_file__bin_bash=true
make # THERE IS NO ERROR HERE just run 'make' else it will fail

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libaacplus 2.0.2 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/libaacplus-2.0.2_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.64   Libsamplerate 0.1.9

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget http://www.mega-nerd.com/SRC/libsamplerate-0.1.9.tar.gz
tar xvzf libsamplerate-0.1.9.tar.gz
cd libsamplerate-0.1.9/
wget "https://aur.archlinux.org/cgit/aur.git/plain/no-examples-or-tests.patch?h=mingw-w64-libsamplerate" -O - |patch -p1
autoreconf -fi
./configure --host=$target --target=$target --prefix=$PREFIX/$target/ --enable-shared --enable-static --enable-sndfile
make -j$(nproc)

make DESTDIR=$DESTDIR install
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a
rm -rf $DESTDIR/$PREFIX/$target/share/doc

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libsamplerate 0.1.9 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/libsamplerate-0.1.9_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.65   Libxml2 2.9.8

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget http://xmlsoft.org/sources/libxml2-2.9.8.tar.gz
tar xvzf libxml2-2.9.8.tar.gz
cd libxml2-2.9.8/
sed -i "s| doc example | |g" Makefile.am
autoreconf -vfi
./configure --host=$target --target=$target --prefix=$PREFIX/$target/ --enable-shared --enable-static --with-icu --without-python
make -j$(nproc)
$target-ar x $PREFIX/$target/lib/libiconv.a
$target-ar x $PREFIX/$target/lib/liblzma.a
$target-ar x $PREFIX/$target/lib/libz.a
$target-ar x $PREFIX/$target/lib/libws2_32.a
$target-ar x $PREFIX/$target/lib/libicuin.dll.a # I don't know if it is needed since I added '--with-icu'
$target-ar x $PREFIX/$target/lib/libicuuc.dll.a # I don't know if is it needed since I added '--with-icu'
$target-ar x $PREFIX/$target/lib/libicudt.dll.a # I don't know  i it is needed since I added '--with-icu'
$target-ar cru .libs/libxml2.a *.o
$target-ranlib .libs/libxml2.a

make DESTDIR=$DESTDIR install
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll
$target-strip --strip-debug $DESTDIR/$PREFIX/$target/lib/*.a
rm -rf $DESTDIR/$PREFIX/$target/share/{doc,man}

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
ln -s $PREFIX/$target/bin/xml2-config $PREFIX/bin
mingw-w64-makeself libxml2 2.9.8 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/libxml2-2.9.8_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.66   Libgpg-error 1.28

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

git clone https://aur.archlinux.org/mingw-w64-libgpg-error.git
wget ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.28.tar.bz2
tar xvjf libgpg-error-1.28.tar.bz2
cd libgpg-error-1.28/
patch -p1 -i ../mingw-w64-libgpg-error/01-mingw32-fix-potomo.mingw.patch
patch -p1 -i ../mingw-w64-libgpg-error/02-fix-symbollist-on.mingw.patch
patch -p1 -i ../mingw-w64-libgpg-error/05-w32-gen.all.patch
./configure --host=$target --prefix=$PREFIX/$target/ --enable-shared --enable-static
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g
rm -rf $DESTDIR/$PREFIX/$target/share/man

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
ln -s $PREFIX/$target/bin/gpgrt-config $PREFIX/bin/
ln -s $PREFIX/$target/bin/gpg-error-config $PREFIX/bin/
mingw-w64-makeself libgpg-error 1.28 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/libgpg-error-1.28_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.67   Libgcrypt 1.8.2

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

git clone https://aur.archlinux.org/mingw-w64-libgcrypt.git
wget https://gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.8.2.tar.bz2
tar xvjf libgcrypt-1.8.2.tar.bz2
cd libgcrypt-1.8.2/
wget "http://techer.pascal.free.fr/libgcrypt/configure.ac-Set-mym4_revision-to-0-if-not-a-git-rep.patch" -O - |patch -Np1
patch -p0 -i ../mingw-w64-libgcrypt/libgcrypt-use-correct-def-file.patch
patch -p1 -i ../mingw-w64-libgcrypt/Smarter-fig2dev-detection.all.patch
autoreconf -fi
./configure --host=$target --target=$target --prefix=$PREFIX/$target/ --enable-shared --enable-static
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g
rm -rf $DESTDIR/$PREFIX/$target/share/man

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
ln -s $PREFIX/$target/bin/libgcrypt-config $PREFIX/bin
mingw-w64-makeself libgcrypt 1.8.2 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/libgcrypt-1.8.2_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.68   Libxslt 1.1.32

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

git clone https://aur.archlinux.org/mingw-w64-libxslt.git
wget http://xmlsoft.org/sources/libxslt-1.1.32.tar.gz
tar xvzf libxslt-1.1.32.tar.gz
cd libxslt-1.1.32/
for file in libxslt-1.1.32-w64.patch libxslt-1.1.27-disable_static_modules.patch libxslt-1.1.32-win32-shared.patch \
        libxslt.m4-libxslt-1.1.26.patch 0002-python-linking-on.mingw.patch 0003-fix-concurrent-directory-creation.all.patch \
        0004-add-missing-include-for-python.all.patch 0007-use-mingw-C99-compatible-functions-{v}snprintf.patch 0008-fix-warnings.patch;
do
        patch -Nbp1 -i /opt/Sources/MINGW-packages/mingw-w64-libxslt/$file;
done
autoreconf -fi
./configure --host=$target --target=$target --prefix=$PREFIX/$target/ --enable-shared --enable-static --without-python --with-crypto --with-plugins LIBS="-lxml2"
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g
rm -rf $DESTDIR/$PREFIX/$target/share/{man,doc}

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
ln -s $PREFIX/$target/bin/xslt-config $PREFIX/bin/
mingw-w64-makeself libxslt 1.1.32 $DESTDIR/$PREFIX/$target delete
#rm -rf $DESTDIR

Download http://techer.pascal.free.fr/MinGW32/2018/packages/libxslt-1.1.32_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.69   Physfs 3.0.1

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

#hg clone -b default http://hg.icculus.org/icculus/physfs physfs
wget https://icculus.org/physfs/downloads/physfs-3.0.1.tar.bz2
tar xvjf physfs-3.0.1.tar.bz2
cd physfs-3.0.1/
#unset LDFLAGS
export CFLAGS="$CFLAGS -fno-strict-aliasing"
export CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
sed -i 's/-Werror//g' CMakeLists.txt
mkdir build && cd build
#wget "https://raw.githubusercontent.com/zyga/cmake-toolchains/master/Toolchain-Ubuntu-mingw32.cmake" -O - |sed -e "s:/usr:/opt/MinGW32:g" > /tmp/Toolchain-Ubuntu-mingw32.cmake
#/opt/cmake/3.9.3/bin/cmake  -DCMAKE_TOOLCHAIN_FILE=/tmp/Toolchain-Ubuntu-mingw32.cmake -DCMAKE_BUILD_TYPE=Release -DPHYSFS_BUILD_TEST=OFF -DPHYSFS_BUILD_WX_TEST=OFF -DCMAKE_INSTALL_PREFIX=$PREFIX/$target/ ..
mingw-w64-cmake -DCMAKE_BUILD_TYPE=Release -DPHYSFS_BUILD_TEST=OFF -DPHYSFS_BUILD_WX_TEST=OFF ..
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself physfs 3.0.1 $DESTDIR/$PREFIX/$target delete

Download http://techer.pascal.free.fr/MinGW32/2018/packages/physfs-3.0.1_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.70   Allegro 4.4.2

[ ! -d /tmp/sources ] && mkdir -p /tmp/source
cd /tmp/sources
export DESTDIR=/tmp/build

wget https://github.com/liballeg/allegro5/releases/download/4.4.2/allegro-4.4.2.tar.gz
tar xvzf allegro-4.4.2.tar.gz
cd allegro-4.4.2/
wget http://techer.pascal.free.fr/0001-allegro-4.4.2_mingw32.patch -O - |patch -p1
mkdir build && cd build
MINGDIR=$PREFIX/$target mingw-w64-cmake -DCMAKE_BUILD_TYPE=Release -DWANT_EXAMPLES=OFF -DWANT_TESTS=OFF   ..
make -j$(nproc)

make DESTDI=$DESTDIR install
sed -i "s:suffix=:suffix=44:g" $DESTDIR/$PREFIX/$target/lib/pkgconfig/allegro.pc
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip --strip-all {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;
cd $DESTDIR/$PREFIX/$target/lib/
ln -s liballeg44.dll.a liballeg44.a
cd -

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself allegro 4.4.2 $DESTDIR/$PREFIX/$target delete

5.71   Dumb 2.0.3

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources
export DESTDIR=/tmp/build

wget https://github.com/kode54/dumb/archive/2.0.3.tar.gz
tar xvzf 2.0.3.tar.gz
cd dumb-2.0.3/
wget "http://techer.pascal.free.fr/dumb-2.0.3_a_Support_Allegro_4.4.2.patch" -O - | patch -p1
mkdir build && cd build
mingw-w64-cmake -DBUILD_EXAMPLES=OFF ..
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself dumb 2.0.3 $DESTDIR/$PREFIX/$target delete

Download http://techer.pascal.free.fr/MinGW32/2018/packages/dumb-2.0.3_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.72   Allegro 5.2.3.0

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources
export DESTDIR=/tmp/build

wget https://github.com/liballeg/allegro5/releases/download/5.2.3.0/allegro-5.2.3.0.tar.gz
tar xvzf allegro-5.2.3.0.tar.gz
cd allegro-5.2.3.0/
mkdir build && cd build/
mingw-w64-cmake \
        -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=$PREFIX/$target/ \
        -DCMAKE_BUILD_TYPE=Release -DPHYSFS_LIBRARY=$PREFIX/$target/lib/libphysfs.dll.a \
        -DWANT_ACODEC_DYNAMIC_LOAD=ON -DWANT_DEMO=OFF -DWANT_DOCS_HTML=OFF -DWANT_DOCS_MAN=OFF -DWANT_EXAMPLES=OFF \
        -DWANT_TESTS=OFF -DOPENAL_LIBRARY=$PREFIX/$target/lib/libOpenAL32.dll.a -DDUMP_LIBRARY=$PREFIX/$target/lib/libdumb.dll.a ..
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself allegro 5.2.3.0 $DESTDIR/$PREFIX/$target delete

5.73   Game-music-emu 0.6.2

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export SRCDIR=/tmp/sources
export DESTDIR=/tmp/build

wget https://bitbucket.org/mpyne/game-music-emu/downloads/game-music-emu-0.6.2.tar.xz
tar xvJf game-music-emu-0.6.2.tar.xz
cd game-music-emu-0.6.2/
mkdir -pv build-${target}-{shared,static}

cd ${SRCDIR}/game-music-emu-0.6.2/build-${target}-static
mingw-w64-cmake .. -DBUILD_SHARED_LIBS=OFF && make -j$(nproc)

cd ${SRCDIR}/game-music-emu-0.6.2/build-${target}-shared
mingw-w64-cmake .. -DBUILD_SHARED_LIBS=ON && make -j$(nproc)


cd ${SRCDIR}/game-music-emu-0.6.2/build-${target}-static && make DESTDIR=${DESTDIR} install
cd ${SRCDIR}/game-music-emu-0.6.2/build-${target}-shared && make DESTDIR=${DESTDIR} install
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself GME_Game-Music-Emu 0.6.2 $DESTDIR/$PREFIX/$target delete

Download http://techer.pascal.free.fr/MinGW32/2018/packages/GME_Game-Music-Emu-0.6.2_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.74   GUILib 1.2.1

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget https://www.libsdl.org/projects/GUIlib/src/GUIlib-1.2.1.tar.gz
tar xvzf GUIlib-1.2.1.tar.gz
cd GUIlib-1.2.1/
./configure --host=$target  --prefix=$PREFIX/$target/  --enable-shared --enable-static --disable-sdltest
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself guilib 1.2.1 $DESTDIR/$PREFIX/$target delete

Download http://techer.pascal.free.fr/MinGW32/2018/packages/guilib-1.2.1_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.75   SDL2_net 2.0.1

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget https://www.libsdl.org/projects/SDL_net/release/SDL2_net-2.0.1.tar.gz
tar xvzf SDL2_net-2.0.1.tar.gz
cd SDL2_net-2.0.1/
sed -i "s|#include <winsock.h>|#include <winsock2.h>|g" SDLnetsys.h
./configure --host=$target --prefix=$PREFIX/$target/ --enable-shared --enable-static --disable-sdltest --disable-gui
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself sdl2_net 2.0.1 $DESTDIR/$PREFIX/$target delete

Download http://techer.pascal.free.fr/MinGW32/2018/packages/sdl2_net-2.0.1_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.76   SDL_net 1.2.8

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget https://www.libsdl.org/projects/SDL_net/release/SDL_net-1.2.8.tar.gz
tar xvzf SDL_net-1.2.8.tar.gz
cd SDL_net-1.2.8/
sed -i "s|#include <winsock.h>|#include <winsock2.h>|g" SDLnetsys.h
./configure --host=$target --prefix=$PREFIX/$target/ --enable-shared --enable-static --disable-sdltest --disable-gui
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself sdl_net 1.2.8 $DESTDIR/$PREFIX/$target delete

Download http://techer.pascal.free.fr/MinGW32/2018/packages/sdl_net-1.2.8_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.77   SDL2_image 2.0.2

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.2.tar.gz
tar xvzf SDL2_image-2.0.2.tar.gz
cd SDL2_image-2.0.2/
./configure --host=$target --prefix=$PREFIX/$target/ --enable-shared --enable-static --disable-sdltest
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself sdl2_image 2.0.2 $DESTDIR/$PREFIX/$target delete

Download http://techer.pascal.free.fr/MinGW32/2018/packages/sdl2_image-2.0.2_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.78   SDL_gfx 2.0.26

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget http://www.ferzkopp.net/Software/SDL_gfx-2.0/SDL_gfx-2.0.26.tar.gz
tar xvzf SDL_gfx-2.0.26.tar.gz
cd SDL_gfx-2.0.26/
./configure --host=$target --prefix=$PREFIX/$target/ --enable-static --enable-shared
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself sdl_gfx 2.0.26 $DESTDIR/$PREFIX/$target delete

Download http://techer.pascal.free.fr/MinGW32/2018/packages/sdl_gfx-2.0.26_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.79   SDL2_ttf 2.0.14 (for SDL 2)

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-2.0.14.tar.gz
tar xzf SDL2_ttf-2.0.14.tar.gz
cd SDL2_ttf-2.0.14/
./configure --host=$target  --prefix=$PREFIX/$target/  --enable-shared=yes --enable-static=yes --disable-sdltest --with-freetype-prefix=$PREFIX/$target
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself sdl2_ttf 2.0.14 $DESTDIR/$PREFIX/$target delete

Download http://techer.pascal.free.fr/MinGW32/2018/packages/sdl2_ttf-2.0.14_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.80   SDL_ttf 2.0.11 (for SDL 1.2)

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget http://libsdl.org/projects/SDL_ttf/release/SDL_ttf-2.0.11.tar.gz
tar xvzf SDL_ttf-2.0.11.tar.gz
cd SDL_ttf-2.0.11/
./configure --host=$target  --prefix=$PREFIX/$target/  --enable-shared=yes --enable-static=yes --disable-sdltest --with-freetype-prefix=$PREFIX/$target
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself sdl_ttf 2.0.11 $DESTDIR/$PREFIX/$target delete

Download http://techer.pascal.free.fr/MinGW32/2018/packages/sdl_ttf-2.0.11_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.81   Lcms2 2.9

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

git clone https://aur.archlinux.org/mingw-w64-lcms2.git
wget --no-check-certificate https://downloads.sourceforge.net/sourceforge/lcms/lcms2-2.9.tar.gz
tar xvzf lcms2-2.9.tar.gz
cd lcms2-2.9/
patch -p1 -i ../mingw-w64-lcms2/0002-need-jconfig-before-jmoreconfig.mingw.patch
autoreconf -fi
mkdir build-$target && cd build-$target
../configure --host=$target  --prefix=$PREFIX/$target/  --enable-shared=yes --enable-static=yes
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself lcms2 2.9 $DESTDIR/$PREFIX/$target delete

Download http://techer.pascal.free.fr/MinGW32/2018/packages/lcms2-2.9_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.82   Zziplib 0.13.69

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

git clone https://aur.archlinux.org/mingw-w64-zziplib.git
wget https://github.com/gdraheim/zziplib/archive/v0.13.69.tar.gz
tar xvzf v0.13.69.tar.gz
cd zziplib-0.13.69/
export PYTHON=$(which python2)
export PERL=$(which perl)
patch -Np1 -i ../mingw-w64-zziplib/configure.patch
autoreconf -fvi
./configure --host=$target  --prefix=$PREFIX/$target/  --enable-shared=yes --enable-static=yes --enable-sdl
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself zziplib 0.13.69 $DESTDIR/$PREFIX/$target delete

Download http://techer.pascal.free.fr/MinGW32/2018/packages/zziplib-0.13.69_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.83   PDFlib-Lite 7.0.5p3

  • This package is required if you want to build gfx2gfx.exe from SwfTools

Note

info These commands have to be executed on a Linux-64Bits system else it will fail for unknown reason. Thus you are advised to copy /opt/MinGW32 on a Linux-64Bits (virtual) machine

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build
export PREFIX=/opt/MinGW32
export PATH=$PREFIX/bin/:$PATH
export target=i686-w64-mingw32

git clone https://github.com/Distrotech/PDFlib-Lite.git
cd PDFlib-Lite

# First patch
wget "https://sourceforge.net/p/gnuplot/support-requests/199/attachment/PDFlib-Lite-7.0.5p3-Mingw-w64.diff"
patch -p0 -i PDFlib-Lite-7.0.5p3-Mingw-w64.diff

# Secund patch. No worries if it failed
wget "https://raw.githubusercontent.com/mxe/mxe/master/src/pdflib_lite-1-mingw.patch" -O  -|patch -p1

CFLAGS="-DPDFLIB_EXPORTS" ./configure --host=$target    --prefix=$PREFIX/$target

# Build
make -j$(nproc)
# Install temporary 'include/pdflib.h ' and 'lib/lib/libpdf.a', 'lib/libpdf.la'
make -j$(nproc) DESTDIR=$DESTDIR -C libs install

# Generate the dynamic library 'libpdf.dll'
cd libs/pdflib/.libs/
${target}-gcc -shared -o libpdf.dll libpdf.a
gendef - libpdf.dll > libpdf.def
${target}-dlltool -d libpdf.def -l libpdf.dll.a

# Copy 'libpdf.dll' and 'libpdf.dll.a'
mkdir $DESTDIR/$PREFIX/$target/bin
cp libpdf.dll $DESTDIR/$PREFIX/$target/bin
cp libpdf.dll.a $DESTDIR/$PREFIX/$target/lib

# Now copy 'pdflib-config'
cp ../../../pdflib-config $DESTDIR/$PREFIX/$target/bin

find $DESTDIR/$PREFIX/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/ -name '*.a' -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself pdflib-lite 7.0.5p3 $DESTDIR/$PREFIX/$target delete

Download http://techer.pascal.free.fr/MinGW32/2018/packages/pdflib-lite-7.0.5p3_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

Now you can get back to your Linux-32Bits machine by scp'ing the file ''/opt/MinGW32/packages/pdflib-lite-7.0.5p3_MinGW32-Linux-i686.xz.run (Right-click and "Save as")''

5.84   UnixODBC 2.3.6

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget "http://www.unixodbc.org/unixODBC-2.3.6.tar.gz" -O - | tar xvzf -
cd unixODBC-2.3.6
wget ftp://ftp.unixodbc.org/pub/unixODBC/0001-unixodbc.patch
patch -d exe < 0001-unixodbc.patch
autoreconf -f
mkdir build-$target && cd build-$target
../configure --host=$target  --prefix=$PREFIX/$target/  --enable-shared=yes --enable-static=yes --enable-setlibversion=yes --enable-driver-conf=yes
make -j$(nproc)

make DESTDIR=$DESTDIR install
touch $DESTDIR/$PREFIX/$target/etc/{odbc,odbcinst}.ini
rm -rf  $DESTDIR/$PREFIX/$target/share/man
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself unixodbc 2.3.6 $DESTDIR/$PREFIX/$target delete

Download http://techer.pascal.free.fr/MinGW32/2018/packages/unixodbc-2.3.6_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.85   Gdbm 1.17

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget http://mirror.ibcp.fr/pub/gnu/gdbm/gdbm-1.17.tar.gz
tar xvzf gdbm-1.17.tar.gz
cd gdbm-1.17/
wget "https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-gdbm/gdbm-1.15-win32.patch" -O - |patch -Np1
autoreconf --install --force
mkdir build-$target && cd build-$target
../configure --host=$target  --prefix=$PREFIX/$target/  --enable-shared=yes --enable-static=yes --enable-libgdbm-compat

make DESTDIR=$DESTDIR install
rm -rf  $DESTDIR/$PREFIX/$target/share/man
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself gdbm 1.17 $DESTDIR/$PREFIX/$target delete

Download http://techer.pascal.free.fr/MinGW32/2018/packages/gdbm-1.17_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.86   Sqlite 3.24.0

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget http://www.sqlite.org/2018/sqlite-autoconf-3240000.tar.gz
tar xvzf sqlite-autoconf-3240000.tar.gz
cd sqlite-autoconf-3240000/
mkdir build-$target && cd build-$target
CFLAGS="-DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_DISABLE_DIRSYNC=1 -DSQLITE_ENABLE_FTS3=3 -DSQLITE_ENABLE_RTREE=1" \
        config_TARGET_EXEEXT=.exe ../configure --host=$target  --prefix=$PREFIX/$target/  --enable-shared=yes --enable-static=yes --enable-threadsafe
make -j$(nproc)

make DESTDIR=$DESTDIR install
rm -rf  $DESTDIR/$PREFIX/$target/share/man
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself sqlite 3.24.0 $DESTDIR/$PREFIX/$target delete

Download http://techer.pascal.free.fr/MinGW32/2018/packages/sqlite-3.24.0_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.87   Cyrus-SASL 2.1.27-rc7

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget "https://github.com/cyrusimap/cyrus-sasl/archive/cyrus-sasl-2.1.27-rc7.tar.gz"
tar xvzf cyrus-sasl-2.1.27-rc7.tar.gz
cd cyrus-sasl-cyrus-sasl-2.1.27-rc7/

wget "https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-cyrus-sasl/02-exeext.patch" -O - |patch -p1
wget "https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-cyrus-sasl/03-fix-plugins.patch" -O - |patch -p1
# This one commented below seems to be useless
#wget "https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-cyrus-sasl/04-manpage-paths.patch" -O - |patch -p1
wget "https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-cyrus-sasl/14-MinGW-w64-add-LIBSASL_API-to-function-definitions.patch" -O - |patch -p1
wget "https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-cyrus-sasl/15-MinGW-w64-define-LIBSASL_EXPORTS_eq_1-for-sasldb.patch" -O - |patch -p1
wget "https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-cyrus-sasl/16-MinGW-w64-define-WIN32_LEAN_AND_MEAN-avoiding-handle_t-redef.patch" -O - |patch -p1
wget "https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-cyrus-sasl/17-MinGW-w64-define-S_IRUSR-and-S_IWUSR.patch" -O - |patch -p1
wget "https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-cyrus-sasl/19-paths-relocation.patch" -O - |patch -p1

autoreconf -fiv
cp -vf win32/include/md5global.h include/md5global.h
mkdir build-$target && cd build-$target
./configure --host=$target --build=$target --target=$target  --prefix=$PREFIX/$target/  --enable-shared=yes --enable-static=no \
        --with-configdir=$PREFIX/$target/etc/sasl2:$PREFIX/$target/etc/sasl:$PREFIX/$target//lib/sasl2 \
        --with-plugindir=$PREFIX/$target/lib/sasl2 --with-sqlite3=$PREFIX/$target/ --disable-ldapdb --oldincludedir=$PREFIX/$target/include \
        --without-saslauthd  --without-pwcheck --without-openssl --without-des --without-authdaemond --with-dblib=gdbm \
        CC=$(which $target-gcc) CC_FOR_BUILD=$(which $target-gcc)
make -j$(nproc)

export _plugindir=$PREFIX/$target/lib/sasl2
make DESTDIR=$DESTDIR install  sasldir=${_plugindir}
rm -rf  $DESTDIR/$PREFIX/$target/share/man
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself cyrus-sasl 2.1.27-rc7 $DESTDIR/$PREFIX/$target delete

Download http://techer.pascal.free.fr/MinGW32/2018/packages/cyrus-sasl-2.1.27-rc7_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.88   Mman-win32 20180604

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

git clone https://github.com/witwall/mman-win32.git
cd mman-win32/
./configure --prefix=$PREFIX/$target --cc=$target-gcc --enable-shared --enable-static --cross-prefix=$target- --bindir=$PREFIX/$target/bin --libdir=$PREFIX/$target/lib --incdir=$PREFIX/$target/include
make -j$(nproc)
make install

make DESTDIR=/tmp/build install
# Libraries are already stripped while building
# v20180604 = Last commit from the git repository

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself mman-win32 v20180604 $DESTDIR/$PREFIX/$target delete

Download http://techer.pascal.free.fr/MinGW32/2018/packages/mman-win32-v20180604_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.89   Berkeley-DB 4.8.30

Should not be included in my own distribution. But for my personal uses, I need it for OpenLDAP.

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget http://download.oracle.com/berkeley-db/db-4.8.30.tar.gz
tar xvzf db-4.8.30.tar.gz
cd db-4.8.30/
chmod 777 -R .
wget "https://gist.githubusercontent.com/kobake/2761506fc958f8bf07601d00dea01470/raw/805e58ee669c9d3f7214091c816c1a6257d5407d/db-4.8.30-fix-for-mingw.patch" -O - |patch -p1
cd build_unix/
../dist/configure --prefix=$PREFIX/$target --host=$target --enable-cxx --enable-mingw --disable-replication --enable-compat185 --enable-diagnostic
make -j$(nproc)

make DESTDIR=$DESTDIR install
cd .libs
for file in db_archive db_checkpoint db_deadlock db_dump db_hotbackup db_load db_printlog db_recover db_sql db_stat db_upgrade db_verify;
do
        cp $file $DESTDIR/$PREFIX/$target/bin/$file.exe;
done
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself berkeley-db 4.8.30 $DESTDIR/$PREFIX/$target delete

Download http://techer.pascal.free.fr/MinGW32/2018/packages/berkeley-db-4.8.30_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.90   Regex-POSIX-Gnulib 20090805

  • Required to build OpenLDAP to get a POSIX regex implementation
[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

git clone https://github.com/Distrotech/regex.git
cd regex
./configure --prefix=$PREFIX/$target --host=$target --enable-shared=yes --enable-static=yes
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself regex-posix-gnulib 20090805 $DESTDIR/$PREFIX/$target delete

Download http://techer.pascal.free.fr/MinGW32/2018/packages/regex-posix-gnulib-20090805_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.91   OpenLDAP 2.4.45 (with LibreSSL + Cyrus-SASL + HDB/BDB)

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build


export LD=i686-w64-mingw32-ld
wget http://repository.linagora.org/OpenLDAP/openldap-release/openldap-2.4.45.tgz
tar xzf openldap-2.4.45.tgz
cd openldap-2.4.45/

wget "https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-openldap/001-backmdb.patch" -O - | patch -p1
wget "https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-openldap/002-link-with-icu.patch" -O - | patch -p1
wget "https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-openldap/003-symdummy-error.patch" -O - | patch -p1
# Patch for LibreSSL
wget "http://techer.pascal.free.fr/0004-fix-libressl-support.patch" -O - |patch -p2
patch -p1 -i  openldap/0004-fix-libressl-support.patch

sed -i "s:windres:${target}-windres:g" libraries/liblutil/Makefile.in
export lt_cv_deplibs_check_method='pass_all'
mkdir build-$target && cd build-$target
../configure --host=$target --prefix=$PREFIX/$target/  --libexecdir=$PREFIX/$target/bin --sbindir=$PREFIX/$target/bin \
        --with-tls=openssl --with-cyrus-sasl=yes --enable-modules=yes --enable-hdb=yes --enable-bdb=yes \
        --enable-overlays=yes --with-mp=gmp --with-odbc=unixodbc --enable-rlookups=yes --enable-lmpasswd=yes \
        --enable-ldap=yes --enable-meta=yes --enable-sql=yes CC=$(which $target-gcc)

sed -i "s/#define socklen_t int/\/*#define socklen_t int*\//" include/portable.h
sed -i "s:^.*NEED_MEMCMP_REPLACEMENT.*$::g" include/portable.h
make depend
sed -i "s:SHELL = /bin/sh:SHELL = /bin/bash:g" servers/slapd/Makefile
make -j$(nproc)

make DESTDIR=$DESTDIR install
rm -rf  $DESTDIR/$PREFIX/$target/share/man
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself openldap 2.4.45 $DESTDIR/$PREFIX/$target delete

Download http://techer.pascal.free.fr/MinGW32/2018/packages/openldap-2.4.45_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.92   Libfdk-aac 0.1.6

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget "https://downloads.sourceforge.net/opencore-amr/fdk-aac-0.1.6.tar.gz"
tar xvzf fdk-aac-0.1.6.tar.gz
cd fdk-aac-0.1.6/
./configure --prefix=$PREFIX/$target --host=$target --enable-shared=yes --enable-static=yes
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.dll' | xargs -rtl1 ${target}-strip -x
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs -rtl1 ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libfdk-aac 0.1.6 $DESTDIR/$PREFIX/$target delete

Download http://techer.pascal.free.fr/MinGW32/2018/packages/libfdk-aac-0.1.6_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.93   Opencore-amr 0.1.5

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget http://downloads.sourceforge.net/sourceforge/opencore-amr/opencore-amr-0.1.5.tar.gz
tar xvzf opencore-amr-0.1.5.tar.gz
cd opencore-amr-0.1.5/
./configure --prefix=$PREFIX/$target --host=$target --enable-shared=yes --enable-static=yes
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.dll' | xargs -rtl1 ${target}-strip -x
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs -rtl1 ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself opencore-amr 0.1.5 $DESTDIR/$PREFIX/$target delete

Download http://techer.pascal.free.fr/MinGW32/2018/packages/opencore-amr-0.1.5_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.94   Vo-aacenc 0.1.3

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget http://downloads.sourceforge.net/opencore-amr/vo-aacenc-0.1.3.tar.gz
tar xvzf vo-aacenc-0.1.3.tar.gz
cd vo-aacenc-0.1.3/
./configure --prefix=$PREFIX/$target --host=$target --enable-shared=yes --enable-static=yes
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.dll' | xargs -rtl1 ${target}-strip -x
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs -rtl1 ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself vo-aacenc 0.1.3 $DESTDIR/$PREFIX/$target delete

Download http://techer.pascal.free.fr/MinGW32/2018/packages/vo-aacenc-0.1.3_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.95   Vo-amrwbenc 0.1.3

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget "https://downloads.sourceforge.net/sourceforge/opencore-amr/vo-amrwbenc-0.1.3.tar.gz"
tar xvzf vo-amrwbenc-0.1.3.tar.gz
cd vo-amrwbenc-0.1.3/
./configure --prefix=$PREFIX/$target --host=$target --enable-shared=yes --enable-static=yes
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.dll' | xargs -rtl1 ${target}-strip -x
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs -rtl1 ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself vo-amrwbenc 0.1.3 $DESTDIR/$PREFIX/$target delete

Download http://techer.pascal.free.fr/MinGW32/2018/packages/vo-amrwbenc-0.1.3_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.96   Xvidcode 1.3.5

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget http://downloads.xvid.org/downloads/xvidcore-1.3.5.tar.bz2
tar xvjf xvidcore-1.3.5.tar.bz2
cd xvidcore/build/generic
./configure --prefix=$PREFIX/$target --host=$target
make -j$(nproc)

make DESTDIR=$DESTDIR install
cp -vf  ${DESTDIR}/${PREFIX}/${target}/lib/xvidcore.a ${DESTDIR}/${PREFIX}/${target}/lib/libxvidcore.a
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself xvidcore 1.3.5 $DESTDIR/$PREFIX/$target delete

Download http://techer.pascal.free.fr/MinGW32/2018/packages/xvidcore-1.3.5_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.97   Orc 4.28

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

git clone git://anongit.freedesktop.org/gstreamer/orc
cd orc/
git checkout 31cb4bfc51de81b5c2569abdcff830b83c74499c
NOCONFIGURE=1 ./autogen.sh
./configure --prefix=$PREFIX/$target --host=$target --enable-shared=yes --enable-static=yes --disable-gtk-doc
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself orc 4.28 $DESTDIR/$PREFIX/$target delete

Download http://techer.pascal.free.fr/MinGW32/2018/packages/orc-4.28_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.98   Liboil 0.3.17

  • Deprecated to build schroedinger in favor of Orc but added it as package for archival purposes.
[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget https://liboil.freedesktop.org/download/liboil-0.3.17.tar.gz
tar xvzf liboil-0.3.17.tar.gz
cd liboil-0.3.17/

NOCONFIGURE=1 ./autogen.sh
./configure --prefix=$PREFIX/$target --host=$target --enable-shared=yes --enable-static=yes
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself liboil 0.3.17 $DESTDIR/$PREFIX/$target delete

Download http://techer.pascal.free.fr/MinGW32/2018/packages/liboil-0.3.17_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.99   Schroedinger 1.0.11

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

git clone https://aur.archlinux.org/mingw-w64-schroedinger.git
wget "http://launchpad.net/schroedinger/trunk/1.0.11/+download/schroedinger-1.0.11.tar.gz"
tar xvzf schroedinger-1.0.11.tar.gz
cd schroedinger-1.0.11/
patch -Np1 -i ../mingw-w64-schroedinger/testsuite.patch
./configure --prefix=$PREFIX/$target --host=$target --enable-shared=yes --enable-static=yes --disable-gtk-doc
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself schroedinger 1.0.11 $DESTDIR/$PREFIX/$target delete

Download http://techer.pascal.free.fr/MinGW32/2018/packages/schroedinger-1.0.11_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.100   Faad 2.8.8

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget "https://sourceforge.net/projects/faac/files/faad2-src/faad2-2.8.0/faad2-2.8.8.tar.gz/download" -O faad2-2.8.8.tar.gz
tar xvzf faad2-2.8.8.tar.gz
cd faad2-2.8.8/
sed -i "s:\#include \"win32_ver.h\":\#include \<windows.h\>:g" libfaad/decoder.c
./configure --prefix=$PREFIX/$target --host=$target --enable-shared=yes --enable-static=yes --with-drm
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself faad 2.8.8 $DESTDIR/$PREFIX/$target delete

Download http://techer.pascal.free.fr/MinGW32/2018/packages/faad-2.8.8_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.101   Faac 1.29.9.2 with DRM (Digital Radio Mondiale support)

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget "https://sourceforge.net/projects/faac/files/faac-src/faac-1.29/faac-1.29.9.2.tar.gz/download" -O faac-1.29.9.2.tar.gz
tar xvzf faac-1.29.9.2.tar.gz
cd faac-1.29.9.2/
mkdir build-$target && cd build-$target
../configure --prefix=$PREFIX/$target --host=$target --enable-shared=yes --enable-static=yes --enable-drm
make -j$(nproc) LDFLAGS="${LDFLAGS} -no-undefined"

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself faac-with-drm 1.29.9.2 $DESTDIR/$PREFIX/$target delete

Download http://techer.pascal.free.fr/MinGW32/2018/packages/faac-with-drm-1.29.9.2_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.102   Faac 1.29.9.2 without DRM (Digital Radio Mondiale support)

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget "https://sourceforge.net/projects/faac/files/faac-src/faac-1.29/faac-1.29.9.2.tar.gz/download" -O faac-1.29.9.2.tar.gz
tar xvzf faac-1.29.9.2.tar.gz
cd faac-1.29.9.2/
./configure --prefix=$PREFIX/$target --host=$target --enable-shared=yes --enable-static=yes
make -j$(nproc) LDFLAGS="${LDFLAGS} -no-undefined"

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself faac-without-drm 1.29.9.2 $DESTDIR/$PREFIX/$target delete

Download http://techer.pascal.free.fr/MinGW32/2018/packages/faac-without-drm-1.29.9.2_MinGW32-Linux-i686.xz.run (Right-click and "Save as")

5.103   Fribidi 1.0.5

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget "https://github.com/fribidi/fribidi/releases/download/v1.0.5/fribidi-1.0.5.tar.bz2"
tar xvjf fribidi-1.0.5.tar.bz2
cd fribidi-1.0.5/
./autogen.sh --prefix=$PREFIX/$target --host=$target --enable-shared=yes --enable-static=yes
make -j$(nproc)

make DESTDIR=$DESTDIR install
${target}-ranlib $DESTDIR/$PREFIX/$target/lib/*.a
${target}-strip -s $DESTDIR/$PREFIX/$target/bin/*.exe
${target}-strip -x $DESTDIR/$PREFIX/$target/bin/*.dll
${target}-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself fribidi 1.0.5 $DESTDIR/$PREFIX/$target delete

5.104   Graphite2 1.3.11

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

git clone https://aur.archlinux.org/mingw-w64-graphite.git
wget https://github.com/silnrsi/graphite/releases/download/1.3.11/graphite2-1.3.11.tgz
tar xvzf graphite2-1.3.11.tgz
cd graphite2-1.3.11/
patch -p1 -i ../mingw-w64-graphite/001-graphite2-1.3.8-win64.patch
patch -p1 -i ../mingw-w64-graphite/002-graphite2-1.2.1-pkgconfig.patch
patch -p1 -i ../mingw-w64-graphite/003-graphite2-1.3.8-staticbuild.patch
sed -i "s:\/usr\/bin\/python:\/usr\/bin\/python2:" tests/{corrupt.py,defuzz,fnttxtrender,fuzzbidi,fuzztest,hbspeeds,jsoncmp}
mkdir build-$target && cd build-$target
mingw-w64-cmake -DCMAKE_BUILD_TYPE=Release -DGRAPHITE2_COMPARE_RENDERER=OFF ..
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs -rtl1 ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself graphite2 1.3.11 $DESTDIR/$PREFIX/$target delete

5.105   Harfbuzz 1.8.6

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget https://www.freedesktop.org/software/harfbuzz/release/harfbuzz-1.8.6.tar.bz2
tar xvjf harfbuzz-1.8.6.tar.bz2
cd harfbuzz-1.8.6/
sed -i '/SUBDIRS/s/test//' Makefile.am
NOCONFIGURE=1 ./autogen.sh
#
# Build-Static
#
mkdir build-$target-static && cd build-$target-static
CFLAGS=-DGRAPHITE2_STATIC CXXFLAGS=-DGRAPHITE2_STATIC ../configure --host=$target --prefix=$PREFIX/$target --with-glib --with-freetype --with-cairo--with-icu --with-gobject --with-graphite2 --enable-static=yes --enable-shared=no
make -j$(nproc)
#
# Build shared
#
cd ..
mkdir build-$target-shared && cd build-$target-shared
../configure --host=$target --prefix=$PREFIX/$target --with-glib --with-freetype --with-cairo--with-icu --with-gobject --with-graphite2 --enable-static=no --enable-shared=yes
make -j$(nproc)

cd /tmp/sources/harfbuzz-1.8.6/build-$target-static
make DESTDIR=$DESTDIR install
cd /tmp/sources/harfbuzz-1.8.6/build-$target-shared
make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs -rtl1 ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself harfbuzz 1.8.6 $DESTDIR/$PREFIX/$target delete

5.106   Libass 0.14.0

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget https://github.com/libass/libass/releases/download/0.14.0/libass-0.14.0.tar.xz
tar xvJf libass-0.14.0.tar.xz
cd libass-0.14.0/
mkdir build-$target && cd build-$target
../configure --host=$target --prefix=$PREFIX/$target --enable-static=yes --enable-shared=yes --enable-harfbuzz --enable-fontconfig --enable-large-tiles
make -j$(nproc)

make DESTDIR=$DESTDIR install
${target}-strip -x -g $DESTDIR/$PREFIX/$target/bin/*.dll
${target}-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libass 0.14.0 $DESTDIR/$PREFIX/$target delete

5.107   Openjpeg2 2.3.0

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

git clone https://aur.archlinux.org/mingw-w64-openjpeg2.git
wget https://github.com/uclouvain/openjpeg/archive/v2.3.0.tar.gz
tar xvzf v2.3.0.tar.gz
cd openjpeg-2.3.0/
sed -i '/add_subdirectory(thirdparty)/d' CMakeLists.txt
patch -p1 -i ../mingw-w64-openjpeg2/0001-fix-install-for-dlls.all.patch
patch -p1 -i ../mingw-w64-openjpeg2/0003-versioned-dlls.mingw.patch
patch -p1 -i ../mingw-w64-openjpeg2/0005-sock-jpip.all.patch
unset LDFLAGS
#
# Build Static
#
mkdir build-$target-static && cd build-$target-static
mingw-w64-cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_DOC=OFF -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=OFF ..
make -j$(nproc)
#
# Build Shared
#
cd ..
mkdir build-$target-shared && cd build-$target-shared
mingw-w64-cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_DOC=OFF -DBUILD_TESTING=OFF -DBUILD_PKGCONFIG_FILES=ON ..
make -j$(nproc)


cd /tmp/sources/openjpeg-2.3.0/build-i686-w64-mingw32-static/
make DESTDIR=$DESTDIR install
cd /tmp/sources/openjpeg-2.3.0/build-i686-w64-mingw32-shared
make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs -rtl1 ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself openjpeg2 2.3.0 $DESTDIR/$PREFIX/$target delete

5.108   Openjpeg 1.5.2

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

git clone https://aur.archlinux.org/mingw-w64-openjpeg.git
wget http://downloads.sourceforge.net/openjpeg.mirror/openjpeg-1.5.2.tar.gz
tar xzf openjpeg-1.5.2.tar.gz
cd openjpeg-1.5.2/
rm -rf thirdparty/
dos2unix libopenjpeg/opj_malloc.h
patch -p1 -i ../mingw-w64-openjpeg/openjpeg-1.5_tiff-pkgconfig.patch
patch -p1 -i ../mingw-w64-openjpeg/rhbz1037945_CVE-2013-1447.patch
patch -p1 -i ../mingw-w64-openjpeg/rhbz1037948_CVE-2013-6887.patch
patch -p1 -i ../mingw-w64-openjpeg/rhbz1082997_CVE-2014-0158.patch
patch -p1 -i ../mingw-w64-openjpeg/cdecl.patch
autoreconf -fvi
./configure --host=$target --prefix=$PREFIX/$target --enable-static=yes --enable-shared=yes --disable-doc --enable-jpwl
make -j$(nproc)

make DESTDIR=$DESTDIR install
rm -rf $DESTDIR/$PREFIX/$target/share/man
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs -rtl1 ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself openjpeg 1.5.2 $DESTDIR/$PREFIX/$target delete

5.109   Gavl 1.4.0

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget "https://downloads.sourceforge.net/sourceforge/gmerlin/gavl-1.4.0.tar.gz"
tar xvzf gavl-1.4.0.tar.gz
cd gavl-1.4.0/
wget "https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-gavl/0001-gavl-1.4.0-fix-64-bit-compilation.patch" -O - | patch -Np1
wget "https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-gavl/0002-gavl-1.4.0-fix-shared-dll-installation.patch" -O - |patch -Np1
autoreconf -fiv
./configure --host=$target --prefix=$PREFIX/$target --enable-shared=yes --enable-static=yes --without-doxygen
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs -rtl1 ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself gavl 1.4.0 $DESTDIR/$PREFIX/$target delete

5.110   Frei0r-plugins 1.6.1

  • Dependancies: Gavl
[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build


wget https://files.dyne.org/frei0r/frei0r-plugins-1.6.1.tar.gz
tar xvzf frei0r-plugins-1.6.1.tar.gz
cd frei0r-plugins-1.6.1/
mkdir build
cd build/
mingw-w64-cmake ..
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs -rtl1 ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself frei0r-plugins 1.6.1 $DESTDIR/$PREFIX/$target delete

5.111   Libsoxr 0.1.3

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

git clone https://aur.archlinux.org/mingw-w64-libsoxr.git
wget "http://downloads.sourceforge.net/project/soxr/soxr-0.1.3-Source.tar.xz"
tar xvJf soxr-0.1.3-Source.tar.xz
cd soxr-0.1.3-Source/
patch -p1 -i ../mingw-w64-libsoxr/tests_executable_suffix.patch
#
# Build Shared
#
mkdir build-$target-shared && cd build-$target-shared
mingw-w64-cmake -DCMAKE_BUILD_TYPE='Release'  -DBUILD_EXAMPLES='OFF' -DBUILD_SHARED_LIBS='ON'  -DWITH_AVFFT='ON'  -DWITH_LSR_BINDINGS='ON'  -DWITH_OPENMP='ON'  -DWITH_PFFFT='ON'  -DHAVE_WORDS_BIGENDIAN_EXITCODE='0'   -DBUILD_TESTS='OFF' ..
make -j$(nproc)
#
# Build Static
#
mkdir ../build-$target-static && cd ../build-$target-static
mingw-w64-cmake -DCMAKE_BUILD_TYPE='Release'  -DBUILD_EXAMPLES='OFF' -DBUILD_SHARED_LIBS='OFF' -DWITH_AVFFT='ON'  -DWITH_LSR_BINDINGS='ON'   -DWITH_OPENMP='ON' -DWITH_PFFFT='ON'  -DHAVE_WORDS_BIGENDIAN_EXITCODE='0'    -DBUILD_TESTS='OFF' ..
make -j$(nproc)

cd ../build-$target-shared && make DESTDIR=$DESTDIR install
cd ../build-$target-static && make DESTDIR=$DESTDIR install
${target}-strip -x -g $DESTDIR/$PREFIX/$target/bin/*.dll
${target}-strip -g $DESTDIR/$PREFIX/$target/lib/*.a
rm -rf $DESTDIR/$PREFIX/$target/doc

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libsoxr 0.1.3 $DESTDIR/$PREFIX/$target delete

5.112   L-smash 2.14.5

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget https://github.com/l-smash/l-smash/archive/v2.14.5.tar.gz
tar xvzf v2.14.5.tar.gz
cd l-smash-2.14.5/
mkdir build-$target && cd build-$target
../configure --prefix=$PREFIX/$target --cross-prefix=$target- --enable-shared --extra-cflags="$CFLAGS" --extra-ldflags="$LDFLAGS"
make

make DESTDIR=$DESTDIR install
${target}-strip -s $DESTDIR/$PREFIX/$target/bin/*exe
${target}-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*.dll
${target}-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself l-smash 2.14.5 $DESTDIR/$PREFIX/$target delete

5.113   X264 r2665-a01e339 (for FFmpeg 2.2.16)

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

git clone http://git.videolan.org/git/x264.git
cd x264/
git checkout a01e33913655f983df7a4d64b0a4178abb1eb618
wget "https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-x264-git/0001-beautify-pc.all.patch" -O - | patch -p1
wget "https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-x264-git/0002-install-avisynth_c.h.mingw.patch" -O - | patch -p1
mkdir build && cd build
unset AS
export RC=${PREFIX}/bin/${target}-ar
../configure --host=$target --prefix=$PREFIX/$target --cross-prefix=$target- --enable-shared --enable-static --enable-strip --enable-pic --disable-win32thread
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs -rtl1 ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself x264 r2665-a01e339 $DESTDIR/$PREFIX/$target delete

5.114   X264 r2901-7d0ff22

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

git clone http://git.videolan.org/git/x264.git
cd x264/
git checkout 7d0ff22e8c96de126be9d3de4952edd6d1b75a8c
wget "https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-x264-git/0001-beautify-pc.all.patch" -O - | patch -p1
wget "https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-x264-git/0002-install-avisynth_c.h.mingw.patch" -O - | patch -p1
mkdir build && cd build
unset AS
export RC=${PREFIX}/bin/${target}-ar
../configure --host=$target --prefix=$PREFIX/$target --cross-prefix=$target- --enable-shared --enable-static --enable-strip --enable-pic --disable-win32thread
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs -rtl1 ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself x264 r2901-7d0ff22 $DESTDIR/$PREFIX/$target delete

5.115   Gsm 1.0.18

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

git clone https://aur.archlinux.org/mingw-w64-gsm.git
wget http://www.quut.com/gsm/gsm-1.0.18.tar.gz
tar xvzf gsm-1.0.18.tar.gz
cd gsm-1.0-pl18/
patch -Np1 -i ../mingw-w64-gsm/makefile.patch
patch -Np1 -i ../mingw-w64-gsm/win32.patch
make -f Makefile.mingw64 CC=$target-gcc AR=$target-ar RANLIB=$target-ranlib


install -m755 -d  $DESTDIR/$PREFIX/$target/{bin,lib,include/gsm,share/{licenses/gsm,man/man{1,3}}}
make -f Makefile.mingw64 CC=$target-gcc AR=$target-ar RANLIB=$target-ranlib \
        INSTALL_ROOT=$DESTDIR/$PREFIX/$target/ \
        GSM_INSTALL_INC=$DESTDIR/$PREFIX/$target/include/gsm \
        GSM_INSTALL_MAN=$DESTDIR/$PREFIX/$target/share/man/man3 \
        TOAST_INSTALL_MAN=$DESTDIR/$PREFIX/$target//share/man/man1 install
chmod 777 -R $DESTDIR
${target}-strip -s $DESTDIR/$PREFIX/$target/bin/*exe
${target}-strip -x -g $DESTDIR/$PREFIX/$target/bin/*.dll
${target}-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself gsm 1.0.18 $DESTDIR/$PREFIX/$target delete

5.116   Libvpx 1.7.0

Note

info Remove option --enable-spatial-svc if you want to build it for ReactOS or if you want to link it to FFmpeg (./configure...--enable-libvpx...) so you can use FFmpeg on ReactOS.

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

git clone https://aur.archlinux.org/mingw-w64-libvpx.git
wget "https://github.com/webmproject/libvpx/archive/v1.7.0.tar.gz"
tar xvzf v1.7.0.tar.gz
cd libvpx-1.7.0/
patch -Np1 -i ../mingw-w64-libvpx/configure.patch
mkdir build-$target && cd build-$target
#
# Had to unset target variable else 'make' will fail :(
#
export _arch=$target
unset target
#
# Compared to the above URL (see above), we will use/set '-mstackrealign' directly for both --extra-cflags and --extra-cxxflags instead of EXTRA_CFLAGS
#
CROSS=i686-w64-mingw32- ../configure --prefix=$PREFIX/${_arch} --target=x86-win32-gcc \
        --enable-runtime-cpu-detect \
        --enable-shared \
        --enable-pic \
        --disable-docs \
        --disable-install-docs \
        --disable-install-srcs \
        --enable-vp8 \
        --enable-postproc \
        --enable-vp9 \
        --enable-vp9-highbitdepth \
        --enable-experimental \
        --enable-spatial-svc \
        --extra-cflags="-mstackrealign"  --extra-cxxflags="-mstackrealign"
make -j4

export DIST_DIR=$DESTDIR/$PREFIX/${_arch}
make DIST_DIR=$DIST_DIR install
mv -vf $DIST_DIR/lib/libvpx.dll $DIST_DIR/bin
mv -vf $DIST_DIR/lib/libvpx.dll.5* $DIST_DIR/bin
cp libvpx.dll.a $DIST_DIR/lib
# Now we can strip binaries
${_arch}-strip -s $DIST_DIR/bin/*exe
${_arch}-strip -g --strip-unneeded $DIST_DIR/bin/*.dll
${_arch}-strip -g --strip-unneeded $DIST_DIR/bin/libvpx.dll.5.0.0
${_arch}-strip -g $DIST_DIR/lib/*.a
chmod 777 -R $DIST_DIR

cp -avf $DESTDIR/$PREFIX/${_arch}/* $PREFIX/${_arch}
mingw-w64-makeself libvpx 1.7.0 $DESTDIR/$PREFIX/${_arch} delete

5.117   Librtmp 20151223

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

git clone https://aur.archlinux.org/mingw-w64-librtmp0.git
git clone git://git.ffmpeg.org/rtmpdump
cd rtmpdump/
patch -Np1 -i ../mingw-w64-librtmp0/0001-Makefile-allow-to-override-some-parameters.patch
export C_INCLUDE_PATH="$PREFIX/$target/include/openssl"
sed -i "s:LIB_OPENSSL=:LIB_OPENSSL=-L${PREFIX}/${target}/lib :g" Makefile librtmp/Makefile
make SYS=mingw prefix="{$PREFIX}/${target}" CRYPTO=OPENSSL XCFLAGS="$CFLAGS" CC=${target}-gcc LD=${target}-ld

make install DESTDIR=$DESTDIR SYS=mingw prefix="${PREFIX}/${target}" CRYPTO=OPENSSL XCFLAGS="$CFLAGS" CC=${target}-gcc LD=${target}-ld
$target-strip --strip-unneeded $DESTDIR/${PREFIX}/${target}/bin/*dll
$target-strip -g $DESTDIR/${PREFIX}/${target}/lib/*.a
$target-strip --strip-all $DESTDIR/${PREFIX}/${target}/bin/*.exe
#
# Wanna make some tests quickly?
#
#
cd ${DESTDIR}/${PREFIX}/${target}/bin
wine rtmpdump.exe -r "rtmp://cp67126.edgefcs.net/ondemand/mp4:mediapm/ovp/content/test/video/spacealonehd_sounas_640_300.mp4" -o spacealonehd_sounas_640_300.mp4
#
# Then open the video file 'spacealonehd_sounas_640_300.mp4'  using any video player (vlc, mpv and so on)
# And delete it
rm -vf spacealonehd_sounas_640_300.mp4

cp -avf $DESTDIR/$PREFIX/${target}/* $PREFIX/${target}
mingw-w64-makeself librtmp 20151223 $DESTDIR/$PREFIX/${target} delete

5.118   Jasper 2.0.14

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

git clone https://aur.archlinux.org/mingw-w64-jasper.git
wget https://github.com/mdadams/jasper/archive/version-2.0.14.tar.gz
tar xzf version-2.0.14.tar.gz
cd jasper-version-2.0.14/
for file in ../mingw-w64-jasper/jasper-1.900.1-fix-filename-buffer-overflow.patch ../mingw-w64-jasper/001-mingw-cmake.patch ../mingw-w64-jasper/002-add-more-exports.patch ../mingw-w64-jasper/jasper-static-fix.patch;
do patch -p1 -i $file;
done
options=( -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release -DJAS_ENABLE_OPENGL=OFF -DJAS_ENABLE_LIBJPEG=ON -DJAS_ENABLE_AUTOMATIC_DEPENDENCIES=OFF -DCMAKE_SKIP_RPATH=ON -DJAS_ENABLE_DOC=OFF )
mkdir -p build-$target-{shared,static}
cd /tmp/sources/jasper-version-2.0.14/build-$target-static
mingw-w64-cmake ${options[@]} -DJAS_ENABLE_SHARED=OFF ..
make -j$(nproc)
cd /tmp/sources/jasper-version-2.0.14/build-$target-shared
mingw-w64-cmake ${options[@]} -DJAS_ENABLE_SHARED=ON ..
make -j$(nproc)

cd /tmp/sources/jasper-version-2.0.14/build-$target-static
make DESTDIR=$DESTDIR install
cd /tmp/sources/jasper-version-2.0.14/build-$target-shared
make DESTDIR=$DESTDIR install
rm -rf $DESTDIR/${PREFIX}/${target}/share
$target-strip --strip-unneeded $DESTDIR/${PREFIX}/${target}/bin/*dll
$target-strip -g $DESTDIR/${PREFIX}/${target}/lib/*.a
$target-strip $DESTDIR/${PREFIX}/${target}/bin/*.exe

cp -avf $DESTDIR/$PREFIX/${target}/* $PREFIX/${target}
mingw-w64-makeself jasper 2.0.14 $DESTDIR/$PREFIX/${target} delete

5.119   Libcroco 0.6.12

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget ftp://ftp.gnome.org/pub/gnome/sources/libcroco/0.6/libcroco-0.6.2.tar.bz2
tar xjf libcroco-0.6.2.tar.bz2
cd libcroco-0.6.2/
./configure --host=$target --prefix=$PREFIX/$target  --enable-shared=yes --enable-static=yes  --enable-gtk-doc=no
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs -rtl1 ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/${target}/* $PREFIX/${target}
ln -s $PREFIX/$target/bin/croco-0.6-config /$PREFIX/bin
mingw-w64-makeself libcroco 0.6.12 $DESTDIR/$PREFIX/${target} delete

5.120   Gdk-pixbuf 2.36.12

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget ftp://ftp.gnome.org/pub/gnome/sources/gdk-pixbuf/2.36/gdk-pixbuf-2.36.12.tar.xz
tar xJf gdk-pixbuf-2.36.12.tar.xz
cd gdk-pixbuf-2.36.12/
../configure --host=$target --prefix=$PREFIX/$target  --enable-shared=yes --enable-static=yes --enable-relocations --with-included-loaders --with-libjasper
touch gdk-pixbuf/loaders.cache
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs -rtl1 ${target}-strip -g
rm -rf $DESTDIR/${PREFIX}/${target}/share/man

cp -avf $DESTDIR/$PREFIX/${target}/* $PREFIX/${target}
echo "wine $PREFIX/$target/bin/gdk-pixbuf-query-loaders.exe \"\$@\"" > $PREFIX/bin/gdk-pixbuf-query-loaders
chmod +x $PREFIX/bin/gdk-pixbuf-query-loaders
mingw-w64-makeself gdk-pixbuf 2.36.12 $DESTDIR/$PREFIX/${target} delete

5.121   Pango 1.42.3

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget https://sources.voidlinux.eu/pango-1.42.3/pango-1.42.3.tar.xz
tar xJf pango-1.42.3.tar.xz
cd pango-1.42.3/
sed -i "s/^if help2man.found()/if help2man.found() and not meson.is_cross_build()/g" utils/meson.build
#mkdir build-$target-shared && cd build-$target-shared
#export NEED_WINE=1;export PYTHON=$(which python3);${target}-meson --buildtype=release --default-library=shared -D 'enable_docs=false' -D 'gir=false' ..
./configure --host=$target --prefix=$PREFIX/$target  --enable-shared=yes --enable-static=yes
make -j4


make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs -rtl1 ${target}-strip -g
rm -rf $DESTDIR/$PREFIX/$target/share/*

cp -avf $DESTDIR/$PREFIX/${target}/* $PREFIX/${target}
mingw-w64-makeself pango 1.42.3 $DESTDIR/$PREFIX/${target} delete

5.122   Librsvg 2.40.20

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget https://download.gnome.org/sources/librsvg/2.40/librsvg-2.40.20.tar.xz
tar xJf librsvg-2.40.20.tar.xz
cd librsvg-2.40.20/
wget "https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-librsvg/0005-hack-unixy-paths.patch" -O - |patch -p1
autoreconf -fi
CXXFLAGS+=" -D_POSIX_SOURCE"
CFLAGS+=" -D_POSIX_SOURCE"
mkdir build-$target && cd build-$target
../configure --host=$target --prefix=$PREFIX/$target  --enable-shared=yes --enable-static=yes --disable-introspection --enable-silent-rules --enable-tools
setconf Makefile AM_CFLAGS '-fno-common'
sed -i "s:-rpath::g" gdk-pixbuf-loader/Makefile
touch gdk-pixbuf-loader/loaders.cache
make -j$(nproc)

make DESTDIR=$DESTDIR install
cp ./tools/rsvg-dimensions.exe $DESTDIR/$PREFIX/$target/bin
cp ./tools/test-performance.exe $DESTDIR/$PREFIX/$target/bin
cp gdk-pixbuf-loader/rsvg-loader.exe  $DESTDIR/$PREFIX/$target/bin
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs -rtl1 ${target}-strip -g
rm -rf $DESTDIR/$PREFIX/$target/share/man

cp -avf $DESTDIR/$PREFIX/${target}/* $PREFIX/${target}
mingw-w64-makeself librsvg 2.40.20 $DESTDIR/$PREFIX/${target} delete

5.123   X265 2.8

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

git clone https://aur.archlinux.org/mingw-w64-x265.git
wget https://bitbucket.org/multicoreware/x265/downloads/x265_2.8.tar.gz
tar xzf x265_2.8.tar.gz
cd x265_2.8/
patch -Np1 -i ../mingw-w64-x265/mingw.patch
mkdir build-8-$target && cd build-8-$target
mingw-w64-cmake -DLIB_INSTALL_DIR="lib" -DENABLE_SHARED='TRUE' -DENABLE_CLI='TRUE' -DWINXP_SUPPORT:BOOL='TRUE'  /tmp/sources/x265_2.8/source
make -j$(nproc)

make DESTDIR=$DESTDIR install
${target}-strip -s $DESTDIR/$PREFIX/$target/bin/*.exe
${target}-strip -x $DESTDIR/$PREFIX/$target/bin/*.dll
${target}-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/${target}/* $PREFIX/${target}
mingw-w64-makeself x265 2.8 $DESTDIR/$PREFIX/${target} delete

5.124   Libaacs 0.9.0

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget ftp://ftp.videolan.org/pub/videolan/libaacs/0.9.0/libaacs-0.9.0.tar.bz2
tar xjf libaacs-0.9.0.tar.bz2
cd libaacs-0.9.0/
./configure --host=$target --prefix=$PREFIX/$target  --enable-shared=yes --enable-static=yes
make -j$(nproc)

make DESTDIR=$DESTDIR install
${target}-strip --strip-all $DESTDIR/$PREFIX/$target/bin/*.exe
${target}-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*.dll
${target}-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/${target}/* $PREFIX/${target}
mingw-w64-makeself libaacs 0.9.0 $DESTDIR/$PREFIX/${target} delete

5.125   Libbdplus 0.1.2

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget ftp://ftp.videolan.org/pub/videolan/libbdplus/0.1.2/libbdplus-0.1.2.tar.bz2
tar xjf libbdplus-0.1.2.tar.bz2
cd libbdplus-0.1.2/
./configure --host=$target --prefix=$PREFIX/$target  --enable-shared=yes --enable-static=yes
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs -rtl1 ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/${target}/* $PREFIX/${target}
mingw-w64-makeself libbdplus 0.1.2 $DESTDIR/$PREFIX/${target} delete

5.126   Libluray 1.0.2

Note

info To build the JAR file libbluray-j2se-1.0.2.jar, here is what I did:

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget ftp://ftp.videolan.org/pub/videolan/libbluray/1.0.2/libbluray-1.0.2.tar.bz2
tar xjf libbluray-1.0.2.tar.bz2
cd libbluray-1.0.2/
./configure --host=$target --prefix=$PREFIX/$target  --enable-shared=yes --enable-static=yes
make -j$(nproc)

make DESTDIR=$DESTDIR install
#find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
#find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
#find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs -rtl1 ${target}-strip -g
${target}-strip -s $DESTDIR/$PREFIX/$target/bin/*.exe
${target}-strip -x $DESTDIR/$PREFIX/$target/bin/*.dll
${target}-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/${target}/* $PREFIX/${target}
mingw-w64-makeself libbluray 1.0.2 $DESTDIR/$PREFIX/${target} delete

5.127   Xavs 0.1.55

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget https://github.com/OpenMandrivaAssociation/xavs/raw/master/xavs-0.1.55.tar.xz
tar xJf xavs-0.1.55.tar.xz
cd xavs-0.1.55/
wget "https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-xavs/0001-xavs-0.1.55-fix-dynamic-build.patch" -O - |patch -Np1
wget "https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-xavs/0002-xavs-0.1.55-fix-asm.patch" -O - |patch -Np1
sed -i -e 's|$(CC) -o $@ $(OBJCLI) $(LDFLAGS) -L. -lxavs|$(CC) -o $@ $(OBJCLI) -L. -lxavs $(LDFLAGS)|' Makefile
sed -i -e 's|xavs$(EXE): $(OBJCLI) $(SONAME)|xavs$(EXE): $(OBJCLI) $(SONAME) libxavs.a|' Makefile
./configure --host=$target --prefix=$PREFIX/$target  --enable-shared --enable-pic --cross-prefix=$target-
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs -rtl1 ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/${target}/* $PREFIX/${target}
mingw-w64-makeself xavs 0.1.55 $DESTDIR/$PREFIX/${target} delete

5.128   Libtre r128.6fb7206

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

git clone https://github.com/laurikari/tre.git
git clone https://aur.archlinux.org/mingw-w64-libtre-git.git
cd tre/
patch -p1 -i ../mingw-w64-libtre-git/001-autotools.patch
patch -p1 -i ../mingw-w64-libtre-git/002-pointer-cast.patch
mv ChangeLog{.old,}
version=$(printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)")
./configure --host=$target --prefix=$PREFIX/$target  --enable-shared --enable-static --without-libintl-prefix
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/${target}/* $PREFIX/${target}
mingw-w64-makeself libtre r128.6fb7206 $DESTDIR/$PREFIX/${target} delete

5.129   Libsystre 1.0.1

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget https://github.com/Alexpux/MINGW-packages/raw/master/mingw-w64-libsystre/systre-1.0.1.tar.xz
tar xJf systre-1.0.1.tar.xz
cd systre-1.0.1/
./configure --host=$target --prefix=$PREFIX/$target  --enable-shared --enable-static
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/${target}/* $PREFIX/${target}
mingw-w64-makeself libsystre 1.0.1 $DESTDIR/$PREFIX/${target} delete

5.130   Libcddb 1.3.2

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget https://downloads.sourceforge.net/sourceforge/libcddb/libcddb-1.3.2.tar.bz2
tar xjf libcddb-1.3.2.tar.bz2
cd libcddb-1.3.2/
for file in $(ls /opt/Sources/MINGW-packages/mingw-w64-libcddb/*patch);
do
        patch -p1 -i $file;
done
WANT_AUTOMAKE=latest autoreconf -fi
mkdir build-$target && cd build-$target
../configure --host=$target --prefix=$PREFIX/$target  --enable-shared --enable-static ac_cv_func_malloc_0_nonnull=yes ac_cv_func_realloc_0_nonnull=yes CFLAGS=-O0
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs -rtl1 ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/${target}/* $PREFIX/${target}
mingw-w64-makeself libcddb 1.3.2 $DESTDIR/$PREFIX/${target} delete

5.131   Libcdio 2.0.0

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget https://ftp.gnu.org/gnu/libcdio/libcdio-2.0.0.tar.bz2
tar xjf libcdio-2.0.0.tar.bz2
cd libcdio-2.0.0/
wget "https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-libcdio/libcdio-0.83-linking.patch" -O - | patch -Np1
autoreconf -fi
mkdir build-$target && cd  build-$target
../configure --host=$target --prefix=$PREFIX/$target  --enable-shared --enable-static  --disable-vcd-info --enable-cpp-progs
make -j$(nproc)

make -j1 DESTDIR=$DESTDIR install
sed -i "/LIBCDIO_SOURCE_PATH/s|.*|/* #undef LIBCDIO_SOURCE_PATH */|" $DESTDIR/$PREFIX/$target/include/cdio/cdio_config.h
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs -rtl1 ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/${target}/* $PREFIX/${target}
mingw-w64-makeself libcdio 2.0.0 $DESTDIR/$PREFIX/${target} delete

5.132   Libcdio-paranoia 10.2+0.94+2

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget "https://ftp.gnu.org/gnu/libcdio/libcdio-paranoia-10.2+0.94+2.tar.gz"
tar xzf libcdio-paranoia-10.2+0.94+2.tar.gz
cd libcdio-paranoia-10.2+0.94+2/
mkdir build-$target && cd build-$target
../configure --host=$target --prefix=$PREFIX/$target  --enable-shared --enable-static  -disable-example-progs --enable-cpp-progs
make -j$(nproc)

make -j1 DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs -rtl1 ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/${target}/* $PREFIX/${target}
mingw-w64-makeself libcdio-paranoia 10.2+0.94+2 $DESTDIR/$PREFIX/${target} delete

5.133   Shine 3.1.1

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

tar xzf shine-3.1.1.tar.gz
cd shine-3.1.1/
wget "https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-shine/0001-shine-3.1.1-fix-include.patch" -O  - |patch -Np1
./configure --host=$target --prefix=$PREFIX/$target  --enable-shared --enable-static
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs -rtl1 ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/${target}/* $PREFIX/${target}
mingw-w64-makeself shine 3.1.1 $DESTDIR/$PREFIX/${target} delete

5.134   Flite 2.0.0

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

git clone https://github.com/kubo/flite.git
cd flite
# My own patch so 'make install' can work by suffixing binary with 'exe'
wget http://techer.pascal.free.fr/flite-2.0.0-mingw32.patch -O - | patch -p1
# Command from MultimediaTools-mingw-w64 (see above link)
sed -i.bak "s|i386-mingw32-|$cross_prefix|" configure*
./configure --host=$target --build=$target --target=$target --prefix=$PREFIX/$target  --enable-shared cross_compiling=yes --with-audio=none --with-pic --with-lang -with-vox --with-lex
# Patch: That should help to reduce dlls sizes. That's the patch from MultimediaTools-mingw-w64 (see above link)
wget "https://raw.githubusercontent.com/Warblefly/MultimediaTools-mingw-w64/master/flite-remove-inline.patch" -O - | patch -p0
# Let's -j set to  1. Don't ttry to set it over 1 else it will fail while generating dll files.
make -j1 CC=$target-gcc AR=$target-ar RANLIB=$target-ranlib STRIP=$target-strip DLLWRAP=$target-dllwrap DLLTOOL=$target-dlltool  AUDIOLIBS="" all

make DESTDIR=$DESTDIR install
cp -vf bin/*.exe $DESTDIR/$PREFIX/$target/bin
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
# Don't try to strip dll file
find $DESTDIR/$PREFIX/$target/ -name '*.a' | xargs -rtl1 ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/${target}/* $PREFIX/${target}
mingw-w64-makeself flite 2.0.0 $DESTDIR/$PREFIX/${target} delete

5.135   Libdvdcss 1.4.2

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget https://download.videolan.org/pub/libdvdcss/1.4.2/libdvdcss-1.4.2.tar.bz2
tar xjf libdvdcss-1.4.2.tar.bz2
cd libdvdcss-1.4.2/
autoreconf -fi
./configure --host=$target  --prefix=$PREFIX/$target  --enable-shared --enable-static
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs -rtl1 ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/${target}/* $PREFIX/${target}
mingw-w64-makeself libdvdcss 1.4.2 $DESTDIR/$PREFIX/${target} delete

5.136   Libdvdread 6.0.0

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget https://download.videolan.org/pub/videolan/libdvdread/6.0.0/libdvdread-6.0.0.tar.bz2
tar xjf libdvdread-6.0.0.tar.bz2
cd libdvdread-6.0.0/
wget "https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-libdvdread/0001-no-undefined-on.all.patch" -O - |patch -p1
autoreconf -fi
./configure --host=$target  --prefix=$PREFIX/$target  --enable-shared --enable-static  --with-libdvdcss
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs -rtl1 ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/${target}/* $PREFIX/${target}
mingw-w64-makeself libdvdread 6.0.0 $DESTDIR/$PREFIX/${target} delete

5.137   Libdvdnav 6.0.0

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget https://download.videolan.org/pub/videolan/libdvdnav/6.0.0/libdvdnav-6.0.0.tar.bz2
tar xjf libdvdnav-6.0.0.tar.bz2
cd libdvdnav-6.0.0/
wget "https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-libdvdnav/001-no-undefined.patch" -O - |patch -p1
autoreconf -fvi
./configure --host=$target  --prefix=$PREFIX/$target  --enable-shared --enable-static
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs -rtl1 ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/${target}/* $PREFIX/${target}
mingw-w64-makeself libdvdnav 6.0.0 $DESTDIR/$PREFIX/${target} delete

5.138   Live555-livemedia 2018.04.25

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget http://download.videolan.org/contrib/live555/live.2018.04.25.tar.gz
tar xzf live.2018.04.25.tar.gz
cd live/
./genMakefiles mingw
make -j$(nproc) CC=$target-gcc CXX=$target-g++ LD=$target-ld  EXE=.exe all
# Build shared and static  library  (Taken from http://pix-galore.blogspot.com/2012/09/to-build-live555-library-with-mingw.html)
$target-gcc -shared -o livemedia.dll -Wl,--out-implib,liblivemedia.dll.a -Wl,--whole-archive liveMedia/libliveMedia.a UsageEnvironment/libUsageEnvironment.a BasicUsageEnvironment/libBasicUsageEnvironment.a groupsock/libgroupsock.a -Wl,--no-whole-archive -lstdc++ -lws2_32


for dir in BasicUsageEnvironment groupsock liveMedia UsageEnvironment; do
    install -dm755 ${DESTDIR}/${PREFIX}/${target}/{bin,lib,include/${dir}}
    install -m644 ${dir}/*.a "${DESTDIR}/${PREFIX}/${target}/lib"
    install -m644 ${dir}/include/*.h* "${DESTDIR}/${PREFIX}/${target}/include/${dir}"
done
for testprog in $(ls testProgs/*exe); do
    install ${testprog} "${DESTDIR}/${PREFIX}/${target}/bin"
done
cp livemedia.dll "${DESTDIR}/${PREFIX}/${target}/bin"
cp liblivemedia.dll.a "${DESTDIR}/${PREFIX}/${target}/lib"
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs -rtl1 ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/${target}/* $PREFIX/${target}
mingw-w64-makeself live555-livemedia 2018.04.25 $DESTDIR/$PREFIX/${target} delete

5.139   Libmad 0.15.1b

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget ftp://ftp.mars.org/pub/mpeg/libmad-0.15.1b.tar.gz
tar xzf libmad-0.15.1b.tar.gz
cd libmad-0.15.1b/
for file in 0001-no-undefined.mingw.patch 0003-update-ac-and-silent-rules.mingw.patch 0004-amd64-64bit.diff 0006-optimize.diff 0007-libmad.patch 0008-md_size.diff 0009-length-check.patch
do
        wget -q "https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-libmad/${file}" -O - | patch -p1
done
touch NEWS AUTHORS ChangeLog
rm aclocal.m4
rm Makefile.in
WANT_AUTOMAKE=latest autoreconf -fi
./configure --host=$target  --prefix=$PREFIX/$target  --enable-shared --enable-static
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs -rtl1 ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/${target}/* $PREFIX/${target}
mingw-w64-makeself libmad 0.15.1b $DESTDIR/$PREFIX/${target} delete

5.140   Liba52 0.7.4 (a52dec)

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget http://liba52.sourceforge.net/files/a52dec-0.7.4.tar.gz
tar xzf a52dec-0.7.4.tar.gz
cd a52dec-0.7.4/
for file in 0001-a52dec-0.7.4-build.patch 0002-do-not-AC_C_ALWAYS_INLINE-it-redefines-inline-breaking-mingw-w64-GCC-5.1.0-C99.patch
do
        wget -q "https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-a52dec/${file}" -O - | patch -Np1
done
sed -i 's/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/' configure.in
mv configure.in configure.ac
./bootstrap
./configure --host=$target  --prefix=$PREFIX/$target  --enable-shared --enable-static
make -j$(nproc)

make DESTDIR=$DESTDIR install
cp -vf liba52/a52_internal.h $DESTDIR/$PREFIX/$target/include/a52dec/
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g
rm -rf $DESTDIR/$PREFIX/$target/share/man

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself liba52 0.7.4 $DESTDIR/$PREFIX/$target delete

5.141   Libmpeg2 0.5.1

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget http://libmpeg2.sourceforge.net/files/libmpeg2-0.5.1.tar.gz
tar xzf libmpeg2-0.5.1.tar.gz
cd libmpeg2-0.5.1/
for file in 0001-fix-bootstrap.mingw.patch 0002-libmpeg2-fix-deprecated.patch 0003-do-not-AC_C_ALWAYS_INLINE-it-redefines-inline-breaking-mingw-w64-GCC-5.1.0-C99.patch
do
        wget -q "https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-libmpeg2-git/${file}" -O - | patch -p1
done
# automake1.15 is installed on my pc but taken into account
sed -i "s:for v in 11:for v in 15 11:g" bootstrap
./bootstrap
./configure --host=$target  --prefix=$PREFIX/$target  --enable-shared --enable-static --disable-sdl
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g
rm -rf $DESTDIR/$PREFIX/$target/share/man

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libmpeg2 0.5.1 $DESTDIR/$PREFIX/$target delete

5.142   UPX 3.94 (with UCL 1.0.3)

5.142.1   Build for the Toolchain

export SRC=/tmp/sources         # where sources will be downloaded and built
export DESTDIR=/tmp/build       # Temporary folder for package
export PREFIX=/opt/MinGW32      # Prefix for my MinGW-w64 Toochain
export target=i686-w64-mingw32  # Expected target

[ ! -d "${SRC}" ] && mkdir -p "${SRC}"
cd ${SRC}

#
# Download UPX sources from Github
#
git clone https://github.com/upx/upx/
cd upx
#
# Download lzma-sdk from Github
#
git clone https://github.com/upx/upx-lzma-sdk
git submodule update --init --recursive
#
# Download and build UCL 1.0.3
#
wget http://www.oberhumer.com/opensource/ucl/download/ucl-1.03.tar.gz
tar xzf ucl-1.03.tar.gz
cd ucl-1.03/
./configure --host=$target --prefix=$PREFIX/$target --enable-static --enable-shared CFLAGS='-std=gnu90 -fPIC'
make -j$(nproc) LDFLAGS='-no-undefined'
#
# Get back to UPX folder and build 'upx.exe'
#
cd ${SRC}/upx
export UPX_UCLDIR=${SRC}/upx/ucl-1.03
make all -j$(nproc) CXX=$target-gcc LIBS="-L${UPX_UCLDIR}/src/.libs -lucl -lz -lstdc++" exeext=.exe

# Build package for my Toolchain
cd $SRC/upx/ucl-1.03
make DESTDIR=$DESTDIR install
cp ${SRC}/upx/src/upx.exe $DESTDIR/$PREFIX/$target/bin
mkdir $DESTDIR/$PREFIX/$target/{doc,share}
cp ${SRC}doc/upx.html $DESTDIR/$PREFIX/$target/doc
cp -vf ${SRC}/upx/{BUGS,COPYING,LICENSE,NEWS,README,README.1ST,THANKS} $DESTDIR/$PREFIX/$target/share
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself upx 3.94 $DESTDIR/$PREFIX/$target nodelete

5.142.2   Generate an installer for ReactOS/ (any) Win32

  • We add the missing DLL

    for dll in zlib1.dll libwinpthread-1.dll libgcc_s_sjlj-1.dll libstdc++-6.dll;
    do
            cp -vf $PREFIX/$target/bin/$dll $DESTDIR/$PREFIX/$target/bin;
    done
    find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
    
  • Open another shell

    # Download Nsiswrapper from Fedora
    cd /tmp/sources
    git clone  https://src.fedoraproject.org/cgit/rpms/mingw-nsiswrapper.git/
    # Git commit = d31947e1f016e87f24f88b944439bbee892f0429
    cd mingw-nsiswrapper
    # Generate a NSIS file
    ./nsiswrapper.pl /tmp/build/opt/MinGW32/i686-w64-mingw32/bin/upx.exe /tmp/build/opt/MinGW32/i686-w64-mingw32/{bin,lib,include,doc,share} \
            --installdir 'C:\Upx-3.94' --name "Upx-3.94" --outfile Upx-3.94_ReactOS.exe |sed -e "s:^\#SetCompressor:SetCompressor:g" > /tmp/sources/upx-3.94.nsis
    # Remove uless sections
    sed -i '53,61d' /tmp/sources/upx-3.94.nsis
    # Generate the exe
    /opt/nsis/3.0/bin/makensis /tmp/sources/upx-3.94.nsis
    # Notice file = '/tmp/sources/Upx-3.94_ReactOS.exe'
    

5.143   Libcaca 0.99.beta19

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget "http://caca.zoy.org/files/libcaca/libcaca-0.99.beta19.tar.gz"
tar xzf libcaca-0.99.beta19.tar.gz
cd libcaca-0.99.beta19
wget "https://raw.githubusercontent.com/Warblefly/MultimediaTools-mingw-w64/master/libcaca-vsnprintf.patch" -O - |patch -p1
cd caca
sed -i.bak "s/__declspec(dllexport)//g" *.h # get rid of the declspec lines otherwise the build will fail for undefined symbols
sed -i.bak "s/__declspec(dllimport)//g" *.h
cd ..
#rm -v configure Makefile autogen autogen.sh bootstrap bootstrap.sh
./configure --host=$target --prefix=$PREFIX/$target --enable-static --enable-shared --disable-ncurses --disable-csharp --disable-doc --disable-python
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
ln -s $PREFIX/$target/bin/caca-config $PREFIX/bin
mingw-w64-makeself libcaca 0.99.beta19 $DESTDIR/$PREFIX/$target delete

5.144   Libuuid r8.63a6759

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

git clone https://github.com/h0tw1r3/libuuid-mingw.git
cd libuuid-mingw/
version=$(printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)")
echo $version
wget "https://raw.githubusercontent.com/Warblefly/MultimediaTools-mingw-w64/master/libuuid-mingw.patch" -O - |patch -p0
./bootstrap
./configure --host=$target --prefix=$PREFIX/$target --enable-static --enable-shared
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libuuid r8.63a6759 $DESTDIR/$PREFIX/$target delete

5.145   Cpuid2cpuflags 5

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget "https://github.com/mgorny/cpuid2cpuflags/releases/download/v5/cpuid2cpuflags-5.tar.bz2"
tar xjf cpuid2cpuflags-5.tar.bz2
cd cpuid2cpuflags-5/
./configure --host=$target --prefix=$PREFIX/$target
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself cpuid2cpuflags 5 $DESTDIR/$PREFIX/$target delete

5.146   Vid.stab 1.1.0

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget "https://github.com/georgmartius/vid.stab/archive/v1.1.0.tar.gz"
tar xzf v1.1.0.tar.gz
mkdir build-$target && cd build-$target
mingw-w64-cmake -DCMAKE_INSTALL_PREFIX=$PREFIX/$target  -DBUILD_SHARED_LIBS:BOOL=ON /tmp/sources/vid.stab-1.1.0/
make -j$(nproc)
mingw-w64-cmake -DCMAKE_INSTALL_PREFIX=$PREFIX/$target  -DBUILD_SHARED_LIBS:BOOL=OFF /tmp/sources/vid.stab-1.1.0/
make -j$(nproc)

mingw-w64-cmake -DCMAKE_INSTALL_PREFIX=$PREFIX/$target  -DBUILD_SHARED_LIBS:BOOL=ON /tmp/sources/vid.stab-1.1.0/ && make DESTDIR=$DESTDIR install
mingw-w64-cmake -DCMAKE_INSTALL_PREFIX=$PREFIX/$target  -DBUILD_SHARED_LIBS:BOOL=OFF /tmp/sources/vid.stab-1.1.0/ && make DESTDIR=$DESTDIR install
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself vid.stab 1.1.0 $DESTDIR/$PREFIX/$target delete

5.147   Openh264 1.8.0

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

wget https://github.com/cisco/openh264/archive/v1.8.0.tar.gz
tar xzf v1.8.0.tar.gz
cd openh264-1.8.0/
export CFLAGS="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4"
export CXXFLAGS=${CFLAGS}
export target_arch="i686"
make -j$(nproc) OS=mingw_nt ARCH=${target_arch} CC=${target}-gcc CXX=${target}-g++ AR=${target}-ar STRIP=${target}-strip

make -j$(nproc) OS=mingw_nt ARCH=${target_arch} CC=${target}-gcc CXX=${target}-g++ AR=${target}-ar STRIP=${target}-strip DESTDIR=${DESTDIR} PREFIX=${PREFIX}/${target} install
install -Dm755 h264{dec,enc}.exe ${DESTDIR}/${PREFIX}/${target}/bin
${target}-strip --strip-unneeded ${DESTDIR}/${PREFIX}/${target}/bin/*.dll
${target}-strip -g ${DESTDIR}/${PREFIX}/${target}/lib/*.a
${target}-strip --strip-all ${DESTDIR}/${PREFIX}/${target}/bin/*.exe

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself openh264 1.8.0 $DESTDIR/$PREFIX/$target delete

Note

info Starting from below subsection and over we will use the following commands

# MinGW - Environment variables
#______________________________
export PREFIX="/opt/MinGW32"
export target="i686-w64-mingw32"

export CPPFLAGS="-I${PREFIX}/${target}/include"
export LDFLAGS="-L${PREFIX}/${target}/lib"
export mingw_c_flags="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4"
export CFLAGS="$mingw_c_flags $CFLAGS"
export CXXFLAGS="$mingw_c_flags $CXXFLAGS"

export PKG_CONFIG_LIBDIR="${PREFIX}/${target}/lib/pkgconfig"
export PKG_CONFIG="${PREFIX}/bin/${target}-pkg-config"
export PKG_CONFIG_PATH="${PREFIX}/${target}/lib/pkgconfig/"
export PATH=${PREFIX}/bin:${PATH}

export SRCDIR="/tmp/sources"
export DESTDIR="/tmp/build"

export CC=${PREFIX}/bin/${target}-gcc
export CXX=${PREFIX}/bin/${target}-g++
export STRIP=${PREFIX}/bin/${target}-strip
export AR=${PREFIX}/bin/${target}-ar
export RANLIB=${PREFIX}/bin/${target}-ranlib
export AS=${PREFIX}/bin/${target}-as
export DLLTOOL=${PREFIX}/bin/dlltool
export DLLWRAP=${PREFIX}/bin/${target}-dllwrap
export WINDRES=${PREFIX}/bin/${target}-windres

_initdir(){
        [ ! -d "${SRCDIR}" ] && { mkdir -p "${SRCDIR}"; } || { cd "${SRCDIR}"; } && { cd "${SRCDIR}"; }
}

_pkgver() {
        ( git describe --long --tags > /dev/null 2>&1 ) && \
        { _version=$( git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/^v//' );  } || \
        { _version=$(printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"); }

         _gitcommit=$(git log | head -n1 | awk '{print $2}' )
        echo "# version = $_version";
        echo "# commit = $_gitcommit";
}

5.148   Libevent 2.1.8 (with LibreSSL support)

_initdir

wget https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
tar xvzf libevent-2.1.8-stable.tar.gz
cd libevent-2.1.8-stable/
wget -q "http://techer.pascal.free.fr/001-libevent-2.1.8-mingw32_Add_LibreSSL_Support_And_Pass_Sample_Tests.patch" -O - | patch -p1
./configure --host=$target --prefix=$PREFIX/$target --enable-shared --enable-static --enable-largefile --enable-openssl --enable-thread-support --enable-samples
make -j$(nproc)

make DESTDIR=$DESTDIR install
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libevent 2.1.8 $DESTDIR/$PREFIX/$target delete

5.149   Libtasn1 4.13

_initdir

git clone https://aur.archlinux.org/mingw-w64-libtasn1.git
wget -q https://ftp.gnu.org/gnu/libtasn1/libtasn1-4.13.tar.gz -O - | tar xzf -
cd libtasn1-4.13/
patch -p1 -i ../mingw-w64-libtasn1/0001-Rename-gnulib-symbols.patch
autoreconf -fvi
./configure --host=$target --prefix=$PREFIX/$target --disable-doc
make -j$(nproc)

make DESTDIR=$DESTDIR install
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libtasn1 4.13 $DESTDIR/$PREFIX/$target delete

5.150   P11-kit 0.23.13

_initdir

git clone https://aur.archlinux.org/mingw-w64-p11-kit.git
wget -q https://github.com/p11-glue/p11-kit/archive/0.23.13.tar.gz -O - | tar xzf -
cd p11-kit-0.23.13/
patch -p1 -i ../mingw-w64-p11-kit/0001-Build-and-install-libnssckbi-p11-kit.so.patch
NOCONFIGURE=1 ./autogen.sh
./configure --host=$target --prefix=$PREFIX/$target --disable-static --disable-silent-rules --enable-trust-module \
        --with-trust-paths=$PREFIX/$target/lib \
        --with-module-config=$PREFIX/$target/etc/pkcs11/modules
        --with-module-path=$PREFIX/$target/lib
        --with-user-config=$PREFIX/$target/etc/pkcs11/
make -j$(nproc)

make DESTDIR=$DESTDIR install
mv -vf $DESTDIR/$PREFIX/$target/lib/*dll $DESTDIR/$PREFIX/$target/bin/
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself p11-kit 0.23.13 $DESTDIR/$PREFIX/$target delete

5.151   Libidn2 2.0.5

_initdir

wget -q https://ftp.gnu.org/pub/gnu/libidn/libidn2-2.0.5.tar.gz -O - | tar xzf -
cd libidn2-2.0.5
./configure --host=$target --prefix=$PREFIX/$target --enable-static --enable-shared --disable-nls --disable-doc
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libidn2 2.0.5 $DESTDIR/$PREFIX/$target delete

5.152   Libunbound 1.7.3

_initdir

wget https://nlnetlabs.nl/downloads/unbound/unbound-1.7.3.tar.gz
tar xzf unbound-1.7.3.tar.gz
cd unbound-1.7.3/
./configure --host=$target --prefix=$PREFIX/$target --enable-static --enable-shared \
        libtool=${PREFIX}/${target}/bin/libtool --with-ssl=$PREFIX/$target \
        --with-libexpat=$PREFIX/$target --with-libevent=$PREFIX/$target \
        --with-run-dir=$PREFIX/$target/etc/unbound --with-pthreads \
        --with-conf-file=$PREFIX/$target/etc/unbound/services.conf \
        --with-rootkey-file=$PREFIX/$target/etc/unbound/root.key

make DESTDIR=$DESTDIR install
rm -rf  $DESTDIR/$PREFIX/$target/share/man
# I had to generate the file 'root.key' so GnuTLS keeps being happy after its configure ELSE it will show a stupid warning :(
wine ${DESTDIR}/${PREFIX}/${target}/sbin/unbound-anchor.exe -a ${DESTDIR}/${PREFIX}/${target}/etc/unbound/root.key
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libunbound 1.7.3 $DESTDIR/$PREFIX/$target delete

5.153   GnuTLS 3.5.19

_initdir

git clone https://aur.archlinux.org/mingw-w64-gnutls.git
wget -q "ftp://ftp.gnutls.org/gcrypt/gnutls/v3.5/gnutls-3.5.19.tar.xz" -O - | tar xJf -
cd gnutls-3.5.19
patch -p0 -i ../mingw-w64-gnutls/gnutls-fix-external-libtasn1-detection.patch
sed 's/gnutls_srp.c//g' -i lib/Makefile.in
sed 's/gnutls_srp.lo//g' -i lib/Makefile.in
rm -f lib/minitasn1/*.c lib/minitasn1/*.h
# I had to add this below step (Link https://sourceforge.net/p/mingw/mailman/message/12041006/)
sed -i "s:arpa/inet.h:winsock2.h:g" libdane/dane.c libdane/dane-params.c
LIBS="-lws2_32" ./configure --host=$target --prefix=$PREFIX/$target --enable-shared \
      --disable-doc \
      --disable-openssl-compatibility \
      --disable-srp-authentication \
      --disable-rpath \
      --disable-non-suiteb-curves \
      --disable-gtk-doc \
      --disable-guile \
      --disable-full-test-suite \
      --with-zlib \
      --with-libiconv-prefix=$PREFIX/$target \
      --with-regex-libs=-lsystre \
      --enable-nls \
      --enable-cxx \
      --enable-local-libopts \
      --without-tpm \
     --with-unbound-root-key-file=${PREFIX}/${target}/etc/unbound/root.key \
     --with-default-trust-store-dir=$PREFIX/$target/etc/pkcs11 --with-default-trust-store-file=$PREFIX/$target/etc/pkcs11/pkcs11.conf.example

# I am not sure for the two above flags '--with-default-trust-store-dir' and '--with-default-trust-store-file'. To be honest I don't really mind :)

make # YES j=1 so it can finish properly. Let j=1

make DESTDIR=$DESTDIR
rm -vf $DESTDIR/$PREFIX/$target/lib/crypt32{.a,.dll.a,.dll}
rm -vf $DESTDIR/$PREFIX/$target/lib/ncrypt{.a,.dll.a,.dll}
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip --strip-all {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself gnutls 3.5.19 $DESTDIR/$PREFIX/$target delete

5.154   Libssh2

_initdir

wget http://www.libssh2.org/download/libssh2-1.8.0.tar.gz
tar xvzf libssh2-1.8.0.tar.gz
cd libssh2-1.8.0/
./configure --host=$target --prefix=$PREFIX/$target --enable-static --enable-shared
make -j$(nproc)

make DESTDIR=$DESTDIR install
rm -rf  $DESTDIR/$PREFIX/$target/share/man
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libssh2 1.8.0 $DESTDIR/$PREFIX/$target delete

5.155   Libpsl 0.20.2

_initdir

wget "https://github.com/rockdaboot/libpsl/releases/download/libpsl-0.20.2/libpsl-0.20.2.tar.gz"
tar xzf libpsl-0.20.2.tar.gz
cd libpsl-0.20.2/
LIBS="-lws2_32"  ./configure --host=$target --prefix=$PREFIX/$target --enable-static --enable-shared --enable-runtime=libidn2
make -j$(nproc)

make DESTDIR=$DESTDIR install
rm -rf  $DESTDIR/$PREFIX/$target/share/man
$target-strip $DESTDIR/$PREFIX/$target/bin/*.exe
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libpsl 0.20.2 $DESTDIR/$PREFIX/$target delete

5.156   Mpfr 4.0.1

_initdir

wget http://www.mpfr.org/mpfr-4.0.1/mpfr-4.0.1.tar.xz
tar xJf mpfr-4.0.1.tar.xz
cd mpfr-4.0.1/
mkdir build-$target && cd build-$target
../configure --host=$target --prefix=$PREFIX/$target --enable-static --enable-shared --enable-thread-safe --enable-float128 --enable-decimal-float
make -j$(nproc)

make DESTDIR=$DESTDIR install
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself mpfr 4.0.1 $DESTDIR/$PREFIX/$target delete

5.157   Mpc 1.1.0

_initdir

wget https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
tar xzf mpc-1.1.0.tar.gz
cd mpc-1.1.0
mkdir build-$target && cd build-$target
../configure --host=$target --prefix=$PREFIX/$target --enable-static --enable-shared
make -j$(nproc)

make DESTDIR=$DESTDIR install
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself mpc 1.1.0 $DESTDIR/$PREFIX/$target delete

5.158   Lapack 3.8.0 (with BLAS/CBLAS/LAPACK/LAPACKE)

Note

info I added this package so I can have a BLAS API for Eigen but I guess this is typically optionnal

_initdir

wget http://www.netlib.org/lapack/lapack-3.8.0.tar.gz
tar xzf lapack-3.8.0.tar.gz
cd lapack-3.8.0/
mkdir build-$target-static && cd build-$target-static
mingw-w64-cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF  -DLAPACKE=ON  -DCBLAS=ON  -DBUILD_TESTING=OFF
make
cd ..
mkdir build-$target-shared && cd build-$target-shared
mingw-w64-cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON  -DLAPACKE=ON  -DCBLAS=ON  -DBUILD_TESTING=OFF
make

cd ../build-i686-w64-mingw32-static/ && make DESTDIR=$DESTDIR install
cd ../build-i686-w64-mingw32-shared/ && make DESTDIR=$DESTDIR install
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself lapack-with-BLAS-CBLAS-LAPACK-LAPACKE 3.8.0 $DESTDIR/$PREFIX/$target delete

5.159   Eigen 3.3.5

Note

info Package should be built with FFTW3 and BLAS support (optional, done only for fun)

_initdir

git clone https://aur.archlinux.org/mingw-w64-eigen.git
wget http://bitbucket.org/eigen/eigen/get/3.3.5.tar.bz2
tar xjf 3.3.5.tar.bz2
cd eigen-eigen-b3f3d4950030/
patch -p1 -i ../mingw-w64-eigen/eigen-3.2_gcc58087.patch
export FFTW_ROOT=$PREFIX/$target
mkdir build-$target && cd build-$target
mingw-w64-cmake .. -DFFTW_LIB="$FFTW_ROOT/lib/libfftw3.dll.a" -DFFTWL_LIB="$FFTW_ROOT/lib/libfftw3l.dll.a" -DFFTWF_LIB="$FFTW_ROOT/lib/libfftw3f.dll.a"
make -j$(nproc)

make DESTDIR=$DESTDIR install
make DESTDIR=$DESTDIR install -C blas/ # This step should install 'libeigen_blas*dll*'
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself eigen 3.3.5 $DESTDIR/$PREFIX/$target delete

5.161   Libproxy 0.4.15

_initdir

wget https://github.com/libproxy/libproxy/releases/download/0.4.15/libproxy-0.4.15.tar.xz
tar xJf libproxy-0.4.15.tar.xz
cd libproxy-0.4.15/
for file in 001-fix-casting-error.patch 002-fix-win32-close-scoket.patch 004-allow-bindings.patch 005-modules.patch 006-python-site-package-dir.patch 007-python37-support.patch
do
        wget -q https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-libproxy/${file} -O - | patch -p1
done
mkdir build-$target && cd build-$target
mingw-w64-cmake -DLIBEXEC_INSTALL_DIR=$PREFIX/$target/lib/libproxy -DCMAKE_SKIP_RPATH=ON  -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_CXX_FLAGS="${CXXFLAGS}" -DCMAKE_C_FLAGS="${CFLAGS}"  -DWITH_PERL=OFF -DWITH_PYTHON2=ON -DWITH_PYTHON3=ON ..
make -j$(nproc)

make DESTDIR=$DESTDIR install
$target-strip $DESTDIR/$PREFIX/$target/bin/*.exe
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libproxy 0.4.15 $DESTDIR/$PREFIX/$target delete

5.162   Brotli 1.0.5

_initdir

wget https://github.com/google/brotli/archive/v1.0.5.tar.gz
tar xzf v1.0.5.tar.gz
cd brotli-1.0.5/
mkdir build-$target && cd build-$target
mingw-w64-cmake DBUILD_{SHARED,STATIC}_LIBS=ON  ..
make -j$(nproc)

make DESTDIR=$DESTDIR install
$target-strip $DESTDIR/$PREFIX/$target/bin/*.exe
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself brotli 1.0.5 $DESTDIR/$PREFIX/$target delete

5.163   Jansson 2.11

_initdir

wget https://github.com/akheron/jansson/archive/v2.11.tar.gz
tar xzf v2.11.tar.gz
cd jansson-2.11/
autoreconf -fvi # There is no configure script. So I had to run this to genenrate one
./configure --host=$target --prefix=$PREFIX/$target --enable-shared --enable-static
make -j$(nproc)

make DESTDIR=$DESTDIR install
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself jansson 2.11 $DESTDIR/$PREFIX/$target delete

5.164   C-ares 1.14.0

_initdir

wget https://c-ares.haxx.se/download/c-ares-1.14.0.tar.gz
tar xzf c-ares-1.14.0.tar.gz
cd c-ares-1.14.0/
rm -vf libcares-static.pc.in
for file in 0001-Use-RPM-compiler-options.patch 0002-Add-static-pkg-config.patch 0003-fix-cmake-targets.patch
do
        wget -q "https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-c-ares/${file}" -O - | patch -Np1
done
autoreconf -fvi
mkdir build-$target && cd build-$target
../configure --host=$target --prefix=$PREFIX/$target --enable-shared --enable-static
mingw-w64-cmake .. -DCARES_STATIC=ON -DCARES_SHARED=ON -Wno-dev
make -j$(nproc)

make DESTDIR=$DESTDIR install
cp $SRCDIR/c-ares-1.14.0/nameser.h $DESTDIR/$PREFIX/$target/include
sed -i "s:^libdir.*:libdir=\${prefix}/lib:g" libcares.pc
cp -vf libcares-static.pc libcares.pc $DESTDIR/$PREFIX/$target/lib/pkgconfig/
$target-strip $DESTDIR/$PREFIX/$target/bin/*.exe
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*.dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself c-ares 1.14.0 $DESTDIR/$PREFIX/$target delete

5.165   Nghttp2 1.32.0

_initdir


wget https://github.com/nghttp2/nghttp2/releases/download/v1.32.0/nghttp2-1.32.0.tar.xz
tar xJf nghttp2-1.32.0.tar.xz
cd nghttp2-1.32.0/
mkdir build-$target && cd build-$target

export ZLIB_CFLAGS="$(${target}-pkg-config --cflags zlib)"
export ZLIB_LIBS="$(${target}-pkg-config --libs zlib)"
export LIBXML2_CFLAGS="$(xml2-config --cflags)"
export LIBXML2_LIBS="$(xml2-config --libs)"
export LIBCARES_CFLAGS="$(${target}-pkg-config --cflags libcares)"
export LIBCARES_LIBS="$(${target}-pkg-config --libs libcares)"

../configure --host=$target --prefix=$PREFIX/$target --enable-shared --enable-static --disable-python-bindings  --disable-examples --enable-hpack-tools=yes

make DESTDIR=$DESTDIR install
$target-strip $DESTDIR/$PREFIX/$target/bin/*.exe
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*.dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself nghttp2 1.32.0 $DESTDIR/$PREFIX/$target delete

5.166   Curl 7.61.0

_initdir

( wget -q http://curl.haxx.se/download/curl-7.61.0.tar.bz2 -O - | tar xjf - ) && cd curl-7.61.0
mkdir build-${target}-{static,shared}
cd $SRCDIR/curl-7.61.0/build-${target}-static
../configure --host=$target --prefix=$PREFIX/$target --disable-shared --enable-static -with-ssl --enable-ipv6 \
        --with-libidn2 --with-libssh2 --without-ca-bundle --without-random --with-libmetalink \
        --enable-proxy --enable-cookies --with-gnutls --enable-verbose --enable-libcurl-option --with-zlib --with-brotli
make -j$(nproc)
cd $SRCDIR/curl-7.61.0/build-${target}-shared
../configure --host=$target --prefix=$PREFIX/$target --enable-shared --disable-static -with-ssl --enable-ipv6 \
        --with-libidn2 --with-libssh2 --without-ca-bundle --without-random --with-libmetalink \
        --enable-proxy --enable-cookies --with-gnutls --enable-verbose --enable-libcurl-option --with-zlib --with-brotli
make -j$(nproc)

cd $SRCDIR/curl-7.61.0/build-${target}-static && make DESTDIR=$DESTDIR install
cd $SRCDIR/curl-7.61.0/build-${target}-shared && make DESTDIR=$DESTDIR install
rm -rf  $DESTDIR/$PREFIX/$target/share/man
ln -s $DESTDIR/$PREFIX/$target/bin/curl-config $PREFIX/bin
$target-strip $DESTDIR/$PREFIX/$target/bin/*.exe
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*.dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself curl 7.61.0 $DESTDIR/$PREFIX/$target delete

5.167   Libzf 3.6

_initdir

wget http://dist.schmorp.de/liblzf/liblzf-3.6.tar.gz -O - | tar -xzvf -
cd liblzf-3.6/
mkdir build-$target
sed -i -e '12iEXEEXT = @EXEEXT@' -e 's/m 755 lzf/m 755 lzf$(EXEEXT)/g' Makefile.in
sed -i -e '38i#include <stdint.h>' -e 's/unsigned _int64/uint64_t/g' lzf_c.c
cp lzf.h build-$target
cd build-$target
../configure --host=$target --prefix=$DESTDIR/$PREFIX/$target --enable-shared --enable-static # Yes the prefix is changed temporary
make -j$(nproc)

cp lzf lzf.exe
make DESTDIR=$DESTDIR install
$target-strip $DESTDIR/$PREFIX/$target/bin/*.exe
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libzf 3.6 $DESTDIR/$PREFIX/$target delete

5.168   Snappy 1.1.7

Note

info While reading the log from this repository (git log) it it noticed that "Remove quicklz and lzf support in benchmarks." (commit 83179dd8be390bb904882e34143d44551f475be0)

_initdir

wget https://github.com/google/snappy/archive/1.1.7.tar.gz
tar xzf 1.1.7.tar.gz
cd snappy-1.1.7/
mkdir build-$target && cd build-$target
mingw-w64-cmake ..
make -j$(nproc)

make DESTDIR=$DESTDIR install
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*.dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself snappy 1.1.7 $DESTDIR/$PREFIX/$target delete

5.169   Jbigkit 2.1.r12.gdce1013

_initdir

git clone https://github.com/qyot27/jbigkit.git
cd jbigkit/
_pkgver
# version = 2.1.r12.gdce1013
# commit = dce101373d87445ed55a385fddad02d8a8751de4
git checkout mingw-w64
autoreconf -fiv
mkdir build-$target && cd build-$target
../configure --host=$target --prefix=$PREFIX/$target --enable-shared --enable-static
make -j$(nproc)

make DESTDIR=$DESTDIR install
$target-strip $DESTDIR/$PREFIX/$target/bin/*.exe
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*.dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself jbigkit 2.1.r12.gdce1013 $DESTDIR/$PREFIX/$target delete

5.170   Enca 1.19

_initdir

wget https://github.com/nijel/enca/archive/1.19.tar.gz
tar xzf 1.19.tar.gz
cd enca-1.19/
sed -i -e 's/encodings.dat make_hash/encodings.dat make_hash$(EXEEXT)/' -e 's/\.\/make_hash/\.\/make_hash$(EXEEXT)/' tools/Makefile.in
mkdir build-$target && cd build-$target
../configure --host=$target --prefix=$PREFIX/$target --enable-shared --enable-static
make -j$(nproc) LDFLAGS=-no-undefined

make DESTDIR=$DESTDIR install
$target-strip $DESTDIR/$PREFIX/$target/bin/*.exe
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*.dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself enca 1.19 $DESTDIR/$PREFIX/$target delete

5.171   Json-c 0.13.1-20180305

_initdir

wget https://github.com/json-c/json-c/archive/json-c-0.13.1-20180305.tar.gz
tar xzf json-c-0.13.1-20180305.tar.gz
cd json-c-json-c-0.13.1-20180305/
mkdir build-$target && cd build-$target
../configure --host=$target --prefix=$PREFIX/$target --enable-shared --enable-static
make -j$(nproc)

make DESTDIR=$DESTDIR install
#$target-strip $DESTDIR/$PREFIX/$target/bin/*.exe
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*.dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself jsonc-c 0.13.1-20180305 $DESTDIR/$PREFIX/$target delete

5.172   Uchardet 0.0.6

_initdir

wget https://www.freedesktop.org/software/uchardet/releases/uchardet-0.0.6.tar.xz
tar xJf uchardet-0.0.6.tar.xz
cd uchardet-0.0.6/
mkdir build-$target && cd build-$target
mingw-w64-cmake ..
make -j($nproc)

make DESTDIR=$DESTDIR install
$target-strip $DESTDIR/$PREFIX/$target/bin/*.exe
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*.dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself uchardet 0.0.6 $DESTDIR/$PREFIX/$target delete

5.173   Ncurses 6.1.20180526

_initdir

git clone https://aur.archlinux.org/mingw-w64-ncurses.git
wget https://invisible-mirror.net/archives/ncurses/current/ncurses-6.1-20180526.tgz
tar xzf ncurses-6.1-20180526.tgz
cd ncurses-6.1-20180526/
patch -Np1 -i ../mingw-w64-ncurses/001-use-libsystre.patch
mkdir build-$target && cd build-$target
../configure --host=$target --prefix=$PREFIX/$target  --without-ada  --with-cxx --without-shared --without-pthread \
        --enable-pc-files --disable-rpath --enable-colorfgbg --enable-ext-colors --enable-ext-mouse --disable-symlinks \
        --enable-warnings --enable-assertions --disable-home-terminfo --enable-database --enable-sp-funcs --enable-term-driver --enable-interop --enable-widec
echo "wine $PWD/ncurses/make_hash.exe \"\$@\"" > ./ncurses/make_hash
chmod +x ./ncurses/make_hash
make

make DESTDIR=$DESTDIR install
cp -R $DESTDIR/$PREFIX/$target/include/ncursesw  $DESTDIR/$PREFIX/$target/include/ncurses
cp -vf $DESTDIR/$PREFIX/$target/lib/libncursesw.a $DESTDIR/$PREFIX/$target/lib/libncurses.a
[ -d "$DESTDIR/$PREFIX/$target/share/man" ] && { rm -rf "$DESTDIR/$PREFIX/$target/share/man"; }
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself ncurses 6.1.20180526 $DESTDIR/$PREFIX/$target delete

5.174   Lua 5.2

_initdir

git clone git://github.com/LuaDist/lua.git
cd lua/
git checkout lua-5.2
export LUAPACKVER=$(grep version dist.info | cut -f2 -d "\"")
mkdir build-$target && cd build-$target
mingw-w64-cmake .. -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON
make -j$(nproc)

make DESTDIR=$DESTDIR install
mkdir -p $DESTDIR/$PREFIX/$target/lib/pkgconfig/

cat << _EOF_ > $DESTDIR/$PREFIX/$target/lib/pkgconfig/lua.pc
prefix=${PREFIX}/${target}
exec_prefix=\${prefix}
libdir=\${exec_prefix}/lib
includedir=\${prefix}/include

Name: lua
Description: Lua scripting language
Version: ${LUAPACKVER}
Libs: -L\${libdir} -llua
Cflags: -I\${includedir}
_EOF_

$target-strip $DESTDIR/$PREFIX/$target/bin/*.exe
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*.dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself lua 5.2 $DESTDIR/$PREFIX/$target delete

5.175   Libbs2b 3.1.0

_initdir

wget "http://downloads.sourceforge.net/project/bs2b/libbs2b/3.1.0/libbs2b-3.1.0.tar.lzma" -O - | tar -xJvf -
cd libbs2b-3.1.0/
mkdir build-$target && cd build-$target
../configure --host=$target --prefix=$PREFIX/$target --enable-shared --enable-static
make -j$(nproc)

make DESTDIR=$DESTDIR install
$target-strip $DESTDIR/$PREFIX/$target/bin/*.exe
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libbs2b 3.1.0 $DESTDIR/$PREFIX/$target delete

5.176   Aom 1.0.0.r401.gb01bfcf (aka Alliance for Open Media)

_initdir

git clone https://aomedia.googlesource.com/aom
cd aom
_pkgver
# version = 1.0.0.r401.gb01bfcf
# commit = b01bfcf06aef7e90d41f7bafe651e8b04a51d524
mkdir build-$target-{shared,static}
cd $SRCDIR/aom/build-$target-static
mingw-w64-cmake .. -DAOM_TARGET_CPU=x86 -DCONFIG_LOWBITDEPTH=0 -DCONFIG_HIGHBITDEPTH=1 -DHAVE_PTHREAD=1 -DENABLE_DOCS:bool=off -DENABLE_NASM:bool=on -DENABLE_TESTS:bool=off -DCONFIG_UNIT_TESTS=0 -DBUILD_SHARED_LIBS=0 -DBUILD_STATIC_LIBS=1
make -j$(nproc)
cd $SRCDIR/aom/build-$target-shared
mingw-w64-cmake .. -DAOM_TARGET_CPU=x86 -DCONFIG_LOWBITDEPTH=0 -DCONFIG_HIGHBITDEPTH=1 -DHAVE_PTHREAD=1 -DENABLE_DOCS:bool=off -DENABLE_NASM:bool=on -DENABLE_TESTS:bool=off -DCONFIG_UNIT_TESTS=0 -DBUILD_SHARED_LIBS=1 -DBUILD_STATIC_LIBS=0
make -j$(nproc)

cd $SRCDIR/aom/build-$target-static && make DESTDIR=$DESTDIR install
cd $SRCDIR/aom/build-$target-shared && make DESTDIR=$DESTDIR install
mv -vf $DESTDIR/$PREFIX/$target/lib/*dll $DESTDIR/$PREFIX/$target/bin
$target-strip $DESTDIR/$PREFIX/$target/bin/*.exe
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*.dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself aom 1.0.0.r401.gb01bfcf $DESTDIR/$PREFIX/$target delete

5.177   libiLBC 2.0.2

_initdir

wget https://github.com/TimothyGu/libilbc/releases/download/v2.0.2/libilbc-2.0.2.tar.bz2
tar xjf libilbc-2.0.2.tar.bz2
cd libilbc-2.0.2/
mkdir build-$target && cd build-$target
../configure --host=$target --prefix=$PREFIX/$target --enable-shared --enable-static
make -j$(nproc)

make DESTDIR=$DESTDIR install
#$target-strip $DESTDIR/$PREFIX/$target/bin/*.exe
$target-strip --strip-unneeded $DESTDIR/$PREFIX/$target/bin/*.dll
$target-strip -g $DESTDIR/$PREFIX/$target/lib/*.a

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libicbc 2.0.2 $DESTDIR/$PREFIX/$target delete

5.178   Zimg 2.7.5

_initdir

wget https://github.com/sekrit-twc/zimg/archive/release-2.7.5.tar.gz
tar xzf release-2.7.5.tar.gz
cd zimg-release-2.7.5/
./autogen.sh
mkdir build-$target && cd build-$target
../configure --host=$target --prefix=$PREFIX/$target --enable-shared --enable-static
make -j$(nproc)

make DESTDIR=$DESTDIR install
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself zimg 2.7.5 $DESTDIR/$PREFIX/$target delete

5.179   Python 3.7m

Note

info While building this package, for the configure wine might fail for a program and its usual Window for erros will appear. Just click on "Close" so configure can go ahead

_initdir

( wget -q https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz -O - | tar -xJf - ) && cd Python-3.7.0
sed -i "s:#include <crypt.h>::g" Include/Python.h
sed -i "s:#include <sys/select.h>::g" Include/pyport.h
./configure --host=$target --build=$target --prefix=$PREFIX/$target --enable-optimizations --with-system-expat --with-system-libmpdec --with-openssl=$PREFIX/$target=python
make inclinstall
mkdir -p $DESTDIR/$PREFIX/$target/lib/pkgconfig

for((iter=4;iter<=7;iter++));
do
        cp -vf Misc/python.pc $DESTDIR/$PREFIX/$target/lib/pkgconfig/python-3.${iter}.pc;
done

_initdir
wget https://www.python.org/ftp/python/3.7.0/python-3.7.0-embed-win32.zip
7za x -opython37_i686 python-3.7.0-embed-win32.zip
cd python37_i686/
gendef python37.dll
${target}-dlltool  -m i386 --as-flags="--32" --output-delaylib  $DESTDIR/$PREFIX/$target/lib/libpython3.7m.a --input-def python37.def
# I don't really know if what I am doing below is required. Well whatever let's go :)
mkdir -p $DESTDIR/$PREFIX/$target/bin
cp python37.dll $DESTDIR/$PREFIX/$target/bin

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself python 3.7m $DESTDIR/$PREFIX/$target delete

5.180   Leptonica 1.76.0

_initdir

wget https://github.com/DanBloomberg/leptonica/releases/download/1.76.0/leptonica-1.76.0.tar.gz
tar xzf leptonica-1.76.0.tar.gz
cd leptonica-1.76.0/
./autobuild
./configure --host=$target --prefix=$PREFIX/$target
make -j$(nproc)

make DESTDIR=$DESTDIR install
[ -d "$DESTDIR/$PREFIX/$target/share/man" ] && { rm -rf "$DESTDIR/$PREFIX/$target/share/man"; }
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself leptonica 1.76.0 $DESTDIR/$PREFIX/$target delete

5.181   Tesseract 3.05.02

_initdir

wget https://github.com/tesseract-ocr/tesseract/archive/3.05.02.tar.gz
tar xzf 3.05.02.tar.gz
cd tesseract-3.05.02/
wget "https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-tesseract-ocr/001-proper-include-thread.patch" -O - | patch -p1
wget "https://github.com/tesseract-ocr/tessdata/raw/3.04.00/osd.traineddata"
./autogen.sh
mkdir build-$target && cd build-$target
../configure --host=$target --prefix=$PREFIX/$target LIBLEPT_HEADERSDIR=${PREFIX}/${target}/include
make -j$(nproc) && make -j$(nproc) training

make DESTDIR=$DESTDIR install
make DESTDIR=$DESTDIR training-install
mkdir -pv $DESTDIR/$PREFIX/$target/share/tessdata
install -Dm0644 ../osd.traineddata $DESTDIR/$PREFIX/$target/share/tessdata/
[ -d "$DESTDIR/$PREFIX/$target/share/man" ] && { rm -rf "$DESTDIR/$PREFIX/$target/share/man"; }
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself tesseract 3.05.02 $DESTDIR/$PREFIX/$target delete

5.182   VapourSynth R44.

_initdir

wget https://github.com/vapoursynth/vapoursynth/archive/R44.tar.gz
tar xzf R44.tar.gz
cd vapoursynth-R44/
./autogen.sh
sed -i "s:Windows.h:windows.h:g" src/vsscript/vsscript.cpp
mkdir build-$target && cd build-$target
# Compared to the originale below command I allow both static and shared

CPPFLAGS="-m32" LDFLAGS="-m32 -L${PREFIX}/${target}"     PYTHON3_CFLAGS="-I${PREFIX}/${target}/include/python3.7m"     \
        PYTHON3_LIBS="-L${PREFIX}/${target}/lib -lpython3.7m"     PKG_CONFIG_PATH=${PREFIX}/${target}/lib/pkgconfig     \
        ASFLAGS="-DARCH_X86_64=0 -f win32"  \
        ../configure --prefix=${PREFIX}/${target} --enable-static  --enable-shared --disable-vspipe --disable-python-module     --disable-plugins --host=${target}

sed -i 's/-DARCH_X86_64=1 -DPIC -f win64/-DARCH_X86_64=0 -f win32/' Makefile
make -j$(nproc)

make DESTDIR=$DESTDIR install
# Here I don't try to strip anything. Keep it as it is

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself vapoursynth R44 $DESTDIR/$PREFIX/$target delete

5.183   Lz4 1.8.2

_initdir

wget https://github.com/lz4/lz4/archive/v1.8.2.zip
unzip v1.8.2.zip
cd lz4-1.8.2/
cd contrib/cmake_unofficial/
mingw-w64-cmake . -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON
make -j$(nproc)

make DESTDIR=$DESTDIR install
[ -d "$DESTDIR/$PREFIX/$target/share/man" ] && { rm -rf "$DESTDIR/$PREFIX/$target/share/man"; }
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself lz4 1.8.2 $DESTDIR/$PREFIX/$target delete

5.184   Libarchive 3.3.2

_initdir

wget https://github.com/libarchive/libarchive/archive/v3.3.2.tar.gz
tar xzf v3.3.2.tar.gz
cd libarchive-3.3.2/
mkdir build-$target && cd  build-$target
mingw-w64-cmake .. -DENABLE_LZO=ON -DENABLE_BZip2=ON -DENABLE_EXPAT=ON -DENABLE_LIBXML2=ON -DENABLE_ZLIB=ON -DENABLE_PCREPOSIX=ON -DENABLE_LZ4=ON -DENABLE_NETTLE=ON -DENABLE_LZMA=ON  -DENABLE_TAR_SHARED=ON -DENABLE_CPIO_SHARED=ON -DENABLE_CAT_SHARED=ON
make -j$(nproc)

make DESTDIR=$DESTDIR install
[ -d "$DESTDIR/$PREFIX/$target/share/man" ] && { rm -rf "$DESTDIR/$PREFIX/$target/share/man"; }
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libarchive 3.3.2 $DESTDIR/$PREFIX/$target delete

5.185   Vamp-sdk 2.7.1

_initdir

wget https://github.com/c4dm/vamp-plugin-sdk/archive/vamp-plugin-sdk-v2.7.1.tar.gz
tar xzf vamp-plugin-sdk-v2.7.1.tar.gz
cd vamp-plugin-sdk-vamp-plugin-sdk-v2.7.1/
sed -i.bak 's/sdk plugins host rdfgen test/sdk plugins host rdfgen/' configure
wget "https://raw.githubusercontent.com/Warblefly/MultimediaTools-mingw-w64/master/vamp-M_PI.patch" -O - | patch -p0
wget "https://raw.githubusercontent.com/Warblefly/MultimediaTools-mingw-w64/master/vamp-configure.patch" -O - |patch -p0
export SNDFILE_LIBS="-lsndfile -lspeex -logg -lspeexdsp -lFLAC -lvorbisenc -lvorbis -logg -lvorbisfile -logg -lFLAC++ -lsndfile"
./configure --host=$target --prefix=$PREFIX/$target
make AR=$AR RANLIB=$RANLIB

make DESTDIR=$DESTDIR install
[ -d "$DESTDIR/$PREFIX/$target/share/man" ] && { rm -rf "$DESTDIR/$PREFIX/$target/share/man"; }
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself vamp-sdk 2.7.1 $DESTDIR/$PREFIX/$target delete

5.186   Rubberband 1.8.1

_initdir

wget https://code.breakfastquay.com/attachments/download/34/rubberband-1.8.1.tar.bz2
tar xjf rubberband-1.8.1.tar.bz2
cd rubberband-1.8.1/
wget "https://raw.githubusercontent.com/Warblefly/MultimediaTools-mingw-w64/master/rubberband-mingw-shared.patch" -O  - |patch -p0
wget "https://www.ladspa.org/ladspa_sdk/ladspa.h.txt" -O $PREFIX/$target/include/ladspa.h
./configure --host=$target --prefix=$PREFIX/$target  --enable-shared=yes --enable-static=yes

make DESTDIR=$DESTDIR install
[ -d "$DESTDIR/$PREFIX/$target/share/man" ] && { rm -rf "$DESTDIR/$PREFIX/$target/share/man"; }
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself rubberband 1.8.1 $DESTDIR/$PREFIX/$target delete

5.187   SPIRV-Tools r144.g58e53ea

_initdir

git clone https://github.com/KhronosGroup/SPIRV-Headers.git SPIRV-Headers
git clone https://github.com/KhronosGroup/SPIRV-Tools.git SPIRV-Tools

cd $SRCDIR/SPIRV-Headers
_pkgver
# version = r110.2c51218
# commit = 2c512180ca03b5d4f56283efc85745775b45fdc4

cd $SRCDIR/SPIRV-Tools
_pkgver
# version = master.tot.r144.g58e53ea
# commit = 58e53ea82f259ed81a41c8165c749add49354380

cd $SRCDIR/SPIRV-Tools
ln -svf ../../SPIRV-Headers external
mingw-w64-cmake . -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=0
make -j$(nproc)

make DESTDIR=$DESTDIR install
[ -d "$DESTDIR/$PREFIX/$target/share/man" ] && { rm -rf "$DESTDIR/$PREFIX/$target/share/man"; }
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself spirv-tools r144.g58e53ea $DESTDIR/$PREFIX/$target delete

5.188   Glslang r0.g97068d8

_initdir

git clone https://github.com/KhronosGroup/glslang.git glslang
cd $SRCDIR/glslang/

_pkgver
# version = master.tot.r0.g97068d8
# commit = 97068d8b306b446fdcff44a3dfd0650c2c579c5b

wget "https://raw.githubusercontent.com/Warblefly/MultimediaTools-mingw-w64/master/glslang-threads.patch" -O - |patch -p0
mingw-w64-cmake . -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=0
make -j$(nproc)

make DESTDIR=$DESTDIR install
[ -d "$DESTDIR/$PREFIX/$target/share/man" ] && { rm -rf "$DESTDIR/$PREFIX/$target/share/man"; }
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself glslang r0.g97068d8 $DESTDIR/$PREFIX/$target delete

5.189   Shaderc ndk.r12.beta2.r244.g30af9f9

_initdir

git clone https://github.com/google/shaderc.git shaderc
cd shaderc/

_pkgver
# version = ndk.r12.beta2.r244.g30af9f9
# commit = 30af9f9899aefd018669e81a5b8e605d14d40431

export spirv_tools_SOURCE_DIR=$SRCDIR/SPIRV-Tools
export glslang_SOURCE_DIR=$SRCDIR/glslang
export shaderc_SOURCE_DIR=$SRCDIR/shaderc
wget "https://raw.githubusercontent.com/Warblefly/MultimediaTools-mingw-w64/master/shaderc.patch" -O - | patch -p0
mkdir build-$target && cd build-$target
mingw-w64-cmake .. -GNinja -DSHADERC_SKIP_TESTS=ON  -DBUILD_SHARED_LIBS=0 -DSHADERC_ENABLE_SHARED_CRT=ON
wget http://techer.pascal.free.fr/shaderc-build-mingw32_r244.g30af9f9.patch -O - | patch -p1
ninja

DESTDIR=$DESTDIR ninja install
[ -d "$DESTDIR/$PREFIX/$target/share/man" ] && { rm -rf "$DESTDIR/$PREFIX/$target/share/man"; }
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself shaderc ndk.r12.beta2.r244.g30af9f9 $DESTDIR/$PREFIX/$target delete

5.190   Crossc 1.3.0.r1.g771aad0

_initdir

git clone https://github.com/rossy/crossc/
cd crossc/
git clone https://github.com/KhronosGroup/SPIRV-Cross.git
make -j$(nproc)

make prefix=$PREFIX/$target install
[ -d "$DESTDIR/$PREFIX/$target/share/man" ] && { rm -rf "$DESTDIR/$PREFIX/$target/share/man"; }
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself crossc 1.3.0.r1.g771aad0 $DESTDIR/$PREFIX/$target delete

5.191   Vulkan-loader 1.1.73.0 (just to get Video Output with MPV)

Note

info That's the only version that works for me :) so I can add Vulkan to mpv. But I upgraded it to 1.1.73.0

_initdir

wget https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/archive/sdk-1.1.73.0.tar.gz
tar xzf sdk-1.1.73.0.tar.gz
cd Vulkan-LoaderAndValidationLayers-sdk-1.1.73.0/

wget "http://techer.pascal.free.fr/patches/vulkan-1.0.30.0/vulkan-0001-loader-cross-compile-static-linking-hacks.patch" -O - | patch -p1
wget "http://techer.pascal.free.fr/patches/vulkan-1.0.30.0/vulkan-0002-always-include-install-rules.patch" -O - | patch -p1
mkdir build-$target && cd build-$target
mingw-w64-cmake .. \
    -DBUILD_ICD=OFF \
    -DBUILD_DEMOS=OFF \
    -DBUILD_TESTS=OFF \
    -DBUILD_LAYERS=OFF \
    -DBUILD_VKJSON=OFF \
    -DINSTALL_LVL_FILES=ON -DCMAKE_ASM-ATT_COMPILER:FILEPATH=$(which nasm) \
    "-DCMAKE_C_FLAGS='-D_WIN32_WINNT=0x0600 -D__STDC_FORMAT_MACROS'" \
    "-DCMAKE_CXX_FLAGS='-D__USE_MINGW_ANSI_STDIO -D__STDC_FORMAT_MACROS -fpermissive -D_WIN32_WINNT=0x0600'"

make -j$(nproc)
sed -i "s:-lvulkan:-lvulkan -lshlwapi -lcfgmgr32 -lws2_32:g" loader/vulkan.pc # That should avoid an issue while building mpv

make DESTDIR=$DESTDIR install
[ -d "$DESTDIR/$PREFIX/$target/share/man" ] && { rm -rf "$DESTDIR/$PREFIX/$target/share/man"; }
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself vulkan-loader 1.1.73.0 $DESTDIR/$PREFIX/$target delete

5.192   Libmysofa 0.6.r56.g5e1fc5b

_initdir

git clone https://github.com/hoene/libmysofa.git
cd libmysofa/

_pkgver
# version = 0.6.r56.g5e1fc5b
# commit = 5e1fc5b62d6d43cbac123e18dfee61408705c4a1

mkdir build-$target && cd build-$target
mingw-w64-cmake -DBUILD_TESTS=OFF -DBUILD_SHARED_LIBS=OFF ..
make -j$(nproc)

make DESTDIR=$DESTDIR install
[ -d "$DESTDIR/$PREFIX/$target/share/man" ] && { rm -rf "$DESTDIR/$PREFIX/$target/share/man"; }
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libmysofa 0.6.r56.g5e1fc5b $DESTDIR/$PREFIX/$target delete

5.193   Libopenmpt 0.3.11

_initdir

wget "https://lib.openmpt.org/files/libopenmpt/src/libopenmpt-0.3.11+release.autotools.tar.gz"
tar xvzf libopenmpt-0.3.11+release.autotools.tar.gz
cd libopenmpt-0.3.11+release.autotools/
wget "http://techer.pascal.free.fr/libopenmpt/libopenmpt-pc.patch -O - |patch -p1
mkdir build-$target && cd build-$target
#../configure --host=$target --prefix=$PREFIX/$target/  --prefix=$PREFIX/$target --without-portaudiocpp  --disable-examples --disable-openmpt123
 ../configure --host=$target --prefix=$PREFIX/$target/  --prefix=$PREFIX/$target --enable-static --disable-shared  --without-portaudiocpp --enable-libopenmpt_modplug
make -j$(nproc)

make DESTDIR=$DESTDIR install
[ -d "$DESTDIR/$PREFIX/$target/share/man" ] && { rm -rf "$DESTDIR/$PREFIX/$target/share/man"; }
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libopenmpt 0.3.11  $DESTDIR/$PREFIX/$target delete

5.194   Mujs 1.0.4

_initdir

wget "https://mujs.com/downloads/mujs-1.0.4.tar.gz"
tar xvzf mujs-1.0.4.tar.gz
cd mujs-1.0.4/
wget "http://techer.pascal.free.fr/mujs/mujs-0001-add-exe-suffix.patch" -O - | patch -p1
make prefix=$PREFIX/$target LDFLAGS=-g
make prefix=$PREFIX/$target LDFLAGS=-g install

[ -d "$DESTDIR/$PREFIX/$target/share/man" ] && { rm -rf "$DESTDIR/$PREFIX/$target/share/man"; }
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself mujs 1.0.4 $DESTDIR/$PREFIX/$target delete

5.195   FFnvcodec 8.1.24.2 (nv-codec-headers)

_initdir

wget https://github.com/FFmpeg/nv-codec-headers/releases/download/n8.1.24.2/nv-codec-headers-8.1.24.2.tar.gz
tar xvzf nv-codec-headers-8.1.24.2.tar.gz
cd nv-codec-headers-n8.1.24.2/
make PREFIX=$PREFIX/$target
make PREFIX=$PREFIX/$target install

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself ffnvcodec 8.1.24.2 $DESTDIR/$PREFIX/$target delete

5.196   Angle 2.1.r8420

Note

info The author of this package already provide a pkg file with all binaries (*.dll, *.h) but I wanted to rebuild them on my own :)

_initdir

git clone https://github.com/gk7huki/mingw-w64-angleproject.git
git clone https://chromium.googlesource.com/angle/angle angleproject
cd angleproject
git checkout 2fc0806f559502882f9d28f2e64445873e0ee884

cp ${SRCDIR}/mingw-w64-angleproject/d3d11_includes/{d3d11,d3d11_1,d3d11_2,d3d11_3,dxgi,dxgi1_2,dxgi1_3,dxgicommon,dxgiformat,dxgitype}.h include/

patch -p1 -i ${SRCDIR}/mingw-w64-angleproject/0000-build-fix.patch
patch -p1 -i ${SRCDIR}/mingw-w64-angleproject/0001-include-import-library-and-use-def-file.patch
patch -p1 -i ${SRCDIR}/mingw-w64-angleproject/0002-provide-windows-xp-support.patch
patch -p1 -i ${SRCDIR}/mingw-w64-angleproject/0003-static-build-workaround.patch
patch -p1 -i ${SRCDIR}/mingw-w64-angleproject/0004-redist.patch
export PYTHON=/usr/bin/python2
sed -i -e 's_python _python2 _g' -e 's_"python"_"python2"_g' -e "s_'python'_'python2'_g" -e 's_/usr/bin/python$_/usr/bin/python2_g' $(find -not \( -path "./.git*" -prune \) -type f)
mkdir build-${target}-shared

export LINK=$CXX
export _target=win32
export  _buildtype="Release"
export CXXFLAGS="-O2 -pipe -Wall -std=c++14 -msse2 -DUNICODE -D_UNICODE"
export LDFLAGS="-static"
export _arch=${target}

gyp -D angle_enable_vulkan=0 -D use_ozone=0 -D OS=win -D MSVS_VERSION="" -D TARGET=${_target} --format make --generator-output="${SRCDIR}/angleproject/build-${_arch}-shared" --depth . -I "${SRCDIR}/angleproject/gyp/common.gypi" "${SRCDIR}/angleproject/src/angle.gyp"
make -C ${SRCDIR}/angleproject/build-${_arch}-shared -j$(($(nproc)+1)) V=1 BUILDTYPE=${_buildtype}

export pkgdir=${DESTDIR}/${PREFIX}
export srcdir=${SRCDIR}

mkdir -p "${pkgdir}/${_arch}"/{bin,lib,include}
install "${srcdir}"/angleproject/build-${_arch}-shared/out/${_buildtype}/lib.target/libGLESv2.so "${pkgdir}/${_arch}"/bin/libGLESv2.dll
install "${srcdir}"/angleproject/build-${_arch}-shared/out/${_buildtype}/lib.target/libGLESv1_CM.so "${pkgdir}/${_arch}"/bin/libGLESv1_CM.dll
install "${srcdir}"/angleproject/build-${_arch}-shared/out/${_buildtype}/lib.target/libEGL.so "${pkgdir}/${_arch}"/bin/libEGL.dll
${_arch}-strip --strip-unneeded "${pkgdir}/${_arch}"/bin/*.dll

install "${srcdir}"/angleproject/build-${_arch}-shared/libGLESv2.dll.a "${pkgdir}/${_arch}"/lib/
install "${srcdir}"/angleproject/build-${_arch}-shared/libGLESv1_CM.dll.a "${pkgdir}/${_arch}"/lib/
install "${srcdir}"/angleproject/build-${_arch}-shared/libEGL.dll.a "${pkgdir}/${_arch}"/lib/
${_arch}-strip --strip-unneeded "${pkgdir}/${_arch}"/lib/*.dll.a

cp -Rv include/{EGL,GLES,GLES2,GLES3,KHR} "${pkgdir}/${_arch}"/include/

# Now we can build our own package
cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself angle-project 2.1.r8420 $DESTDIR/$PREFIX/$target delete

5.197   Libmfx 1.23.r8.gb93a3ac

_initdir

git clone https://github.com/lu-zero/mfx_dispatch/ libmfx-git
cd libmfx-git/
_pkgver
# version = 1.23.r8.gb93a3ac
# commit = b93a3acb07d4b51c9dd6f251ca5e79dacfe87705
autoreconf -fvi
mkdir build-$target && cd build-$target
../configure --host=${target} --prefix=${PREFIX}/${target} --enable-static=yes --enable-shared=yes
make -j$(nproc)

make DESTDIR=$DESTDIR install
[ -d "$DESTDIR/$PREFIX/$target/share/man" ] && { rm -rf "$DESTDIR/$PREFIX/$target/share/man"; }
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libmfx 1.23.r8.gb93a3ac $DESTDIR/$PREFIX/$target delete

5.198   Apngasm 3.1.6.r47.g606c547

_initdir

git clone https://github.com/apngasm/apngasm.git
cd apngasm/
_pkgver
# version = 3.1.6.r47.g606c547
# commit = 606c547e4e523ce6ec67f1f5142532b0975b319a
mkdir build-${target} && cd build-${target}
mingw-w64-cmake ..
make -j$(nproc)

make DESTDIR=${DESTDIR} install
cp ${DESTDIR}/${PREFIX}/${target}/lib/*.dll ${DESTDIR}/${PREFIX}/${target}/bin
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip --strip-all {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself apngasm 3.1.6.r47.g606c547 $DESTDIR/$PREFIX/$target delete

5.199   Apng2gif 1.8

_initdir

wget "https://sourceforge.net/projects/apng2gif/files/1.8/apng2gif-1.8-src.zip/download" -O apng2gif-1.8-src.zip
mkdir apng2gif-1.8-src
unzip apng2gif-1.8-src.zip -d apng2gif-1.8-src
cd apng2gif-1.8-src/
make CC=${CC}

mkdir -pv ${DESTDIR}/${PREFIX}/${target}/bin
cp apng2gif ${DESTDIR}/${PREFIX}/${target}/bin/apng2gif.exe
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip --strip-all {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself apng2gif 1.8 $DESTDIR/$PREFIX/$target delete

5.200   Libepoxy 1.5.2

_initdir

wget https://github.com/anholt/libepoxy/archive/1.5.2.tar.gz
tar xvzf 1.5.2.tar.gz
cd libepoxy-1.5.2/
NOCONFIGURE=1 ./autogen.sh
./configure --host=${target} --prefix=${PREFIX}/${target}
make -j$(nproc)

make DESTDIR=$DESTDIR install
[ -d "$DESTDIR/$PREFIX/$target/share/man" ] && { rm -rf "$DESTDIR/$PREFIX/$target/share/man"; }
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libepoxy 1.5.2 $DESTDIR/$PREFIX/$target delete

5.201   AMF-Headers 1.4.9 (Advanced Media Framework)

_initdir

wget "https://github.com/GPUOpen-LibrariesAndSDKs/AMF/archive/v1.4.9.tar.gz"
tar xvzf v1.4.9.tar.gz

cd AMF-1.4.9/
mkdir -pv ${DESTDIR}/${PREFIX}/${target}/include/AMF
cp -avf "amf/public/include/." "${DESTDIR}/${PREFIX}/${target}/include/AMF"

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself amf-headers 1.4.9 $DESTDIR/$PREFIX/$target delete

6   Refreshed Packages

6.1   Libaacs-git 0.9.0.r19.gf263376

_initdir

git clone https://git.videolan.org/git/libaacs.git
cd libaacs/
_pkgver
# version = 0.9.0.r19.gf263376
# commit = f263376b1e6570556031f420b9df08373e346d76

./bootstrap
./configure --host=${target} --prefix=${PREFIX}/${target} CFLAGS=-DGPGRT_ENABLE_ES_MACROS --with-libgcrypt-prefix=${PREFIX}/${target} --with-gpg-error-prefix=${PREFIX}/${target} --enable-shared=yes --enable-static=yes
make -j$(nproc) CFLAGS=-DGPGRT_ENABLE_ES_MACROS

make DESTDIR=$DESTDIR install
[ -d "$DESTDIR/$PREFIX/$target/share/man" ] && { rm -rf "$DESTDIR/$PREFIX/$target/share/man"; }
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libaacs-git 0.9.0.r19.gf263376 $DESTDIR/$PREFIX/$target delete

6.2   Libbdplus-git 0.1.2.r31.gc7f1e8b

_initdir

git clone http://git.videolan.org/git/libbdplus.git
cd libbdplus/
_pkgver
# version = 0.1.2.r31.gc7f1e8b
# commit = c7f1e8bbb22853ffef1feadb100845ae3ad4d562

./bootstrap
wget "https://raw.githubusercontent.com/Warblefly/MultimediaTools-mingw-w64/master/libbdplus-dirs_win32.c.patch" -O - |patch -p0
./configure --host=${target} --prefix=${PREFIX}/${target} CFLAGS=-DGPGRT_ENABLE_ES_MACROS --with-libaacs --with-libgcrypt-prefix=${PREFIX}/${target} --with-gpg-error-prefix=${PREFIX}/${target} --enable-shared=yes --enable-static=yes
make -j$(nproc) CFLAGS=-DGPGRT_ENABLE_ES_MACROS

make DESTDIR=$DESTDIR install
[ -d "$DESTDIR/$PREFIX/$target/share/man" ] && { rm -rf "$DESTDIR/$PREFIX/$target/share/man"; }
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libbdplus-git 0.1.2.r31.gc7f1e8b $DESTDIR/$PREFIX/$target delete

6.3   Libbluray-git 1.0.2.r33.gf77d22b

_initdir

git clone git://git.videolan.org/libbluray.git
cd libbluray
git submodule init
git submodule update
cd contrib/libudfread
wget "https://raw.githubusercontent.com/Warblefly/MultimediaTools-mingw-w64/master/libudfread-udfread-c.patch" -O - |patch -p0
./bootstrap
cd ../..

_pkgver
# version = 1.0.2.r33.gf77d22b
# commit = f77d22b48e441f7a2db9a780b1901653ead29c07

export JAVA_HOME=/opt/Builds/wine/data/tmp/Telechargements/jdk1.8.0_181/jre/ # java is already installed on my system but this jar file for BD+ is optional -- of course --
./bootstrap
./configure --host=${target} --prefix=${PREFIX}/${target} --enable-shared=yes --enable-static=yes
make -j$(nproc)
cd contrib/libudfread
./configure --host=${target} --prefix=${PREFIX}/${target} --enable-shared=yes --enable-static=yes
make -j$(nproc)


cd ${SRCDIR}/libbluray && make DESTDIR=$DESTDIR install
cd ${SRCDIR}/libbluray/contrib/libudfread && make DESTDIR=$DESTDIR install
[ -d "$DESTDIR/$PREFIX/$target/share/man" ] && { rm -rf "$DESTDIR/$PREFIX/$target/share/man"; }
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libbluray-git 1.0.2.r33.gf77d22b $DESTDIR/$PREFIX/$target delete

6.4   Libass-git 0.14.0.r4.g98727c3

  • URL
_initdir

git clone https://github.com/libass/libass.git
cd libass
_pkgver
# version = 0.14.0.r4.g98727c3
# commit = 98727c3b78f44cb3bbc955fcf5d977ebd911d5ca

./autogen.sh
./configure --host=${target} --prefix=${PREFIX}/${target} --enable-shared=yes --enable-static=yes --enable-directwrite --enable-harfbuzz --enable-fontconfig --enable-require-system-font-provider --enable-asm --enable-large-tiles
# --disable-directwrite : not sure if I should disable this option? for win32
# After doing some test than it removed the main menu  from mpv. So I will not use it
make -j$(nproc)

make DESTDIR=$DESTDIR install
[ -d "$DESTDIR/$PREFIX/$target/share/man" ] && { rm -rf "$DESTDIR/$PREFIX/$target/share/man"; }
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libass-git 0.14.0.r4.g98727c3  $DESTDIR/$PREFIX/$target delete

7   Core Packages - Part 2

7.1   FFmpeg-basic 4.1.dev.r1129.g95876c2

_initdir

# Used in case I want to backup the folder later
current_time=$(date '+%Y%m%d%H%M%S')

git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg-git_${current_time}
cd ffmpeg-git_${current_time}

git pull git://github.com/qyot27/FFmpeg.git plain_pkgconfig && \
git pull git://github.com/qyot27/FFmpeg.git datetime && \
git pull git://github.com/qyot27/FFmpeg.git silent_invoke && \
git pull git://github.com/qyot27/FFmpeg.git versioninfo

_pkgver
# version = n4.1.dev.r1129.g95876c2
# commit = 95876c2d2fe364e508547bbaa281c1f23b8199b4


# Press Ctrl+X to commit using nano


./configure --arch=x86 --target-os=mingw32 --enable-cross-compile --prefix=$PREFIX/$target --cross-prefix=${target}- \
        --enable-gpl --enable-version3 --disable-w32threads --enable-avresample --disable-encoders --disable-muxers \
        --disable-doc --disable-debug --disable-devices --disable-avdevice --enable-avisynth

make -j$(nproc)

make DESTDIR=$DESTDIR install
[ -d "$DESTDIR/$PREFIX/$target/share/man" ] && { rm -rf "$DESTDIR/$PREFIX/$target/share/man"; }
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself ffmpeg-basic 4.1.dev.r1129.g95876c2 $DESTDIR/$PREFIX/$target delete

7.2   FFMS2 2.18.r707.g928b011 (aka FFmegSources)

_initdir

git clone git://github.com/qyot27/ffms2.git
cd ffms2/
git checkout patches

_pkgver
# version = 2.18.r707.g928b011
# commit = 928b0110a91a89fc10fe5f35e635b3ea2320475e

#RCFLAGS="-F pe-i386" ./configure --host=${target} --prefix=${PREFIX}/${target} --cross-prefix=${target}- --enable-pic --enable-shared --enable-avisynth --enable-vapoursynth --enable-pic
RCFLAGS="-F pe-i386" ./configure --host=${target} --prefix=${PREFIX}/${target} --cross-prefix=${target}-
make -j$(nproc)

make DESTDIR=$DESTDIR install
[ -d "$DESTDIR/$PREFIX/$target/share/man" ] && { rm -rf "$DESTDIR/$PREFIX/$target/share/man"; }
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself ffms2 2.18.r707.g928b011 $DESTDIR/$PREFIX/$target delete

7.3   X264-Snapshot 20180908-2245 (with Lavf + Ffms support - for x264.exe)

_initdir

wget https://download.videolan.org/x264/snapshots/x264-snapshot-20180908-2245.tar.bz2
tar xjf x264-snapshot-20180908-2245.tar.bz2
cd x264-snapshot-20180908-2245/
wget "https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-x264-git/0001-beautify-pc.all.patch" -O - | patch -p1

unset AS
export RC=${PREFIX}/bin/${target}-ar
../configure --host=$target --prefix=$PREFIX/$target --cross-prefix=$target- --enable-static --enable-shared --enable-strip --enable-pic --disable-win32thread --extra-ldflags="$(pkg-config --libs --static ffms2)"
make -j$(nproc)

make DESTDIR=$DESTDIR install
[ -d "$DESTDIR/$PREFIX/$target/share/man" ] && { rm -rf "$DESTDIR/$PREFIX/$target/share/man"; }
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself x264-snapshot 20180908-2245 $DESTDIR/$PREFIX/$target delete

7.4   MediaInfo CLI 18.08

  • URL no
  • Dependancies: zlib, winpthread
_initdir

wget https://mediaarea.net/download/binary/mediainfo/18.08/MediaInfo_CLI_18.08_GNU_FromSource.tar.xz
tar xvJf MediaInfo_CLI_18.08_GNU_FromSource.tar.xz
cd MediaInfo_CLI_GNU_FromSource/
for file in $(grep -lr -E "Windows\.h" .);do sed -i "s:Windows\.h:windows\.h:g" ${file};done
./CLI_Compile.sh --host=${target} --prefix=${PREFIX}/${target}

mkdir -pv $DESTDIR/$PREFIX/$target/bin
cp -vf MediaInfo/Project/GNU/CLI/.libs/mediainfo.exe $DESTDIR/$PREFIX/$target/bin
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself mediainfo-cli 18.08 $DESTDIR/$PREFIX/$target delete

7.5   Libcelt

_initdir

wget "https://ftp.osuosl.org/pub/xiph/releases/celt/celt-0.11.3.tar.gz"
tar xvzf celt-0.11.3.tar.gz
cd celt-0.11.3/
./configure --host=${target} --prefix=${PREFIX}/${target} --enable-static=yes --enable-shared=yes --enable-custom-modes --enable-fixed-point --enable-float-approx
make -j$(nproc)

make DESTDIR=$DESTDIR install
[ -d "$DESTDIR/$PREFIX/$target/share/man" ] && { rm -rf "$DESTDIR/$PREFIX/$target/share/man"; }
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself libcelt 0.11.3 $DESTDIR/$PREFIX/$target delete

8   External

8.1   FFmpeg 4.0.2

8.1.1   Tips to know

  • If you want to build FFmpeg from its Git repository then you might meet some issues -- running command like git pull..... Before going ahead I had to do to fix issues for git pull....

    git config --global user.email "davidtecher@yahoo.fr"
    git config --global user.name "David Techer"
    
  • I met an issue while trying configure ...--enable-vapoursynth. Then I had to generate a false python-3.4.pc file

    cat << _EOF_ > $PREFIX/$target/lib/pkgconfig/python-3.4.pc
    prefix=$PREFIX/$target
    exec_prefix=${prefix}
    libdir=${exec_prefix}/lib
    includedir=${prefix}/include
    
    Name: Python
    Description: Python library
    Requires:
    Version: 3.7
    Libs.private: -lpthread -ldl  -lutil
    Libs: -L${libdir} -lpython3.7m
    Cflags: -I${includedir}/python3.7m -I${includedir}/python3.7m
    _EOF_
    
  • I had to remove --enable-openssl since ffmpeg support now LibreSSL with enable-libtls

8.1.2   Build FFmpeg

_initdir


( wget -q https://ffmpeg.org/releases/ffmpeg-4.0.2.tar.bz2 -O - | tar xvjf - ) && cd ffmpeg-4.0.2

#export PKG_CONFIG=$(which pkg-config)
export extra_version="Win32_CrossBuild_On_Linux32Bit"
export extralibs="-lstdc++ -lpthread -lz -lmpg123 -logg -lvorbis -lvorbisfile" # This is for libopenmpt
export target_os="mingw32"
export arch="x86"
export cross_prefix="${target}-"
export prefix="${PREFIX}/${target}/"

# All options in alphabetical order
configure_options="--disable-debug --disable-doc --disable-w32threads --enable-avisynth --enable-avresample --enable-bzlib --enable-cross-compile --enable-d3d11va --enable-dxva2 \
        --enable-filter=frei0r --enable-ffnvcodec --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gmp --enable-gnutls --enable-gpl --enable-hardcoded-tables \
        --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libfdk-aac --enable-libflite \
        --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libilbc --enable-libmysofa --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb \
        --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-librsvg --enable-librtmp --enable-librubberband --enable-libshine \
        --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtesseract --enable-libtheora --enable-libtls --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc \
        --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxml2 --enable-libxvid --enable-libzimg --enable-lzma \
        --enable-nonfree --enable-nvenc --enable-nvdec --enable-openal --enable-opengl --enable-optimizations --enable-pic --enable-postproc --enable-runtime-cpudetect --enable-sdl2 --enable-shared --enable-static \
        --enable-swresample --enable-version3 --enable-zlib"

./configure $configure_options
make -j$(nproc)

make DESTDIR=$DESTDIR install
[ -d "$DESTDIR/$PREFIX/$target/share/man" ] && { rm -rf "$DESTDIR/$PREFIX/$target/share/man"; }
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself ffmpeg 4.0.2 $DESTDIR/$PREFIX/$target delete

8.2   FFmpeg 4.1.dev.r1163.gfae040e

_initdir

# Used in case I want to backup the folder later
current_time=$(date '+%Y%m%d%H%M%S')

git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg-git_${current_time}
cd ffmpeg-git_${current_time}

git pull git://github.com/qyot27/FFmpeg.git plain_pkgconfig && \
git pull git://github.com/qyot27/FFmpeg.git datetime && \
git pull git://github.com/qyot27/FFmpeg.git silent_invoke && \
git pull git://github.com/qyot27/FFmpeg.git versioninfo

# Press Ctrl+X to commit using nano

_pkgver
# version = n4.1.dev.r1163.gfae040e
# commit = fae040e899a53957517bae4776bbdec524832667

export extra_version="Win32_CrossBuild_On_Linux32Bit"
export extralibs="-lstdc++ -lpthread -lz -lmpg123 -logg -lvorbis -lvorbisfile" # This is for libopenmpt
export target_os="mingw32"
export arch="x86"
export cross_prefix="${target}-"
export prefix="${PREFIX}/${target}/"

./configure --disable-debug --disable-doc --disable-w32threads --enable-amf --enable-avisynth --enable-avresample --enable-bzlib \
        --enable-concise-version --enable-cross-compile --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 \
        --enable-ffnvcodec --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-hardcoded-tables --enable-libaom --enable-libass \
        --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libfdk-aac --enable-libfreetype --enable-libfribidi \
        --enable-libgme --enable-libilbc --enable-libmfx  --enable-libmodplug --enable-libmp3lame --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb \
        --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtls \
        --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp \
        --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxml2 --enable-libxvid --enable-libzimg --enable-lzma --enable-nonfree --enable-nvdec --enable-nvenc \
        --enable-openal --enable-opengl --enable-postproc --enable-runtime-cpudetect --enable-sdl2 --enable-vapoursynth --enable-version3 --enable-zlib \
        --extra-cflags="-m32 -DCACA_STATIC -DMODPLUG_STATIC -DVS_CORE_EXPORTS" \
        --extra-ldflags="-m32 -L/${PREFIX}/${target}/lib -lgcrypt -lgpg-error " \
        --pkg-config-flags="--static" --extra-ldflags="-Wl,--allow-multiple-definition" --disable-encoder=aac  --disable-decoder=aac,aac_fixed #--cpu=haswell

make DESTDIR=$DESTDIR install
[ -d "$DESTDIR/$PREFIX/$target/share/man" ] && { rm -rf "$DESTDIR/$PREFIX/$target/share/man"; }
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself ffmpeg 4.1.dev.r1163.gfae040e $DESTDIR/$PREFIX/$target delete

8.3   Mpv 0.29.0

  • URL

8.3.1   Patches to apply to MinGW64-headers

cd $PREFIX/$target/include
wget "https://raw.githubusercontent.com/Warblefly/MultimediaTools-mingw-w64/master/mingw-w64-headers-d3d11_1.h.patch" -O - | patch -p4
wget "https://raw.githubusercontent.com/Warblefly/MultimediaTools-mingw-w64/master/mingw-w64-headers-dxgi1_2.h.patch" -O - |patch -p4
 wget "https://raw.githubusercontent.com/Warblefly/MultimediaTools-mingw-w64/master/mingw-w64-headers-processor_format.patch" -O - | patch -p4

After that include this code, inside ${PREFIX}/${target}/include/dxgi1_2.h,d3d11.idl,d3d11_1.h -- taken from https://github.com/doitsujin/dxvk/blob/master/src/d3d11/d3d11_include.h --

typedef enum D3D11_UAV_FLAG {
  D3D11_BUFFER_UAV_FLAG_RAW = 0x1,
  D3D11_BUFFER_UAV_FLAG_APPEND = 0x2,
  D3D11_BUFFER_UAV_FLAG_COUNTER = 0x4
} D3D11_UAV_FLAG;

8.3.2   Build mpv

_initdir

wget https://github.com/mpv-player/mpv/archive/v0.29.0.tar.gz
tar xvzf v0.29.0.tar.gz
cd mpv-0.29.0/
./bootstrap.py

DEST_OS=win32 TARGET=$target CFLAGS="-DHAVE_GPL -DHAVE_GPL2 -m32 $CFLAGS" \
LDFLAGS=" -m32 ${LDFLAGS}"  \
LINKFLAGS="-m32 -L${PREFIX}/${target}/lib" \
PKG_CONFIG="/usr/bin/pkg-config" \
PKG_CONFIG_LIBDIR="$PREFIX/$target/lib/pkgconfig" \
PKG_CONFIG_PATH="$PREFIX/$target/lib/pkgconfig/" \
./waf configure --prefix=$PREFIX/$target --disable-debug-build  \
        --enable-openal --enable-sdl2  \
        --enable-dvdread --enable-dvdnav \
        --enable-cdda --enable-manpage-build --enable-pdf-build --enable-html-build \
        --enable-vapoursynth --enable-vapoursynth-lazy \
        --enable-libmpv-shared  --enable-d3d9-hwaccel --enable-d3d-hwaccel --enable-vulkan  \
        --enable-gl-dxinterop-d3d9 --enable-wasapi --enable-cuda-hwaccel \
        --disable-win32-internal-pthreads --enable-libbluray

./waf build
./waf  install

find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs -rtl1 ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself mpv 0.29.0 $DESTDIR/$PREFIX/$target delete

8.4   Mpv 0.29.0.r29.g48c38f7

_initdir

current_time=$(date '+%Y%m%d%H%M%S');
git clone https://github.com/mpv-player/mpv.git mpv-git_${current_time}
cd mpv-git_${current_time}

_pkgver
# version = 0.29.0.r26.g91786fa
# commit = 91786fa99c15dc64d3bce4be413326ba2dbe59f7

./bootstrap

DEST_OS=win32 \
TARGET=$target \
CFLAGS="-DHAVE_GPL -DHAVE_GPL2 -m32 $CFLAGS" \
LDFLAGS=" -m32 ${LDFLAGS}"  \
LINKFLAGS="-m32 -L${PREFIX}/${target}/lib" \
PKG_CONFIG="/usr/bin/pkg-config" \
PKG_CONFIG_LIBDIR="$PREFIX/$target/lib/pkgconfig" \
PKG_CONFIG_PATH="$PREFIX/$target/lib/pkgconfig/" \
./waf configure --prefix=$PREFIX/$target \
        --disable-debug-build --enable-openal --enable-sdl2 --enable-dvdread --enable-dvdnav --enable-cdda \
        --enable-manpage-build --enable-pdf-build --enable-html-build --enable-vapoursynth --enable-vapoursynth-lazy \
        --enable-d3d9-hwaccel --enable-d3d-hwaccel --enable-vulkan --enable-gl-dxinterop-d3d9 --enable-wasapi \
        --enable-cuda-hwaccel --disable-win32-internal-pthreads --enable-libbluray

./waf install

find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a' -o -name '*.dll' | xargs -rtl1 ${target}-strip -g

cp -avf $DESTDIR/$PREFIX/$target/* $PREFIX/$target/
mingw-w64-makeself mpv 0.29.0.r29.g48c38f7 $DESTDIR/$PREFIX/$target delete

9   Packages/tests to try (experimental) - Still in Development

9.1   FFmpeg 3.4.4 - for Wine

# MinGW - Environment variables
#______________________________
export PREFIX="/opt/MinGW32"
export target="i686-w64-mingw32"
export CPPFLAGS="-I${PREFIX}/${target}/include"
export LDFLAGS="-L${PREFIX}/${target}/lib"
export mingw_c_flags="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4"
export CFLAGS="$mingw_c_flags $CFLAGS"
export CXXFLAGS="$mingw_c_flags $CXXFLAGS"
export PKG_CONFIG_LIBDIR="${PREFIX}/${target}/lib/pkgconfig"
export PKG_CONFIG="${PREFIX}/bin/${target}-pkg-config"
export PKG_CONFIG_PATH="${PREFIX}/${target}/lib/pkgconfig/"
export PATH=${PREFIX}/bin:${PATH}
export SRCDIR="/tmp/sources"
export DESTDIR="/tmp/build"

# FFmpeg - Environment variables
#________________________________
export extra_version="Win32_CrossBuild_On_Linux32Bit"
export target_os="mingw32"
export arch="x86"
export cross_prefix="${target}-"
export prefix="${PREFIX}/${target}/"

# FFmpeg - Configuration
#________________________
#
# For FFmpeg 4 and over you can add '--enable-concise-version' and '--enable-vapoursynth'
configure_options="--disable-debug --disable-doc --enable-cross-compile --enable-d3d11va --enable-dxva2 --enable-avresample --enable-avisynth --enable-filter=frei0r \
                --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gmp --enable-gpl --enable-libass --enable-libbluray --enable-libcaca \
                --enable-libcdio --enable-libfdk-aac --enable-libflite --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm \
                --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg \
                --enable-libopus --enable-librsvg --enable-librtmp --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame \
                --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 \
                --enable-libx265 --enable-libxavs --enable-libxml2 --enable-libxvid --enable-libzimg --enable-lzma --enable-nonfree --enable-openal --enable-opengl \
                --enable-openssl --enable-optimizations --enable-pic --enable-postproc --enable-runtime-cpudetect --enable-shared --enable-sdl2 \
                --enable-static --enable-swresample  --enable-version3 --enable-zlib"

# Get into SRCDIR -- Create it if needed
[ ! -d "${SRCDIR}" ] && { mkdir -p "${SRCDIR}"; } || { cd "${SRCDIR}"; } && { cd "${SRCDIR}"; }

# Download and decompress on the fly. Get into its folder when ready
( wget -q "https://ffmpeg.org/releases/ffmpeg-3.4.4.tar.bz2" -O - | tar xjf - ) && cd ffmpeg-3.4.4/

# Fble-libsnappyFmpeg: configure
./configure ${configure_options}

# FFmpeg: build
make -j$(nproc) || make -j$(nproc) # Just in case it failed while documentation is being generated

# FFmpeg: Prepare package
make DESTDIR=${DESTDIR} install

# Some more stuff to do .....

9.2   zdoom 3.2.5 (TO DO)

Help from https://zdoom.org/wiki/Compile_ZDoom_on_Mac_OS_X

wget https://zdoom.org/files/gzdoom/src/gzdoom-g3.2.5.zip
unzip gzdoom-g3.2.5.zip
cd gzdoom-g3.2.5/
mkdir {build-native,build-cross}
cd build-native
#
# SDL2 is not part of my base system but install at /opt/wine/apps/koku-xinput/. Prefix is used here to point to its installation
#
SDL2DIR=/opt/wine/apps/koku-xinput/  /opt/cmake/3.9.3/bin/cmake -DCMAKE_BUILD_TYPE=Release ..
#
# CrossCompiling
#
cd ../build-cross
/opt/cmake/3.9.3/bin/cmake  -DCMAKE_TOOLCHAIN_FILE=/tmp/Toolchain-Ubuntu-mingw32.cmake -DBUILD_SHARED_LIBS=OFF \
        -DCMAKE_INSTALL_PREFIX=$PREFIX/$target/  \
        -DCMAKE_BUILD_TYPE=Release \
        -DFORCE_CROSSCOMPILE=ON -DIMPORT_EXECUTABLES=/tmp/sources/gzdoom-g3.2.5/build-native/ImportExecutables.cmake ..

9.3   PostgreSQL 10.3 (TO DO )

[ ! -d /tmp/sources ] && mkdir -p /tmp/sources
cd /tmp/sources/
export DESTDIR=/tmp/build

git clone https://aur.archlinux.org/mingw-w64-postgresql.git
wget https://ftp.postgresql.org/pub/source/v10.3/postgresql-10.3.tar.bz2
tar xvjf postgresql-10.3.tar.bz2
cd postgresql-10.3/
patch -p1 -i ../mingw-w64-postgresql/postgresql-9.4.1-mingw-link.patch
#mkdir build-$target && cd build-$target
./configure --host=$target --target=$target --prefix=$PREFIX/$target/  --with-openssl --with-libxml --with-libxslt --with-icu --enable-nls --enable-thread-safety
#ln -s /tmp/sources/postgresql-10.3/src/interfaces/libpq/libpqdll.def src/interfaces/libpq/
#ln -s /tmp/sources/postgresql-10.3/src/cinterfaces/ecpg/ecpglib/libecpgdll.def src/interfaces/ecpg/ecpglib/
#ln -s /tmp/sources/postgresql-10.3/src/interfaces/ecpg/pgtypeslib/libpgtypesdll.def src/interfaces/ecpg/pgtypeslib/
#ln -s /tmp/sources/postgresql-10.3/src/interfaces/ecpg/compatlib/libecpg_compatdll.def src/interfaces/ecpg/compatlib/
make -j$(nproc)
$target-ar rvs -o libpq.a src/interfaces/libpq/*.o

make DESTDIR=$DESTDIR install
mv -vf libpq.a $DESTDIR/$PREFIX/$target/lib
mv -vf $DESTDIR/$PREFIX/$target/lib/*.dll $DESTDIR/$PREFIX/$target/bin/
find $DESTDIR/$PREFIX/$target/ -name '*.exe' -exec ${target}-strip --strip-all {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.dll' -exec ${target}-strip --strip-unneeded {} \;
find $DESTDIR/$PREFIX/$target/ -name '*.a'   -exec ${target}-strip -g {} \;

10   Make the Toolchain portable

10.1   Download

Download the compressed toolchain i686-w64-mingw32-gcc-7.2.0-posix_Linux-32Bit_binaries_20180227_v001.tar.xz

  • Required space: 900MB

TODO

10.2   Install on Linux Debian 9.3 64 Bits

  • Option #1: Enough free space on /

    sudo tar xvJf MinGW32-Distro-ALL-Linux-i686_MinGW-w64-5.0.3_Gcc_7.2.0.tar.xz  -C /
    
  • Option #2: Using symbolic link

    sudo tar xvJf MinGW32-Distro-ALL-Linux-i686_MinGW-w64-5.0.3_Gcc_7.2.0.tar.xz -C /some/path/to/extract
    sudo ln -s /some/path/to/extract/opt/MinGW32 /opt/
    

10.3   Prerequisites for 32 bits binaries (OUTDATE SECTION)

  • Install missing packages

    apt-get install libc6-i386
    
  • Check that it works running /opt/MinGW32/bin/i686-w64-mingw32-gcc -v

    david@kvm-ReactOS:~$ /opt/MinGW32/bin/i686-w64-mingw32-gcc -v
    Using built-in specs.
    COLLECT_GCC=/opt/MinGW32/bin/i686-w64-mingw32-gcc
    COLLECT_LTO_WRAPPER=/home/david/opt/MinGW32/bin/../libexec/gcc/i686-w64-mingw32/7.2.0/lto-wrapper
    Target: i686-w64-mingw32
    Configured with: /build/gcc-7.2.0/configure --prefix=/opt/MinGW32 --target=i686-w64-mingw32 --disable-multilib --enable-threads=posix --enable-lto --enable-languages=c,c++ --disable-nls --with-gnu-ld --with-gnu-as --enable-libgomp
    Thread model: posix
    gcc version 7.2.0 (GCC)
    

10.4   Set up environment

export PREFIX=/opt/MinGW32
export target=i686-w64-mingw32
export PATH=/opt/MinGW32/bin:${PATH}
export CPPFLAGS=-I/opt/MinGW32/i686-w64-mingw32/include
export LDFLAGS=-L/opt/MinGW32/i686-w64-mingw32/lib
export PKG_CONFIG=/opt/MinGW32/bin/i686-w64-mingw32-pkg-config
export PKG_CONFIG_LIBDIR=$PREFIX/$target/lib/pkgconfig

11   Test 1 - Chocolate Doom 3.0.0

11.1   Ahout dependancies for this game

  • SDL2
  • SDL2_{Mixer,Net}
  • Libsamplerate (optional)
  • Libpng

11.2   Build the game

export CHOCOLATE_PREFIX=/tmp/chocolate
wget https://github.com/chocolate-doom/chocolate-doom/releases/download/chocolate-doom-3.0.0/chocolate-doom-3.0.0.tar.gz
tar xzf chocolate-doom-3.0.0.tar.gz
cd chocolate-doom-3.0.0/
./configure --host=$target --prefix=$CHOCOLATE_PREFIX --datadir=$CHOCOLATE_PREFIX --with-bashcompletiondir=$CHOCOLATE_PREFIX/completions
make -j$(nproc) && make install

11.3   Add DLLs to make it portable

cp -vf /opt/MinGW32/i686-w64-mingw32/bin/SDL2{_mixer,_net,}.dll $CHOCOLATE_PREFIX/bin/
cp -vf /opt/MinGW32/i686-w64-mingw32/bin/libpng16-16.dll $CHOCOLATE_PREFIX/bin/
cp -vf /opt/MinGW32/i686-w64-mingw32/bin/libsamplerate-0.dll $CHOCOLATE_PREFIX/bin/
cp -vf /opt/MinGW32/i686-w64-mingw32/bin/zlib1.dll $CHOCOLATE_PREFIX/bin/
cp -vf /opt/MinGW32/i686-w64-mingw32/lib/libgcc_s_sjlj-1.dll $CHOCOLATE_PREFIX/bin/
cp -vf /opt/MinGW32/i686-w64-mingw32/bin/libwinpthread-1.dll $CHOCOLATE_PREFIX/bin/
cp -vf /opt/MinGW32/i686-w64-mingw32/bin/libglib-2.0-0.dll $CHOCOLATE_PREFIX/bin/
cp -vf /opt/MinGW32/i686-w64-mingw32/bin/libportaudio-2.dll $CHOCOLATE_PREFIX/bin/
cp -vf /opt/MinGW32/i686-w64-mingw32/bin/libsndfile-1.dll $CHOCOLATE_PREFIX/bin/
cp -vf /opt/MinGW32/i686-w64-mingw32/bin/libintl-8.dll $CHOCOLATE_PREFIX/bin/
cp -vf /opt/MinGW32/i686-w64-mingw32/bin/libpcre-1.dll $CHOCOLATE_PREFIX/bin/
cp -vf /opt/MinGW32/i686-w64-mingw32/bin/libglib-2.0-0.dll $CHOCOLATE_PREFIX/bin/
cp -vf /opt/MinGW32/i686-w64-mingw32/bin/libFLAC-8.dll $CHOCOLATE_PREFIX/bin/
cp -vf /opt/MinGW32/i686-w64-mingw32/bin/libogg-0.dll $CHOCOLATE_PREFIX/bin/
cp -vf /opt/MinGW32/i686-w64-mingw32/bin/libspeex-1.dll $CHOCOLATE_PREFIX/bin/
cp -vf /opt/MinGW32/i686-w64-mingw32/bin/libvorbis-0.dll $CHOCOLATE_PREFIX/bin/
cp -vf /opt/MinGW32/i686-w64-mingw32/bin/libvorbisenc-2.dll $CHOCOLATE_PREFIX/bin/
cp -vf /opt/MinGW32/i686-w64-mingw32/bin/libsndfile-1.dll $CHOCOLATE_PREFIX/bin/
cp -vf /opt/MinGW32/i686-w64-mingw32/bin/libfluidsynth-1.dll $CHOCOLATE_PREFIX/bin/
cp -vf /opt/MinGW32/i686-w64-mingw32/bin/libiconv-2.dll $CHOCOLATE_PREFIX/bin/

i686-w64-mingw32-strip $CHOCOLATE_PREFIX/bin/*exe
i686-w64-mingw32-strip $CHOCOLATE_PREFIX/bin/*dll

That's it! Now you can copy the prefix folder and test it on any Window machine. I tried it on my own Windows XP and it worked.

12   Test 2 - OpenTTD 1.7.2

12.1   About dependancies for this game

Quoted from https://svn.openttd.org/trunk/readme.txt

The following libraries are used by OpenTTD for:

  • libSDL/liballegro: hardware access (video, sound, mouse)
  • zlib: (de)compressing of old (0.3.0-1.0.5) savegames, content downloads, heightmaps
  • liblzo2: (de)compressing of old (pre 0.3.0) savegames
  • liblzma: (de)compressing of savegames (1.1.0 and later)
  • libpng: making screenshots and loading heightmaps
  • libfreetype: loading generic fonts and rendering them
  • libfontconfig: searching for fonts, resolving font names to actual fonts
  • libicu: handling of right-to-left scripts (e.g. Arabic and Persian) and natural sorting of strings.

OpenTTD does not require any of the libraries to be present, but without liblzma you cannot open most recent savegames and without zlib you cannot open most older savegames or use the content downloading system. Without libSDL/liballegro on non-Windows and non-MacOS X machines you have no graphical user interface; you would be building a dedicated server

Depends on

  • ZLib
  • Lzo2
  • Icu
  • Freetype
  • SDL

12.3   Build game from sources

cd /tmp/sources
wget http://binaries.openttd.org/releases/1.7.2/openttd-1.7.2-source.tar.gz -O- | tar xfz -
cd openttd-1.7.2/
# Patch for src/video/allegro_v.cpp, dirty patch but it works
wget http://techer.pascal.free.fr/0001-openttd-1.7.2_mingw32.patch -O - |patch -p1
# Patch: Allegro dependancies are not taken into account for pkg-config for MinGW environment
wget http://techer.pascal.free.fr/0002-openttd-1.7.2_mingw32.patch -O - | patch -p1
./configure --host=$target --prefix=/tmp/openttd_build  --with-lzo2=$PREFIX/$target/lib/liblzo2.a --enable-static --static-icu
make -j$(nproc)

12.4   Make the game portable

cp /opt/MinGW32/i686-w64-mingw32/bin/alleg44.dll bin/
cp /opt/MinGW32/i686-w64-mingw32/bin/SDL.dll bin/
cp /opt/MinGW32/i686-w64-mingw32/lib/libgcc_s_sjlj-1.dll bin/
cp /opt/MinGW32/i686-w64-mingw32/bin/libwinpthread-1.dll bin/
i686-w64-mingw32-strip bin/*dll

12.5   Add Modules (OpenGFX, OpenSFX, OpenMSX)

# OpenGFX
wget http://uk.binaries.openttd.org/binaries/extra/opengfx/0.5.2/opengfx-0.5.2-all.zip -O /tmp/opengfx.zip
unzip /tmp/opengfx.zip -d bin/baseset
# OpenSFX
wget http://bundles.openttdcoop.org/opensfx/releases/opensfx-0.2.3.zip -O /tmp/opensfx-0.2.3.zip
unzip /tmp/opensfx-0.2.3.zip -d bin/baseset
# OpenMSX
wget http://bundles.openttdcoop.org/openmsx/releases/0.3.1/openmsx-0.3.1.zip -O /tmp/openmsx-0.3.1.zip
unzip /tmp/openmsx-0.3.1.zip -d bin/baseset
# Zbase
wget http://binaries.openttd.org/bananas/basegraphic/zBase-v5588.tar.gz
gunzip zBase-v5588.tar.gz
mv zBase-v5588.tar bin/baseset/

12.6   MIDI on Linux (Music in Game)

apt install fluidsynth fluid-soundfont-gm timidity

Open a terminal and launch -- let the terminal opened --

timidity -iA -B2,8 -Os -EFreverb=0

12.7   Launch the game

  • Help for the game

    wine bin/openttd.exe -h
    
  • With some options

    wine bin/openttd.exe  -r 1400x900 -s win32 -m win32 -v win32 -b 32bpp-sse4-anim
    
  • With SDL options

    wine openttd.exe  -r 1920x1080 -s sdl -m win32 -v sdl -b 32bpp-sse4-anim