1
0
Dominique Leuenberger 2019-11-07 22:18:40 +00:00 committed by Git OBS Bridge
commit 3e4aa6079a
5 changed files with 58 additions and 46 deletions

View File

@ -1,4 +1,4 @@
From 2e80787bfadd3d02064d72f7d5374d07bc0225cc Mon Sep 17 00:00:00 2001
From b01c5510a1bc825a5bf90155ca926844fd679430 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Sun, 13 Jan 2019 01:50:59 +0100
Subject: [PATCH] Generalize lookup of stdosl.h in install directory, allow
@ -26,17 +26,17 @@ The configured path is added to the stdosl.h path lookup, i.e. for
the example above "/usr/share/OpenShadingLanguage/shaders/stdosl.h".
---
CMakeLists.txt | 9 +++++++++
src/liboslcomp/CMakeLists.txt | 2 ++
src/liboslcomp/CMakeLists.txt | 3 +++
src/liboslcomp/oslcomp.cpp | 9 +++++++++
src/liboslcomp/oslcomp_shaders_dir.h.in | 7 +++++++
src/liboslexec/CMakeLists.txt | 1 +
src/shaders/CMakeLists.txt | 2 +-
src/shaders/MaterialX/CMakeLists.txt | 2 +-
7 files changed, 30 insertions(+), 2 deletions(-)
7 files changed, 31 insertions(+), 2 deletions(-)
create mode 100644 src/liboslcomp/oslcomp_shaders_dir.h.in
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 02feab53..05d5e959 100644
index 3722d68..cb5320e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -53,6 +53,15 @@ if (CMAKE_USE_FOLDERS)
@ -54,22 +54,23 @@ index 02feab53..05d5e959 100644
+
include (GNUInstallDirs)
set (CMAKE_MODULE_PATH
list (APPEND CMAKE_MODULE_PATH
diff --git a/src/liboslcomp/CMakeLists.txt b/src/liboslcomp/CMakeLists.txt
index 549aa549..15d9d026 100644
index 549aa54..a91a1b5 100644
--- a/src/liboslcomp/CMakeLists.txt
+++ b/src/liboslcomp/CMakeLists.txt
@@ -29,6 +29,8 @@ else ()
@@ -29,6 +29,9 @@ else ()
endif ()
+configure_file ( oslcomp_shaders_dir.h.in oslcomp_shaders_dir.h )
+target_include_directories ( oslcomp PRIVATE "${CMAKE_BINARY_DIR}/src/liboslcomp" )
+
TARGET_LINK_LIBRARIES ( oslcomp ${OPENIMAGEIO_LIBRARIES} ${ILMBASE_LIBRARIES}
${Boost_LIBRARIES} ${CMAKE_DL_LIBS}
${CLANG_LIBRARIES} ${LLVM_LIBRARIES} ${LLVM_LDFLAGS}
diff --git a/src/liboslcomp/oslcomp.cpp b/src/liboslcomp/oslcomp.cpp
index a89212aa..d4deda70 100644
index 76145dd..db1ec06 100644
--- a/src/liboslcomp/oslcomp.cpp
+++ b/src/liboslcomp/oslcomp.cpp
@@ -36,6 +36,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@ -80,7 +81,7 @@ index a89212aa..d4deda70 100644
#include <OpenImageIO/platform.h>
#include <OpenImageIO/sysutil.h>
@@ -478,6 +479,14 @@ find_stdoslpath (const std::vector<std::string>& includepaths)
@@ -485,6 +486,14 @@ find_stdoslpath (const std::vector<std::string>& includepaths)
}
}
@ -97,7 +98,7 @@ index a89212aa..d4deda70 100644
std::vector<std::string> exec_path_dirs;
diff --git a/src/liboslcomp/oslcomp_shaders_dir.h.in b/src/liboslcomp/oslcomp_shaders_dir.h.in
new file mode 100644
index 00000000..0638252f
index 0000000..0638252
--- /dev/null
+++ b/src/liboslcomp/oslcomp_shaders_dir.h.in
@@ -0,0 +1,7 @@
@ -109,7 +110,7 @@ index 00000000..0638252f
+
+#endif // OSL_SHADERS_INSTALL_DIR
diff --git a/src/liboslexec/CMakeLists.txt b/src/liboslexec/CMakeLists.txt
index eb8f0fa9..ff5595cc 100644
index 9f39444..fce411b 100644
--- a/src/liboslexec/CMakeLists.txt
+++ b/src/liboslexec/CMakeLists.txt
@@ -41,6 +41,7 @@ if (NOT BUILDSTATIC)
@ -121,7 +122,7 @@ index eb8f0fa9..ff5595cc 100644
FILE ( GLOB exec_headers "*.h" )
FILE ( GLOB compiler_headers "../liboslcomp/*.h" )
diff --git a/src/shaders/CMakeLists.txt b/src/shaders/CMakeLists.txt
index 9b263ffa..594c09cb 100644
index 9b263ff..594c09c 100644
--- a/src/shaders/CMakeLists.txt
+++ b/src/shaders/CMakeLists.txt
@@ -63,4 +63,4 @@ add_custom_target (shaders ALL
@ -131,10 +132,10 @@ index 9b263ffa..594c09cb 100644
- DESTINATION shaders)
+ DESTINATION ${INSTALL_FULL_SHADERDIR}/shaders)
diff --git a/src/shaders/MaterialX/CMakeLists.txt b/src/shaders/MaterialX/CMakeLists.txt
index 98f54840..d134fcde 100644
index 88b52f3..42384da 100644
--- a/src/shaders/MaterialX/CMakeLists.txt
+++ b/src/shaders/MaterialX/CMakeLists.txt
@@ -196,5 +196,5 @@ add_custom_target (mxshaders ALL
@@ -258,5 +258,5 @@ add_custom_target (mxshaders ALL
SOURCES ${shader_source} ${mx_shader_headers})
install (FILES ${mx_shader_headers} ${mx_shader_objs} ${mx_shader_osls}
@ -142,5 +143,5 @@ index 98f54840..d134fcde 100644
+ DESTINATION ${INSTALL_FULL_SHADERDIR}/shaders/MaterialX)
--
2.20.1
2.24.0

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0c4cce505e2803baa55db11744adb72fad854c2a4cc4f02592f79324ac5bfda1
size 13542717

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2bcd1d835f210dbc9e73f1d8892bb15c067d269cbb7b77d9fe5054e2f4fee394
size 15451839

View File

@ -1,3 +1,28 @@
-------------------------------------------------------------------
Wed Nov 6 15:45:59 UTC 2019 - Stefan Brüns <stefan.bruens@rwth-aachen.de>
- Properly rebase 0001-Generalize-lookup-of-stdosl.h-in-install-directory-a.patch
avoid workarounds in the spec file.
- Remove conditional code for Leap 42.x
- Reflect required versions of OpenIIO and Clang in the spec file.
-------------------------------------------------------------------
Wed Nov 6 11:38:51 UTC 2019 - Dave Plater <davejplater@gmail.com>
- Update to release 1.10.7 which fixes build with new llvm.
- Rebased:
0001-Generalize-lookup-of-stdosl.h-in-install-directory-a.patch
- Recent upstream changes:
*Adjust for deprecated material in more recent Qt releases. #1043
*Fixes for MinGW compiler. #1047
*Texture "missingalpha" optional parameter generated incorrect
code and crashed. #1044
*Fix incorrect optimizations surrounding 'exit()' calls in the
middle of certain shader code blocks. #1051
*LLVM 9 / clang 9 compatibility. #1058
*Fixes to Travis CI system to keep up with OIIO master recently
upgrading its minimum required CMake. #1065
-------------------------------------------------------------------
Sun Jan 13 02:21:24 UTC 2019 - Stefan Brüns <stefan.bruens@rwth-aachen.de>

View File

@ -15,16 +15,13 @@
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
# The library soname versions follow the package version major and minor numbers.
%define sover %(echo %{version} | cut -d . -f 1,2)
%define sufx %(echo %{sover}|tr . _)
#NOTE: This package was created for blender, blender doesn't build against
# the 1.10.x ABI. If there is the need to update to such a version please consult me
# first davejplater@gmail.com or suffix the package with a 110 or something.
Name: OpenShadingLanguage
Version: 1.9.13
Version: 1.10.7
Release: 0
Summary: A language for programmable shading
License: BSD-3-Clause
@ -38,27 +35,15 @@ Patch0: 0001-Generalize-lookup-of-stdosl.h-in-install-directory-a.patch
BuildRequires: bison
BuildRequires: cmake
BuildRequires: cmake(pugixml)
%if 0%{suse_version} >= 1500
BuildRequires: clang-devel
%else
BuildRequires: llvm-clang-devel >= 3.8
BuildRequires: ncurses-devel
%endif
BuildRequires: clang-devel >= 4
BuildRequires: flex
BuildRequires: gcc-c++
%if 0%{suse_version} >= 1500
BuildRequires: libboost_filesystem-devel
BuildRequires: libboost_system-devel
BuildRequires: libboost_thread-devel
BuildRequires: libboost_wave-devel
%else
# The default 1.54 is to old, 1.61 has unresolvable
# symbols in boost::wave (C++ ABI issue?)
BuildRequires: boost-devel >= 1.55.0
BuildConflicts: boost-devel >= 1.61.0
%endif
BuildRequires: OpenImageIO-devel
BuildRequires: OpenEXR-devel
BuildRequires: OpenImageIO-devel >= 1.8
BuildRequires: python
Requires: %{name}-common-headers = %{version}
Recommends: %{name}-doc = %{version}
@ -85,6 +70,7 @@ This package contains documentation.
%package MaterialX-shaders-source
Summary: MaterialX shader nodes
License: BSD-3-Clause
Group: Development/Languages/Other
Requires: %{name} = %{version}
Requires: %{name}-common-headers
@ -98,6 +84,7 @@ This package contains the code for the MaterialX shader nodes.
%package example-shaders-source
Summary: OSL shader examples
License: BSD-3-Clause
Group: Development/Languages/Other
Requires: %{name} = %{version}
Requires: %{name}-common-headers
@ -111,6 +98,7 @@ This package contains some OSL example shaders.
%package common-headers
Summary: OSL standard library and auxiliary headers
License: BSD-3-Clause
Group: Development/Languages/Other
Requires: %{name} = %{version}
@ -124,6 +112,7 @@ as some additional headers useful for writing shaders.
%package -n liboslcomp%{sufx}
Summary: OpenShadingLanguage's compiler component library
License: BSD-3-Clause
Group: System/Libraries
%description -n liboslcomp%{sufx}
@ -133,6 +122,7 @@ materials, lights, displacement, and pattern generation.
%package -n liboslexec%{sufx}
Summary: OpenShadingLanguage's execution component library
License: BSD-3-Clause
Group: System/Libraries
%description -n liboslexec%{sufx}
@ -142,6 +132,7 @@ materials, lights, displacement, and pattern generation.
%package -n liboslnoise%{sufx}
Summary: OpenShadingLanguage's image noise generation library
License: BSD-3-Clause
Group: System/Libraries
%description -n liboslnoise%{sufx}
@ -151,6 +142,7 @@ materials, lights, displacement, and pattern generation.
%package -n liboslquery%{sufx}
Summary: Osl library
License: BSD-3-Clause
Group: System/Libraries
%description -n liboslquery%{sufx}
@ -160,6 +152,7 @@ materials, lights, displacement, and pattern generation.
%package -n libtestshade%{sufx}
Summary: Osl library
License: BSD-3-Clause
Group: System/Libraries
%description -n libtestshade%{sufx}
@ -169,6 +162,7 @@ materials, lights, displacement, and pattern generation.
%package -n osl.imageio%{sufx}
Summary: Shader interface to OpenImageIO functions
License: BSD-3-Clause
Group: System/Libraries
%description -n osl.imageio%{sufx}
@ -178,6 +172,7 @@ materials, lights, displacement, and pattern generation.
%package devel
Summary: Development files for %{name}
License: BSD-3-Clause
Group: Development/Libraries/C and C++
Requires: %{name} = %{version}
Requires: liboslcomp%{sufx} = %{version}
@ -196,15 +191,7 @@ developing applications that use %{name}.
%patch0 -p1
%build
# We use a combined LLVM on 15.0/TW, so libLLVMMCJIT is neither available nor needed
# On 42.3., we have to collect the split libraries ourselfs,
# as the supplied FindLLVM.cmake is broken
%if 0%{suse_version} < 1500
%define llvm_libs %(llvm-config --libfiles | tr ' ' ';')
%endif
%cmake \
%{?llvm_libs:-DLLVM_LIBRARY="%{llvm_libs}"} \
-DLLVM_MCJIT_LIBRARY="" \
-DCMAKE_INSTALL_DOCDIR:PATH=%{_docdir}/%{name} \
-DOSL_INSTALL_SHADERDIR:PATH=%{_datadir}/%{name}
@ -236,7 +223,6 @@ find %{buildroot} -type f -name "*.la" -delete -print
%post -n osl.imageio%{sufx} -p /sbin/ldconfig
%postun -n osl.imageio%{sufx} -p /sbin/ldconfig
%files
%{_bindir}/*