forked from pool/OpenShadingLanguage
Accepting request 796879 from home:plater:blender
- Update to v1.11.4.1 to fix build with LLVM10. - Remove incorporated patch: 0001-Generalize-lookup-of-stdosl.h-in-install-directory-a.patch Added patches from git: 0001-Some-SPI-build-fixes-for-finding-the-right-llvm.patch and 0001-LLVM-10-odds-and-ends-1135.patch. - Created osl-pkgconfig-versions.patch to fix pc file's version fields. Upstreamed along with workaround for new libclang-cpp in issue #1155 Created osl-oslimageio-soname.patch to keep the library build in line with v1.x. OBS-URL: https://build.opensuse.org/request/show/796879 OBS-URL: https://build.opensuse.org/package/show/graphics/OpenShadingLanguage?expand=0&rev=11
This commit is contained in:
parent
1d8ebb2e7a
commit
1c4af470c7
@ -1,147 +0,0 @@
|
||||
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
|
||||
customization
|
||||
|
||||
Currently, shaders are installed in <PREFIX>/shaders, which does not
|
||||
fit the needs of most Linux distributions, where <PREFIX> is typically
|
||||
/usr/, and architecture independent data like the shaders should be
|
||||
installed in e.g. /usr/share/OpenShadingLanguage/shaders/.
|
||||
|
||||
Typically, CMAKE_INSTALL_DATADIR is used for this case, but this would
|
||||
break the current scheme. Introduce an OSL specific option instead,
|
||||
OSL_INSTALL_SHADERDIR (default ""), which can be used to specify an
|
||||
absolute or relative path for the shader installation.
|
||||
|
||||
Usage (relative to CMAKE_INSTALL_PREFIX):
|
||||
$> cmake -DCMAKE_INSTALL_PREFIX=/usr/ \
|
||||
-DOSL_INSTALL_SHADERDIR=share/OpenShadingLanguage
|
||||
|
||||
Same effect, using absolute paths:
|
||||
$> cmake -DCMAKE_INSTALL_PREFIX=/usr/ \
|
||||
-DOSL_INSTALL_SHADERDIR=/usr/share/OpenShadingLanguage
|
||||
|
||||
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 | 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, 31 insertions(+), 2 deletions(-)
|
||||
create mode 100644 src/liboslcomp/oslcomp_shaders_dir.h.in
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 3722d68..cb5320e 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -53,6 +53,15 @@ if (CMAKE_USE_FOLDERS)
|
||||
set_property (GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
endif ()
|
||||
|
||||
+option (OSL_INSTALL_SHADERDIR "Shader install directory, absolute or relative (to CMAKE_INSTALL_PREFIX)" "")
|
||||
+mark_as_advanced (OSL_INSTALL_SHADERDIR)
|
||||
+if (IS_ABSOLUTE ${OSL_INSTALL_SHADERDIR})
|
||||
+ set (INSTALL_FULL_SHADERDIR ${OSL_INSTALL_SHADERDIR})
|
||||
+else()
|
||||
+ set (INSTALL_FULL_SHADERDIR "${CMAKE_INSTALL_PREFIX}/${OSL_INSTALL_SHADERDIR}")
|
||||
+endif()
|
||||
+message (STATUS "Shader install dir = ${INSTALL_FULL_SHADERDIR}")
|
||||
+
|
||||
include (GNUInstallDirs)
|
||||
|
||||
list (APPEND CMAKE_MODULE_PATH
|
||||
diff --git a/src/liboslcomp/CMakeLists.txt b/src/liboslcomp/CMakeLists.txt
|
||||
index 549aa54..a91a1b5 100644
|
||||
--- a/src/liboslcomp/CMakeLists.txt
|
||||
+++ b/src/liboslcomp/CMakeLists.txt
|
||||
@@ -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 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.
|
||||
#include <cerrno>
|
||||
|
||||
#include "oslcomp_pvt.h"
|
||||
+#include "oslcomp_shaders_dir.h"
|
||||
|
||||
#include <OpenImageIO/platform.h>
|
||||
#include <OpenImageIO/sysutil.h>
|
||||
@@ -485,6 +486,14 @@ find_stdoslpath (const std::vector<std::string>& includepaths)
|
||||
}
|
||||
}
|
||||
|
||||
+ // Try the regular install directory
|
||||
+ std::string install_path = OSL_SHADERS_INSTALL_DIR;
|
||||
+ if (OIIO::Filesystem::is_directory (install_path)) {
|
||||
+ install_path = install_path + "/stdosl.h";
|
||||
+ if (OIIO::Filesystem::exists (install_path))
|
||||
+ return ustring(install_path);
|
||||
+ }
|
||||
+
|
||||
// Try looking for "oslc" binary in the $PATH, and if so, look in
|
||||
// ../../shaders/stdosl.h
|
||||
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 0000000..0638252
|
||||
--- /dev/null
|
||||
+++ b/src/liboslcomp/oslcomp_shaders_dir.h.in
|
||||
@@ -0,0 +1,7 @@
|
||||
+#ifndef OSL_SHADERS_INSTALL_DIR
|
||||
+
|
||||
+// Keep this in sync with the DESTINATION in shaders/CMakeLists.txt
|
||||
+// and shaders/MaterialX/CMakeLists.txt
|
||||
+#define OSL_SHADERS_INSTALL_DIR "@INSTALL_FULL_SHADERDIR@/shaders/"
|
||||
+
|
||||
+#endif // OSL_SHADERS_INSTALL_DIR
|
||||
diff --git a/src/liboslexec/CMakeLists.txt b/src/liboslexec/CMakeLists.txt
|
||||
index 9f39444..fce411b 100644
|
||||
--- a/src/liboslexec/CMakeLists.txt
|
||||
+++ b/src/liboslexec/CMakeLists.txt
|
||||
@@ -41,6 +41,7 @@ if (NOT BUILDSTATIC)
|
||||
endif ()
|
||||
|
||||
include_directories ( "${CMAKE_SOURCE_DIR}/src/liboslcomp" )
|
||||
+include_directories ( "${CMAKE_BINARY_DIR}/src/liboslcomp" )
|
||||
|
||||
FILE ( GLOB exec_headers "*.h" )
|
||||
FILE ( GLOB compiler_headers "../liboslcomp/*.h" )
|
||||
diff --git a/src/shaders/CMakeLists.txt b/src/shaders/CMakeLists.txt
|
||||
index 9b263ff..594c09c 100644
|
||||
--- a/src/shaders/CMakeLists.txt
|
||||
+++ b/src/shaders/CMakeLists.txt
|
||||
@@ -63,4 +63,4 @@ add_custom_target (shaders ALL
|
||||
SOURCES ${shader_source} ${shader_headers})
|
||||
|
||||
install (FILES ${shader_headers} ${shader_source} ${shader_objs}
|
||||
- DESTINATION shaders)
|
||||
+ DESTINATION ${INSTALL_FULL_SHADERDIR}/shaders)
|
||||
diff --git a/src/shaders/MaterialX/CMakeLists.txt b/src/shaders/MaterialX/CMakeLists.txt
|
||||
index 88b52f3..42384da 100644
|
||||
--- a/src/shaders/MaterialX/CMakeLists.txt
|
||||
+++ b/src/shaders/MaterialX/CMakeLists.txt
|
||||
@@ -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}
|
||||
- DESTINATION shaders/MaterialX)
|
||||
+ DESTINATION ${INSTALL_FULL_SHADERDIR}/shaders/MaterialX)
|
||||
|
||||
--
|
||||
2.24.0
|
||||
|
94
0001-LLVM-10-odds-and-ends-1135.patch
Normal file
94
0001-LLVM-10-odds-and-ends-1135.patch
Normal file
@ -0,0 +1,94 @@
|
||||
From 2683cfdc41e66f7681c68a6f1b85e0a26fb00a86 Mon Sep 17 00:00:00 2001
|
||||
From: Larry Gritz <lg@larrygritz.com>
|
||||
Date: Tue, 31 Mar 2020 08:21:01 -0700
|
||||
Subject: [PATCH] LLVM 10 odds and ends (#1135)
|
||||
|
||||
* Use llvm 10 in some CI tests
|
||||
|
||||
* build_llvm: New download location for llvm 10
|
||||
|
||||
* Build time check that LLVM 10+ requires C++ >= 14
|
||||
---
|
||||
.github/workflows/workflow.yml | 22 ++++++++++++++++++++--
|
||||
src/build-scripts/build_llvm.bash | 7 ++++++-
|
||||
src/cmake/externalpackages.cmake | 5 ++++-
|
||||
3 files changed, 30 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml
|
||||
index b331fca9..4ef8a2ee 100644
|
||||
--- a/.github/workflows/workflow.yml
|
||||
+++ b/.github/workflows/workflow.yml
|
||||
@@ -111,8 +111,26 @@ jobs:
|
||||
source src/build-scripts/gh-installdeps.bash
|
||||
source src/build-scripts/ci-build-and-test.bash
|
||||
|
||||
+ linux-2021ish-gcc8-llvm9:
|
||||
+ name: "Linux gcc8, C++17, llvm10, oiio master, avx2, exr2.4"
|
||||
+ runs-on: ubuntu-18.04
|
||||
+ steps:
|
||||
+ - uses: actions/checkout@v1
|
||||
+ - name: all
|
||||
+ env:
|
||||
+ CXX: g++-8
|
||||
+ CMAKE_CXX_STANDARD: 17
|
||||
+ LLVM_VERSION: 10.0.0
|
||||
+ USE_SIMD: avx2,f16c
|
||||
+ OPENEXR_VERSION: 2.4.0
|
||||
+ OPENIMAGEIO_BRANCH: master
|
||||
+ run: |
|
||||
+ source src/build-scripts/ci-startup.bash
|
||||
+ source src/build-scripts/gh-installdeps.bash
|
||||
+ source src/build-scripts/ci-build-and-test.bash
|
||||
+
|
||||
linux-bleeding:
|
||||
- name: "Linux bleeding edge: gcc8, C++17, llvm9, oiio master, avx2, exr2.4"
|
||||
+ name: "Linux bleeding edge: gcc8, C++17, llvm10, oiio master, avx2, exr2.4"
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
@@ -121,7 +139,7 @@ jobs:
|
||||
CXX: g++-8
|
||||
USE_CPP: 17
|
||||
CMAKE_CXX_STANDARD: 17
|
||||
- LLVM_VERSION: 9.0.0
|
||||
+ LLVM_VERSION: 10.0.0
|
||||
USE_SIMD: avx2,f16c
|
||||
OPENEXR_VERSION: 2.4.0
|
||||
OPENIMAGEIO_BRANCH: master
|
||||
diff --git a/src/build-scripts/build_llvm.bash b/src/build-scripts/build_llvm.bash
|
||||
index b0fdf591..3b25b64e 100755
|
||||
--- a/src/build-scripts/build_llvm.bash
|
||||
+++ b/src/build-scripts/build_llvm.bash
|
||||
@@ -24,7 +24,12 @@ if [[ `uname` == "Linux" ]] ; then
|
||||
LLVMTAR=clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-${LLVM_DISTRO_NAME}.tar.xz
|
||||
fi
|
||||
echo LLVMTAR = $LLVMTAR
|
||||
- curl --location http://releases.llvm.org/${LLVM_VERSION}/${LLVMTAR} -o $LLVMTAR
|
||||
+ if [ "$LLVM_VERSION" == "10.0.0" ] ; then
|
||||
+ # new
|
||||
+ curl --location https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/${LLVMTAR} -o $LLVMTAR
|
||||
+ else
|
||||
+ curl --location http://releases.llvm.org/${LLVM_VERSION}/${LLVMTAR} -o $LLVMTAR
|
||||
+ fi
|
||||
ls -l $LLVMTAR
|
||||
tar xf $LLVMTAR
|
||||
rm -f $LLVMTAR
|
||||
diff --git a/src/cmake/externalpackages.cmake b/src/cmake/externalpackages.cmake
|
||||
index 5afb9664..62f9b7fd 100644
|
||||
--- a/src/cmake/externalpackages.cmake
|
||||
+++ b/src/cmake/externalpackages.cmake
|
||||
@@ -223,7 +223,10 @@ add_definitions (-DOSL_LLVM_FULL_VERSION="${LLVM_VERSION}")
|
||||
if (LLVM_NAMESPACE)
|
||||
add_definitions ("-DLLVM_NAMESPACE=${LLVM_NAMESPACE}")
|
||||
endif ()
|
||||
-
|
||||
+if (LLVM_VERSION VERSION_GREATER_EQUAL 10.0.0 AND
|
||||
+ CMAKE_CXX_STANDARD VERSION_LESS 14)
|
||||
+ message (FATAL_ERROR "LLVM 10+ requires C++14 or higher.")
|
||||
+endif ()
|
||||
|
||||
checked_find_package (partio)
|
||||
|
||||
--
|
||||
2.16.4
|
||||
|
133
0001-Some-SPI-build-fixes-for-finding-the-right-llvm.patch
Normal file
133
0001-Some-SPI-build-fixes-for-finding-the-right-llvm.patch
Normal file
@ -0,0 +1,133 @@
|
||||
From ca90dc60c0f6473ff99fa0b396af4d434862bc1b Mon Sep 17 00:00:00 2001
|
||||
From: Larry Gritz <lg@larrygritz.com>
|
||||
Date: Mon, 30 Mar 2020 21:05:24 -0700
|
||||
Subject: [PATCH] Some SPI build fixes for finding the right llvm
|
||||
|
||||
---
|
||||
site/spi/Makefile-bits | 63 ++++++++++++++++++++++++++++++++------------------
|
||||
1 file changed, 41 insertions(+), 22 deletions(-)
|
||||
|
||||
diff --git a/site/spi/Makefile-bits b/site/spi/Makefile-bits
|
||||
index 4b148191..15eeca0e 100644
|
||||
--- a/site/spi/Makefile-bits
|
||||
+++ b/site/spi/Makefile-bits
|
||||
@@ -66,11 +66,13 @@ endif
|
||||
ifeq (${SP_OS}, rhel7)
|
||||
# Rhel7 (current)
|
||||
platform := rhel7
|
||||
- SPI_COMPILER_PLATFORM ?= gcc-4.8
|
||||
- ifeq (${SPI_COMPILER_PLATFORM},gcc-6.3)
|
||||
- SPCOMP2_COMPILER ?= gcc63
|
||||
- else
|
||||
+ SPI_COMPILER_PLATFORM ?= gcc-6.3
|
||||
+ ifeq (${SPI_COMPILER_PLATFORM},gcc-4.8)
|
||||
SPCOMP2_COMPILER ?= gcc48m64
|
||||
+ CMAKE_CXX_STANDARD ?= 11
|
||||
+ else
|
||||
+ SPCOMP2_COMPILER ?= gcc63
|
||||
+ CMAKE_CXX_STANDARD ?= 14
|
||||
endif
|
||||
SP_PLATFORM ?= linux
|
||||
SP_PROC ?= x86_64
|
||||
@@ -100,7 +102,6 @@ SPCOMP2_ROOT ?= /shots/spi/home/lib/SpComp2
|
||||
|
||||
## Rhel7 (current)
|
||||
ifeq (${SP_OS}, rhel7)
|
||||
- CMAKE_CXX_STANDARD ?= 11
|
||||
USE_SIMD ?= sse4.1,aes
|
||||
CMAKE ?= cmake
|
||||
USE_NINJA ?= 1
|
||||
@@ -128,23 +129,22 @@ ifeq (${SP_OS}, rhel7)
|
||||
LLVM_DIRECTORY ?= /shots/spi/home/lib/arnold/rhel7/llvm_8.0.0
|
||||
ifeq (${COMPILER},clang6)
|
||||
LLVM_DIRECTORY := /shots/spi/home/lib/arnold/rhel7/llvm_6.0.1
|
||||
- MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang -DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
|
||||
- MY_CMAKE_FLAGS += -DCMAKE_C_FLAGS="--gcc-toolchain=/usr" -DCMAKE_CXX_FLAGS="--gcc-toolchain=/usr"
|
||||
+ MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang \
|
||||
+ -DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
|
||||
else ifeq (${COMPILER},clang7)
|
||||
LLVM_DIRECTORY := /shots/spi/home/lib/arnold/rhel7/llvm_7.0.1
|
||||
- MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang -DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
|
||||
- MY_CMAKE_FLAGS += -DCMAKE_C_FLAGS="--gcc-toolchain=/usr" -DCMAKE_CXX_FLAGS="--gcc-toolchain=/usr"
|
||||
+ MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang \
|
||||
+ -DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
|
||||
else ifeq (${COMPILER},clang8)
|
||||
LLVM_DIRECTORY := /shots/spi/home/lib/arnold/rhel7/llvm_8.0.0
|
||||
- MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang -DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
|
||||
- MY_CMAKE_FLAGS += -DCMAKE_C_FLAGS="--gcc-toolchain=/usr" -DCMAKE_CXX_FLAGS="--gcc-toolchain=/usr"
|
||||
+ MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang \
|
||||
+ -DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
|
||||
else ifeq (${COMPILER},clang9)
|
||||
- LLVM_DIRECTORY := /shots/spi/home/software/packages/llvm/9.0.0/${SPI_COMPILER_PLATFORM}
|
||||
- MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang -DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
|
||||
- MY_CMAKE_FLAGS += -DCMAKE_C_FLAGS="--gcc-toolchain=/usr" -DCMAKE_CXX_FLAGS="--gcc-toolchain=/usr"
|
||||
+ LLVM_DIRECTORY := /shots/spi/home/software/packages/llvm/9.0.1-1/${SPI_COMPILER_PLATFORM}
|
||||
+ MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang \
|
||||
+ -DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
|
||||
else ifeq (${COMPILER},clang)
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
|
||||
- MY_CMAKE_FLAGS += -DCMAKE_C_FLAGS="--gcc-toolchain=/usr" -DCMAKE_CXX_FLAGS="--gcc-toolchain=/usr"
|
||||
else ifeq (${COMPILER}, gcc6)
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_C_COMPILER=/opt/rh/devtoolset-6/root/usr/bin/gcc \
|
||||
@@ -156,9 +156,11 @@ ifeq (${SP_OS}, rhel7)
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang \
|
||||
-DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
|
||||
- MY_CMAKE_FLAGS += -DCMAKE_C_FLAGS="--gcc-toolchain=/usr" \
|
||||
- -DCMAKE_CXX_FLAGS="--gcc-toolchain=/usr" \
|
||||
- -DTOOLCHAIN_FLAGS="--gcc-toolchain=/usr"
|
||||
+ endif
|
||||
+ ifeq (${SPI_COMPILER_PLATFORM},gcc-4.8)
|
||||
+ MY_CMAKE_FLAGS += -DCMAKE_C_FLAGS="--gcc-toolchain=/usr" \
|
||||
+ -DCMAKE_CXX_FLAGS="--gcc-toolchain=/usr" \
|
||||
+ -DTOOLCHAIN_FLAGS="--gcc-toolchain=/usr"
|
||||
endif
|
||||
|
||||
MY_CMAKE_FLAGS +=
|
||||
@@ -292,6 +294,7 @@ ifeq (${SP_OS}, rhel7)
|
||||
|
||||
## Generic OSX machines (including LG's laptop)
|
||||
else ifeq (${platform}, macosx)
|
||||
+ CMAKE_CXX_STANDARD ?= 14
|
||||
USE_SIMD ?= sse4.2
|
||||
MY_CMAKE_FLAGS += -DCMAKE_BUILD_WITH_INSTALL_RPATH=1
|
||||
MY_CMAKE_FLAGS += -DCMAKE_INSTALL_NAME_DIR="${working_dir}/dist/${platform}${variant}/lib"
|
||||
@@ -317,14 +320,30 @@ else ifeq (${platform}, macosx)
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_C_COMPILER=gcc-8 -DCMAKE_CXX_COMPILER=g++-8
|
||||
USE_LIBCPLUSPLUS := 0
|
||||
+ else ifeq (${COMPILER}, gcc9)
|
||||
+ MY_CMAKE_FLAGS += \
|
||||
+ -DCMAKE_C_COMPILER=gcc-9 -DCMAKE_CXX_COMPILER=g++-9
|
||||
+ USE_LIBCPLUSPLUS := 0
|
||||
else ifeq (${COMPILER},clang6)
|
||||
- MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=/usr/local/Cellar/llvm@6/6.0.1_1/bin/clang -DCMAKE_CXX_COMPILER=/usr/local/Cellar/llvm@6/6.0.1_1/bin/clang++
|
||||
+ MY_CMAKE_FLAGS += \
|
||||
+ -DCMAKE_C_COMPILER=/usr/local/Cellar/llvm@6/6.0.1_2/bin/clang \
|
||||
+ -DCMAKE_CXX_COMPILER=/usr/local/Cellar/llvm@6/6.0.1_2/bin/clang++
|
||||
else ifeq (${COMPILER},clang7)
|
||||
- MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=/usr/local/Cellar/llvm@7/7.0.1/bin/clang -DCMAKE_CXX_COMPILER=/usr/local/Cellar/llvm@7/7.0.1/bin/clang++
|
||||
+ MY_CMAKE_FLAGS += \
|
||||
+ -DCMAKE_C_COMPILER=/usr/local/Cellar/llvm@7/7.0.1_1/bin/clang \
|
||||
+ -DCMAKE_CXX_COMPILER=/usr/local/Cellar/llvm@7/7.0.1_1/bin/clang++
|
||||
else ifeq (${COMPILER},clang8)
|
||||
- MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=/usr/local/Cellar/llvm/8.0.1/bin/clang -DCMAKE_CXX_COMPILER=/usr/local/Cellar/llvm/8.0.1/bin/clang++
|
||||
+ MY_CMAKE_FLAGS += \
|
||||
+ -DCMAKE_C_COMPILER=/usr/local/Cellar/llvm@8/8.0.1_1/bin/clang \
|
||||
+ -DCMAKE_CXX_COMPILER=/usr/local/Cellar/llvm/8.0.1/bin/clang++
|
||||
else ifeq (${COMPILER},clang9)
|
||||
- MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=/usr/local/Cellar/llvm/9.0.0/bin/clang -DCMAKE_CXX_COMPILER=/usr/local/Cellar/llvm/9.0.0/bin/clang++
|
||||
+ MY_CMAKE_FLAGS += \
|
||||
+ -DCMAKE_C_COMPILER=/usr/local/Cellar/llvm@9/9.0.1/bin/clang \
|
||||
+ -DCMAKE_CXX_COMPILER=/usr/local/Cellar/llvm@9/9.0.1/bin/clang++
|
||||
+ else ifeq (${COMPILER},clang10)
|
||||
+ MY_CMAKE_FLAGS += \
|
||||
+ -DCMAKE_C_COMPILER=/usr/local/Cellar/llvm/10.0.0/bin/clang \
|
||||
+ -DCMAKE_CXX_COMPILER=/usr/local/Cellar/llvm/10.0.0/bin/clang++
|
||||
else ifeq (${COMPILER},clang)
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
|
||||
else ifeq (${COMPILER},gcc)
|
||||
--
|
||||
2.16.4
|
||||
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0c4cce505e2803baa55db11744adb72fad854c2a4cc4f02592f79324ac5bfda1
|
||||
size 13542717
|
3
OpenShadingLanguage-Release-1.11.4.1.tar.gz
Normal file
3
OpenShadingLanguage-Release-1.11.4.1.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8d8f2a1544f537f5ff3fc033195e023546c51dadd700849ed5aaaf0cf5fb24dd
|
||||
size 15083497
|
@ -1,3 +1,20 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue Apr 21 09:54:50 UTC 2020 - Dave Plater <davejplater@gmail.com>
|
||||
|
||||
- Update to v1.11.4.1 to fix build with LLVM10.
|
||||
- Remove incorporated patch:
|
||||
0001-Generalize-lookup-of-stdosl.h-in-install-directory-a.patch
|
||||
- Added patches from git:
|
||||
0001-Some-SPI-build-fixes-for-finding-the-right-llvm.patch and
|
||||
0001-LLVM-10-odds-and-ends-1135.patch.
|
||||
- Created osl-pkgconfig-versions.patch to fix pc file's version
|
||||
fields. Upstreamed along with workaround for new libclang-cpp in
|
||||
issue #1155
|
||||
- Created osl-oslimageio-soname.patch to keep the library build in
|
||||
line with v1.x.
|
||||
- For many upstream changes since v1.10.7 see:
|
||||
/usr/share/doc/packages/OpenShadingLanguage/CHANGES.md
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Nov 6 15:45:59 UTC 2019 - Stefan Brüns <stefan.bruens@rwth-aachen.de>
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package OpenShadingLanguage
|
||||
#
|
||||
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@ -19,32 +19,36 @@
|
||||
# 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 . _)
|
||||
# LLVM version is needed because -lclang-cpp doesn't exist < 10
|
||||
%define llvm_version %(llvm-config --version | cut -d . -f 1)
|
||||
|
||||
Name: OpenShadingLanguage
|
||||
Version: 1.10.7
|
||||
Version: 1.11.4.1
|
||||
Release: 0
|
||||
Summary: A language for programmable shading
|
||||
License: BSD-3-Clause
|
||||
Group: Productivity/Graphics/Other
|
||||
Url: https://github.com/imageworks/OpenShadingLanguage
|
||||
Source0: https://github.com/imageworks/OpenShadingLanguage/archive/Release-%{version}.tar.gz#/%{name}-Release-%{version}.tar.gz
|
||||
Source0: https://github.com/imageworks/OpenShadingLanguage/archive/Release-%{version}-dev.tar.gz#/%{name}-Release-%{version}.tar.gz
|
||||
Source1: https://creativecommons.org/licenses/by/3.0/legalcode.txt
|
||||
#PATCH-FIX-UPSTREAM 0001-Generalize-lookup-of-stdosl.h-in-install-directory-a.patch
|
||||
#https://github.com/imageworks/OpenShadingLanguage/issues/955
|
||||
Patch0: 0001-Generalize-lookup-of-stdosl.h-in-install-directory-a.patch
|
||||
Patch0: 0001-LLVM-10-odds-and-ends-1135.patch
|
||||
Patch1: 0001-Some-SPI-build-fixes-for-finding-the-right-llvm.patch
|
||||
Patch2: osl-pkgconfig-versions.patch
|
||||
Patch3: osl-oslimageio-soname.patch
|
||||
BuildRequires: OpenEXR-devel
|
||||
BuildRequires: OpenImageIO-devel >= 2.0
|
||||
BuildRequires: bison
|
||||
BuildRequires: cmake
|
||||
BuildRequires: cmake(pugixml)
|
||||
BuildRequires: clang-devel >= 4
|
||||
BuildRequires: cmake
|
||||
BuildRequires: flex
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: libboost_filesystem-devel
|
||||
BuildRequires: libboost_system-devel
|
||||
BuildRequires: libboost_thread-devel
|
||||
BuildRequires: libboost_wave-devel
|
||||
BuildRequires: OpenEXR-devel
|
||||
BuildRequires: OpenImageIO-devel >= 1.8
|
||||
BuildRequires: pkg-config
|
||||
BuildRequires: python
|
||||
BuildRequires: cmake(pugixml)
|
||||
Requires: %{name}-common-headers = %{version}
|
||||
Recommends: %{name}-doc = %{version}
|
||||
|
||||
@ -187,14 +191,20 @@ The %{name}-devel package contains libraries and header files for
|
||||
developing applications that use %{name}.
|
||||
|
||||
%prep
|
||||
%setup -q -n %{name}-Release-%{version}
|
||||
%patch0 -p1
|
||||
%setup -q -n %{name}-Release-%{version}-dev
|
||||
%autopatch -p1
|
||||
echo "Using LLVM%{llvm_version}"
|
||||
|
||||
%build
|
||||
%cmake \
|
||||
-DCMAKE_INSTALL_DOCDIR:PATH=%{_docdir}/%{name} \
|
||||
-DOSL_INSTALL_SHADERDIR:PATH=%{_datadir}/%{name}
|
||||
|
||||
-DOSL_INSTALL_SHADERDIR:PATH=%{_datadir}/%{name} \
|
||||
-DCMAKE_CXX_STANDARD:STRING=14
|
||||
%if 0%{?llvm_version} >= 10
|
||||
# Add missing -lclang-cpp to linker scripts for liboslcomp and liboslexec
|
||||
sed -i 's/\-ldl /\-ldl \-lclang-cpp /' src/liboslexec/CMakeFiles/oslexec.dir/link.txt
|
||||
sed -i 's/\-ldl /\-ldl \-lclang-cpp /' src/liboslcomp/CMakeFiles/oslcomp.dir/link.txt
|
||||
%endif
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
@ -203,6 +213,8 @@ make %{?_smp_mflags}
|
||||
cp -v %{SOURCE1} .
|
||||
|
||||
find %{buildroot} -name LICENSE -print -delete
|
||||
find %{buildroot} -name README.md -print -delete
|
||||
find %{buildroot} -name CHANGES.md -print -delete
|
||||
find %{buildroot} -type f -name "*.la" -delete -print
|
||||
|
||||
%post -n liboslcomp%{sufx} -p /sbin/ldconfig
|
||||
@ -224,6 +236,7 @@ find %{buildroot} -type f -name "*.la" -delete -print
|
||||
%postun -n osl.imageio%{sufx} -p /sbin/ldconfig
|
||||
|
||||
%files
|
||||
%license LICENSE
|
||||
%{_bindir}/*
|
||||
|
||||
%files doc
|
||||
@ -231,16 +244,16 @@ find %{buildroot} -type f -name "*.la" -delete -print
|
||||
%doc %{_docdir}/%{name}/
|
||||
|
||||
%files MaterialX-shaders-source
|
||||
%_datadir/%{name}/shaders/MaterialX
|
||||
%{_datadir}/OSL/shaders/MaterialX
|
||||
|
||||
%files example-shaders-source
|
||||
%_datadir/%{name}/shaders/*.osl
|
||||
%_datadir/%{name}/shaders/*.oso
|
||||
%{_datadir}/OSL/shaders/*.osl
|
||||
%{_datadir}/OSL/shaders/*.oso
|
||||
|
||||
%files common-headers
|
||||
%dir %_datadir/%{name}
|
||||
%dir %_datadir/%{name}/shaders
|
||||
%_datadir/%{name}/shaders/*.h
|
||||
%dir %{_datadir}/OSL
|
||||
%dir %{_datadir}/OSL/shaders
|
||||
%{_datadir}/OSL/shaders/*.h
|
||||
|
||||
%files -n liboslcomp%{sufx}
|
||||
%license LICENSE
|
||||
@ -270,5 +283,7 @@ find %{buildroot} -type f -name "*.la" -delete -print
|
||||
%license LICENSE
|
||||
%{_includedir}/*
|
||||
%{_libdir}/*.so
|
||||
%{_libdir}/cmake/
|
||||
%{_libdir}/pkgconfig/
|
||||
|
||||
%changelog
|
||||
|
33
osl-oslimageio-soname.patch
Normal file
33
osl-oslimageio-soname.patch
Normal file
@ -0,0 +1,33 @@
|
||||
From: Dave Plater <davejplater@gmail.com>
|
||||
Date: Fri 24 Apr 08:52:18 SAST 2020
|
||||
Subject: input: reenable shared library build osl.imageio.so
|
||||
Upstream: submitted
|
||||
|
||||
The build mistakes version 1.11 for > 2.1 and builds osl.imageio.so as
|
||||
a plugin. This would mean relocating it to a plugin directory.Index: b/src/osl.imageio/CMakeLists.txt
|
||||
===================================================================
|
||||
--- a/src/osl.imageio/CMakeLists.txt 2020-03-24 07:33:42.000000000 +0200
|
||||
+++ b/src/osl.imageio/CMakeLists.txt 2020-04-22 09:31:43.152642764 +0200
|
||||
@@ -28,20 +28,16 @@ macro (add_oiio_plugin)
|
||||
|
||||
# Get the name of the current directory and use it as the target name.
|
||||
get_filename_component (_plugin_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
||||
- if (OPENIMAGEIO_VERSION VERSION_LESS 2.1)
|
||||
# Prior to OIIO 2.1, OIIO built plugin modules as shared libs rather
|
||||
# than "modules". On OSX, that changed its extension from ".dylib"
|
||||
# to ".so". If building against OIIO < 2.1, do it the old way.
|
||||
# This clause can disappear when OIIO 2.1 is the minimum that OSL
|
||||
# supports.
|
||||
- add_library (${_plugin_name} SHARED ${_plugin_UNPARSED_ARGUMENTS})
|
||||
- set_target_properties (${_plugin_name}
|
||||
+ add_library (${_plugin_name} SHARED ${_plugin_UNPARSED_ARGUMENTS})
|
||||
+ set_target_properties (${_plugin_name}
|
||||
PROPERTIES
|
||||
VERSION ${OSL_VERSION_MAJOR}.${OSL_VERSION_MINOR}.${OSL_VERSION_PATCH}
|
||||
SOVERSION ${SOVERSION} )
|
||||
- else ()
|
||||
- add_library (${_plugin_name} MODULE ${_plugin_UNPARSED_ARGUMENTS})
|
||||
- endif ()
|
||||
|
||||
target_compile_definitions (${_plugin_name} PRIVATE
|
||||
${_plugin_DEFINITIONS})
|
22
osl-pkgconfig-versions.patch
Normal file
22
osl-pkgconfig-versions.patch
Normal file
@ -0,0 +1,22 @@
|
||||
From: Dave Plater <davejplater@gmail.com>
|
||||
Date: Tue 21 Apr 10:49:01 SAST 2020
|
||||
Subject: input: Fix version field in pc files
|
||||
Upstream: submitted
|
||||
|
||||
CMakeLists.txt fails to provide Version:
|
||||
@PACKAGE_VERSION_MAJOR@.@PACKAGE_VERSION_MINOR@.@PACKAGE_VERSION_PATCH@
|
||||
for pc files resulting in a Version: field of ..
|
||||
This patch adds the above variables.diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 9877af9a..4b84c7a9 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -50,6 +50,9 @@ set (OSO_FILE_VERSION_MINOR 0)
|
||||
# This needs to be early, for CMAKE_INSTALL_FULL_DATADIR
|
||||
include (GNUInstallDirs)
|
||||
|
||||
+set (PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
|
||||
+set (PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
|
||||
+set (PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
|
||||
|
||||
option (VERBOSE "Print lots of messages while compiling" OFF)
|
||||
set (${PROJ_NAME}_NAMESPACE ${PROJECT_NAME} CACHE STRING
|
Loading…
Reference in New Issue
Block a user