File wayland.spec of Package wayland

#
# spec file for package wayland
#
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%define _version 1.24.0
%if 0%{?suse_version} >= 1500 && 0%{?suse_version} < 1550
%define eglversion 99~%_version
%else
%define eglversion %_version
%endif
%define lname	libwayland0
%define enable_test 1
%if 0%{?qemu_user_space_build}
# qemu linux-user emulation does not support ptrace
%define enable_test 0
%endif
%bcond_with doc
Name:           wayland
Version:        %_version
Release:        1.1
Summary:        Wayland Compositor Infrastructure
License:        MIT
Group:          Development/Libraries/C and C++
URL:            https://wayland.freedesktop.org/
#Git-Clone:	git://anongit.freedesktop.org/wayland/wayland
#Git-Web:	http://cgit.freedesktop.org/wayland/wayland/
Source:         https://gitlab.freedesktop.org/wayland/wayland/-/releases/%version/downloads/wayland-%version.tar.xz
Source2:        https://gitlab.freedesktop.org/wayland/wayland/-/releases/%version/downloads/wayland-%version.tar.xz.sig
Source3:        %name.keyring
Source4:        baselibs.conf
BuildRequires:  c++_compiler
BuildRequires:  c_compiler
BuildRequires:  libxml2-tools
BuildRequires:  libxslt-tools
BuildRequires:  meson
BuildRequires:  pkgconfig
BuildRequires:  xz
BuildRequires:  pkgconfig(expat)
BuildRequires:  pkgconfig(libffi)
BuildRequires:  pkgconfig(libxml-2.0)
%if %{with doc}
BuildRequires:  doxygen
BuildRequires:  graphviz-gnome
BuildRequires:  xmlto
%endif

%description
Wayland is a protocol for a compositor to talk to its clients as well
as a C library implementation of that protocol. The compositor can be
a standalone display server running on Linux kernel modesetting and
evdev input devices, an X application, or a wayland client itself.
The clients can be traditional applications, X servers (rootless or
fullscreen) or other display servers.

%package -n libwayland-client0
Summary:        Wayland core client library
Group:          System/Libraries

%description -n libwayland-client0
Wayland is a protocol for a compositor to talk to its clients as well
as a C library implementation of that protocol. The compositor can be
a standalone display server running on Linux kernel modesetting and
evdev input devices, an X application, or a wayland client itself.
The clients can be traditional applications, X servers (rootless or
fullscreen) or other display servers.

%package -n libwayland-cursor0
Summary:        Wayland cursor library
Group:          System/Libraries

%description -n libwayland-cursor0
The purpose of this library is to be the equivalent of libXcursor in
the X world. This library is compatible with X cursor themes and
loads them directly into an shm pool making it easy for the clients
to get buffer for each cursor image.

%package -n libwayland-egl1
Version:        %eglversion
Summary:        Additional egl functions for wayland
Group:          System/Libraries

%description -n libwayland-egl1
This package provides additional functions for EGL-using programs
that run within the Wayland framework. This allows for applications
that need not run full-screen and cooperate with a compositor.

%package -n libwayland-server0
Summary:        Wayland core server library
Group:          System/Libraries

%description -n libwayland-server0
Wayland is a protocol for a compositor to talk to its clients as well
as a C library implementation of that protocol. The compositor can be
a standalone display server running on Linux kernel modesetting and
evdev input devices, an X application, or a wayland client itself.
The clients can be traditional applications, X servers (rootless or
fullscreen) or other display servers.

%package devel
Summary:        Development files for the Wayland Compositor Infrastructure
Group:          Development/Libraries/C and C++
Requires:       libwayland-client0 = %_version
Requires:       libwayland-cursor0 = %_version
Requires:       libwayland-egl1 = %eglversion
Requires:       libwayland-server0 = %_version
%if 0%{?suse_version} >= 1500
# egl1 was once provided by Mesa 17.x.
%if (0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150400)
Provides:       libwayland-egl-devel = 18.1.5
Obsoletes:      libwayland-egl-devel < 18.1.5
%else
Provides:       libwayland-egl-devel = 18.0.2
Obsoletes:      libwayland-egl-devel < 18.0.2
%endif
%endif

%description devel
Wayland is a protocol for a compositor to talk to its clients as well
as a C library implementation of that protocol. The compositor can be
a standalone display server running on Linux kernel modesetting and
evdev input devices, an X application, or a wayland client itself.
The clients can be traditional applications, X servers (rootless or
fullscreen) or other display servers.

This package contains all necessary include files and libraries needed
to develop applications that require these.

%package doc
Summary:        Wayland development documentation
Group:          Documentation/HTML
BuildArch:      noarch

%description doc
This subpackage contains the documentation to Wayland.

%prep
%autosetup -p1
sed -i 's/<eglversion>/%eglversion/' "%_sourcedir/baselibs.conf"

%build
# includedir intentional, cf. bugzilla.opensuse.org/795968
%meson \
	--includedir="%_includedir/%name" \
%if %{with doc}
	--docdir="%_defaultdocdir/%name"
%else
	-D documentation=false
%endif
%meson_build

%install
%meson_install

%if %{enable_test}
%check
%meson_test
%endif

%if 0%{?suse_version} >= 1550
%ldconfig_scriptlets -n libwayland-client0
%ldconfig_scriptlets -n libwayland-cursor0
%ldconfig_scriptlets -n libwayland-egl1
%ldconfig_scriptlets -n libwayland-server0
%else
%post   -n libwayland-client0 -p /sbin/ldconfig
%postun -n libwayland-client0 -p /sbin/ldconfig
%post   -n libwayland-cursor0 -p /sbin/ldconfig
%postun -n libwayland-cursor0 -p /sbin/ldconfig
%post   -n libwayland-egl1 -p /sbin/ldconfig
%postun -n libwayland-egl1 -p /sbin/ldconfig
%post   -n libwayland-server0 -p /sbin/ldconfig
%postun -n libwayland-server0 -p /sbin/ldconfig
%endif

%files -n libwayland-client0
%_libdir/libwayland-client.so.0*
%license COPYING

%files -n libwayland-cursor0
%_libdir/libwayland-cursor.so.0*

%files -n libwayland-egl1
%_libdir/libwayland-egl.so.1*

%files -n libwayland-server0
%_libdir/libwayland-server.so.0*

%files devel
%_bindir/wayland-scanner
%_includedir/%name/
%_libdir/libwayland-*.so
%_libdir/pkgconfig/wayland-*.pc
%_datadir/aclocal/
%_datadir/wayland/

%if %{with doc}
%files doc
%_mandir/man3/wl*.3*
%_docdir/%name/
%endif

%changelog
* Sun Jul  6 2025 Jan Engelhardt <jengelh@inai.de>
- Update to release 1.24
  * A new wl_fixes interface to add a request to destroy a
    wl_registry object.
  * A new wl_keyboard.key repeated state, to allow compositors to
    take over the responsibility of repeating keys, which is
    useful for remote desktop.
  * wl_display_dispatch_queue_timeout() and
    wl_display_dispatch_timeout(), to set a timeout when
    dispatching events.
  * wl_shm_buffer_ref() and wl_shm_buffer_unref(), to access
    wl_shm_buffer underlying storage after the protocol object
    has been destroyed (e.g. when a client is shutting down).
  * wl_proxy_get_interface() and wl_resource_get_interface(), to
    fetch the wl_interface of an object.
  * wl_resource_post_error_vargs(), as an alternative to
    wl_resource_post_error() when the compositor already has a
    va_list.
* Sat Jun  7 2025 Andreas Schwab <schwab@suse.de>
- Skip tests in qemu emulation
* Fri Mar 21 2025 Hillwood Yang <hillwood@opensuse.org>
- Disable test on loongarch.
* Tue Sep 17 2024 llyyr <llyyr@yukari.in>
- Update to release 1.23.1:
  * meson: Fix use of install_data() without specifying install_dir
  * Put WL_DEPRECATED in front of the function declarations
  * client: Handle proxies with no queue
  * scanner: extract validator function emission to helper function
  * scanner: fix validator for bitfields
  * tests: add enum bitfield test
* Thu Jun 20 2024 Joan Torres <joan.torres@suse.com>
- Update to release 1.23.0
  * A mechanism to set the size of the internal connection buffer used by
    libwayland
  * An enum-header mode for wayland-scanner to generate headers with only enums
  * wayland-scanner now generates validator functions for enums on the server
    side
  * Protocols can now indicate with a "deprecated-since" XML attribute that a
    request, event or enum entry is deprecated
  * An API to set a name for a queue to aid debugging
  * wl_client_get_user_data() and wl_client_set_user_data() to more easily attach
    custom data to a client
  * OpenBSD support
  * A wl_shm.release request for proper cleanup of this global
* Tue Apr  4 2023 llyyr <llyyr.public@gmail.com>
- Update to release 1.22.0
  * This new release adds explicit events for the preferred buffer scale
    and transform, adds an event to indicate the pointer's physical scroll
    direction, adds a few new convenience functions, and includes various
    spec clarifications and bug fixes.
* Thu Jun 30 2022 Jan Engelhardt <jengelh@inai.de>
- Update to release 1.21
  * This new release adds a new wl_pointer high-resolution scroll
    event, adds a few new convenience functions, and contains a
    collection of bug fixes.
- Drop wayland-shm-Close-file-descriptors-not-needed.patch
* Tue May 24 2022 Dirk Müller <dmueller@suse.com>
- modernize spec file
  * use licensedir
  * use bcond
  * use https:// urls
  * spec-cleaner
* Tue Jan 25 2022 Stefan Dirsch <sndirsch@suse.com>
- There is a file conflict in current wayland-devel-32bit and
  prvevious libwayland-egl-devel-32bit package; therefore add
  a conflicts to baselibs.conf
* Tue Jan 11 2022 Alynx Zhou <alynx.zhou@suse.com>
- Add wayland-shm-Close-file-descriptors-not-needed.patch: For
  platforms that support mremap(), we don't need to hold file
  descriptors all the time, because programs like Xwayland will
  hold a lot of file descriptors and may crash, this patch close
  file descriptors earlier for those platforms (bsc#1194190).
* Mon Jan 10 2022 Stefan Dirsch <sndirsch@suse.com>
- obsolete/provide libwayland-egl-devel 18.0.2 also on sle15-sp4
* Thu Dec  9 2021 Jan Engelhardt <jengelh@inai.de>
- Update to release 1.20
  * A few protocol additions: wl_surface.offset allows clients to
    update a surface's buffer offset independently from the
    buffer, wl_output.name and description allow clients to
    identify outputs without depending on xdg-output-unstable-v1.
  * In protocol definitions, events have a new "type" attribute
    and can now be marked as destructors.
  * A number of bug fixes, including a race condition when
    destroying proxies in multi-threaded clients.
* Fri Nov 12 2021 Bjørn Lie <bjorn.lie@gmail.com>
- Switch to meson buildsystem: Add meson BuildRequires and macros.
- Add generic c_compiler and c++_compiler BuildRequires, needed now
  with the meson buildsystem.
- Use ldconfig_scriptlets macro for post(un) handling for
  Tumbleweed and newer.
* Wed Jan 27 2021 Jan Engelhardt <jengelh@inai.de>
- Update to release 1.19
  * This release mostly contains bug fixes and minor
    protocol updates.
* Thu Feb 20 2020 Antonio Larrosa <alarrosa@suse.com>
- Replace public key in keyring with
  34FF9526CFEF0E97A340E2E40FDE7BE0E88F5E48
  (Simon Ser <contact at emersion.fr>).
* Wed Feb 12 2020 Jan Engelhardt <jengelh@inai.de>
- Update to release 1.18
  * Add API to tag proxy objects to allow applications and
    toolkits to share the same Wayland connection
  * Track wayland-server timers in user-space to prevent creating
    too many FDs
  * Add wl_global_remove, a new function to mitigate race
    conditions with globals
* Thu Mar 21 2019 Jan Engelhardt <jengelh@inai.de>
- Update to new upstream release 1.17
  * There is now a protocol to express an internal server error
    message, and a new version of the wl_seat protocol with no
    changes other than keymaps must be private.
* Tue Nov 20 2018 sndirsch@suse.com
- Downgrades do not work in SLES service packs, because the SP0
  repo remains enabled for SP1. (This is unlike Leap, where a 15.1
  system will have no 15.0 directories.) As such, to force the
  upgrade from Mesa:libwayland-egl1 to wayland:libwayland-egl1,
  the number in wayland is bumped to >18 for those distros.
* Mon Nov 19 2018 sndirsch@suse.com
- add Provides/Obsoletes for libwayland-egl-devel for the devel
  files, which were previously built by Mesa, also on
  sle15-sp1/Leap 15.1 due to wayland update on these products
  (boo#1116042)
* Sat Aug 25 2018 jengelh@inai.de
- Update to new upstream release 1.16
  * The client definition of wl_global is removed.
  * Some long standing oddness has been fixed with destroy signals.
  * The code generator now supports referencing foreign enums.
* Mon Aug 13 2018 sndirsch@suse.com
- devel package: add Provides/Obsoletes for libwayland-egl-devel
  for the devel files, which were previously built by Mesa; see also
  https://build.opensuse.org/request/show/613048
* Wed May 23 2018 bjorn.lie@gmail.com
- Update wayland.keyring to contain Derek Foreman
  derekf@osg.samsung.com public key.
* Mon Apr  9 2018 jengelh@inai.de
- Update to new upstream release 1.15
  * wl_subcompositor.get_subsurface is now documented to be
    double buffered.
  * wayland-scanner can now generate either public or private
    symbols.
  * libwayland-egl is now part of libwayland (and will presumably
    be removed Mesa soon)
  * The WAYLAND_DISPLAY environment variable can now contain
    absolute paths (where previously it was prefixed by
    XDG_RUNTIME_DIR) - anything that reads WAYLAND_DISPLAY
    outside of libwayland will have to deal with that change
    independently.
* Tue Feb 27 2018 emil.l.velikov@gmail.com
- Remove unneeded fdupes dependency/handling
* Fri Oct 13 2017 jengelh@inai.de
- Add COPYING
* Wed Aug  9 2017 jengelh@inai.de
- Update to new upstream release 1.14
  * wayland-util: do not export the wl_map_* API
  * wayland-server: Remove unused members from struct wl_client
- Drop 0001-tests-Fix-new-ID-type-handling-in-argument_from_va_l.patch
  (integrated)
* Mon Apr 10 2017 sndirsch@suse.com
- wayland support in Mesa 17 requires wayland >= 1.11 [fate#321223]
* Wed Mar 15 2017 jengelh@inai.de
- Add 0001-tests-Fix-new-ID-type-handling-in-argument_from_va_l.patch
  to resolve testsuite failure on s390x [boo#1029452]
* Tue Feb 21 2017 jengelh@inai.de
- Update to new upstream release 1.13.0
  * Add some API for controlling the visibility of globals.
- Drop wayland-wl_array_Set_data_to_invalid_address_after_free.patch
  (no longer needed)
* Sat Nov  5 2016 zaitor@opensuse.org
- Add
  wayland-wl_array_Set_data_to_invalid_address_after_free.patch:
  Crash fix patch from upstream git.
* Wed Sep 21 2016 jengelh@inai.de
- Update to new upstream release 1.12.0
  * The core protocol documentation has received numerous
  refinements to improve its clarity and consistency. Along with
  this, many blank areas of the protocol documentation have been
  fleshed out.
  * A new wl_display_add_protocol logger API provides a new
  interactive way to debug requests; along with this are new APIs
  for examining clients and their resources. This is analogous to
  using WAYLAND_DEBUG=1, but more powerful since it allows run
  time review of log data such as through a UI view.
  * There have been improvements to how the protocol XML scanner
  handles version identification in protocol headers. This
  enables better detection and fallback handling when compositors
  and clients support differing versions of their protocols.
* Wed Jun  1 2016 jengelh@inai.de
- Update to new upstream release 1.11.0
  * Final version bump.
* Tue May 24 2016 jengelh@inai.de
- Update to new upstream release 1.10.93
  * Proxy wrappers were introduced, which help avoid race
  conditions in multi-threaded clients. A new "proxy wrapper" API
  is added for the client to use when sending requests which does
  not proxy events. This helps avoid one thread causing events to
  be dropped before they can be handled by other threads.
  * shm: When undergoing a resize operation while external users
  are holding references to it, the resize is deferred to prevent
  leading to a crash; Wayland now counts external and internal
  users differently to permit tracking this.
  * Support for cross-interface enum attributes is added.
* Thu Feb 18 2016 jengelh@inai.de
- Update to new upstream release 1.10.0
  * Drag and drop actions are now added to the Wayland API
  * Frame events group pointer events together
  * A buffer damage request, wl_surface.damage_buffer, allows
  applications a more convenient way to communicate portions of a
  surface needing to be re-rendered.
  * Shared memory buffers now do reference counting to allow
  compositors to delay releasing the memory pools.
  * New APIs are provided for getting and setting the socket file
  descriptor Wayland servers use to communicate with their clients.
* Tue Sep 22 2015 jengelh@inai.de
- Update to new upstream release 1.9.0
  * This release brings fixes and modest refactoring.
- License was changed from MIT X11 to MIT Expat upstream.
* Wed Aug 26 2015 zaitor@opensuse.org
- Update to new upstream release 1.8.1
  * This is just a brown paper bag release. In rolling the wayland
  1.8.0 distribution tarball some files were set to read-only. This
  rectifies that. There are no file content changes.
* Wed Jun  3 2015 jengelh@inai.de
- Update to new upstream release 1.8.0
  * Wayland 1.8 splits the client and server header files into core
  and generated protocol. The core headers can be included as
  wayland-client-core.h and wayland-server-core.h. The scanner
  also now supports a --include-core-only option, which causes
  generated code to use only these core headers.
* Wed Mar  4 2015 jengelh@inai.de
- Update to new upstream release 1.7.0
  * Documentation updates
* Mon Feb  2 2015 jengelh@inai.de
- Update to new upstream prerelease 1.6.92
  * More documentation updates
* Tue Jan 27 2015 jengelh@inai.de
- Update to new upstream prerelease 1.6.91
  * The codebase's doxygen documentation was revamped
* Sun Jan 25 2015 jengelh@inai.de
- Update to new upstream release 1.6.1
  * Maintenance release for Wayland 1.6, with a handful of fixes
  pulled from the 1.7 tree that improve handling of several error
  situations between server and clients.
* Fri Sep 19 2014 jengelh@inai.de
- Update to new upstream release 1.6
  * Add error enums to wl_surface.
  * Add keyboard repeat information to wl_keyboard protocol.
  * Error handling additions in libwayland-client: when a protocol
  error happens, the program can query more detailed information
  about the error.
  * New wl_display_add_socket_auto() in libwayland-server:
  automatically find a free socket name.
  * Add wl_display_roundtrip_queue(): blocking round-trip on a
  custom queue.
  * Stop exposing wl_display global. Turns out binding to the
  global would have triggered bugs, and there was no proper use
  for it.
* Fri Sep 12 2014 jengelh@inai.de
- Update to version 1.5.93
  * Bug fixes
* Mon Sep  8 2014 dimstar@opensuse.org
- Update to version 1.5.92:
  * wayland-client: Initialize newly created wl_proxys to zero.
  * client: add display_wakeup_threads function.
  * Doc and test updates / fixes.
* Wed May 21 2014 jengelh@inai.de
- Update to new upstream release 1.5.0
  * Use an internal event queue for wl_display events. This allows
  the client library to dispatch delete_id and error events
  immediately, even if the default queue is not dispatched.
* Fri Jan 24 2014 jengelh@inai.de
- Update to new upstream release 1.4.0
  * SHM Buffer SIBGUS protection
  * Subsurfaces protocol moved to wayland
- Remove wayland-1.3.93-resourcestest.patch
* Tue Jan 21 2014 tchvatal@suse.com
- Version bump to 1.3.93:
  * Various bugfixes to another RC release
- Add patch wayland-1.3.93-resourcestest.patch fixing tests from
  upstream git
- Cleanup the spec with spec-cleaner
- Always run tests do not conditionalize them. They wether fail or
  not
- Add missing dep on xsltproc as per configure
* Tue Dec 24 2013 jengelh@inai.de
- Update to new upstream release 1.3.91
  * protocol: add sub-surfaces to the core
* Thu Oct 17 2013 tobias.johannes.klausmann@mni.thm.de
- Update to version 1.3.0:
  * More pixel formats for wl_shm, such as RGB565
  * Multi resource support.
  * Support for language bindings
  * Release requests for wl_pointer, wl_keyboard and wl_touch
* Tue Oct 15 2013 dmueller@suse.com
- skip testsuite on QEMU Userspace build (fixes hang on ARMv6 build)
* Thu Sep 19 2013 hrvoje.senjan@gmail.com
- Update to new upstream release 1.2.1
  * Bug fixes and documentation tweaks
  * Touch support for toytoolkit and other clients.
* Mon Jul 15 2013 jengelh@inai.de
- Update to new upstream release 1.2.0
  * This release provides a stable wayland-server API and improved
  thread safety and relaxed thread-model assumptions in
  libwayland-client.
  * New features include color management, a subsurface protocol,
  output scaling (HiDPI), Rasperry Pi backend and renderer,
  and multi-seat support.
* Wed Apr 17 2013 jengelh@inai.de
- Update to new upstream release 1.1.0
  * Optimize damage handling when moving surfaces in and out of planes
  * Touch screen calibration feature and client
  * Proper support for popup surfaces
- Use a header location that does not change with every release
* Sun Mar 24 2013 hrvoje.senjan@gmail.com
- Update to new upstream release 1.0.6
  * protocol: remove implicit attach semantics
  * client: Invoke new_id closure arguments as pointers instead of integers
  * client: Check reference count only for destroyed proxies
  * client: add wl_proxy_get_class()
  * scanner: Fix 'destroy)' typo in check for destroy request presence
  * scanner: remove list_length in favor of wl_list_length
  * connection.c: Align pointer extra storage correctly
* Tue Dec 18 2012 jengelh@inai.de
- Update to new upstream release 1.0.3
  * a couple of documentation fixes
  * the test suite now cleans up its temporary files
* Sat Dec  1 2012 jengelh@inai.de
- Update to new upstream release 1.0.2
  * new wl_display_dispatch_queue_pending() entry point that allows
  avoiding triple buffering in Mesa
  * avoid premature exit and potential memory corruption in
  wl_display_roundtrip()
- Put all include files in a separate directory so that we see
  when downstream users forget to use pkgconfig
* Mon Nov 26 2012 tobias.johannes.klausmann@mni.thm.de
- Add initial baselibs.conf
  With this we can provide 32bit x86_64.rpm
* Tue Nov 20 2012 jengelh@inai.de
- Update to new upstream release 1.0.1
  * Supply a fix for out-of-order delete_id events, which allows
  to fix a crash that happens during EGLSurface destruction.
* Fri Nov  2 2012 cfarrell@suse.com
- license update: HPND
  http://spdx.org/licenses/HPND#licenseText
* Tue Oct 23 2012 jengelh@inai.de
- Update to new upstream release 1.0
  * more consistent error checking
* Fri Oct 19 2012 tobias.johannes.klausmann@mni.thm.de
- Update to version 0.99.0
  * responsible error handling
  * well-defined atomic update mechanism and event dispatching
  (thread safe)
  * Some API breakage
* Sat Feb 11 2012 jengelh@inai.de
- Initial package for build.opensuse.org (0.85)
openSUSE Build Service is sponsored by