commit: 8a5fba4b16d9b8b434fb5634c5701e455cc575aa
parent af292abe8d09af90b0bdcf017fe22dcfed9f00cc
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Sun, 27 Feb 2022 02:37:26 +0100
gui-libs/libdecor: New package
Diffstat:
4 files changed, 141 insertions(+), 0 deletions(-)
diff --git a/gui-libs/libdecor/Manifest b/gui-libs/libdecor/Manifest
@@ -0,0 +1 @@
+DIST libdecor-0.1.0.tar.gz 45026 BLAKE2B d698dee7e86266adcd39c09fc58944b7359c86c9d25706fe3f193e0eaed8b07b06501199a10db34497b94a6561a74051ed5c0255b7e9759753c60304c8ff0a89 SHA512 7e228b276efc98894085398ac8b4a37fb23a8ce3dfbb16c3d664d833f99e7d6365c43276880ef36d21d6471e1cdcae1925e6daaf95b4904b5701d103e023a916
diff --git a/gui-libs/libdecor/files/libdecor-0.1.0_demo_install.patch b/gui-libs/libdecor/files/libdecor-0.1.0_demo_install.patch
@@ -0,0 +1,56 @@
+From 7106f5e32986e2773df8199a194b152a2a2c0cab Mon Sep 17 00:00:00 2001
+From: Simon McVittie <smcv@debian.org>
+Date: Wed, 11 Aug 2021 13:20:31 +0100
+Subject: [PATCH] build: Optionally install the demo programs
+
+This makes it possible to test packages in their "as-installed" state
+without relying on having a version of SDL with libdecor support.
+
+Signed-off-by: Simon McVittie <smcv@debian.org>
+---
+ demo/meson.build | 6 +++---
+ meson_options.txt | 2 ++
+ 2 files changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/demo/meson.build b/demo/meson.build
+index 0cadb3f..a65125b 100644
+--- a/demo/meson.build
++++ b/demo/meson.build
+@@ -47,7 +47,7 @@ executable('libdecor-demo',
+ wayland_cursor_dep,
+ cursor_settings_dep,
+ xkb_dep],
+- install: false,
++ install: get_option('install_demo'),
+ )
+
+ executable('libdecor-egl',
+@@ -59,7 +59,7 @@ executable('libdecor-egl',
+ egl_dep,
+ gl_dep,
+ math_dep],
+- install: false,
++ install: get_option('install_demo'),
+ )
+
+ executable('libdecor-c++-demo',
+@@ -79,5 +79,5 @@ executable('libdecor-c++-demo',
+ wayland_cursor_dep,
+ cursor_settings_dep,
+ xkb_dep],
+- install: false,
++ install: get_option('install_demo'),
+ )
+diff --git a/meson_options.txt b/meson_options.txt
+index 52fa154..b4911da 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -1,3 +1,5 @@
+ option('demo', type: 'boolean', value: true, description: 'build cairo and EGL client examples')
+
+ option('dbus', type: 'feature', value: 'enabled', description: 'use D-Bus to fetch cursor settings')
++
++option('install_demo', type: 'boolean', value: false, description: 'install demo programs')
+--
+GitLab
+
diff --git a/gui-libs/libdecor/files/libdecor-0.1.0_opengl_link.patch b/gui-libs/libdecor/files/libdecor-0.1.0_opengl_link.patch
@@ -0,0 +1,31 @@
+From 3479c0afaf01be05c28746ec4557055c1668ee88 Mon Sep 17 00:00:00 2001
+From: Christian Rauch <Rauch.Christian@gmx.de>
+Date: Mon, 9 Aug 2021 00:16:02 +0100
+Subject: [PATCH] egl: link against libOpenGL and not libGL
+
+On modern Linux, GLVND provides a way to separate the pure OpenGL functions
+(gl*) from the GLX/EGL context creation (glX*/egl*). This requires to link
+OpenGL and EGL separately. Previously, we would simply link against libGL,
+which includes OpenGL and GLX symbols. This in turn links against libX11,
+which is not desired for a pure Wayland client.
+By replacing libGL with libOpenGL, we prevent linking GLX.
+---
+ demo/meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/demo/meson.build b/demo/meson.build
+index 819aeda..0cadb3f 100644
+--- a/demo/meson.build
++++ b/demo/meson.build
+@@ -5,7 +5,7 @@ wayland_cursor_dep = dependency('wayland-cursor')
+ math_dep = cc.find_library('m')
+
+ egl_dep = dependency('egl')
+-gl_dep = dependency('gl')
++gl_dep = dependency('opengl')
+ wayland_egl_dep = dependency('wayland-egl')
+
+ xkb_dep = dependency('xkbcommon')
+--
+GitLab
+
diff --git a/gui-libs/libdecor/libdecor-0.1.0.ebuild b/gui-libs/libdecor/libdecor-0.1.0.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit meson
+
+if [[ ${PV} == 9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://gitlab.gnome.org/jadahl/libdecor.git"
+else
+ SRC_URI="https://gitlab.gnome.org/jadahl/libdecor/-/archive/${PV}/${P}.tar.gz"
+ KEYWORDS="~amd64"
+fi
+
+DESCRIPTION="A client-side decorations library for Wayland clients"
+HOMEPAGE="https://gitlab.gnome.org/jadahl/libdecor"
+LICENSE="MIT"
+SLOT="0"
+IUSE="+dbus examples"
+
+DEPEND="
+ >=dev-libs/wayland-1.18
+ >=dev-libs/wayland-protocols-1.15
+ x11-libs/pango
+ dbus? ( sys-apps/dbus )
+ examples? (
+ virtual/opengl
+ dev-libs/wayland
+ media-libs/mesa[egl]
+ x11-libs/libxkbcommon
+ )
+"
+RDEPEND="${DEPEND}"
+BDEPEND="
+ >=dev-util/meson-0.47
+ examples? ( dev-libs/wayland-protocols )
+"
+
+PATCHES=(
+ "${FILESDIR}/libdecor-0.1.0_opengl_link.patch"
+ "${FILESDIR}/libdecor-0.1.0_demo_install.patch"
+)
+
+src_configure() {
+ local emesonargs=(
+ $(meson_feature dbus)
+ $(meson_use examples demo)
+ -Dinstall_demo=true
+ )
+
+ meson_src_configure
+}