This document explains how to compile and install SMPlayer.

Compiling SMPlayer should be easy. It only depends on Qt 4.


1) How to make a deb package
2) How to make a rpm package
3) Generic compilation
4) Changing installation path
5) How to compile in Windows


1) How to make a deb package
----------------------------
You need to install a compiler and some development packages:
sudo apt-get install zlib1g-dev fakeroot build-essential devscripts debhelper g++

You also need either Qt 5 or Qt 4.

This will install the development packages of Qt 5:
sudo apt-get install qtbase5-dev qt5-qmake qtscript5-dev \
                     qttools5-dev-tools qtbase5-private-dev qtdeclarative5-dev \
                     libqt5webkit5-dev libqt5opengl5-dev --no-install-recommends
(note: libqt5webkit5-dev is only necessary if you're going to build smtube as well)

It's still possible to build SMPlayer with Qt 4, although not recommended:
sudo apt-get install libqt4-dev

Now run ./create_deb.sh


2) How to make a rpm package
----------------------------
Building a rpm package is not easy. Better get a binary package from
this repository:
https://software.opensuse.org/download.html?project=home%3Asmplayerdev&package=smplayer


3) Generic compilation
----------------------
(obsolete)


4) Changing installation path
-----------------------------
By default smplayer will be installed in /usr/local. You can change it by
using PREFIX and DESTDIR.

Examples:
make PREFIX=/usr
make PREFIX=/usr install

That would install smplayer under /usr.

DESTDIR will be useful for package maintainers.

make PREFIX=/usr
make PREFIX=/usr DESTDIR=/tmp/ install

That would compile smplayer for /usr but in fact it will be installed in
/tmp/usr/


5) How to compile in Windows
----------------------------
Download components:
Download latest QT Windows Installer:
https://download.qt.io/archive/qt/5.14/5.14.2/qt-opensource-windows-x86-5.14.2.exe

Download latest portable GIT for Windows:
https://git-scm.com/download/win

Install components:
Install latest QT Windows Installer with all/full options.
Hint:
If you don't have an QT account, disable internet connection before start QT Installer.

Start PortableGit installer to extract all files.
copy the contents of "mingw32" folder to C:\Qt\Qt5.14.2\5.14.2\mingw73_32 and overwrite existing files

Compile:
git clone https://github.com/smplayer-dev/smplayer.git
cd smplayer
Call compile_windows.cmd nosmtube (don't compile SMTube)

SMPlayer application will be found in .\src\release
SMPlayer translation files (.qm) will be found in .\src\translation
SMPlayer webserver application will be found in .\webserver

Necessary files to run SMPLayer:
Root directory:
libcrypto-1_1.dll
libgcc_s_dw2-1.dll
libssl-1_1.dll
libstdc++-6.dll
libwinpthread-1.dll
Qt5Core.dll
Qt5DBus.dll
Qt5Gui.dll
Qt5Network.dll
Qt5Qml.dll
Qt5Script.dll
Qt5Widgets.dll
Qt5Xml.dll
simple_web_server.exe
smplayer.exe

Create folder "translation" and put all translation files (.qm) from compiled source code folder ".\src\translation" in that folder
Create folder "platforms" and put "qwindows.dll" files from C:\Qt\Qt5.14.2\5.14.2\mingw73_32\plugins\platforms in that folder
Create folder "mplayer" and put mplayer application executable in that folder
Create folder "mpv" and put mpv application executable in that folder

Qt5 DLL files could be found in C:\Qt\Qt5.14.2\5.14.2\mingw73_32\bin
lib DLL files could be found in C:\Qt\Qt5.14.2\Tools\QtCreator\bin, C:\Qt\Qt5.14.2\Tools\mingw730_32\bin and C:\Qt\Qt5.14.2\5.14.2\mingw73_32\bin

