Blame luxcorerender.spec

8248545
# Force out of source build
8248545
%undefine __cmake_in_source_build
8248545
abc50bc
%global	        prerelease	beta1
f6bd46f
f6bd46f
Name:		luxcorerender
abc50bc
Version:	2.7
abc50bc
Release:	%autorelease %{?prerelease: -p -e %{prerelease}}
f6bd46f
Summary:	LuxCore Renderer, an unbiased rendering system
f6bd46f
4279ffe
License:	Apache-2.0
8567f70
URL:		https://luxcorerender.org/
a795673
Source0:	https://github.com/%{name}/LuxCore/archive/%{name}_v%{version}%{?prerelease}.tar.gz
f6bd46f
Source1:	https://github.com/%{name}/BlendLuxCore/archive/blendluxcore_v%{version}%{?prerelease}.tar.gz
2d9df7d
18dd154
# Upstream rejected appstream metainfo support
8248545
# https://github.com/LuxCoreRender/BlendLuxCore/issues/567
18dd154
Source3:        org.%{name}.blendluxcore.metainfo.xml
f6bd46f
f4b1387
# add python build dependency
2d9df7d
Patch0:         LuxCore-boost-python3.patch
ee9ad19
# Unbundle
2d9df7d
Patch1:         LuxCore-unbundle.patch
bbac79a
# Use C++ Standard 17
8248545
# Changed all uses of the boost.bind placeholders to use the boost::placeholders namespace
8248545
# https://github.com/LuxCoreRender/LuxCore/issues/449
bbac79a
Patch2:         LuxCore-use-cxx-standard-17.patch
642fcfc
# Use system bcd
2d9df7d
Patch3:         LuxCore-system-bcd.patch
31235af
# Include atomic header
2d9df7d
Patch5:         LuxCore-atomic-header.patch
afb2113
# Patch for OpenEXR and Imath 3.x
afb2113
Patch7:         luxcorerender-openexr3.patch
e132ef1
# Path for OpenImageIO 2.3
e132ef1
Patch8:         luxcorerender-oiio-2.3.patch
8567f70
# Patch for system libs when possible
8567f70
Patch9:         luxcorerender-system.patch
8567f70
Patch10:        luxcorerender-system2.patch
5da042c
# https://github.com/LuxCoreRender/LuxCore/pull/611 (Currently under review)
5da042c
# Replace boost::filesystem::ofstream with boost::nowide
5da042c
Patch11:        luxcorerender-pr611-boost_181.patch
2cea81c
# Patch for fmtlib 10
2cea81c
Patch12:        luxcorerender-fmt10.patch
f6bd46f
f4b1387
# Upstream only uses 64 bit archtecture
c25cb6f
ExclusiveArch:  x86_64
c25cb6f
c25cb6f
BuildRequires:  bison
c25cb6f
BuildRequires:  blender-rpm-macros
c25cb6f
BuildRequires:  chrpath
c25cb6f
BuildRequires:  cmake
c25cb6f
BuildRequires:  dos2unix
c25cb6f
BuildRequires:  doxygen
c25cb6f
BuildRequires:  flex
c25cb6f
BuildRequires:  gcc-c++
c25cb6f
BuildRequires:  libappstream-glib
c25cb6f
BuildRequires:  bcd-devel
c25cb6f
BuildRequires:  boost-devel
2677670
BuildRequires:  embree3-devel
c25cb6f
BuildRequires:  freeimage-devel
c25cb6f
BuildRequires:  json-devel
c25cb6f
BuildRequires:  oidn-devel
c25cb6f
BuildRequires:  opensubdiv-devel
c25cb6f
BuildRequires:  openvdb-devel
c25cb6f
BuildRequires:  pkgconfig(blosc)
8567f70
BuildRequires:  pkgconfig(expat)
c25cb6f
BuildRequires:  pkgconfig(eigen3)
8567f70
BuildRequires:  pkgconfig(glfw3)
c25cb6f
BuildRequires:  pkgconfig(gtk+-3.0)
c25cb6f
BuildRequires:  pkgconfig(libcdio)
c25cb6f
BuildRequires:  pkgconfig(libjpeg)
c25cb6f
BuildRequires:  pkgconfig(libpng)
c25cb6f
BuildRequires:  pkgconfig(libtiff-4)
afb2113
BuildRequires:  cmake(OpenEXR)
afb2113
BuildRequires:  cmake(Imath)
3291d23
BuildRequires:  cmake(OpenColorIO)
3291d23
BuildRequires:  cmake(OpenImageIO)
5b5990e
# Disable pyside2 due to incompatibility with python 3.12
5b5990e
%if 0%{?fedora} < 39
c25cb6f
BuildRequires:  pkgconfig(pyside2)
c25cb6f
BuildRequires:  pkgconfig(python3)
a7b9fa3
BuildRequires:	pkgconfig(shiboken2)
5b5990e
%endif
8567f70
BuildRequires:  pkgconfig(spdlog)
c25cb6f
BuildRequires:  pkgconfig(tbb)
8567f70
BuildRequires:  pkgconfig(yaml-cpp)
c25cb6f
BuildRequires:  python3dist(pillow)
ee9ad19
%{!?_without_opencl:
c25cb6f
BuildRequires:  pkgconfig(OpenCL)
ee9ad19
}
309c86d
c25cb6f
Requires:       %{name}-core = %{version}-%{release}
c25cb6f
Obsoletes:      LuxRender < 2.0
c25cb6f
Provides:       LuxRender = 2.0
f6bd46f
f6bd46f
%description
f6bd46f
LuxCoreRender is a rendering system for physically correct image synthesis.
f6bd46f
c25cb6f
%package        core
c25cb6f
Summary:        Core binaries for %{name}
c25cb6f
Obsoletes:      LuxRender-core < 2.0
c25cb6f
Provides:       LuxRender-core = 2.0
c25cb6f
Obsoletes:      %{name}-libs < 2.3-1
c25cb6f
Conflicts:      %{name}-libs < 2.3-1
c25cb6f
Obsoletes:      LuxRender-lib < 2.0
c25cb6f
Provides:       LuxRender-lib = 2.0
f6bd46f
c25cb6f
%description    core
f6bd46f
The %{name}-core package contains core binaries for using %{name}.
f6bd46f
c25cb6f
%package        -n blender-%{name}
c25cb6f
Summary:        Blender export plugin to %{name}
c25cb6f
Requires:       %{name}%{?_isa} = %{version}-%{release}
0ed4d64
#Requires:       blender(ABI)%%{?blender_api: = %%{blender_api}}
c25cb6f
Obsoletes:      LuxRender-blender < 2.0
c25cb6f
Provides:       LuxRender-blender = 2.0
f6bd46f
c25cb6f
%description    -n blender-%{name}
f6bd46f
The blender-%{name} package contains the plugin for Blender
f6bd46f
to export into %{name}
f6bd46f
c25cb6f
%package        devel
c25cb6f
Summary:        Development files for %{name}
c25cb6f
Provides:       LuxRender-devel = %{version}-%{release}
c25cb6f
Obsoletes:      LuxRender-devel < 2.0
f6bd46f
c25cb6f
%description        devel
f6bd46f
The %{name}-devel package contains libraries and header files for
f6bd46f
developing applications that use %{name}.
f6bd46f
c25cb6f
%package        examples
c25cb6f
Summary:        Example of application using %{name}
c25cb6f
Requires:       %{name}%{?_isa} = %{version}-%{release}
f6bd46f
c25cb6f
%description    examples
f6bd46f
The %{name}-examples package contains sample binaries using %{name}.
f6bd46f
5b5990e
%if 0%{?fedora} < 39
c25cb6f
%package        -n python3-%{name}
c25cb6f
Summary:        Python 3 interface to %{name}
c25cb6f
Requires:       blender-%{name}%{?_isa} = %{version}-%{release}
f2aac87
%{?python_provide:%python_provide python3-%{name}}
f2aac87
f2aac87
%description -n python3-%{name}
f2aac87
The python3-%{name} contains Python 3 API for the library.
5b5990e
%endif
f2aac87
a7b9fa3
%package static
a7b9fa3
Summary:	luxcorerender static libraries
a7b9fa3
Requires:	%{name}-devel = %{version}-%{release}
a7b9fa3
a7b9fa3
%description static
a7b9fa3
Static libraries for the LuxCore render.
a7b9fa3
f6bd46f
%prep
abc50bc
%autosetup -p1 -a1 -n LuxCore-%{name}_v%{version}%{?prerelease}
f6bd46f
ee9ad19
# Fix bundled deps
ee9ad19
rm -rf pywheel pyunittests
ee9ad19
rm -rf samples/luxcoreui/deps/glfw-*
8567f70
rm -rf deps/{bcd-*,expat-*,eigen-*,json-*,opencolorio-*,opensubdiv-*,spdlog-*,openvdb-*,yaml-cpp-*}
ee9ad19
# keep imgui-1.46 nfd bundled for now
2b1386f
642fcfc
# Switch to WIP system bcd
642fcfc
sed -i -e 's/bcd/bcdio bcdcore/' CMakeLists.txt tests/luxcoreimplserializationdemo/CMakeLists.txt src/luxcore/CMakeLists.txt
642fcfc
8567f70
# Link to system version
8567f70
sed -i -e 's/opencolorio/OpenColorIO/' CMakeLists.txt src/luxcore/CMakeLists.txt tests/luxcoreimplserializationdemo/CMakeLists.txt
8567f70
sed -i -e 's/OpenColorIO/OpenColorIO spdlog fmt/' CMakeLists.txt tests/luxcoreimplserializationdemo/CMakeLists.txt
8567f70
sed -i -e 's/opensubdiv/osdCPU/' CMakeLists.txt src/luxcore/CMakeLists.txt tests/luxcoreimplserializationdemo/CMakeLists.txt
8567f70
0193fe5
# Explicitly avoid using static boost library: seems needed on boost 1.78
0193fe5
%if 0%{?fedora} >= 37
0193fe5
sed -i -e '\@set.*Boost_USE_STATIC_LIBS@s|ON|OFF|' cmake/Dependencies.cmake
0193fe5
%endif
0193fe5
f6bd46f
# Fix all Python shebangs recursively in .
18dd154
%py3_shebang_fix .
f6bd46f
f6bd46f
%build
f6bd46f
#Building lux
f6bd46f
%cmake \
e4d63b1
	-DBUILD_SHARED_LIBS=ON \
e4d63b1
	-DBOOST_SEARCH_PATH=%{_libdir} \
8986ac5
	-DCMAKE_C_FLAGS="%{optflags} -Wl,--as-needed" \
8567f70
	-DCMAKE_CXX_FLAGS="%{optflags} -Wl,--as-needed -DSPDLOG_FMT_EXTERNAL" \
f6bd46f
	-DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE \
8248545
	-DOpenGL_GL_PREFERENCE=GLVND \
488ac2a
	-DPYTHON_V=%{python3_version_nodots} \
70592b2
	-DEMBREE_INCLUDE_PATH=%{_includedir}/libembree3 \
f7fcd5b
        -DEMBREE_LIBRARY=%{_libdir}/libembree3.so \
21b3995
	-DOIDN_INCLUDE_PATH=%{_includedir}/OpenImageDenoise
ab054cf
%cmake_build
f4b1387
f6bd46f
%install
ab054cf
pushd %{_vpath_builddir}
f6bd46f
mkdir -p %{buildroot}%{_bindir}
f6bd46f
mkdir -p %{buildroot}%{_datadir}/%{name}
f6bd46f
mkdir -p %{buildroot}%{_libdir}
f6bd46f
mkdir -p %{buildroot}%{_includedir}
c25cb6f
        
f6bd46f
install -Dpm 0755 bin/* %{buildroot}%{_bindir}/
a7b9fa3
install -Dpm 0755 lib/*.{a,so*} %{buildroot}%{_libdir}/
c25cb6f
        
f6bd46f
# Remove rpaths
f6bd46f
chrpath --delete %{buildroot}%{_bindir}/*
f6bd46f
chrpath --delete %{buildroot}%{_libdir}/*.so*
488ac2a
popd
c25cb6f
        
c2a5af9
# Install include files
c2a5af9
cp -pr include/{luxcore,luxrays} %{buildroot}%{_includedir}/
c25cb6f
        
c2a5af9
# Relocate pyluxcore
c2a5af9
mkdir -p %{buildroot}%{python3_sitearch}
c2a5af9
mv %{buildroot}%{_libdir}/pyluxcore.so %{buildroot}%{python3_sitearch}
f6bd46f
f6bd46f
# Import add-ons and preset
0222bc2
mkdir -p %{buildroot}%{blender_addons}/%{name}
f6bd46f
cp -a BlendLuxCore-blendluxcore_v%{version}%{?prerelease}/* \
0222bc2
  %{buildroot}%{blender_addons}/%{name}
164c025
fc78c2a
# change the search path in exporter so it finds pylux in its new location
fc78c2a
# borrowed from Arch Linux
fc78c2a
for file in `grep -rl import\ pyluxcore ${pkgdir}` ; 
c25cb6f
        do sed -i 's/from .* import pyluxcore/import pyluxcore/g' $file;
fc78c2a
done
0222bc2
rm -fr %{buildroot}%{blender_addons}/%{name}/.gitignore
f6bd46f
f6bd46f
# Metainfo for blender addon
c25cb6f
# Upstream rejected the appdata
18dd154
install -p -m 644 -D %{SOURCE3} %{buildroot}%{_metainfodir}/org.%{name}.blendluxcore.metainfo.xml
f6bd46f
f6bd46f
%check
18dd154
appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/org.%{name}.blendluxcore.metainfo.xml
f6bd46f
f6bd46f
%files
f6bd46f
%license COPYING.txt
488ac2a
%doc AUTHORS.txt
f6bd46f
f6bd46f
%files core
abc50bc
%{_bindir}/{luxcoreconsole,luxcoredemo,luxcoreimplserializationdemo,luxcorescenedemo,luxcoreui}
f6bd46f
f6bd46f
# GPLv3
f6bd46f
%files -n blender-%{name}
f6bd46f
%doc README.md
18dd154
%{_metainfodir}/org.%{name}.blendluxcore.metainfo.xml
0222bc2
%{blender_addons}/%{name}
f6bd46f
5b5990e
%if 0%{?fedora} < 39
f2aac87
%files -n python3-%{name}
f2aac87
%license COPYING.txt
f2aac87
%{python3_sitearch}/pyluxcore.so
5b5990e
%endif
f2aac87
f6bd46f
%files devel
f6bd46f
%{_includedir}/{luxcore,luxrays,slg}
5b5990e
%exclude %{python3_sitearch}/pyluxcore.so
a7b9fa3
%files static
a7b9fa3
%{_libdir}/lib{luxcore,luxrays,slg-core,slg-film,slg-kernels}.a
a7b9fa3
f6bd46f
%changelog
d363e5e
%autochangelog