File imgui.spec of Package imgui-shared

#
# spec file for package imgui
#
# Copyright (c) 2024 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 _lver   1_91_0
Name:           imgui
Version:        1.91.0
Release:        0
Summary:        Immediate Mode Graphical User interface for C++ with minimal dependencies
License:        MIT
Group:          System/Libraries
URL:            https://www.dearimgui.org
Source0:        https://github.com/ocornut/imgui/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1:        https://raw.githubusercontent.com/microsoft/vcpkg/935b5c81c21f9a97a692a75728e4fc3443882937/ports/imgui/CMakeLists.txt#/%{name}-CMakeLists.txt-%{version}
Source2:        https://raw.githubusercontent.com/microsoft/vcpkg/935b5c81c21f9a97a692a75728e4fc3443882937/ports/imgui/imgui-config.cmake.in#/imgui-config.cmake.in-%{version}
# PATCH-FIX-OPENSUSE imgui-fix_installation_paths.patch -- aloisio@gmx.com (see if the include path also needs to be versioned)
Patch0:         imgui-fix_installation_paths.patch
# PATCH-FIX-OPENSUSE imgui-add_version_to_soname.patch -- aloisio@gmx.com
Patch1:         imgui-add_version_to_soname.patch
BuildRequires:  c++_compiler
BuildRequires:  cmake

%description
ImGui is a bloat-free graphical user interface library for C++. It outputs
optimized vertex buffers that you can render anytime in your 3D-pipeline
enabled application. It is fast, portable, renderer agnostic and self-contained
(no external dependencies).

ImGui is designed to enable fast iteration and empower programmers to create
content creation tools and visualization/ debug tools (as opposed to UI for the
average end-user). It favors simplicity and productivity toward this goal, and
thus lacks certain features normally found in more high-level libraries.

ImGui is particularly suited to integration in realtime 3D applications,
fullscreen applications, embedded applications, games, or any applications on
consoles platforms where operating system features are non-standard.

%package devel
Summary:        Development files for ImGui
Group:          Development/Libraries/C and C++
Requires:       lib%{name}_%{_lver}

%description devel
Contains development files for ImGui

%package -n lib%{name}_%{_lver}
Summary:        ImGui shared library
Group:          Development/Libraries/C and C++

%description -n lib%{name}_%{_lver}
Contains ImGui shared library.

%prep
%autosetup -N
install -m0644 %{SOURCE1} CMakeLists.txt
install -m0644 %{SOURCE2} imgui-config.cmake.in
%autopatch -p1

%build
%cmake \
  -DCUSTOM_SOVERSION=%{version}
%cmake_build

%install
%cmake_install

%check

%post -n lib%{name}_%{_lver} -p /sbin/ldconfig

%postun -n lib%{name}_%{_lver} -p /sbin/ldconfig

%files devel
%dir %{_includedir}/%{name}
%{_includedir}/%{name}/imconfig.h
%{_includedir}/%{name}/imgui.h
%{_includedir}/%{name}/imgui_internal.h
%{_includedir}/%{name}/imgui_stdlib.h
%{_includedir}/%{name}/imstb_rectpack.h
%{_includedir}/%{name}/imstb_textedit.h
%{_includedir}/%{name}/imstb_truetype.h
%dir %{_libdir}/cmake/%{name}
%{_libdir}/cmake/%{name}/imgui-config.cmake
%{_libdir}/cmake/%{name}/imgui-targets-relwithdebinfo.cmake
%{_libdir}/cmake/%{name}/imgui-targets.cmake

%files -n lib%{name}_%{_lver}
%{_libdir}/lib%{name}-%{version}.so

%changelog
openSUSE Build Service is sponsored by