1. Install 7-Zip, NSIS, Subversion and CMake 3.13.5
2. Create initial directory structure
C:/devel
|--mingw32
|--msys
|--mingw32-libs
3. Download i686-4.9.4-release-posix-dwarf-rt_v5-rev0.7z from here and unpack it to C:/devel/mingw32
4. Download msys+7za+wget+svn+git+mercurial+cvs-rev13.7z from here and unpack it to C:/devel/msys
5. Create environment variables PATH and QTDIR with the following content:
PATH=C:\devel\msys\bin;C:\devel\qt4\bin;C:\devel\mingw32\bin;C:\devel\mingw32\opt\bin;C:\devel\mingw32-libs\bin;C:\Program Files (x86)\7-Zip;C:\Program Files\7-Zip;C:\Program Files\Subversion\bin
QTDIR=C:\devel\qt4
6. Download latest Qt4 snapshot. You should start cmd.exe and execute the following commands:
cd C:/devel/
git clone git://code.qt.io/qt/qt.git qt4
cd qt4
git checkout 4.8
Do not close cmd.exe before next step.
7. Apply patches to Qt4:
wget https://svn.code.sf.net/p/qmmp-dev/code/trunk/patches/qt-4.8.6-fix-win7-tooltip.diff
cat qt-4.8.6-fix-win7-tooltip.diff | patch -p1
Do not close cmd.exe before next step.
8. Compile Qt4 using the following commands:
configure -release -nomake demos -nomake examples -openssl-linked OPENSSL_LIBS="-lcrypto.dll -lssl.dll" -I c:/devel/mingw32/opt/include -L c:/devel/mingw32/opt/lib
cd tools
cd configure
qmake
mingw32-make
cd ..
cd ..
mingw32-make confclean
configure -release -nomake demos -nomake examples -openssl-linked OPENSSL_LIBS="-lcrypto.dll -lssl.dll" -I c:/devel/mingw32/opt/include -L c:/devel/mingw32/opt/lib
mingw32-make -j4
9. Download qmmp build scripts
cd C:\devel
svn co https://svn.code.sf.net/p/qmmp-dev/code/trunk/extras/package/win32/ qmmp-win32
10. Check paths in the following files:
C:\devel\qmmp-win32\start_sh.cmd
C:\devel\qmmp-win32\qmmp-0-win32.sh
C:\devel\qmmp-win32\contrib\mingw-libs.sh
C:\devel\qmmp-win32\contrib\start_sh.cmd
11. Install all required libraries. You should start C:\devel\qmmp-win32\contrib\start_sh.cmd and execute the following commands:
./mingw-libs.sh --download
./mingw-libs.sh --install
12. Open c:\devel\qt4\mkspecs\win32-g++\qmake.conf and change following lines:
#before
QMAKE_INCDIR =
QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS]
QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS]
#after
QMAKE_INCDIR += C:/devel/mingw32-libs/include
QMAKE_LIBDIR += C:/devel/mingw32-libs/lib
QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS]
QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS]
13. Compile and prepare qmmp package. You should start C:\devel\qmmp-win32\start_sh.cmd and execute the following commands:
./qmmp-0-win32.sh --download
./qmmp-0-win32.sh --install
14. All required files will be in the directory C:\devel\qmmp-win32\tmp\qmmp-distr. Add extra files, modify qmmp.nsi and create package using nsis installed before.