File vkdt.spec of Package vkdt

#
# spec file for package vkdt
#
# 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/
#

%bcond_with    vkdt_clang

%if 0%{?fedora} && %{with vkdt_clang}
%global toolchain clang
%endif

%global vkdt_dir          %{_libexecdir}/%{name}

# we need to include LDFLAGS here for the workaround from https://bugzilla.redhat.com/show_bug.cgi?id=2158172#c1
%global common_make_args  V=1 OPT_CFLAGS="%{optflags} -fPIC" OPT_LDFLAGS="%{?build_ldflags}"

Name:           vkdt
Version:        1.0.99+git8.aad9381cf
Release:        0
Summary:        darktable which sucks less
License:        BSD-2-Clause
URL:            https://github.com/hanatos/vkdt
Source:         %{name}-%{version}.tar.zst
Source1:        vendor.tar.zst
Source9:        series
Patch:          buildconfig.patch
BuildRequires:  zstd
BuildRequires:  cmake
BuildRequires:  gcc-c++
%if %{with vkdt_clang}
BuildRequires:  clang%{?force_clang_version}
BuildRequires:  clang%{?force_clang_version}-devel
BuildRequires:  libomp%{?force_clang_version}-devel
%if 0%{?fedora_version}
BuildRequires:  libomp
%endif
%endif
BuildRequires:  llvm%{?force_clang_version}-devel
%if 0%{?fedora_version}
BuildRequires:  libasan
BuildRequires:  llvm-static
%endif
BuildRequires:  glslang-devel
%if 0%{?suse_version}
BuildRequires:  libxml2-tools
%else
BuildRequires:  libxml2
%endif
BuildRequires:  pkgconfig
BuildRequires:  rsync
BuildRequires:  vulkan-headers >= 1.2.162
%if 0%{?suse_version}
BuildRequires:  vulkan-validationlayers
%else
BuildRequires:  vulkan-validation-layers-devel
%endif
BuildRequires:  cargo >= 1.70
BuildRequires:  rust >= 1.70
%if 0%{?suse_version}
BuildRequires:  cargo-packaging
BuildRequires:  ffmpeg
%else
BuildRequires:  cargo
BuildRequires:  ffmpeg-free
# have choice helper
BuildRequires:  pipewire-jack-audio-connection-kit-libs OpenCL-ICD-Loader
%endif
BuildRequires:  mold
BuildRequires:  pkgconfig(libavformat)
BuildRequires:  pkgconfig(libavcodec)
BuildRequires:  pkgconfig(libswresample)
BuildRequires:  pkgconfig(alsa)
BuildRequires:  pkgconfig(exiv2)
BuildRequires:  pkgconfig(freetype2)
BuildRequires:  pkgconfig(glfw3)
BuildRequires:  pkgconfig(libjpeg)
BuildRequires:  pkgconfig(libpng16)
BuildRequires:  pkgconfig(pugixml)
BuildRequires:  pkgconfig(vulkan)
BuildRequires:  pkgconfig(zlib)
BuildRequires:  pkgconfig(ogg)
BuildRequires:  pkgconfig(vorbis)
BuildRequires:  pkgconfig(vorbisfile)
BuildRequires:  pkgconfig(mad)
%if 0%{?suse_version} && 0%{?suse_version} < 1550
BuildRequires:  pkgconfig(gl)
%endif
BuildRequires:  xxd
ExclusiveArch:  x86_64
Requires:       exiftool

%description
this is an experimental complete rewrite of darktable, naturally at this point
with a heavily reduced feature set.

the processing pipeline has been rewritten as a generic node graph (dag) which
supports multiple inputs and multiple outputs. all processing is done in glsl
shaders/vulkan. this facilitates potentially heavy duty computational
photography tasks, for instance aligning multiple raw files and merging them
before further processing, as well as outputting many intermediate results as
jpg for debugging. the gui profits from this scheme as well and can display
textures while they are still on gpu and output the data to multiple targets,
such as the main view and histograms.

%prep
%autosetup -p1 -a1

%build
#define _lto_cflags %{nil}
mv LICENCE LICENSE
%if %{with vkdt_clang}
export CC=clang
export CXX=clang++
%else
export CC=gcc
export CXX=g++
%endif
export LD=mold

%make_build %{common_make_args} VKDTDIR=%{vkdt_dir} VKDT_VERSION="%{version}"

# make sure that our version.h work
./bin/vkdt-cli --version | grep '%{version}'

%install
%make_install %{common_make_args} VKDTDIR=%{buildroot}%{vkdt_dir}

LIBEXEC="$(echo %{_libexecdir} | sed -e 's|^%{_prefix}|..|g')"
ln -sf ${LIBEXEC}/%{name}/vkdt{,-cli} %{buildroot}%{_bindir}

find %{buildroot} \( -name \*.[ch] -o -name \*.cpp \) -print -delete

%files
%license LICENSE
%doc readme.md
%{_bindir}/vkdt*
%{vkdt_dir}/
%{_datadir}/applications/vkdt.desktop
%{_datadir}/icons/vkdt.png

%changelog
openSUSE Build Service is sponsored by