commit:     7ea1ebac1ed0cc77a70dd8a3fbe1251584f7f3e5
Author:     Leonardo Hernández Hernández <leohdz172 <AT> proton <DOT> me>
AuthorDate: Fri Jun 28 04:38:07 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Jul  4 01:17:48 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7ea1ebac

gui-wm/tinywl: add 0.17.4

Closes: https://bugs.gentoo.org/934030
Signed-off-by: Leonardo Hernández Hernández <leohdz172 <AT> proton.me>
Closes: https://github.com/gentoo/gentoo/pull/37326
Signed-off-by: Sam James <sam <AT> gentoo.org>

 gui-wm/tinywl/Manifest                             |  1 +
 .../files/tinywl-0.17.4-improve-makefile.patch     | 84 ++++++++++++++++++++++
 gui-wm/tinywl/tinywl-0.17.4.ebuild                 | 53 ++++++++++++++
 3 files changed, 138 insertions(+)

diff --git a/gui-wm/tinywl/Manifest b/gui-wm/tinywl/Manifest
index a21edb849e46..daac1f27af5b 100644
--- a/gui-wm/tinywl/Manifest
+++ b/gui-wm/tinywl/Manifest
@@ -1 +1,2 @@
 DIST wlroots-0.17.3.tar.gz 608292 BLAKE2B 
7caab3c3a58595d3a745c0b20a5db2193c54931cdd7bc1b9de11c151af82503a03a6a3166a86f42486cc69c6ac18ca2a5596809a5c5e6d7b44c9845f509c1093
 SHA512 
b88747daba304db6dc302acdebb8764e719d84134118963c019d5f0d0d38552e0ffd2a50bf560b3b84549c5a0f2d11a6187ac8ddcd9faa28c5b42f86c585b555
+DIST wlroots-0.17.4.tar.gz 609179 BLAKE2B 
dc5a7749533ab54631d4a26be554b86e5b08b2472cf8f22ccebddb319d571cbd98a5c56e64e7bc762a5918d4272eb6b4261050288f3053c18c824c6a9c32b96b
 SHA512 
35803df9fe68cadb0b9b5e522863535407ba2354ed1ca8f824a9c40b64698a97c579fec0afeb444b05d429adc1e3dfc45b20c3a1b7a2004e4f5a10d2305c9116

diff --git a/gui-wm/tinywl/files/tinywl-0.17.4-improve-makefile.patch 
b/gui-wm/tinywl/files/tinywl-0.17.4-improve-makefile.patch
new file mode 100644
index 000000000000..2537955f7b12
--- /dev/null
+++ b/gui-wm/tinywl/files/tinywl-0.17.4-improve-makefile.patch
@@ -0,0 +1,84 @@
+https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4710
+From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
+ <leohdz...@proton.me>
+Date: Wed, 12 Jun 2024 10:01:52 -0600
+Subject: [PATCH 1/2] tinywl: split compilation into two steps
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+While we are at it also respect LDFLAGS and optimize pkg-config usage
+
+Signed-off-by: Leonardo Hernández Hernández <leohdz...@proton.me>
+--- a/tinywl/Makefile
++++ b/tinywl/Makefile
+@@ -1,9 +1,9 @@
+ WAYLAND_PROTOCOLS=$(shell pkg-config --variable=pkgdatadir wayland-protocols)
+ WAYLAND_SCANNER=$(shell pkg-config --variable=wayland_scanner wayland-scanner)
+-LIBS=\
+-       $(shell pkg-config --cflags --libs "wlroots >= 0.17.0") \
+-       $(shell pkg-config --cflags --libs wayland-server) \
+-       $(shell pkg-config --cflags --libs xkbcommon)
++
++PKGS="wlroots" wayland-server xkbcommon
++CFLAGS+=$(shell pkg-config --cflags $(PKGS))
++LIBS=$(shell pkg-config --libs $(PKGS))
+ 
+ # wayland-scanner is a tool which generates C headers and rigging for Wayland
+ # protocols, which are specified in XML. wlroots requires you to rig these up
+@@ -12,15 +12,13 @@ xdg-shell-protocol.h:
+       $(WAYLAND_SCANNER) server-header \
+               $(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
+ 
+-tinywl: tinywl.c xdg-shell-protocol.h
+-      $(CC) $(CFLAGS) \
+-              -g -Werror -I. \
+-              -DWLR_USE_UNSTABLE \
+-              -o $@ $< \
+-              $(LIBS)
++tinywl.o: tinywl.c xdg-shell-protocol.h
++      $(CC) -g -Werror $(CFLAGS) -I. -DWLR_USE_UNSTABLE -o $@ -c $<
++tinywl: tinywl.o
++      $(CC) $< -g -Werror $(CFLAGS) $(LDFLAGS) $(LIBS) -o $@
+ 
+ clean:
+-      rm -f tinywl xdg-shell-protocol.h xdg-shell-protocol.c
++      rm -f tinywl tinywl.o xdg-shell-protocol.h
+ 
+ .DEFAULT_GOAL=tinywl
+ .PHONY: clean
+-- 
+2.45.2
+
+
+From 29451c3dd28ffd52eb3dcf20e47399a26ecafb3c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
+ <leohdz...@proton.me>
+Date: Wed, 12 Jun 2024 17:58:54 -0600
+Subject: [PATCH 2/2] tinywl: allow specify pkg-config binary
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Leonardo Hernández Hernández <leohdz...@proton.me>
+--- a/tinywl/Makefile
++++ b/tinywl/Makefile
+@@ -1,9 +1,10 @@
+-WAYLAND_PROTOCOLS=$(shell pkg-config --variable=pkgdatadir wayland-protocols)
+-WAYLAND_SCANNER=$(shell pkg-config --variable=wayland_scanner wayland-scanner)
++PKG_CONFIG?=pkg-config
++WAYLAND_PROTOCOLS=$(shell $(PKG_CONFIG) --variable=pkgdatadir 
wayland-protocols)
++WAYLAND_SCANNER=$(shell $(PKG_CONFIG) --variable=wayland_scanner 
wayland-scanner)
+ 
+-PKGS="wlroots" wayland-server xkbcommon
+-CFLAGS+=$(shell pkg-config --cflags $(PKGS))
+-LIBS=$(shell pkg-config --libs $(PKGS))
++PKGS=wlroots wayland-server xkbcommon
++CFLAGS+=$(shell $(PKG_CONFIG) --cflags $(PKGS))
++LIBS=$(shell $(PKG_CONFIG) --libs $(PKGS))
+ 
+ # wayland-scanner is a tool which generates C headers and rigging for Wayland
+ # protocols, which are specified in XML. wlroots requires you to rig these up
+-- 
+2.45.2
+

diff --git a/gui-wm/tinywl/tinywl-0.17.4.ebuild 
b/gui-wm/tinywl/tinywl-0.17.4.ebuild
new file mode 100644
index 000000000000..c8f32923fd24
--- /dev/null
+++ b/gui-wm/tinywl/tinywl-0.17.4.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs
+
+DESCRIPTION="\"minimum viable product\" Wayland compositor based on wlroots"
+HOMEPAGE="https://gitlab.freedesktop.org/wlroots/wlroots";
+
+if [[ ${PV} == 9999 ]]; then
+       EGIT_REPO_URI="https://gitlab.freedesktop.org/wlroots/wlroots.git";
+       inherit git-r3
+else
+       
SRC_URI="https://gitlab.freedesktop.org/wlroots/wlroots/-/releases/${PV}/downloads/wlroots-${PV}.tar.gz";
+       KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~x86"
+       S="${WORKDIR}/wlroots-${PV}"
+fi
+
+LICENSE="CC0-1.0"
+SLOT="0"
+DEPEND="
+       dev-libs/wayland
+       x11-libs/libxkbcommon
+       =gui-libs/wlroots-$(ver_cut 1-2)*:=
+"
+RDEPEND="
+       ${DEPEND}
+       !gui-libs/wlroots[tinywl(-)]
+"
+BDEPEND="
+       dev-libs/wayland-protocols
+       dev-util/wayland-scanner
+       virtual/pkgconfig
+"
+
+PATCHES=( "${FILESDIR}/${P}"-improve-makefile.patch )
+
+src_prepare() {
+       default
+       sed -i -e "s/-Werror //" tinywl/Makefile || die
+}
+
+src_compile() {
+       local -x CFLAGS="${CFLAGS} ${CPPFLAGS}"
+       tc-export CC PKG_CONFIG
+       emake -C tinywl
+}
+
+src_install() {
+       dodoc tinywl/README.md
+       dobin tinywl/tinywl
+}

Reply via email to