Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
BartSte committed Jan 12, 2024
1 parent 284042f commit 1326bf1
Show file tree
Hide file tree
Showing 5 changed files with 165 additions and 20 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Release

on:
push:
tags:
- 'v[0-9]+\.[0-9]+\.[0-9]+'

jobs:
build-release:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Update apt-get database
run: |
sudo apt-get update -y
sudo apt-get upgrade -y
- name: Install build dependencies
run: sudo apt-get install -y clang ninja-build git cmake llvm pkg-config

- name: Install vulkan
run: |
wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list http://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list
sudo apt update
sudo apt install vulkan-sdk
- name: Install project dependencies
run: |
sudo apt-get install -y libboost-all-dev libspdlog-dev
sudo apt-get install -y '^libxcb.*-dev' build-essential libgl1-mesa-dev libgles2-mesa-dev libglu1-mesa-dev libpulse-dev libqt5x11extras5 libssl-dev libssl1.0 libwayland-dev libwayland-egl1-mesa libwayland-server0 libx11-xcb-dev libxi-dev libxkbcommon-dev libxkbcommon-dev libxkbcommon-x11-dev libxrender-dev openssl ffmpeg
- name: Install ffmpeg
env:
PC_FFMPEG_LIBRARY_DIRS: /usr/ilb/x86_64-linux-gnu
PC_FFMPEG_INCLUDE_DIRS: /usr/include/x86_64-linux-gnu
run: |
sudo add-apt-repository ppa:ubuntuhandbook1/ffmpeg6
sudo apt update
sudo apt-get install ffmpeg
ffmpeg -version
- name: Download Qt source
env:
QT_INSTALLER_JWT_TOKEN: ${{ secrets.QT_INSTALLER_JWT_TOKEN }}
run: |
mkdir /tmp/Qt
./scripts/install-qt --root /tmp/Qt qt.qt6.661.src
- name: Build Qt from source with static linking
env:
CC: gcc
CXX: g++
CXXFLAGS: -Wall
run: |
src=/tmp/Qt/6.6.1/Src
$src/configure -release -static -prefix $PWD/3rdparty/Qt/ -submodules qtbase,qtmultimedia,qtwayland -no-pch -no-gstreamer -feature-ffmpeg -- -S $src -B $src/build -Wdev --trace-source=FindFFmpeg.cmake
cmake --build $src/build
cmake --install $src/build
- name: Build project
run: |
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF
cmake --build ./build --target package
- name: Publish
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
draft: true
files: ./build/*.tar.gz
13 changes: 10 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,20 @@ jobs:
- name: Install build dependencies
run: sudo apt-get install -y clang ninja-build git cmake

- name: Install vulkan
run: |
wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list http://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list
sudo apt update
sudo apt install vulkan-sdk
- name: Install project dependencies
env:
QT_INSTALLER_JWT_TOKEN: ${{ secrets.QT_INSTALLER_JWT_TOKEN }}
run: |
sudo apt-get install -y libboost-all-dev libspdlog-dev
sudo apt-get install -y build-essential openssl libssl-dev libssl1.0 libgl1-mesa-dev libqt5x11extras5 '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev libpulse-dev
./scripts/install-qt
sudo apt-get install -y libboost-all-dev libspdlog-dev
sudo apt-get install -y build-essential openssl libssl-dev libssl1.0 libgl1-mesa-dev libqt5x11extras5 '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev libpulse-dev libwayland-dev libwayland-egl1-mesa libwayland-server0
./scripts/install-qt --root $PWD/3rdparty/Qt qt.qt6.661.gcc_64 qt.qt6.661.addons.qtmultimedia
- name: Build project
run: |
Expand Down
46 changes: 43 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# README

[![Tests](https://github.com/BartSte/snapshot/actions/workflows/tests.yml/badge.svg)](https://github.com/BartSte/snapshot/actions/workflows/tests.yml)
[![Release](https://github.com/BartSte/snapshot/actions/workflows/release.yml/badge.svg)](https://github.com/BartSte/snapshot/actions/workflows/release.yml)

> WORK IN PROGRESS!
> This project is still under development. The code is still experimental and
> is subject to change.
Expand Down Expand Up @@ -425,11 +428,48 @@ more information.
libEGL warning: egl: failed to create dri2 screen
```
- On ubuntu, fresh install, I get the following error:
According to bing:
```
It seems that you are encountering an error while running your Qt app on
Arch Linux with WSL. The error message you provided indicates that the
vkCreateInstance function failed with the error code
VK_ERROR_INCOMPATIBLE_DRIVER. This error is usually caused by a mismatch
between the Vulkan driver and the hardware it is running on 1.
One possible solution is to install the latest graphics drivers for your
system 2. Another possible solution is to try running the app without any
Vulkan layers at all 3.
It’s also worth noting that there is an ongoing issue with
hardware-accelerated Vulkan in WSL2 4. You may want to check if this issue
is related to your problem.
I hope this helps!
```
barts@zbook:~$ ./snapshot-0.0.0-Linux/snapshot -h
1012: __vdso_timeSegmentation fault
An idea is to check for differences in the output of `pldd` when comparing
an snapshot app that uses a dynamic Qt6 and one that uses a static Qt6. I
the past, a dynamic Qt6 worked on WSL, so it is likely that something goes
wrong during the static linking.
I think it has to do with support for the GPU. I think it is not possible
to make a stand-alone structure that support all GPU's. So it is likely to
be better that the user installs the GPU drivers themselves. I am not sure
what the best way is to do this. It does explain why the build on the
ubuntu server fails on my arch machine, but when I build it myself, it
works. This may also be the case on my WSL+arch machine when I install the
GPU drivers as is explained
[here](https://github.com/lutris/docs/blob/master/InstallingDrivers.md#amd--intel).
When looking at the stdout of the workflow, I do not see any
WrapVulkanHeaders maybe that has something to do with it.
The other issue is that the workflow cannot find FFmpeg. On arch, it is
easy, I get:
```stdout
Found FFmpeg: /usr/lib/libavcodec.so;libavcodec.so;/usr/lib/libavformat.so;libavformat.so;/usr/lib/libavutil.so;libavutil.so;/usr/lib/libavdevice.so;libavdevice.so;/usr/lib/libswresample.so;libswresample.so;/usr/lib/libswscale.so;libswscale.so found components: AVCODEC AVFORMAT AVUTIL AVDEVICE SWRESAMPLE SWSCALE
```
- [ ] Cross compile for raspberry pi
31 changes: 21 additions & 10 deletions scripts/install-qt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail

usage="Usage: $0 <optional packages>
usage="Usage: $0 <packages>
Installs Qt 6.6.1 to 3rdparty/Qt. For this script to work, you need to set the
QT_INSTALLER_JWT_TOKEN environment variable to your jwt token. Check the
Expand All @@ -11,21 +11,32 @@ Optionally, you can add more Qt packages to install by adding them as
arguments.
Options:
-r, --root The root directory to install Qt to.
-h, --help Show this help message and exit"

if [[ "$*" == *-h* ]] || [[ "$*" == *--help* ]]; then
echo "$usage"
exit 0
fi
packages=""
while [[ $# -gt 0 ]]; do
case "$1" in
-r | --root)
install_dir="$2"
shift
shift
;;
-h | --help)
echo "$usage"
exit 0
;;
*)
packages="$packages $1"
shift
;;
esac
done

tmp_dir=$(mktemp -d)
this_dir=$(dirname "$(realpath "${BASH_SOURCE:-$0}")")
install_dir="$this_dir/../3rdparty/Qt"
base="qt.qt6.661.gcc_64"
multimedia="qt.qt6.661.addons.qtmultimedia"

curl "https://d13lb3tujbc8s0.cloudfront.net/onlineinstallers/qt-unified-linux-x64-4.6.1-online.run" -o "$tmp_dir/qt-installer.run"
chmod +x "$tmp_dir/qt-installer.run"
"$tmp_dir/qt-installer.run" --root "$install_dir" --accept-licenses --accept-obligations --default-answer --confirm-command install $base $multimedia $@
"$tmp_dir/qt-installer.run" --root "$install_dir" --accept-licenses --accept-obligations --default-answer --confirm-command install $packages

rm -rf "$tmp_dir"
20 changes: 16 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ list(APPEND CMAKE_PREFIX_PATH ${CMAKE_SOURCE_DIR}/3rdparty/Qt/lib/cmake)
set(Boost_USE_STATIC_LIBS ON)
find_package(spdlog REQUIRED)
find_package(Boost REQUIRED COMPONENTS filesystem)
find_package(Qt6 REQUIRED COMPONENTS Widgets Multimedia MultimediaWidgets)
find_package(Qt6 REQUIRED COMPONENTS Widgets Multimedia MultimediaWidgets
WaylandClient)

message(STATUS "Qt6 was found at ${Qt6_DIR}")

Expand All @@ -27,7 +28,18 @@ target_link_libraries(
Qt6::Widgets
Qt6::Multimedia
Qt6::MultimediaWidgets
Qt6::QWaylandIntegrationPlugin)
Qt6::QWaylandEglPlatformIntegrationPlugin
Qt6::QWaylandIntegrationPlugin
Qt6::QXcbIntegrationPlugin
Qt6::QFFmpegMediaPlugin)

qt_import_plugins(snapshotapp INCLUDE_BY_TYPE platforms
Qt6::QWaylandIntegrationPlugin)
qt_import_plugins(
snapshotapp
INCLUDE_BY_TYPE
platforms
Qt6::QWaylandEglPlatformIntegrationPlugin
Qt6::QWaylandIntegrationPlugin
Qt6::QXcbIntegrationPlugin
INCLUDE_BY_TYPE
multimedia
Qt6::QFFmpegMediaPlugin)

0 comments on commit 1326bf1

Please sign in to comment.