From 3d4c45354fb9065837dbf6cc54d09439591d5f0d Mon Sep 17 00:00:00 2001 From: Luya Tshimbalanga Date: Aug 02 2020 05:09:03 +0000 Subject: Use cmake macros for build and install --- diff --git a/blender.spec b/blender.spec index c6fed20..4ffe9b4 100644 --- a/blender.spec +++ b/blender.spec @@ -14,10 +14,25 @@ # Comment this to enable FFmpeg support. %global _without_ffmpeg 1 +# default to build with OSL +%bcond_without openshading + +# default to build with opensubdiv +%bcond_without opensubdiv + +# build with embree and oidn only available on x86_64 arch +%ifarch x86_64 +%bcond_without embree +%bcond_without oidn +%else +%bcond_with embree +%bcond_with oidn +%endif + Name: blender Epoch: 1 Version: %{blender_api}.3 -Release: 2%{?dist} +Release: 3%{?dist} Summary: 3D modeling, animation, rendering and post-production License: GPLv2 @@ -34,9 +49,9 @@ Patch0: %{name}-%{blender_api}-droid.patch # Upstream fix to support Python 3.9 # https://developer.blender.org/rB56d0df51a36fdce7ec2d1fbb7b47b1d95b591b5f -#%%if 0%%{?fedora} > 32 -#Patch1: %%{name}-support-python-3.9.diff -#%%endif +%if 0%{?fedora} > 32 +Patch1: %{name}-support-python-3.9.diff +%endif # Development stuff BuildRequires: boost-devel @@ -47,6 +62,7 @@ BuildRequires: gettext BuildRequires: git BuildRequires: libtool BuildRequires: libspnav-devel +BuildRequires: llvm-devel BuildRequires: pkgconfig(blosc) BuildRequires: pkgconfig(expat) BuildRequires: pkgconfig(jemalloc) @@ -60,8 +76,8 @@ BuildRequires: pugixml-devel %endif BuildRequires: pkgconfig(python3) >= 3.5 BuildRequires: pkgconfig(xxf86vm) -BuildRequires: python3-numpy -BuildRequires: python3-requests +BuildRequires: python3dist(numpy) +BuildRequires: python3dist(requests) BuildRequires: subversion-devel # Compression stuff @@ -75,9 +91,17 @@ BuildRequires: pkgconfig(zlib) # 3D modeling stuff -%ifarch x86_64 -BuildRequires: embree-devel -BuildRequires: oidn-devel +%if %{with embree} +BuildRequires: cmake(embree) +%endif +%if %{with opensubdiv} +BuildRequires: opensubdiv-devel +%endif +%if %{with openshading} +BuildRequires: cmake(OSL) +%endif +%if %{with oidn} +BuildRequires: cmake(OpenImageDenoise) %endif BuildRequires: openCOLLADA-devel >= svn825 BuildRequires: pkgconfig(fftw3) @@ -94,16 +118,11 @@ BuildRequires: pkgconfig(glu) BuildRequires: pkgconfig(xi) BuildRequires: pkgconfig(xrender) BuildRequires: pkgconfig(ode) -#Exclude architectures where build fails -%ifnarch %{ix86} armv7hl -BuildRequires: pkgconfig(oslcomp) -%endif -BuildRequires: opensubdiv-devel BuildRequires: pkgconfig(sdl2) BuildRequires: pkgconfig(xproto) # Picture/Video stuff -BuildRequires: alembic-devel +BuildRequires: cmake(Alembic) %{!?_without_ffmpeg: BuildRequires: ffmpeg-devel } @@ -120,14 +139,14 @@ BuildRequires: pkgconfig(libopenjp2) BuildRequires: pkgconfig(tbb) # Audio stuff +BuildRequires: pkgconfig(ao) BuildRequires: pkgconfig(freealut) BuildRequires: pkgconfig(jack) -BuildRequires: pkgconfig(ao) BuildRequires: pkgconfig(ogg) +BuildRequires: pkgconfig(opus) BuildRequires: pkgconfig(samplerate) BuildRequires: pkgconfig(sndfile) BuildRequires: pkgconfig(vorbis) -BuildRequires: pkgconfig(opus) # Typography stuff BuildRequires: fontpackages-devel @@ -140,8 +159,8 @@ Requires: google-droid-sans-fonts Requires: hicolor-icon-theme Requires: %{name}-fonts = %{?epoch:%{epoch}:}%{version}-%{release} Requires: fontpackages-filesystem -Requires: python3-numpy -Requires: python3-requests +Requires: python3dist(requests) +Requires: python3dist(numpy) Provides: blender(ABI) = %{blender_api} # Obsolete the standalone Blender player retired by upstream @@ -192,34 +211,55 @@ pathfix.py -pni "%{__python3} %{py3_shbang_opts}" . %build -%cmake \ - -B build +%cmake3 . \ %ifnarch %{ix86} x86_64 -DWITH_RAYOPTIMIZATION=OFF \ %endif -DBOOST_ROOT=%{_prefix} \ -DBUILD_SHARED_LIBS=OFF \ + -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_SKIP_RPATH=ON \ -DOpenGL_GL_PREFERENCE=GLVND \ + -DPYTHON_VERSION=%{python3_version} \ + -DPYTHON_INCLUDE_DIRS=%{_includedir} \ + -DPYTHON_INCLUDE_CONFIG_DIR=%{_prefix} \ + -DPYTHON_LIBPATH=%{python3_version} \ + -DPYTHON_LIBRARY=%{_libdir}/%{python3_version} \ + -DPYTHON_ROOT_DIR=%{_prefix} \ %{?_without_ffmpeg:-DWITH_CODEC_FFMPEG=OFF} \ + -DWITH_ALEMBIC=ON \ + -DWITH_OPENVDB=ON \ + -DWITH_OPENVDB_BLOSC=ON \ -DWITH_CYCLES=%{cyclesflag} \ - -DWITH_CYCLES_EMBREE=%{cyclesflag} \ -%ifnarch %{ix86} armv7hl - -DWITH_CYCLES_OSL=%{cyclesflag} \ -%endif +%if %{with embree} + -DEMBREE_ROOT_DIR=%{_prefix} \ + -DWITH_CYCLES_EMBREE=%{cyclesflag} \ +%endif +%if %{with openshading} + -DOSL_COMPILER=g++ \ + -DOSL_ROOT_DIR=%{_prefix} \ + -DWITH_CYCLES_OSL=%{cyclesflag} \ +%endif +%if %{with opensubdiv} + -DWITH_OPENSUBDIV=ON \ +%endif +%if %{with oidn} + -DWITH_OPENIMAGEDENOISE=ON \ + -DOPENIMAGEDENOISE_LIBRARY=%{_libdir} \ + -DOPENIMAGEDENOISE_INCLUDE_DIR=%{_includedir} \ +%endif -DWITH_DOC_MANPAGE=ON \ -DWITH_INSTALL_PORTABLE=OFF \ + -DWITH_PYTHON=ON \ -DWITH_PYTHON_INSTALL=OFF \ -DWITH_PYTHON_INSTALL_REQUESTS=OFF \ -DWITH_PYTHON_SAFETY=ON \ - -DWITH_SDL=ON \ - -DWITH_SYSTEM_LZO=ON \ - . -%cmake_build + -DWITH_SYSTEM_GLOG=OFF +%cmake3_build %install -%cmake_install +%cmake3_install # Thumbnailer @@ -279,6 +319,9 @@ appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/%{name}-fonts. %{_metainfodir}/%{name}-fonts.metainfo.xml %changelog +* Wed Jul 29 2020 Luya Tshimbalanga - 1:2.83.3-3 +- Use cmake macros for build and install + * Mon Jul 27 2020 Fedora Release Engineering - 1:2.83.3-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild @@ -288,7 +331,6 @@ appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/%{name}-fonts. * Thu Jul 09 2020 Luya Tshimbalanga - 1:2.83.2-2 - Add openshadinglanguage dependency -- Use cmake macros for build and install - Reenable upstream patch to build on Python 3.9 for Fedora 33+ (#1843100) * Thu Jul 09 2020 Luya Tshimbalanga - 1:2.83.2-1