Skip to content
Snippets Groups Projects
Commit 68e029f3 authored by Vladimir Druzenko's avatar Vladimir Druzenko
Browse files

graphics/spectacle: make pipewire optional

New build option PIPEWIRE, ON by default (as was before).

PR:			270982
Approved by:		arrowd (mentor, kde)
Differential Revision:	https://reviews.freebsd.org/D39978
parent c8db4f9c
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,7 @@ USES= cmake compiler:c++11-lang gettext kde:5 pkgconfig qt:5 tar:xz \
xorg
USE_KDE= attica auth codecs completion config configwidgets coreaddons \
dbusaddons globalaccel guiaddons i18n jobwidgets kdeclarative \
kio kpipewire libkipi newstuff notifications package purpose \
kio libkipi newstuff notifications package purpose \
service solid wayland widgetsaddons windowsystem xmlgui \
doctools:build ecm:build
USE_QT= concurrent core dbus declarative gui network printsupport \
......@@ -25,6 +25,11 @@ USE_QT= concurrent core dbus declarative gui network printsupport \
buildtools:build qmake:build testlib:build
USE_XORG= x11 xcb xext xfixes
OPTIONS_DEFINE= DOCS
OPTIONS_DEFINE= DOCS PIPEWIRE
OPTIONS_DEFAULT= PIPEWIRE
PIPEWIRE_DESC= Screen capture via PipeWire
PIPEWIRE_USE= KDE=kpipewire
PIPEWIRE_CMAKE_BOOL_OFF= DISABLE_PIPEWIRE
PIPEWIRE_EXTRA_PATCHES_OFF= ${FILESDIR}/extra-patch-pipewire-off
.include <bsd.port.mk>
--- CMakeLists.txt.orig 2023-05-09 03:35:10 UTC
+++ CMakeLists.txt
@@ -74,10 +74,14 @@ find_package(PlasmaWaylandProtocols REQUIRED)
if (QT_MAJOR_VERSION EQUAL "5")
find_package(QtWaylandScanner REQUIRED)
endif()
-find_package(KPipeWire)
+option(DISABLE_PIPEWIRE "Disable PipeWire support." OFF)
+if(NOT DISABLE_PIPEWIRE)
+ find_package(KPipeWire REQUIRED)
+ set(PIPEWIRE_FOUND 1)
+endif()
set_package_properties(KPipeWire PROPERTIES DESCRIPTION
"Used to record pipewire streams into a file"
- TYPE REQUIRED
+ TYPE OPTIONAL
)
# optional components
--- src/CMakeLists.txt.orig 2023-05-09 03:35:10 UTC
+++ src/CMakeLists.txt
@@ -9,6 +9,10 @@ kconfig_add_kcfg_files(SPECTACLE_SRCS GENERATE_MOC Gui
ecm_qt_declare_logging_category(SPECTACLE_SRCS HEADER spectacle_core_debug.h IDENTIFIER SPECTACLE_CORE_LOG CATEGORY_NAME org.kde.spectacle.core DESCRIPTION "spectacle (core)" EXPORT SPECTACLE)
ecm_qt_declare_logging_category(SPECTACLE_SRCS HEADER spectacle_gui_debug.h IDENTIFIER SPECTACLE_GUI_LOG CATEGORY_NAME org.kde.spectacle.gui DESCRIPTION "spectacle (gui)" EXPORT SPECTACLE)
+if(PIPEWIRE_FOUND)
+ list(APPEND SPECTACLE_SRCS Platforms/VideoPlatformWayland.cpp)
+endif()
+
add_executable(spectacle
${SPECTACLE_SRCS}
Main.cpp
@@ -45,7 +49,6 @@ add_executable(spectacle
Platforms/PlatformKWinWayland.cpp
Platforms/PlatformKWinWayland2.cpp
Platforms/VideoPlatform.cpp
- Platforms/VideoPlatformWayland.cpp
Platforms/screencasting.cpp
../resources.qrc
@@ -84,6 +87,10 @@ endif()
ki18n_wrap_ui(spectacle Gui/SettingsDialog/GeneralOptions.ui Gui/SettingsDialog/SaveOptions.ui)
+if(PIPEWIRE_FOUND)
+ target_link_libraries(spectacle K::KPipeWireRecord)
+endif()
+
target_link_libraries(
spectacle
Qt::Concurrent
@@ -107,7 +114,6 @@ target_link_libraries(
KF${QT_MAJOR_VERSION}::XmlGui
KF${QT_MAJOR_VERSION}::GuiAddons
KF${QT_MAJOR_VERSION}::Kirigami2
- K::KPipeWireRecord
Wayland::Client
)
--- src/Config.h.in.orig 2023-05-16 10:09:13 UTC
+++ src/Config.h.in
@@ -7,6 +7,9 @@
/* Define to 1 if we have Purpose */
#cmakedefine PURPOSE_FOUND 1
+/* Define to 1 if we are building with PIPEWIRE */
+#cmakedefine PIPEWIRE_FOUND 1
+
/* Set the Spectacle version from CMake */
#cmakedefine SPECTACLE_VERSION "@SPECTACLE_VERSION@"
--- src/Platforms/PlatformLoader.cpp.orig 2023-05-09 03:35:10 UTC
+++ src/Platforms/PlatformLoader.cpp
@@ -10,7 +10,9 @@
#include "PlatformKWinWayland.h"
#include "PlatformKWinWayland2.h"
#include "PlatformNull.h"
+#ifdef PIPEWIRE_FOUND
#include "VideoPlatformWayland.h"
+#endif
#ifdef XCB_FOUND
#include "PlatformXcb.h"
@@ -44,8 +46,10 @@ PlatformPtr loadPlatform()
VideoPlatformPtr loadVideoPlatform()
{
+#ifdef PIPEWIRE_FOUND
if (KWindowSystem::isPlatformWayland()) {
return std::make_unique<VideoPlatformWayland>();
}
+#endif
return std::make_unique<VideoPlatformNull>();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment