git: f081b8b768c8 - main - x11-wm/wayfire-plugins-extra: enable dbus and windecor plugins

From: Jan Beich <jbeich_at_FreeBSD.org>
Date: Mon, 20 Dec 2021 14:45:58 UTC
The branch main has been updated by jbeich:

URL: https://cgit.FreeBSD.org/ports/commit/?id=f081b8b768c80b77f4f73e1d85938004d2d51014

commit f081b8b768c80b77f4f73e1d85938004d2d51014
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2021-12-20 13:27:46 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2021-12-20 14:44:18 +0000

    x11-wm/wayfire-plugins-extra: enable dbus and windecor plugins
---
 x11-wm/wayfire-plugins-extra/Makefile              | 24 +++++++-
 x11-wm/wayfire-plugins-extra/distinfo              |  4 ++
 x11-wm/wayfire-plugins-extra/files/patch-clang     | 21 +++++++
 x11-wm/wayfire-plugins-extra/files/patch-glib-2.68 | 64 ++++++++++++++++++++++
 x11-wm/wayfire-plugins-extra/files/patch-libc++    | 14 +++++
 x11-wm/wayfire-plugins-extra/pkg-plist             |  5 ++
 6 files changed, 130 insertions(+), 2 deletions(-)

diff --git a/x11-wm/wayfire-plugins-extra/Makefile b/x11-wm/wayfire-plugins-extra/Makefile
index b062448b2aa7..32dd881e1879 100644
--- a/x11-wm/wayfire-plugins-extra/Makefile
+++ b/x11-wm/wayfire-plugins-extra/Makefile
@@ -1,7 +1,7 @@
 PORTNAME=	wayfire-plugins-extra
 DISTVERSIONPREFIX=	v
 DISTVERSION=	0.7.0
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	x11-wm
 
 PATCH_SITES=	https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
@@ -19,9 +19,29 @@ BUILD_DEPENDS=	wayland-scanner:graphics/wayland \
 LIB_DEPENDS=	libwf-config.so:devel/wf-config \
 		libwlroots.so:x11-toolkits/wlroots
 
-USES=		compiler:c++17-lang gnome meson pkgconfig
+USES=		compiler:c++17-lang gnome meson pkgconfig shebangfix
 USE_GITHUB=	yes
+USE_GITLAB=	nodefault
 USE_GNOME=	cairo glibmm
 GH_ACCOUNT=	WayfireWM
+GH_TUPLE=	damianatorrpm:wayfire-plugin_dbus_interface:c705bf1:dbus/subprojects/dbus
+GL_TUPLE=	wayfireplugins:windecor:6ad31bfc10c5d39c0da7c68fa435064effad6381:windecor/subprojects/windecor
+SHEBANG_FILES=	subprojects/dbus/compile-schemas.sh
+bash_CMD=	${SH}
+
+OPTIONS_DEFINE=	DBUS LIBRSVG2
+OPTIONS_DEFAULT=DBUS LIBRSVG2
+OPTIONS_SUB=	yes
+
+DBUS_BUILD_DEPENDS=	evdev-proto>0:devel/evdev-proto
+DBUS_USES=		xorg
+DBUS_USE=		XORG=xcb
+DBUS_MESON_TRUE=	enable_dbus
+DBUS_VARS=		GLIB_SCHEMAS+=org.wayland.compositor.dbus.gschema.xml
+
+LIBRSVG2_BUILD_DEPENDS=	evdev-proto>0:devel/evdev-proto
+LIBRSVG2_USES=		xorg
+LIBRSVG2_USE=		GNOME=librsvg2 XORG=pixman
+LIBRSVG2_MESON_TRUE=	enable_windecor
 
 .include <bsd.port.mk>
diff --git a/x11-wm/wayfire-plugins-extra/distinfo b/x11-wm/wayfire-plugins-extra/distinfo
index 2af881fe3ae3..0bc2e2a30895 100644
--- a/x11-wm/wayfire-plugins-extra/distinfo
+++ b/x11-wm/wayfire-plugins-extra/distinfo
@@ -1,5 +1,9 @@
 TIMESTAMP = 1611938557
 SHA256 (WayfireWM-wayfire-plugins-extra-v0.7.0_GH0.tar.gz) = e6377e7f2cd6b0a19fe0a256c819f801ee1d963524ed4e4930b702474bc04287
 SIZE (WayfireWM-wayfire-plugins-extra-v0.7.0_GH0.tar.gz) = 50385
+SHA256 (damianatorrpm-wayfire-plugin_dbus_interface-c705bf1_GH0.tar.gz) = 1eef146ea1077b69aa2ec1afdf51dc1a7831d7661c43b9b10ea68a39b7c50ac3
+SIZE (damianatorrpm-wayfire-plugin_dbus_interface-c705bf1_GH0.tar.gz) = 30095
+SHA256 (wayfireplugins-windecor-6ad31bfc10c5d39c0da7c68fa435064effad6381_GL0.tar.gz) = d3c739481faad2abc4391f165ebcd52a8fde1b062038bdbefcc1540a2dbbeed2
+SIZE (wayfireplugins-windecor-6ad31bfc10c5d39c0da7c68fa435064effad6381_GL0.tar.gz) = 16547
 SHA256 (a8eca14c44b9.patch) = 99dd5f51ff2a27bbff2165ee80707ea3954c25c438bef5969f85bedcda410c7f
 SIZE (a8eca14c44b9.patch) = 1059
diff --git a/x11-wm/wayfire-plugins-extra/files/patch-clang b/x11-wm/wayfire-plugins-extra/files/patch-clang
new file mode 100644
index 000000000000..be9e72000e7a
--- /dev/null
+++ b/x11-wm/wayfire-plugins-extra/files/patch-clang
@@ -0,0 +1,21 @@
+https://github.com/damianatorrpm/wayfire-plugin_dbus_interface/issues/47
+
+In file included from ../subprojects/dbus/dbus_interface.cpp:45:
+../subprojects/dbus/dbus_interface_backend.cpp:1131:34: error: 'core' cannot be captured because it does not have automatic storage duration
+            idle_call->run_once([core, idle_call] ()
+                                 ^
+../subprojects/dbus/dbus_interface_backend.cpp:59:24: note: 'core' declared here
+wf::compositor_core_t& core = wf::get_core();
+                       ^
+
+--- subprojects/dbus/dbus_interface_backend.cpp.orig	2020-12-25 14:04:08 UTC
++++ subprojects/dbus/dbus_interface_backend.cpp
+@@ -1128,7 +1128,7 @@ handle_method_call (GDBusConnection* connection,
+             }
+ 
+             wf::wl_idle_call* idle_call = new wf::wl_idle_call;
+-            idle_call->run_once([core, idle_call] ()
++            idle_call->run_once([idle_call] ()
+             {
+                 core.set_cursor("crosshair");
+                 delete idle_call;
diff --git a/x11-wm/wayfire-plugins-extra/files/patch-glib-2.68 b/x11-wm/wayfire-plugins-extra/files/patch-glib-2.68
new file mode 100644
index 000000000000..cb65e54a5c73
--- /dev/null
+++ b/x11-wm/wayfire-plugins-extra/files/patch-glib-2.68
@@ -0,0 +1,64 @@
+https://github.com/damianatorrpm/wayfire-plugin_dbus_interface/commit/c7cc8e11e7f8
+
+In file included from ../subprojects/dbus/dbus_interface.cpp:12:
+In file included from /usr/local/include/glib-2.0/gio/gio.h:26:
+In file included from /usr/local/include/glib-2.0/gio/giotypes.h:28:
+In file included from /usr/local/include/glib-2.0/gio/gioenums.h:28:
+In file included from /usr/local/include/glib-2.0/glib-object.h:22:
+In file included from /usr/local/include/glib-2.0/gobject/gbinding.h:28:
+In file included from /usr/local/include/glib-2.0/glib.h:32:
+In file included from /usr/local/include/glib-2.0/glib/gasyncqueue.h:32:
+In file included from /usr/local/include/glib-2.0/glib/gthread.h:32:
+In file included from /usr/local/include/glib-2.0/glib/gatomic.h:28:
+In file included from /usr/local/include/glib-2.0/glib/glib-typeof.h:39:
+In file included from /usr/include/c++/v1/type_traits:420:
+/usr/include/c++/v1/cstddef:56:1: error: templates must have C++ linkage
+template <class _Tp> struct __libcpp_is_integral                     { enum { value = 0 }; };
+^~~~~~~~~~~~~~~~~~~~
+../subprojects/dbus/dbus_interface.cpp:10:1: note: extern "C" language linkage specification begins here
+extern "C"
+^
+
+--- subprojects/dbus/dbus_interface.cpp.orig	2020-12-25 14:04:08 UTC
++++ subprojects/dbus/dbus_interface.cpp
+@@ -9,11 +9,11 @@
+ 
+ extern "C"
+ {
+-#include <gio/gio.h>
+ #include <sys/socket.h>
+ #include <sys/types.h>
+ };
+ 
++#include <gio/gio.h>
+ #include <iostream>
+ #include <string>
+ #include <charconv>
+--- subprojects/dbus/dbus_interface_backend.cpp.orig	2020-12-25 14:04:08 UTC
++++ subprojects/dbus/dbus_interface_backend.cpp
+@@ -16,11 +16,11 @@ extern "C"
+ // #include <xwayland/xwm.h>
+ #undef static
+ #undef class
+-#include <gio/gio.h>
+ #include <sys/socket.h>
+ #include <wlr/types/wlr_idle.h>
+ };
+ 
++#include <gio/gio.h>
+ #include <ctime>
+ #include <iostream>
+ #include <set>
+--- subprojects/dbus/wf-prop.cpp.orig	2020-12-25 14:04:08 UTC
++++ subprojects/dbus/wf-prop.cpp
+@@ -6,10 +6,7 @@
+ #define DBUS_ID "org.wayland.compositor"
+ #define DBUS_PATH "/org/wayland/compositor"
+ 
+-extern "C" {
+ #include <gio/gio.h>
+-};
+-
+ #include <giomm/application.h>
+ #include <giomm/dbusconnection.h>
+ #include <giomm/dbusproxy.h>
diff --git a/x11-wm/wayfire-plugins-extra/files/patch-libc++ b/x11-wm/wayfire-plugins-extra/files/patch-libc++
new file mode 100644
index 000000000000..3e0ebb1e007f
--- /dev/null
+++ b/x11-wm/wayfire-plugins-extra/files/patch-libc++
@@ -0,0 +1,14 @@
+../subprojects/windecor/deco-theme.cpp:11:9: fatal error: 'bits/stdc++.h' file not found
+#include<bits/stdc++.h>
+        ^~~~~~~~~~~~~~~
+
+--- subprojects/windecor/deco-theme.cpp.orig	2020-12-14 07:51:43 UTC
++++ subprojects/windecor/deco-theme.cpp
+@@ -8,7 +8,6 @@
+ #include <sys/stat.h>
+ #include <unistd.h>
+ #include <fstream>
+-#include<bits/stdc++.h>
+ 
+ #include "INIReader.h"
+ 
diff --git a/x11-wm/wayfire-plugins-extra/pkg-plist b/x11-wm/wayfire-plugins-extra/pkg-plist
index a754ad499e40..5d5e1adc75bf 100644
--- a/x11-wm/wayfire-plugins-extra/pkg-plist
+++ b/x11-wm/wayfire-plugins-extra/pkg-plist
@@ -1,8 +1,10 @@
+%%DBUS%%bin/wf-prop
 lib/wayfire/libannotate.so
 lib/wayfire/libautorotate-iio.so
 lib/wayfire/libbackground-view.so
 lib/wayfire/libbench.so
 lib/wayfire/libcrosshair.so
+%%DBUS%%lib/wayfire/libdbus_interface.so
 lib/wayfire/libfollow-focus.so
 lib/wayfire/libforce-fullscreen.so
 lib/wayfire/libglib-main-loop.so
@@ -11,6 +13,7 @@ lib/wayfire/libkeycolor.so
 lib/wayfire/libmag.so
 lib/wayfire/libshowrepaint.so
 lib/wayfire/libwater.so
+%%LIBRSVG2%%lib/wayfire/libwindecor.so
 lib/wayfire/libwinzoom.so
 lib/wayfire/libworkspace-names.so
 share/wayfire/metadata/annotate.xml
@@ -18,6 +21,7 @@ share/wayfire/metadata/autorotate-iio.xml
 share/wayfire/metadata/background-view.xml
 share/wayfire/metadata/bench.xml
 share/wayfire/metadata/crosshair.xml
+%%DBUS%%share/wayfire/metadata/dbus_interface.xml
 share/wayfire/metadata/follow-focus.xml
 share/wayfire/metadata/force-fullscreen.xml
 share/wayfire/metadata/join-views.xml
@@ -25,5 +29,6 @@ share/wayfire/metadata/keycolor.xml
 share/wayfire/metadata/mag.xml
 share/wayfire/metadata/showrepaint.xml
 share/wayfire/metadata/water.xml
+%%LIBRSVG2%%share/wayfire/metadata/windecor.xml
 share/wayfire/metadata/window-zoom.xml
 share/wayfire/metadata/workspace-names.xml