#
# spec file for package wayfire
#
# Copyright (c) 2020 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 libname libwf-utils0
Name:           wayfire
Version:        0.5.0
Release:        0
Summary:        3D wayland compositor
License:        MIT
URL:            https://wayfire.org/
Source0:        https://github.com/WayfireWM/%{name}/releases/download/%{version}/%{name}-%{version}.tar.xz
Source1:        https://github.com/WayfireWM/%{name}/releases/download/%{version}/%{name}-%{version}.tar.xz.sha256sum
BuildRequires:  Mesa-libGLESv3-devel
BuildRequires:  gcc-c++
BuildRequires:  inotify-tools-devel
BuildRequires:  meson
BuildRequires:  fdupes
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(cairo)
BuildRequires:  pkgconfig(egl)
BuildRequires:  pkgconfig(freetype2)
BuildRequires:  pkgconfig(glesv2)
BuildRequires:  pkgconfig(glm)
BuildRequires:  pkgconfig(libdrm)
BuildRequires:  pkgconfig(libevdev)
BuildRequires:  pkgconfig(libinput)
BuildRequires:  pkgconfig(libjpeg)
BuildRequires:  pkgconfig(libpng)
BuildRequires:  pkgconfig(pixman-1)
BuildRequires:  pkgconfig(wayland-client)
BuildRequires:  pkgconfig(wayland-cursor)
BuildRequires:  pkgconfig(wayland-protocols)
BuildRequires:  pkgconfig(wayland-server)
BuildRequires:  pkgconfig(wf-config)
BuildRequires:  pkgconfig(wlroots)
BuildRequires:  pkgconfig(xkbcommon)
Recommends:     wayfire-config-manager
Recommends:     wayfire-plugins-extra
Recommends:     wcm
Recommends:     wf-shell

%description
Wayfire is a wayland compositor based on wlroots. It aims to create a customizable, extendable and lightweight environment without sacrificing its appearance. If you want to gain a better impression at what it can do, see the demo videos on youtube: https://www.youtube.com/playlist?list=PLb7YRKEhWEBUIoT-a29UoJW9mhfzjpNle

%package -n %{libname}
Summary:        Library for %{name}

%description -n %{libname}
%{summary}.

%package        devel
Summary:        Devel files for %{name}
Requires:       %{name} = %{version}

%description    devel
Development files for %{name}.

%prep
echo "`grep %{name}-%{version}.tar.xz %{SOURCE1} | grep -Eo '^[0-9a-f]+'`  %{SOURCE0}" | sha256sum -c
%autosetup

%build
%meson
%meson_build

%install
%meson_install
install -Dpm0644 wayfire.desktop %{buildroot}%{_datadir}/wayland-sessions/%{name}.desktop

%fdupes %{buildroot}/%{_prefix}

%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig

%files
%license LICENSE
%doc README.md wayfire.ini
%{_bindir}/%{name}
%{_datadir}/%{name}
%{_datadir}/wayland-sessions/
%{_datadir}/wayland-sessions/*.desktop

%files -n %{libname}
%{_libdir}/*.so.*


%files devel
%{_libdir}/%{name}/
%{_libdir}/%{name}/*.so
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc
%{_includedir}/%{name}

%changelog