File stable-diffusion.cpp.spec of Package stable-diffusion.cpp

#
# spec file for package stable-diffusion.cpp
#
# 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/
#


Name:           stable-diffusion.cpp
Version:        0
Release:        0
Summary:Inference of Stable Diffusion and Flux in pure C/C++
# FIXME: Select a correct license from https://github.com/openSUSE/spec-cleaner#spdx-licenses
License:        MIT
URL:            https://github.com/leejet/stable-diffusion.cpp.git
Source:	_service
BuildRequires:	gcc-c++
BuildRequires:	pkgconfig(ggml)
BuildRequires:	cmake-full
BuildRequires:	curl-devel
BuildRequires:	cmake(libzip)
BuildRequires:	pkgconfig(stb)
%description
Plain C/C++ implementation based on ggml, working in the same way as llama.cpp

%package -n     libstable-diffusion
License:        MIT
Summary:        Plain C/C++ implementation based on ggml
%description -n libstable-diffusion
Plain C/C++ implementation based on ggml, working in the same way as llama.cpp

%prep

%setup -q -n %_sourcedir/%name-%version -T -D
%__mkdir -p %_builddir/%_sourcedir
%__ln -s %_sourcedir/%name-%version %_builddir/%_sourcedir

%build
%cmake -DSD_VULKAN=1 -DSD_BUILD_SHARED_LIBS=1 -DSD_STANDALONE=ON -DSD_USE_SYSTEM_GGML=ON

%cmake_build

%install
%cmake_install
%__install  -D -m 0755 build/bin/libstable-diffusion.so %{buildroot}%{_libdir}/libstable-diffusion.so

%files
%license LICENSE
%doc README.md
%_bindir/sd
%files -n libstable-diffusion
%{_libdir}/libstable-diffusion.so
%changelog

openSUSE Build Service is sponsored by