Skip to content

Commit

Permalink
mesonify
Browse files Browse the repository at this point in the history
  • Loading branch information
xdavidwu committed Mar 19, 2019
1 parent 94bc0a7 commit 31612c9
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 19 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ core
*-protocol.h
*-protocol.c
*.o
build
15 changes: 6 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@

Qt pip-mode-like video player for wlroots based wayland compositors.

To compile:
To install:

```sh
wayland-scanner client-protocol wlr-layer-shell-unstable-v1.xml wlr-layer-shell-unstable-v1-client-protocol.h
wayland-scanner private-code wlr-layer-shell-unstable-v1.xml wlr-layer-shell-unstable-v1-protocol.c
wayland-scanner private-code /usr/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml xdg-shell-protocol.c
gcc xdg-shell-protocol.c wlr-layer-shell-unstable-v1-protocol.c -c
g++ qt-video-wlr-bg.cpp wlr-layer-shell-unstable-v1-protocol.o xdg-shell-protocol.o -I /usr/include/qt/ -fpic -lQt5Widgets -lQt5Core -lQt5Multimedia -lQt5MultimediaWidgets -lQt5Gui -lwayland-client -o qt-video-wlr
meson build
cd build
ninja
sudo ninja install
```

To run:

```
Usage: ./qt-video-wlr [options] FILE...
Usage: qt-video-wlr [options] FILE...
Qt pip-mode-like video player for wlroots based wayland compositor
Options:
Expand Down Expand Up @@ -43,5 +42,3 @@ Options:
Arguments:
FILE Files to play.
```

Paths are based on Archlinux and might be different on other distro.
21 changes: 21 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
project('qt-video-wlr',['c','cpp'])

wl_client=dependency('wayland-client')
wl_protocols=dependency('wayland-protocols')
scanner=find_program('wayland-scanner')
scanner_private_code=generator(scanner,output: '@[email protected]',arguments: ['private-code','@INPUT@','@OUTPUT@'])
scanner_client_header=generator(scanner,output: '@[email protected]',arguments: ['client-header','@INPUT@','@OUTPUT@'])

protocols_src=[
scanner_private_code.process('wlr-layer-shell-unstable-v1.xml'),
scanner_private_code.process(wl_protocols.get_pkgconfig_variable('pkgdatadir')+'/stable/xdg-shell/xdg-shell.xml')
]
protocols_headers=[
scanner_client_header.process('wlr-layer-shell-unstable-v1.xml')
]
lib_protocols=static_library('protocols',protocols_src+protocols_headers,dependencies: wl_client)
protocols_dep=declare_dependency(link_with: lib_protocols,sources: protocols_headers)

qt5=import('qt5')
qt5_dep=dependency('qt5',modules: ['Widgets','Core','Multimedia','MultimediaWidgets','Gui'])
executable('qt-video-wlr',['qt-video-wlr-bg.cpp'],dependencies: [qt5_dep,protocols_dep],install: true)
20 changes: 10 additions & 10 deletions qt-video-wlr-bg.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#include <QtCore/QUrl>
#include <QtCore/QFileInfo>
#include <QtCore/QCommandLineParser>
#include <QtWidgets/QApplication>
#include <QtWidgets/QWidget>
#include <QtWidgets/QPushButton>
#include <QtGui/5.12.1/QtGui/qpa/qplatformnativeinterface.h>
#include <QtMultimedia/QMediaPlayer>
#include <QtMultimedia/QMediaPlaylist>
#include <QtMultimediaWidgets/QVideoWidget>
#include <QUrl>
#include <QWidget>
#include <QFileInfo>
#include <QPushButton>
#include <QApplication>
#include <QMediaPlayer>
#include <QVideoWidget>
#include <QMediaPlaylist>
#include <QCommandLineParser>
#include <5.12.2/QtGui/qpa/qplatformnativeinterface.h>
#include <iostream>
#include "wlr-layer-shell-unstable-v1-client-protocol.h"

Expand Down

0 comments on commit 31612c9

Please sign in to comment.