1
0
Fork 0
mutter-performance-pkgbuild/PKGBUILD
Mingi Sung da1363f444
1:46.3.1+r5+g1ccf2cfb5-2: Add mr3912
Signed-off-by: Mingi Sung <sungmg@saltyming.net>
2024-07-31 16:57:25 +09:00

335 lines
10 KiB
Bash

# Patched package:
# Maintainer: Térence Clastres <t.clastres@gmail.com>
# Co-maintainer: Saren Arterius <saren@wtako.net>
# Co-maintainer: Mingi Sung <sungmg@saltyming.net>
# Official package:
# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Ionut Biru <ibiru@archlinux.org>
# Contributor: Michael Kanis <mkanis_at_gmx_dot_de>
### PACKAGE OPTIONS
## MERGE REQUESTS SELECTION
# Merge Requests List: ('579' '1441' '3373' '3567' '3751' '3912')
_merge_requests_to_use=('1441' '3751' '3912')
## Disable building the DOCS package (Enabled if not set)
# Remember to unset this variable when producing .SRCINFO
: "${_disable_docs:=""}"
## Enable the `check()` operation (Disabled if not set)
: "${_enable_check:=""}"
### IMPORTANT: Do no edit below this line unless you know what you're doing!
_pkgname=mutter
pkgbase=mutter-performance
if [ -n "$_disable_docs" ]; then
pkgname=mutter-performance
else
pkgname=(mutter-performance mutter-performance-docs)
fi
epoch=1
pkgver=46.3.1+r5+g1ccf2cfb5
pkgrel=2
pkgdesc="A window manager for GNOME | Attempts to improve performances with non-upstreamed merge-requests and frequent stable branch resync"
url="https://gitlab.gnome.org/GNOME/mutter"
arch=(x86_64 aarch64)
license=(GPL-2.0-or-later)
depends=(
at-spi2-core
cairo
colord
dconf
fontconfig
fribidi
gcc-libs
gdk-pixbuf2
glib2
glibc
gnome-desktop-4
gnome-settings-daemon
graphene
gsettings-desktop-schemas
gtk4
harfbuzz
iio-sensor-proxy
lcms2
libcanberra
libcolord
libdisplay-info
libdrm
libei
libglvnd
libgudev
libice
libinput
libpipewire
libsm
libsysprof-capture
libwacom
libx11
libxau
libxcb
libxcomposite
libxcursor
libxdamage
libxext
libxfixes
libxi
libxinerama
libxkbcommon
libxkbcommon-x11
libxkbfile
libxrandr
libxtst
mesa
pango
pipewire
pixman
python
startup-notification
systemd-libs
wayland
xorg-xwayland
)
makedepends=(
egl-wayland
gi-docgen
git
glib2-devel
gobject-introspection
gtk3
meson
sysprof
wayland-protocols
xorg-server
xorg-server-xvfb
)
if [ -n "$_enable_check" ]; then
checkdepends=(gnome-session xorg-server-xvfb pipewire-session-manager python-dbusmock zenity)
fi
_commit=1ccf2cfb568d4f9aeee2d23e5ededca21927d133 # tags/46.3.1^5
source=("git+$url.git#commit=$_commit"
'mr1441.patch'
'mr3373.patch'
'mr3567.patch'
'mr3751.patch'
'mr3912.patch')
sha256sums=('893c784ff14ab886615e7a58cd37c2409895fd73b8c95cc83fca209fbecbc1aa'
'7a5e1bcc90bbab100bf57b0dd052a96f34dd1673a5f43e53acd34ee648fd7b29'
'3e1f07b696ad37b1c639a524c092cd9259444bc6156542901ccaec936bea240f'
'47885ffe6c0aa06fa798cc0b9b48b4f6acf21b6f250b7003819db3854d52635a'
'9d925b810629074285388b5a1a9a88514a6cb45463a98ada6f66c2cba2ad9d2f'
'43ea9e96f2bafaa40edc48510b1391a055ee507af82d81721fb76752c9295c6b')
b2sums=('3d2fccc192c53d7c80ba7f6d97e6392d8e5d6d884161b4b9d120294cc95627167e45d43737374781a8e52ca64e21caab3a07abb7bc38e3f358e593c43d9e69c6'
'55bf09c286a361297952dc55670e3974ad35a91d54649892259fe423c422c6580e00e9f194bad97bebe3c53a65858a23d6e332d426c8572bd14cdc8e5cbcbbfb'
'71f10db4ebe04a787940c7048131eac67cffd3ec8e415cfc961b8041b881f272650581e9df273e2a8da23a50ec9151c790dc2d5ecc0309ab2847a22f8c922c9c'
'8e57fa09e4742cf350436c5d54f3114495543151df71fbb684199d85ca9b138bcedd1dfb5df5724d0efc74aa786f6b1ebf54f3c260a48a4937a700dcb1d5b178'
'f720718049c1f9d0f338c203a5ae4520b5e7079b57e692ec95d8183705d7b7627ccd7d3d350d0010d0b225226641afccd699b65a81bd044fd32c441d413a0779'
'f7a7ef368d2d15cc7edcb1d2def23ed9a349410620aeebe83d8ca0e612dad868e7a2fe731323bd4382fb4cef71d65a15c849df0b4ff0f8da972261728fdf6f6f')
for mr in "${_merge_requests_to_use[@]}"; do
if [ '3567' = "$mr" ]; then
depends+=(gnome-settings-daemon-xwayland-scaling)
fi
done
pkgver() {
cd mutter
git describe --tags | sed -r 's/\.([a-z])/\1/;s/([a-z])\./\1/;s/[^-]*-g/r&/;s/-/+/g'
}
pick_mr() {
for mr in "${_merge_requests_to_use[@]}"; do
if [ "$1" = "$mr" ]; then
if [ "$2" = "merge" ] || [ -z "$2" ]; then
msg2 "Downloading then Merging $1..."
curl -O "https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/$mr.diff"
git apply "$mr.diff"
elif [ "$3" = "revert" ]; then
msg2 "Reverting $1..."
git revert "$2" --no-commit
elif [ "$3" = "patch" ]; then
if [ -e ../"$2" ]; then
msg2 "Patching with $2..."
patch -Np1 -i ../"$2"
else
msg2 "Downloading $mr as $2 then patching..."
curl -O "https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/$mr.diff" -o "$2"
patch -Np1 -i "$2"
fi
else
msg2 "ERROR: wrong argument given: $2"
fi
break
fi
done
}
prepare() {
cd $_pkgname
git reset --hard
git cherry-pick --abort || true
git clean -fd
#git remote add vanvugt https://gitlab.gnome.org/vanvugt/mutter.git || true
#git remote add verdre https://gitlab.gnome.org/verdre/mutter.git || true
#git remote add 3v1no https://gitlab.gnome.org/3v1n0/mutter.git || true
#git fetch vanvugt
#git fetch verdre
#git fetch 3v1no
### Merge Requests
# Merge Request Prototype
# Title:
# Author:
# URL:
# Type:
# Status:
# Comment:
# git cherry-pick -n first_commit^..last_commit
#
# Possible Type:
# 1. Improvement: Makes an already existing feature behave better, more efficiently/reliably.
# 2. Feature: Adds a new functionality.
# 3. Fix: Regression/bug fix only available in master (not backported).
# 4. Cleanup: Code styling improvement, function deprecation, rearrangement...
#
# Possible Status:
# 1. Needs rebase: Conflicts with master branch.
# 2. Needs review: Mutter maintainers needs to review the new/updated MR and provide feedback.
# 3. Needs changes: MR needs to be adjusted based on maintainers feedback.
# 4. Merged: MR approved and it changes commited to master.
#
# Generally, a MR status oscillate between 2 and 3 and then becomes 4.
# Title: backends: Do not reload keymap on new keyboard notifications
# Author: Carlos Garnacho <carlosg@gnome.org>
# URL: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/579
# Type: 1
# Status: 4
# Comment: Was reverted: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/833
# If you use stenography software or play hardcore rhythm games like Lunatic Rave 2/osumania, use it.
pick_mr '579' ce86f90efbaa51522ba14c5b4cad933c2106de42 'revert'
# Title: kms/crtc: Increase default deadline evasion to 1000 microseconds
# Author: Daniel van Vugt <daniel.van.vugt@canonical.com>
# URL: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3373
# Type: 3
# Status: 2
# Comment: This fix cursor stutter.
pick_mr '3373' 'mr3373.patch' 'patch'
# Title: Let scaling-aware Xwayland clients scale themselves with "scale-monitor-framebuffers"
# Author: Jonas Dreßler <verdre@v0yd.nl>
# URL: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3567
# Type: 1
# Status: 3
# Comment: Backported to gnome-46. It needs more testing.
# Goes with https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/merge_requests/353
pick_mr '3567' 'mr3567.patch' 'patch'
# Title: wayland/text-input-v1: Implement basic text-input-v1 support
# Author: Alynx Zhou <alynx.zhou@gmail.com>
# URL: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3751
# Type: 1
# Status: Not gonna be merged considering the maintainers' feedbacks.
# Comment: This commit makes input methods work in text-input-v1 only clients.
# (mostly Chromium/Electron based apps with Ozone Wayland.)
pick_mr '3751' 'mr3751.patch' 'patch'
# Title: backends/native: Avoid duplicating or losing KMS property sets
# Author: Daniel van Vugt <daniel.van.vugt@canonical.com>
# URL: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3912
# Type: 1
# Status: 2
pick_mr '3912' 'mr3912.patch' 'patch'
# Title: Draft: Dynamic triple/double buffering (v4)
# Author: Daniel van Vugt <daniel.van.vugt@canonical.com>
# URL: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1441
# Type: 1
# Status: 2 & 3
# Comment: Help GPU frequencies to scale up but not currently working on Wayland.
pick_mr '1441' 'mr1441.patch' 'patch'
}
build() {
local meson_options=(
-D egl_device=true
-D wayland_eglstream=true
-D installed_tests=false
-D libdisplay_info=enabled
-D docs=$(if ! [ -n "$_disable_docs" ]; then echo "true"; else echo "false"; fi)
-D tests=$(if [ -n "$_enable_check" ]; then echo "true"; else echo "false"; fi)
)
CFLAGS="${CFLAGS/-O2/-O3} -fno-semantic-interposition"
LDFLAGS+=" -Wl,-Bsymbolic-functions"
arch-meson $_pkgname build "${meson_options[@]}"
meson compile -C build
}
if [ -n "$_enable_check" ]; then
check() {
mkdir -p -m 700 "${XDG_RUNTIME_DIR:=$PWD/runtime-dir}"
glib-compile-schemas "${GSETTINGS_SCHEMA_DIR:=$PWD/build/data}"
export XDG_RUNTIME_DIR GSETTINGS_SCHEMA_DIR
export NO_AT_BRIDGE=1 GTK_A11Y=none
export MUTTER_DEBUG_DUMMY_MODE_SPECS="800x600@10.0"
local _pipewire_session_manager=$(pacman -Qq pipewire-session-manager)
msg2 "It is possible to fail some tests. Use with caution!"
# Tests fail:
# mutter:cogl+cogl/conform / cogl-test-offscreen-texture-formats-gles2
# mutter:core+mutter/stacking / fullscreen-maximize
## https://gitlab.gnome.org/GNOME/mutter/-/issues/3343
xvfb-run -s '-nolisten local +iglx -noreset' \
${_pkgname}/src/tests/meta-dbus-runner.py --launch=pipewire --launch=${_pipewire_session_manager} \
meson test -C build --no-suite 'mutter/kvm' --no-rebuild \
--print-errorlogs --setup plain ||:
}
fi
_pick() {
local p="$1" f d; shift
for f; do
d="$srcdir/$p/${f#$pkgdir/}"
mkdir -p "$(dirname "$d")"
mv "$f" "$d"
rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
done
}
package_mutter-performance() {
provides=(mutter libmutter-14.so)
conflicts=(mutter)
groups=(gnome)
meson install -C build --destdir "$pkgdir"
if ! [ -n "$_disable_docs" ]; then
_pick docs "$pkgdir"/usr/share/mutter-*/doc
fi
}
if ! [ -n "$_disable_docs" ]; then
package_mutter-performance-docs() {
provides=(mutter-docs)
conflicts=(mutter-docs)
pkgdesc+=" (documentation)"
depends=()
mv docs/* "$pkgdir"
}
fi