Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.13)
cmake_minimum_required(VERSION 3.16)
# set(CMAKE_CONFIGURATION_TYPES "Release" CACHE STRING "" FORCE)
if(APPLE)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.10" CACHE STRING "Minimum OS X deployment version")
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14" CACHE STRING "Minimum OS X deployment version")
set(HAVE_FLAG_SEARCH_PATHS_FIRST 0)
endif()

Expand All @@ -12,7 +12,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModules/")

add_definitions(-DSTREMIO_SHELL_BIN_VERSION=${NUMERIC_VERSION} -DSTREMIO_SHELL_VERSION="${PROJECT_VERSION}" -DUNICODE -D_UNICODE)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_AUTOMOC ON)
Expand All @@ -34,9 +34,12 @@ set(SOURCES
)

set(MPV_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/deps/libmpv/include)
if(NOT QT_DEFAULT_MAJOR_VERSION)
set(QT_DEFAULT_MAJOR_VERSION 6)
endif()

if(WIN32)
list(APPEND SOURCES stremio.rc)
set(QT_DEFAULT_MAJOR_VERSION 5)
set(ENV{Qt6_DIR} $ENV{QTDIR})
set(MPV_LIBRARY_mpv ${CMAKE_CURRENT_SOURCE_DIR}/deps/libmpv/win32/mpv.lib)
endif()
Expand All @@ -56,7 +59,7 @@ add_subdirectory(deps/singleapplication)

set(CMAKE_BUILD_RPATH_USE_ORIGIN TRUE)

find_package(Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Widgets Network Qml Quick WebEngine WebChannel DBus OpenGL REQUIRED)
find_package(Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Widgets Network Qml Quick WebEngineQuick WebChannel DBus OpenGL REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(MPV REQUIRED)

Expand Down Expand Up @@ -109,14 +112,14 @@ target_include_directories(${PROJECT_NAME} PRIVATE
)

target_link_libraries(${PROJECT_NAME} LINK_PUBLIC
Qt5::Qml
Qt5::Quick
Qt5::Network
Qt5::Widgets
Qt5::WebEngine
Qt5::WebChannel
Qt5::DBus
Qt5::OpenGL
Qt${QT_DEFAULT_MAJOR_VERSION}::Qml
Qt${QT_DEFAULT_MAJOR_VERSION}::Quick
Qt${QT_DEFAULT_MAJOR_VERSION}::Network
Qt${QT_DEFAULT_MAJOR_VERSION}::Widgets
Qt${QT_DEFAULT_MAJOR_VERSION}::WebEngineQuick
Qt${QT_DEFAULT_MAJOR_VERSION}::WebChannel
Qt${QT_DEFAULT_MAJOR_VERSION}::DBus
Qt${QT_DEFAULT_MAJOR_VERSION}::OpenGL
SingleApplication::SingleApplication
OpenSSL::Crypto
${MPV_LIBRARY}
Expand Down
108 changes: 35 additions & 73 deletions DEBIAN.md
Original file line number Diff line number Diff line change
@@ -1,96 +1,58 @@
# Build Stremio for Debian GNU/Linux

These instructions have been tested in Debian Bookworm 12 (Stable)
These instructions have been tested on Debian Trixie 13 and Sid (unstable).

## 1. Start by cloning the GIT repository:
## 1. Clone the repository

``git clone --recurse-submodules -j8 https://github.com/Stremio/stremio-shell.git``

## 2. Install QTCreator and other dependencies

``sudo apt-get install qtcreator qt5-qmake g++ pkgconf libssl-dev librsvg2-bin``

## 3. Generate the Makefiles for Stremio

``cd stremio-shell``

``qmake``

## 3.1 Install missing dependencies

If you see this message:

```
Info: creating stash file /home/mendezr/development/misc/stremio-shell/.qmake.stash
Project ERROR: mpv development package not found
```bash
git clone --recurse-submodules https://github.com/vejeta/stremio-shell.git
cd stremio-shell
git checkout qt6-migration
```

Then you need to install the development package for mpv (movie player)

``sudo apt-get install libmpv-dev``

If you see this message:
If you already cloned without `--recurse-submodules`:

```bash
git submodule update --init
```
Project ERROR: Unknown module(s) in QT: qml quick webengine
```

Then install:
``sudo apt-get install libqt5webview5-dev``

If you find:
```Project ERROR: Unknown module(s) in QT: webengine```
## 2. Install build dependencies

Then install:
```bash
sudo apt-get install cmake g++ pkgconf libssl-dev libmpv-dev librsvg2-bin \
qt6-base-dev qt6-declarative-dev qt6-webengine-dev qt6-webchannel-dev qt6-tools-dev libgl-dev
```

``sudo apt-get install libkf5webengineviewer-dev``
## 3. Build Stremio

## 4. Compile Stremio:
```bash
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DQT_DEFAULT_MAJOR_VERSION=6
make -j$(nproc)
```

$ make -f release.makefile
## 4. Install runtime QML dependencies

This will create a new directory named `build` where the `stremio' binary will be located. It will also generate icons and download the streaming server.
If you see errors like `module "QtWebEngine" is not installed` when running, install:

```bash
sudo apt-get install qml6-module-qtwebengine qml6-module-qtwebchannel \
qml6-module-qtquick-controls qml6-module-qtquick-dialogs
```

## 5. Prepare the streaming server

Upon running the ./build/stremio binary, stremio should start up as usual. Except it won't start the streaming server, for this you need to have NodeJS installed and server.js in your working dir, for which you need to do:

``cp ./server.js ./build/ && ln -s "$(which node)" ./build/node``

The stremio binary expects a Node.js server in the same directory:

## 6. Install other dependencies

If you get this messages:

```
$ ./stremio
QQmlApplicationEngine failed to load component
qrc:/main.qml:3 module "QtWebChannel" is not installed
qrc:/main.qml:2 module "QtWebEngine" is not installed
qrc:/main.qml:12 module "Qt.labs.platform" is not installed
qrc:/main.qml:3 module "QtWebChannel" is not installed
qrc:/main.qml:2 module "QtWebEngine" is not installed
qrc:/main.qml:12 module "Qt.labs.platform" is not installed
qrc:/main.qml:3 module "QtWebChannel" is not installed
qrc:/main.qml:2 module "QtWebEngine" is not installed
qrc:/main.qml:12 module "Qt.labs.platform" is not installed
```bash
cp ./server.js ./build/
ln -s "$(which node)" ./build/node
```

That means you need to install:
## 6. Run Stremio

``sudo apt-get install qml-module-qtwebchannel qml-module-qt-labs-platform qml-module-qtwebengine qml-module-qtquick-dialogs qml-module-qtquick-controls qtdeclarative5-dev qml-module-qt-labs-settings qml-module-qt-labs-folderlistmodel``

Now you should be able to run it normally.

## 7. Run Stremio

``./build/stremio``

If you get a popup window stating:

Error while starting streaming server. Please consider re-installing Stremio from https://www.stremio.com

Perhaps you've skipped step #5
```bash
./build/stremio
```

Cheers!
If you get a popup about the streaming server failing, make sure you completed step 5.
55 changes: 25 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,42 @@
## Build

### Build instructions for Mac OS X
This branch (`qt6-migration`) uses **Qt 6** and **CMake** as the build system.

1. Make sure you have Qt 5.10.x or newer and Qt Creator
2. Open the project in Qt creator
3. build it
### Dependencies

#### Command line to build:

```
qmake
make
**Debian/Ubuntu:**
```bash
sudo apt install qt6-base-dev qt6-declarative-dev qt6-webengine-dev \
qt6-webchannel-dev qt6-tools-dev libgl-dev libmpv-dev libssl-dev cmake
```
### Build instructions for Windows

Please, refer to [WINDOWS.md](https://github.com/Stremio/stremio-shell/blob/master/WINDOWS.md) for a detailed explanation of how to build the latest Stremio in Windows.


### Build instructions for Debian GNU/Linux

Please, refer to [DEBIAN.md](https://github.com/Stremio/stremio-shell/blob/master/DEBIAN.md) for a detailed explanation of how to build the latest Stremio in Debian.
### Build instructions (all platforms)

### Build instructions for OpenSuseLeap 15.0
```bash
# Clone with submodules
git clone --recurse-submodules https://github.com/vejeta/stremio-shell.git
cd stremio-shell
git checkout qt6-migration

Please, refer to [OpenSuseLeap.md](https://github.com/Stremio/stremio-shell/blob/master/OpenSuseLeap.md) for a detailed explanation of how to build the latest Stremio in OpenSuseLeap 15.0
# If you already cloned without --recurse-submodules:
git submodule update --init

### Build instructions for Docker builds of supported Linux distros

There are Docker files and setup scripts for supported Linux distributions (Debian, Fedora, Arch), located in the `./distros` directory.

There is also an automated build script located in `./dist-utils/build-package.sh`.

For more information refer to the [DOCKER.md](DOCKER.md) file.

## Third-party install scripts
# Build
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DQT_DEFAULT_MAJOR_VERSION=6
make -j$(nproc)
```

There are repositories for third-party install scripts that may be useful for you, most notably: https://github.com/alexandru-balan/Stremio-Install-Scripts
### Platform-specific notes

We give no guarantees about their correctness or security.
- **Windows**: Refer to [WINDOWS.md](WINDOWS.md)
- **Debian**: Refer to [DEBIAN.md](DEBIAN.md)
- **OpenSuse Leap**: Refer to [OpenSuseLeap.md](OpenSuseLeap.md)
- **Docker**: See `./distros` directory and [DOCKER.md](DOCKER.md)

## Releasing a version

1. Bump the version in the `stremio.pro` file
1. Bump the version in `CMakeLists.txt`
2. Create a git tag with the corresponding version

## Arguments
Expand Down
3 changes: 1 addition & 2 deletions autoupdater.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
#include <QUrlQuery>
#include <QProcessEnvironment>
#include <QQueue>
#include <QVector>
#include <QList>
#include <QProcess>
#include <QNetworkConfigurationManager>

// Mixing C and C++ :(
extern "C" {
Expand Down
28 changes: 8 additions & 20 deletions main.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <QQmlApplicationEngine>
#include <QtWebEngine>
#include <QSysInfo>
#include <QtWebEngineQuick>
#include <QQuickWindow>

#include <clocale>

Expand Down Expand Up @@ -50,25 +50,13 @@ void InitializeParameters(QQmlApplicationEngine *engine, MainApp& app) {
int main(int argc, char **argv)
{
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--autoplay-policy=no-user-gesture-required");
#ifdef _WIN32
// Default to ANGLE (DirectX), because that seems to eliminate so many issues on Windows
// Also, according to the docs here: https://wiki.qt.io/Qt_5_on_Windows_ANGLE_and_OpenGL, ANGLE is also preferrable
// We do not need advanced OpenGL features but we need more universal support

Application::setAttribute(Qt::AA_UseOpenGLES);
auto winVer = QSysInfo::windowsVersion();
if(winVer <= QSysInfo::WV_WINDOWS8 && winVer != QSysInfo::WV_None) {
qputenv("NODE_SKIP_PLATFORM_CHECK", "1");
}
if(winVer <= QSysInfo::WV_WINDOWS7 && winVer != QSysInfo::WV_None) {
qputenv("QT_ANGLE_PLATFORM", "d3d9");
}
#endif

// This is really broken on Linux
#ifndef Q_OS_LINUX
Application::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
// Qt6: Force OpenGL backend for QQuickFramebufferObject (used by MPV renderer).
// Without this, Qt6 RHI may choose Vulkan/Metal and MPV frames won't update.
QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL);

// Qt6: QtWebEngineQuick::initialize() must be called before QApplication
QtWebEngineQuick::initialize();

Application::setApplicationName("Stremio");
Application::setApplicationVersion(STREMIO_SHELL_VERSION);
Expand Down
Loading
Loading