Re: Need assistance to build openshadinglanguage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Saturday, 11 July 2020 20:04:17 CEST you wrote:
> On Saturday, 11 July 2020 18:46:18 CEST Luya Tshimbalanga wrote:
> > Hello team,
> > 
> > I attempt to build openshadinglanguage. For some reasons, cmake keeps on
> > claiming c++14 is required for LLVM10 despite the inclusion of
> > parameter. Can someone investigate it?
> > 
> > Build result:
> > 
> > https://download.copr.fedorainfracloud.org/results/luya/openshadinglanguag
> > e/ fedora-rawhide-x86_64/01547329-openshadinglanguage/
> > 
> > Thanks
> 
> Hey,
> 
> I think the issue is that you run %make_build in the wrong directory: you
> starting cmake to do an out of source build with -B build, but you run
> %make_build in the top source directory. Since the project provide a
> Makefile wrapper around CMake in the top directory, it is trying to
> reconfigure the project with this default Makefile.
> 
> Correct way should be passing -C build to both %make_build and
> %make_install:
> 
> %cmake \
>    -B build \
>    -DUSE_BOOST_WAVE=ON \
>    -DUSE_PARTIO=OFF \
>    -DCMAKE_CXX_STANDARD=14 \
>    -DLLVM_STATIC=0 \
>    -DENABLERTTI=ON \
>    -DSTOP_ON_WARNING=OFF \
>    ..
> %make_build -C build
> 
> %install
> %make_install -C build

Here's a full SPEC bused on the Tumbleweed one.
It handles some quirks about the package, like proper shaders location and 
location of the OpenImageIO plugin.



# Required for the plugin directory name, see https://github.com/OpenImageIO/
oiio/issues/2583
%define oiio_major_minor_ver %(rpm -q --queryformat='%%{version}' OpenImageIO-
devel | cut -d . -f 1-2)

Name:           openshadinglanguage
Version:        1.11.6.0
Release:        1%{?dist}
Summary:        Advanced shading language for production GI renderers

License:        BSD
URL:            https://github.com/imageworks/OpenShadingLanguage
Source:         %{url}/archive/Release-%{version}-dev.tar.gz

BuildRequires:  bison
BuildRequires:  boost-devel >= 1.55
BuildRequires:  clang-devel >= 7
BuildRequires:  cmake >= 3.12
BuildRequires:  flex
BuildRequires:  gcc-c++
BuildRequires:  llvm-devel
BuildRequires:  meson
BuildRequires:  pkgconfig(IlmBase)
BuildRequires:  pkgconfig(OpenImageIO) >= 2.0
BuildRequires:  pkgconfig(OpenEXR)
BuildRequires:  pkgconfig(pugixml)
BuildRequires:  pkgconfig(python3)
BuildRequires:  pkgconfig(Qt5)
# Compression
BuildRequires:  pkgconfig(zlib)

%description
Open Shading Language (OSL) is a small but rich language for programmable
shading in advanced renderers and other applications, ideal for describing
materials, lights, displacement, and pattern generation.

%package doc
Summary:        Documentation for OpenShadingLanguage
License:        CC-BY
BuildArch:      noarch
Requires:       %{name} = %{version}

%description doc
Open Shading Language (OSL) is a language for programmable shading
in advanced renderers and other applications, ideal for describing
materials, lights, displacement, and pattern generation.
This package contains documentation.

%package MaterialX-shaders-source
Summary:        MaterialX shader nodes
License:        BSD
BuildArch:      noarch
Requires:       %{name} = %{version}-%{release}
Requires:       %{name}-common-headers

%description MaterialX-shaders-source
Open Shading Language (OSL) is a language for programmable shading
in advanced renderers and other applications, ideal for describing
materials, lights, displacement, and pattern generation.

This package contains the code for the MaterialX shader nodes.

%package example-shaders-source
Summary:        OSL shader examples
License:        BSD
BuildArch:      noarch
Requires:       %{name} = %{version}-%{release}
Requires:       %{name}-common-headers

%description example-shaders-source
Open Shading Language (OSL) is a language for programmable shading
in advanced renderers and other applications, ideal for describing
materials, lights, displacement, and pattern generation.

This package contains some OSL example shaders.

%package common-headers
Summary:        OSL standard library and auxiliary headers
License:        BSD
BuildArch:      noarch
Requires:       %{name} = %{version}-%{release}

%description common-headers
Open Shading Language (OSL) is a language for programmable shading
in advanced renderers and other applications, ideal for describing
materials, lights, displacement, and pattern generation.

This package contains the OSL standard library headers, as well
as some additional headers useful for writing shaders.

%package -n OpenImageIO-plugin-osl
Summary:        OpenImageIO input plugin
License:        BSD

%description -n OpenImageIO-plugin-osl
Open Shading Language (OSL) is a language for programmable shading
in advanced renderers and other applications, ideal for describing
materials, lights, displacement, and pattern generation.

This is a plugin to access OSL from OpenImageIO.

%package        libs
Summary:        OpenShadingLanguage's libraries
License:        BSD

%description    libs
Open Shading Language (OSL) is a language for programmable shading
in advanced renderers and other applications, ideal for describing
materials, lights, displacement, and pattern generation.


%package        devel
Summary:        Development files for %{name}
License:        BSD
Requires:       %{name}-libs%{?_isa} = %{version}-%{release}

%description    devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.

%prep
%autosetup -n OpenShadingLanguage-Release-%{version}-dev
# Use python3 binary instead of unversioned python
sed -i -e "s/COMMAND python/COMMAND python3/" $(find . -iname CMakeLists.txt)

%build
%cmake \
   -B build \
   -DUSE_BOOST_WAVE=ON \
   -DUSE_PARTIO=OFF \
   -DCMAKE_CXX_STANDARD=14 \
   -DLLVM_STATIC=0 \
   -DENABLERTTI=ON \
   -DSTOP_ON_WARNING=OFF \
   -DOSL_BUILD_MATERIALX:BOOL=ON \
   -DCMAKE_INSTALL_DOCDIR:PATH=%{_docdir}/%{name} \
   -DOSL_SHADER_INSTALL_DIR:PATH=%{_datadir}/%{name}/shaders/

%make_build -C build

%install
%make_install -C build

# Move the OpenImageIO plugin into its default search path
mkdir %{buildroot}%{_libdir}/OpenImageIO-%{oiio_major_minor_ver}
mv %{buildroot}%{_libdir}/osl.imageio.so %{buildroot}%{_libdir}/OpenImageIO-%
{oiio_major_minor_ver}/

%files
%license LICENSE
%doc CHANGES.md CONTRIBUTING.md README.md
%{_bindir}/oslc
%{_bindir}/oslinfo
%{_bindir}/osltoy
%{_bindir}/testrender
%{_bindir}/testshade
%{_bindir}/testshade_dso

%files doc
%license LICENSE
%doc %{_docdir}/%{name}/

%files MaterialX-shaders-source
%{_datadir}/%{name}/shaders/MaterialX

%files example-shaders-source
%{_datadir}/%{name}/shaders/*.osl
%{_datadir}/%{name}/shaders/*.oso

%files common-headers
%dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}/shaders
%{_datadir}/%{name}/shaders/*.h

%files -n OpenImageIO-plugin-osl
%license LICENSE
%{_libdir}/OpenImageIO-%{oiio_major_minor_ver}/osl.imageio.so
   
%files libs
%license LICENSE
%{_libdir}/libosl*.so.1*
%{_libdir}/libtestshade.so.1*

%files devel
%{_includedir}/OSL/
%{_libdir}/libosl*.so
%{_libdir}/libtestshade.so
%{_libdir}/cmake/
%{_libdir}/pkgconfig/

%changelog
* Mon Feb 17 2020 Luya Tshimbalanga <luya@xxxxxxxxxxxxxxxxx> - 1.11.6.0-1
- Initial build

_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux