File tracy.spec of Package tracy

#
# spec file for package tracy
#
# 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         _lto_cflags      %{nil}
Name:           tracy
Version:        0.11.0
Release:        1
Summary:        Tracy frame profiler
License:        BSD-3-Clause
URL:            https://github.com/wolfpld/tracy
Source0:        v%version.tar.gz
BuildRequires:  gcc-c++
BuildRequires:  hicolor-icon-theme
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(capstone)
BuildRequires:  pkgconfig(freetype2)
BuildRequires:  pkgconfig(glfw3)
BuildRequires:  pkgconfig(gtk+-3.0)
# TW, ALP and Leap 15.5
%if 0%{?suse_version} >= 1600 || (0%{?sle_version} == 150500 && 0%{?is_opensuse})
BuildRequires:  pkgconfig(gtk+-wayland-3.0)
%endif

%{?systemd_ordering}

%if 0%{?suse_version} >= 1600
BuildRequires:  gcc13-c++
%endif
%if 0%{?sle_version} == 150500 && 0%{?is_opensuse}
BuildRequires:  gcc12-c++
%endif

%description
A real time, nanosecond resolution, remote telemetry, hybrid frame and sampling
profiler for games and other applications.

Tracy supports profiling CPU (C, C++11, Lua), GPU (OpenGL, Vulkan, OpenCL),
memory, locks, context switches, per-frame screenshots and more.

%if 0%{?suse_version} >= 1600 || (0%{?sle_version} == 150500 && 0%{?is_opensuse})
%package wayland
Summary: Wayland version of Tracy's frame profiler
%description wayland
Wayland version of Tracy profiler
%endif

%package x11
Summary: X11 version of Tracy's frame profiler
%description x11
X11 version of Tracy profiler

%package utils
Summary: Tracy capture and update utilities
%description utils
Tracy capture and update utilities

%package devel
Summary: Tracy development library and headers
%description devel
Tracy development library and headers

%prep
%autosetup

%build
%if 0%{?suse_version} >= 1600
export CC=gcc-13
export CXX=g++-13
%endif
%if 0%{?sle_version} == 150500 && 0%{?is_opensuse}
export CC=gcc-12
export CXX=g++-12
%endif

%if 0%{?suse_version} >= 1600 || (0%{?sle_version} == 150500 && 0%{?is_opensuse})
%make_build -C profiler/build/unix release CFLAGS="%{optflags}"
mv profiler/build/unix/Tracy-release profiler/build/unix/Tracy-wayland-release
%endif

%make_build -C profiler/build/unix release CFLAGS="%{optflags}" LEGACY=1
mv profiler/build/unix/Tracy-release profiler/build/unix/Tracy-x11-release
%make_build -C update/build/unix release CFLAGS="%{optflags}"
%make_build -C capture/build/unix release CFLAGS="%{optflags}"

%install
%if 0%{?suse_version} >= 1600 || (0%{?sle_version} == 150500 && 0%{?is_opensuse})
install -Dm755 profiler/build/unix/Tracy-wayland-release %{buildroot}/%{_bindir}/%{name}-wayland
install -Dm644 icon/icon.png %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/tracy-wayland.png
%endif
install -Dm755 profiler/build/unix/Tracy-x11-release %{buildroot}/%{_bindir}/%{name}-x11
install -Dm755 update/build/unix/update-release %{buildroot}/%{_bindir}/%{name}-update
install -Dm755 capture/build/unix/capture-release %{buildroot}/%{_bindir}/%{name}-capture
install -Dm644 icon/icon.png %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/tracy-x11.png
install -Dm644 public/TracyClient.cpp %{buildroot}%{_datadir}/tracy/TracyClient.cpp
install -Dm644 public/tracy/Tracy.hpp %{buildroot}%{_includedir}/tracy/Tracy.hpp
install -Dm644 public/tracy/TracyC.h %{buildroot}%{_includedir}/tracy/TracyC.h
install -Dm644 public/tracy/TracyD3D11.hpp %{buildroot}%{_includedir}/tracy/TracyD3D11.hpp
install -Dm644 public/tracy/TracyD3D12.hpp %{buildroot}%{_includedir}/tracy/TracyD3D12.hpp
install -Dm644 public/tracy/TracyLua.hpp %{buildroot}%{_includedir}/tracy/TracyLua.hpp
install -Dm644 public/tracy/TracyOpenCL.hpp %{buildroot}%{_includedir}/tracy/TracyOpenCL.hpp
install -Dm644 public/tracy/TracyOpenGL.hpp %{buildroot}%{_includedir}/tracy/TracyOpenGL.hpp
install -Dm644 public/tracy/TracyVulkan.hpp %{buildroot}%{_includedir}/tracy/TracyVulkan.hpp

%if 0%{?suse_version} >= 1600 || (0%{?sle_version} == 150500 && 0%{?is_opensuse})
%suse_update_desktop_file -c %{name}-wayland Graphics 3DGraphics GTK
%endif
%suse_update_desktop_file -c %{name}-x11 Graphics 3DGraphics GTK

%if 0%{?suse_version} >= 1600 || (0%{?sle_version} == 150500 && 0%{?is_opensuse})
%files wayland
%license LICENSE
%doc README.md
%{_bindir}/%{name}-wayland
%{_datadir}/applications/%{name}-wayland.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}-wayland.png
%endif

%files x11
%license LICENSE
%doc README.md
%{_bindir}/%{name}-x11
%{_datadir}/applications/%{name}-x11.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}-x11.png

%files utils
%license LICENSE
%doc README.md
%{_bindir}/%{name}-capture
%{_bindir}/%{name}-update

%files devel
%license LICENSE
%doc README.md
%{_datadir}/tracy/
%{_datadir}/tracy/TracyClient.cpp
%{_includedir}/tracy/
#%{_includedir}/tracy/Tracy.hpp
#%{_includedir}/tracy/TracyC.h
#%{_includedir}/tracy/TracyD3D11.hpp
#%{_includedir}/tracy/TracyD3D12.hpp
#%{_includedir}/tracy/TracyLua.hpp
#%{_includedir}/tracy/TracyOpenCL.hpp
#%{_includedir}/tracy/TracyOpenGL.hpp
#%{_includedir}/tracy/TracyVulkan.hpp

%changelog
openSUSE Build Service is sponsored by