File KnobKraft-orm.spec of Package KnobKraft-orm

#
# spec file for package KnobKraft-orm
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 binname KnobKraftOrm
Name:           KnobKraft-orm
Version:        2.8.2+git.3.891e72e
Release:        0
Summary:        Free modern cross-platform MIDI Sysex Librarian
License:        AGPL-3.0 or MIT
Group:          Productivity/Multimedia/Sound/Midi
URL:            https://github.com/christofmuc/KnobKraft-orm
Source0:        %{name}-%{version}.tar.xz
Source1:        %{binname}.desktop
Patch0:         noneeded-deps-and-flags.patch
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  pkgconfig(alsa)
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(xinerama)
BuildRequires:  pkgconfig(xext)
BuildRequires:  pkgconfig(freetype2)
BuildRequires:  pkgconfig(fontconfig)
BuildRequires:  pkgconfig(icu-uc)
BuildRequires:  pkgconfig(libcurl)
# BuildRequires:  pkgconfig(gtk+-3.0)
# BuildRequires:  pkgconfig(glew)
# BuildRequires:  pkgconfig(webkit2gtk-4.1)
BuildRequires:  libboost_headers-devel
BuildRequires:  Mesa-libGL-devel
BuildRequires:  libXrandr-devel
BuildRequires:  libXcursor-devel
BuildRequires:  libjack-devel
BuildRequires:  sqlite3-devel
BuildRequires:  python313-devel

%description

The KnobKraft Orm - The free modern cross-platform MIDI Sysex Librarian

%prep
%autosetup -p1

%define VERSION %(echo %{version} |awk -F . '{ gsub(/\+git/, "" ); print $1"."$2"."$3 }')
%define OFFSET %(echo %{version} |awk -F . '{ gsub(/\+git/, "" ); print $4}')
%define HASH %(echo %{version} |awk -F . '{ gsub(/\+git/, "" ); print $5}')
%define FULL_VER %{VERSION}-%{OFFSET}-%{HASH}
sed -i -e 's/'"unknown"'/%{FULL_VER}/' The-Orm/gitversion.cmake

%build
%cmake -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=off \
       -DBUILD_SHARED_LIBS=OFF \
       -DBUILD_STATIC_LIBS=ON\
       -DPYTHON_EXECUTABLE=/usr/bin/python3.13 \
       -DPYTHON_VERSION_TO_EMBED=3.13

%cmake_build

%install
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_libexecdir}/%{name}

mkdir -p %{buildroot}%{_datadir}/pixmaps
cp The-Orm/resources/icon_orm.png %{buildroot}%{_datadir}/pixmaps/%{binname}.png
mkdir -p %{buildroot}%{_datadir}/applications
cp %{SOURCE1} %{buildroot}%{_datadir}/applications/

cd build/The-Orm
for i in adaptations knobkraft KnobKraftOrm roland sequential testing; do
 cp -r $i %{buildroot}%{_libexecdir}/%{name}/
done

cd %{buildroot}%{_bindir}
ln -s ../libexec/%{name}/%{binname} %{binname}

%files 
%{_bindir}/%{binname}
%dir %{_libexecdir}/%{name}
%{_libexecdir}/%{name}/
%{_datadir}/pixmaps/%{binname}.png
%{_datadir}/applications/%{binname}.desktop

%doc README.md
%license LICENSE.md
%changelog
openSUSE Build Service is sponsored by