x11-toolkits/libdecor: convert cairo plugin to port option

libdecor is under MIT but Cairo, Pango, DBus are under GPL variants.
GPL may not be permitted with LICENSES_REJECTED, so let users opt out
when libdecor support cannot be disabled in consumers.
This commit is contained in:
Jan Beich 2024-01-29 10:50:10 +01:00
parent 367a49562b
commit 94a4803c44
2 changed files with 19 additions and 9 deletions

View file

@ -9,25 +9,35 @@ WWW= https://gitlab.freedesktop.org/libdecor/libdecor
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
BUILD_DEPENDS= evdev-proto>0:devel/evdev-proto \
wayland-protocols>=1.15:graphics/wayland-protocols
BUILD_DEPENDS= wayland-protocols>=1.15:graphics/wayland-protocols
LIB_DEPENDS= libwayland-client.so:graphics/wayland
USES= gnome meson pkgconfig
USES= meson pkgconfig
USE_GITLAB= yes
USE_GNOME= cairo pango
USE_LDCONFIG= yes
GL_SITE= https://gitlab.freedesktop.org
MESON_ARGS= -Ddemo=false
OPTIONS_DEFINE= DBUS GTK3
OPTIONS_DEFAULT=DBUS GTK3
OPTIONS_DEFINE= CAIRO DBUS GTK3
OPTIONS_DEFAULT=CAIRO DBUS GTK3
OPTIONS_SUB= yes
DBUS_LIB_DEPENDS= libdbus-1.so:devel/dbus
CAIRO_BUILD_DEPENDS= evdev-proto>0:devel/evdev-proto
CAIRO_USES= gnome
CAIRO_USE= GNOME=cairo,pango
# Unused by the main library
DBUS_LIB_DEPENDS= ${"${PORT_OPTIONS:NDBUS}":?libdbus-1.so\:devel/dbus:}
DBUS_MESON_ENABLED= dbus
GTK3_USE= GNOME=gtk30
GTK3_BUILD_DEPENDS= evdev-proto>0:devel/evdev-proto
GTK3_USES= gnome
GTK3_USE= GNOME=cairo,gtk30
GTK3_MESON_ENABLED= gtk
post-patch-CAIRO-off:
@${REINPLACE_CMD} '/cairo/d' ${WRKSRC}/src/plugins/meson.build
@${REINPLACE_CMD} "s/'cairo'/&, required: false, disabler: true/" \
${WRKSRC}/src/plugins/common/meson.build
.include <bsd.port.mk>

View file

@ -2,6 +2,6 @@ include/libdecor-0/libdecor.h
lib/libdecor-0.so
lib/libdecor-0.so.0
lib/libdecor-0.so.0.200.2
lib/libdecor/plugins-1/libdecor-cairo.so
%%CAIRO%%lib/libdecor/plugins-1/libdecor-cairo.so
%%GTK3%%lib/libdecor/plugins-1/libdecor-gtk.so
libdata/pkgconfig/libdecor-0.pc