Package Details: wayland-debug-cli-git r397.a9dde8a-1

Git Clone URL: https://aur.archlinux.org/wayland-debug-cli-git.git (read-only, click to copy)
Package Base: wayland-debug-cli-git
Description: A CLI for viewing, filtering, and setting breakpoints on Wayland protocol messages.
Upstream URL: https://github.com/wmww/wayland-debug
Licenses: MIT
Conflicts: wayland-debug-cli
Provides: wayland-debug-cli
Submitter: dorianr
Maintainer: dorianr
Last Packager: dorianr
Votes: 0
Popularity: 0.000000
First Submitted: 2022-07-08 21:19 (UTC)
Last Updated: 2022-07-08 21:19 (UTC)

Latest Comments

patlefort commented on 2023-03-18 23:23 (UTC) (edited on 2023-03-18 23:23 (UTC) by patlefort)

Hi, patch suggestion:

diff --git a/PKGBUILD b/PKGBUILD
index ed4dfda..e2e25b4 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
 # Maintainer: Dorian Rudolph <mail@dorianrudolph.com
 _pkgname=wayland-debug-cli
 pkgname=$_pkgname-git
-pkgver=r397.a9dde8a
+pkgver=r433.d64ffa2
 pkgrel=1
 pkgdesc="A CLI for viewing, filtering, and setting breakpoints on Wayland protocol messages."
 arch=('x86_64')
@@ -13,8 +13,10 @@ makedepends=('git' 'meson' 'ninja' 'libxslt' 'doxygen' 'xmlto' 'graphviz' 'docbo
 provides=("$_pkgname")
 conflicts=("$_pkgname")
 backup=("etc/$_pkgname/$_pkgname.conf")
-source=("$_pkgname::git+https://github.com/wmww/wayland-debug")
-md5sums=('SKIP')
+source=(
+    "$_pkgname::git+https://github.com/wmww/wayland-debug"
+    'git+https://gitlab.freedesktop.org/wayland/wayland.git')
+md5sums=('SKIP' 'SKIP')
 options=(!strip)

 pkgver() {
@@ -22,13 +24,15 @@ pkgver() {
     printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
 }

-build() {
-    cd "$srcdir/$_pkgname"
+prepare() {
+    [ -L "$srcdir/$_pkgname/resources/wayland" ] || \
+        ln -s "$srcdir/wayland" "$srcdir/$_pkgname/resources/wayland"
+}

-    cd resources
-    git clone https://gitlab.freedesktop.org/wayland/wayland.git
-    cd wayland
-    git checkout "$(pacman -Q wayland | grep -Po '\d+\.\d+\.\d+')"
+build() {
+    cd "$srcdir/$_pkgname/resources/wayland"
+    
+    export CFLAGS='-O0 -g'
     meson --buildtype=debug build
     ninja -C build
 }
@@ -36,17 +40,17 @@ build() {
 package() {
     cd "$srcdir/$_pkgname"

-    name=wayland-debug
-    libdir="$pkgdir/usr/lib/$name"
+    local _name=wayland-debug
+    local _libdir="$pkgdir/usr/lib/$_name"
     mkdir -p "$pkgdir/usr/bin"

-    find . -type l,f ! -path "./.git*" \( -name 'libwayland-client.so' -or -name 'libwayland-server.so' -or ! -path "./resources/wayland/*" \) ! -path "*/libwayland_debug_logs/*" ! -name "update-protocols.sh" -exec install -Dm644 {} "$libdir/{}" \;
-    chmod +x "$libdir/main.py"
-    ln -s "/usr/lib/$name/main.py" "$pkgdir/usr/bin/$name"
+    find -L . -type l,f ! -path "./.git*" \( -name 'libwayland-client.so*' -or -name 'libwayland-server.so*' -or ! -path "./resources/wayland/*" \) ! -path "*/libwayland_debug_logs/*" ! -name "update-protocols.sh" -exec install -Dm644 {} "$_libdir/{}" \;
+    chmod +x "$_libdir/main.py"
+    ln -s "/usr/lib/$_name/main.py" "$pkgdir/usr/bin/$_name"

     while read -rd '' _file; do
         _destdir="$(dirname "${_file#${pkgdir}}")"
         python3 -m compileall -d "${_destdir}" "${_file}"
         python3 -O -m compileall -d "${_destdir}" "${_file}"
-    done < <(find "$libdir" -name '*.py' -print0)
+    done < <(find "$_libdir" -name '*.py' -print0)
 }

It fixes a few issues:

  • It will correctly use the source field to pull wayland source code.

  • Correctly use underscore local variables.

  • Since we are compiling wayland in debug mode, override CFLAGS.