c27c0e5
# Lists copied from gcc.spec
c27c0e5
# Current as of 13.2.1 (lines 66, 86, and 76, respectively).
c27c0e5
# Note that asan and ubsan are available on all Fedora primary architectures;
c27c0e5
# tsan is missing on i686 only.
3eb2210
%ifarch %{ix86} x86_64 ppc ppc64 ppc64le ppc64p7 s390 s390x %{arm} aarch64
c27c0e5
%global arch_has_asan 1
8908eb2
%endif
3eb2210
%ifarch %{ix86} x86_64 ppc ppc64 ppc64le ppc64p7 s390 s390x %{arm} aarch64
c27c0e5
%global arch_has_ubsan 1
3eb2210
%endif
e70f2e1
%ifarch x86_64 ppc64 ppc64le aarch64 s390x
c27c0e5
%global arch_has_tsan 1
c38221d
%endif
c38221d
c27c0e5
# By default, enable sanitizers whenever they are available on the architecture.
c27c0e5
%bcond asan 0%{?arch_has_asan:1}
c27c0e5
%bcond ubsan 0%{?arch_has_ubsan:1}
c27c0e5
%bcond tsan 0%{?arch_has_tsan:1}
c27c0e5
9773b06
Name:           wlcs
b99314c
Version:        1.7.0
4073d69
Release:        %autorelease
9773b06
Summary:        Wayland Conformance Test Suite
9773b06
79263c8
# The entire source is GPL-3.0-only, except:
3eb2210
#
79263c8
# (GPL-2.0-only OR GPL-3.0-only):
3eb2210
#   - CMakeLists.txt
3eb2210
# > Build system file that does not contribute to the licenses of the binary
3eb2210
#   RPMs
3eb2210
#
79263c8
# (LGPL-2.0-only OR LGPL-3.0-only):
a4df262
#   - include/geometry/*
3eb2210
#   - include/mutex.h
3eb2210
#   - include/shared_library.h
3eb2210
#   - src/helpers.cpp
3eb2210
#   - src/shared_library.cpp
3eb2210
# > Since (L)GPLv2-only code is not compatible with (L)GPLv3 or (L)GPLv3+ code,
3eb2210
#   and these sources are combined with GPLv3 code, the LGPLv3 option is used
79263c8
#   in this package. However, we encode both options in the SPDX expression.
3eb2210
#
3eb2210
# GPLv2+:
3eb2210
#   - debian/*
3eb2210
# > Not used in this package
3eb2210
#
3eb2210
# MIT:
3eb2210
#   - src/protocol/gtk-primary-selection.xml
c9d6fa3
#   - src/protocol/input-method-unstable-v1.xml
3eb2210
#   - src/protocol/pointer-constraints-unstable-v1.xml
3eb2210
#   - src/protocol/primary-selection-unstable-v1.xml
3eb2210
#   - src/protocol/relative-pointer-unstable-v1.xml
3eb2210
#   - src/protocol/wayland.xml
e0c9157
#   - src/protocol/wlr-virtual-pointer-unstable-v1.xml
3eb2210
#   - src/protocol/xdg-output-unstable-v1.xml
3eb2210
#   - src/protocol/xdg-shell-unstable-v6.xml
3eb2210
#   - src/protocol/xdg-shell.xml
3eb2210
#   - tests/test_bad_buffer.cpp
3eb2210
#   - tests/test_surface_events.cpp
f499c43
#   - tests/text_input_v3_with_input_method_v2.cpp
e0c9157
#   - tests/wlr_virtual_pointer_v1.cpp
3eb2210
#   - tests/xdg_popup_v6.cpp
3eb2210
#   - tests/xdg_surface_stable.cpp
3eb2210
#   - tests/xdg_surface_v6.cpp
3eb2210
#   - tests/xdg_toplevel_stable.cpp
3eb2210
#   - tests/xdg_toplevel_v6.cpp
3eb2210
# > Files in tests/ are all test code that is not installed (so does not
3eb2210
#   contribute to the licenses of the binary RPMs). Files in src/protocol/ are
3eb2210
#   used as inputs to “wayland-scanner” to generate C source files and headers,
3eb2210
#   and are not directly included in the binary RPMs.
c9d6fa3
#
c9d6fa3
# HPND-sell-variant:
c9d6fa3
#   - src/protocol/text-input-unstable-v2.xml
c9d6fa3
# > Files in src/protocol/ are used as inputs to “wayland-scanner” to generate
c9d6fa3
#   C source files and headers, and are not directly included in the binary
c9d6fa3
#   RPMs.
79263c8
License:        GPL-3.0-only AND (LGPL-2.0-only OR LGPL-3.0-only)
3eb2210
URL:            https://github.com/MirServer/wlcs
f6d31a0
Source:         %{url}/archive/v%{version}/wlcs-%{version}.tar.gz
9773b06
9773b06
BuildRequires:  gcc
9773b06
BuildRequires:  gcc-c++
3eb2210
9773b06
BuildRequires:  cmake
c018cc5
BuildRequires:  ninja-build
3eb2210
9773b06
BuildRequires:  boost-devel
3eb2210
BuildRequires:  cmake(GTest)
9773b06
BuildRequires:  gmock-devel
9773b06
BuildRequires:  pkgconfig(wayland-client)
9773b06
BuildRequires:  pkgconfig(wayland-server)
3eb2210
BuildRequires:  pkgconfig(wayland-scanner)
3eb2210
c38221d
%if %{with asan}
9773b06
BuildRequires:  libasan
c38221d
%endif
c38221d
%if %{with ubsan}
9773b06
BuildRequires:  libubsan
c38221d
%endif
c38221d
%if %{with tsan}
9773b06
BuildRequires:  libtsan
c38221d
%endif
9773b06
9773b06
%description
3eb2210
wlcs aspires to be a protocol-conformance-verifying test suite usable by
3eb2210
Wayland compositor implementors.
9773b06
3eb2210
It is growing out of porting the existing Weston test suite to be run in Mir’s
3eb2210
test suite, but it is designed to be usable by any compositor.
9773b06
3eb2210
wlcs relies on compositors providing an integration module, providing wlcs with
3eb2210
API hooks to start a compositor, connect a client, move a window, and so on.
9773b06
3eb2210
This makes both writing and debugging tests easier - the tests are (generally)
3eb2210
in the same address space as the compositor, so there is a consistent global
3eb2210
clock available, it’s easier to poke around in compositor internals, and
3eb2210
standard debugging tools can follow control flow from the test client to the
3eb2210
compositor and back again.
9773b06
f499c43
9773b06
%package        devel
3eb2210
Summary:        Development files for wlcs
3eb2210
Requires:       wlcs%{?_isa} = %{version}-%{release}
9773b06
9773b06
%description    devel
3eb2210
wlcs aspires to be a protocol-conformance-verifying test suite usable by
3eb2210
Wayland compositor implementors.
9773b06
3eb2210
The wlcs-devel package contains libraries and header files for developing
3eb2210
Wayland compositor tests that use wlcs.
9773b06
9773b06
9773b06
%prep
f499c43
%autosetup
439e14c
# -Werror makes sense for upstream CI, but is too strict for packaging
439e14c
sed -r -i 's/-Werror //' CMakeLists.txt
9773b06
9773b06
9773b06
%build
3eb2210
%cmake \
3eb2210
    -DWLCS_BUILD_ASAN=%{?with_asan:ON}%{?!with_asan:OFF} \
3eb2210
    -DWLCS_BUILD_TSAN=%{?with_tsan:ON}%{?!with_tsan:OFF} \
3eb2210
    -DWLCS_BUILD_UBSAN=%{?with_ubsan:ON}%{?!with_ubsan:OFF} \
3eb2210
    -GNinja
2fff743
%cmake_build
9773b06
3eb2210
9773b06
%install
2fff743
%cmake_install
9773b06
3eb2210
e0c9157
%check
e0c9157
%ctest
e0c9157
e0c9157
9773b06
%files
9773b06
%license COPYING.*
9773b06
%doc README.rst
3eb2210
3eb2210
%{_libexecdir}/wlcs/
3eb2210
9773b06
9773b06
%files devel
9773b06
%doc README.rst
a51e8d4
%doc example/
3eb2210
3eb2210
%{_includedir}/wlcs/
3eb2210
%{_libdir}/pkgconfig/wlcs.pc
9773b06
9773b06
9773b06
%changelog
4073d69
%autochangelog