210114d
%global appname MangoHud
f1118ac
%global forgeurl https://github.com/flightlessmango/%{appname}
210114d
Packit 7d08944
%global imgui_ver 1.89.9
Packit 7d08944
%global imgui_wrap_ver 2
16878ff
%global vulkan_headers_ver 1.2.158
16878ff
%global vulkan_headers_wrap_ver 1
Packit 7d08944
%global implot_ver 0.16
Packit 7d08944
%global implot_wrap_ver 2
34db244
5444550
%global tarball_version %%(echo %{version} | tr '~' '-')
5444550
b34b647
# Failed on s390x arch
b34b647
# [  ERROR   ] --- 0x4000 != 0x40
b34b647
# [   LINE   ] --- ../tests/test_amdgpu.cpp:35: error: Failure!
b34b647
# [  FAILED  ] amdgpu_tests: 1 test(s), listed below:
b34b647
# [  FAILED  ] test_amdgpu_get_instant_metrics
b34b647
%ifnarch s390x
a48a5e0
%bcond_without tests
b34b647
%endif
c3ed1d6
210114d
Name:           mangohud
Packit 7d08944
Version:        0.7.1
Packit 7d08944
%forgemeta
e2361a1
Release:        %autorelease
a006683
Summary:        Vulkan and OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load
210114d
210114d
License:        MIT
f1118ac
URL:            %{forgeurl}
f1118ac
Source0:        %{forgesource}
d397271
# imgui
34db244
Source1:        https://github.com/ocornut/imgui/archive/v%{imgui_ver}/imgui-%{imgui_ver}.tar.gz
Packit 7d08944
Source2: https://wrapdb.mesonbuild.com/v%{imgui_wrap_ver}/imgui_%{imgui_ver}-1/get_patch#/imgui-%{imgui_ver}-%{imgui_wrap_ver}-wrap.zip
d397271
# Vulkan-Headers
16878ff
Source3:        https://github.com/KhronosGroup/Vulkan-Headers/archive/v%{vulkan_headers_ver}/Vulkan-Headers-%{vulkan_headers_ver}.tar.gz
16878ff
Source4:        https://wrapdb.mesonbuild.com/v%{vulkan_headers_wrap_ver}/projects/vulkan-headers/%{vulkan_headers_ver}/%{vulkan_headers_wrap_ver}/get_zip#/vulkan-headers-%{vulkan_headers_ver}-%{vulkan_headers_wrap_ver}-wrap.zip
Packit 7d08944
# implot
Packit 7d08944
Source5:        https://github.com/epezent/implot/archive/v%{implot_ver}/implot-%{implot_ver}.tar.gz
Packit 7d08944
Source6:        https://wrapdb.mesonbuild.com/v%{implot_wrap_ver}/implot_%{implot_ver}-1/get_patch#/implot-%{implot_ver}-%{implot_wrap_ver}-wrap.zip
87e3e10
c3ed1d6
# MangoHud switched to bundled vulkan-headers since 0.6.9 version. This rebased
c3ed1d6
# upstream patch which reverts this change.
c3ed1d6
# https://github.com/flightlessmango/MangoHud/commit/bc282cf300ed5b6831177cf3e6753bc20f48e942
16878ff
# Patch0:         mangohud-0.6.9-use-system-vulkan-headers.patch
Packit 7d08944
BuildRequires:  vulkan-headers
8a8f60b
6da66fb
BuildRequires:  appstream
abb77ad
BuildRequires:  dbus-devel
210114d
BuildRequires:  gcc-c++
210114d
BuildRequires:  git-core
b7e655b
BuildRequires:  glew-devel
b7e655b
BuildRequires:  glfw-devel
210114d
BuildRequires:  glslang-devel
6da66fb
BuildRequires:  libappstream-glib
210114d
BuildRequires:  mesa-libGL-devel
6da66fb
BuildRequires:  meson >= 0.60
210114d
BuildRequires:  python3-mako
b7e655b
BuildRequires:  spdlog-devel
34db244
c3ed1d6
BuildRequires:  pkgconfig(nlohmann_json)
4fd9b54
# Tip and memo if upstream decide to unbundle vulkan-headers
4fd9b54
# BuildRequires:  pkgconfig(vulkan) < 1.3.241
8a8f60b
BuildRequires:  pkgconfig(wayland-client)
c3ed1d6
BuildRequires:  pkgconfig(x11)
c3ed1d6
c3ed1d6
%if %{with tests}
c3ed1d6
BuildRequires:  libcmocka-devel
c3ed1d6
%endif
cf89a8d
6da66fb
Requires:       hicolor-icon-theme
210114d
Requires:       vulkan-loader%{?_isa}
cf89a8d
c87664e
Recommends:     (mangohud(x86-32) if glibc(x86-32))
643b20a
c52181e
Suggests:       %{name}-mangoplot
89b43ff
Suggests:       goverlay
89b43ff
81cddf1
Provides:       bundled(imgui) = %{imgui_ver}
16878ff
Provides:       bundled(vulkan-headers) = %{vulkan_headers_ver}
210114d
6da66fb
%global _description %{expand:
a006683
A Vulkan and OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load and
a006683
more.
210114d
89b43ff
To install GUI front-end:
89b43ff
a006683
  # dnf install goverlay
a006683
a006683
To install local visualization "mangoplot":
a006683
e3a6b95
  # dnf install %{name}-mangoplot}
6da66fb
6da66fb
%description %{_description}
89b43ff
210114d
a006683
%package        mangoplot
a006683
Summary:        Local visualization "mangoplot" for %{name}
a006683
BuildArch:      noarch
a006683
a006683
Requires:       %{name} = %{version}-%{release}
7be5123
Requires:       python3-matplotlib
7be5123
Requires:       python3-numpy
a006683
a006683
%description    mangoplot
a006683
Local visualization "mangoplot" for %{name}.
a006683
a006683
210114d
%prep
f1118ac
%forgeautosetup -p1
5444550
%setup -qn %{appname}-%{tarball_version} -D -T -a1
5444550
%setup -qn %{appname}-%{tarball_version} -D -T -a2
5444550
%setup -qn %{appname}-%{tarball_version} -D -T -a3
5444550
%setup -qn %{appname}-%{tarball_version} -D -T -a4
Packit 7d08944
%setup -qn %{appname}-%{tarball_version} -D -T -a5
Packit 7d08944
%setup -qn %{appname}-%{tarball_version} -D -T -a6
34db244
16878ff
# imgui
8a8f60b
mv imgui-%{imgui_ver} subprojects/
16878ff
# Vulkan-Headers
16878ff
mv Vulkan-Headers-%{vulkan_headers_ver} subprojects/
Packit 7d08944
# implot
Packit 7d08944
mv implot-%{implot_ver} subprojects/
210114d
a48a5e0
%if %{with tests}
a48a5e0
# Use system cmocka instead of subproject
a48a5e0
# https://gitlab.archlinux.org/archlinux/packaging/packages/mangohud/-/blob/0.6.9.1-10/PKGBUILD?ref_type=tags#L32
a48a5e0
sed -i "s/  cmocka = subproject('cmocka')//g" meson.build
a48a5e0
sed -i "s/cmocka_dep = cmocka.get_variable('cmocka_dep')/cmocka_dep = dependency('cmocka')/g" meson.build
a48a5e0
%endif
a48a5e0
5444550
# https://github.com/flightlessmango/MangoHud/commit/dc1761e98a435aaee6a919e21f43b85cc38500ac
5444550
sed -i "s/, '-static-libstdc++'//" \
5444550
    src/meson.build
5444550
210114d
210114d
%build
abb77ad
%meson \
582be74
    -Dmangoapp=true \
582be74
    -Dmangoapp_layer=true \
582be74
    -Dmangohudctl=true \
6da66fb
    -Dinclude_doc=true \
b7e655b
    -Duse_system_spdlog=enabled \
8a8f60b
    -Dwith_wayland=enabled \
b7e655b
    -Dwith_xnvctrl=disabled \
c3ed1d6
    %if %{with tests}
c3ed1d6
    -Dtests=enabled \
c3ed1d6
    %else
c3ed1d6
    -Dtests=disabled \
c3ed1d6
    %endif
b7e655b
    %{nil}
210114d
%meson_build
210114d
210114d
210114d
%install
210114d
%meson_install
210114d
5444550
# ERROR: ambiguous python shebang
5444550
sed -i "s@#!/usr/bin/env python@#!/usr/bin/python3@" \
5444550
    %{buildroot}%{_bindir}/mangoplot
5444550
210114d
6da66fb
%check
6da66fb
# https://github.com/flightlessmango/MangoHud/issues/812
d397271
# ? tag-invalid           : stock icon is not valid [io.github.flightlessmango.mangohud]
6da66fb
%dnl appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/*.xml
a48a5e0
%if %{with tests}
a48a5e0
%meson_test
a48a5e0
%endif
6da66fb
6da66fb
210114d
%files
210114d
%license LICENSE
Packit 7d08944
%doc README.md presets.conf.example
e865121
%{_bindir}/%{name}*
582be74
%{_bindir}/mangoapp
6da66fb
%{_datadir}/icons/hicolor/scalable/*/*.svg
be2ca44
%{_datadir}/vulkan/implicit_layer.d/*Mango*.json
cf89a8d
%{_docdir}/%{name}/%{appname}.conf.example
210114d
%{_libdir}/%{name}/
2c1199f
%{_mandir}/man1/%{name}.1*
582be74
%{_mandir}/man1/mangoapp.1*
6da66fb
%{_metainfodir}/*.metainfo.xml
210114d
a006683
%files mangoplot
a006683
%{_bindir}/mangoplot
a006683
210114d
210114d
%changelog
e2361a1
%autochangelog