diff --git a/0001-Fix-typo-in-the-.pc.in-files-that-botched-the-versio.patch b/0001-Fix-typo-in-the-.pc.in-files-that-botched-the-versio.patch new file mode 100644 index 0000000..88b18b0 --- /dev/null +++ b/0001-Fix-typo-in-the-.pc.in-files-that-botched-the-versio.patch @@ -0,0 +1,51 @@ +From 38413a86dc8782048089077a07b2347bf430dc02 Mon Sep 17 00:00:00 2001 +From: Larry Gritz +Date: Sat, 9 May 2020 12:48:09 -0700 +Subject: [PATCH] Fix typo in the .pc.in files that botched the version (#1168) + +Signed-off-by: Larry Gritz +--- + src/build-scripts/oslcomp.pc.in | 2 +- + src/build-scripts/oslexec.pc.in | 2 +- + src/build-scripts/oslquery.pc.in | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/build-scripts/oslcomp.pc.in b/src/build-scripts/oslcomp.pc.in +index 00244fd1..63cf7a9f 100644 +--- a/src/build-scripts/oslcomp.pc.in ++++ b/src/build-scripts/oslcomp.pc.in +@@ -6,6 +6,6 @@ includedir=${prefix}/include + Name: oslcomp + Description: oslcomp Compile OSL shaders from source + URL: https://github.com/imageworks/OpenShadingLanguage +-Version: @PACKAGE_VERSION_MAJOR@.@PACKAGE_VERSION_MINOR@.@PACKAGE_VERSION_PATCH@ ++Version: @PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@ + Libs: -L${libdir} -loslcomp + Cflags: -I${includedir} +diff --git a/src/build-scripts/oslexec.pc.in b/src/build-scripts/oslexec.pc.in +index e29cf9a1..1ad264c2 100644 +--- a/src/build-scripts/oslexec.pc.in ++++ b/src/build-scripts/oslexec.pc.in +@@ -6,6 +6,6 @@ includedir=${prefix}/include + Name: oslexec + Description: oslexec Execute compiled OSL shaders + URL: https://github.com/imageworks/OpenShadingLanguage +-Version: @PACKAGE_VERSION_MAJOR@.@PACKAGE_VERSION_MINOR@.@PACKAGE_VERSION_PATCH@ ++Version: @PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@ + Libs: -L${libdir} -loslexec + Cflags: -I${includedir} +diff --git a/src/build-scripts/oslquery.pc.in b/src/build-scripts/oslquery.pc.in +index 060cd4c0..4da229b2 100644 +--- a/src/build-scripts/oslquery.pc.in ++++ b/src/build-scripts/oslquery.pc.in +@@ -6,6 +6,6 @@ includedir=${prefix}/include + Name: oslquery + Description: oslquery Query parameters of OSL compiled shaders + URL: https://github.com/imageworks/OpenShadingLanguage +-Version: @PACKAGE_VERSION_MAJOR@.@PACKAGE_VERSION_MINOR@.@PACKAGE_VERSION_PATCH@ ++Version: @PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@ + Libs: -L${libdir} -loslquery + Cflags: -I${includedir} +-- +2.26.2 + diff --git a/0001-Generalize-lookup-of-stdosl.h-in-install-directory-a.patch b/0001-Generalize-lookup-of-stdosl.h-in-install-directory-a.patch deleted file mode 100644 index a2171b6..0000000 --- a/0001-Generalize-lookup-of-stdosl.h-in-install-directory-a.patch +++ /dev/null @@ -1,147 +0,0 @@ -From b01c5510a1bc825a5bf90155ca926844fd679430 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20Br=C3=BCns?= -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 /shaders, which does not -fit the needs of most Linux distributions, where 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 - - #include "oslcomp_pvt.h" -+#include "oslcomp_shaders_dir.h" - - #include - #include -@@ -485,6 +486,14 @@ find_stdoslpath (const std::vector& 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 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 - diff --git a/0001-LLVM-10-odds-and-ends-1135.patch b/0001-LLVM-10-odds-and-ends-1135.patch new file mode 100644 index 0000000..d307bd0 --- /dev/null +++ b/0001-LLVM-10-odds-and-ends-1135.patch @@ -0,0 +1,94 @@ +From 2683cfdc41e66f7681c68a6f1b85e0a26fb00a86 Mon Sep 17 00:00:00 2001 +From: Larry Gritz +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 + diff --git a/0001-Some-SPI-build-fixes-for-finding-the-right-llvm.patch b/0001-Some-SPI-build-fixes-for-finding-the-right-llvm.patch new file mode 100644 index 0000000..06bb1dc --- /dev/null +++ b/0001-Some-SPI-build-fixes-for-finding-the-right-llvm.patch @@ -0,0 +1,133 @@ +From ca90dc60c0f6473ff99fa0b396af4d434862bc1b Mon Sep 17 00:00:00 2001 +From: Larry Gritz +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 + diff --git a/0001-Use-single-shared-clang-cpp-library-starting-with-LL.patch b/0001-Use-single-shared-clang-cpp-library-starting-with-LL.patch new file mode 100644 index 0000000..b91ce4c --- /dev/null +++ b/0001-Use-single-shared-clang-cpp-library-starting-with-LL.patch @@ -0,0 +1,41 @@ +From 891061d02a71ce1a5aad6807063b69f8e38e174a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20Br=C3=BCns?= +Date: Wed, 13 May 2020 20:23:49 +0200 +Subject: [PATCH] Use single shared clang-cpp library starting with LLVM 9 + +Since 9.0 LLVM defaults to building a single clang-cpp library for +non-developer builds. + +As this is just the default, and some distributions enable it only with +LLVM 10 (e.g. Fedora), make the clang-cpp search dependent on the build +mode. +--- + src/cmake/modules/FindLLVM.cmake | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/src/cmake/modules/FindLLVM.cmake b/src/cmake/modules/FindLLVM.cmake +index 8b17ad8e..21a87f38 100644 +--- a/src/cmake/modules/FindLLVM.cmake ++++ b/src/cmake/modules/FindLLVM.cmake +@@ -79,6 +79,18 @@ if (NOT LLVM_LIBRARY) + set (LLVM_LIBRARY "${LLVM_LIBRARIES}") + endif () + ++execute_process (COMMAND ${LLVM_CONFIG} --shared-mode ++ OUTPUT_VARIABLE LLVM_SHARED_MODE ++ OUTPUT_STRIP_TRAILING_WHITESPACE) ++if (LLVM_VERSION VERSION_GREATER_EQUAL 9.0 AND (LLVM_SHARED_MODE STREQUAL "shared")) ++ find_library ( _CLANG_CPP_LIBRARY ++ NAMES "clang-cpp" ++ PATHS ${LLVM_LIB_DIR}) ++ if (_CLANG_CPP_LIBRARY) ++ list (APPEND CLANG_LIBRARIES ${_CLANG_CPP_LIBRARY}) ++ endif () ++endif () ++ + foreach (COMPONENT clangFrontend clangDriver clangSerialization + clangParse clangSema clangAnalysis clangAST clangBasic + clangEdit clangLex) +-- +2.26.2 + diff --git a/OpenShadingLanguage-Release-1.10.7.tar.gz b/OpenShadingLanguage-Release-1.10.7.tar.gz deleted file mode 100644 index db7015d..0000000 --- a/OpenShadingLanguage-Release-1.10.7.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0c4cce505e2803baa55db11744adb72fad854c2a4cc4f02592f79324ac5bfda1 -size 13542717 diff --git a/OpenShadingLanguage-Release-1.11.4.1.tar.gz b/OpenShadingLanguage-Release-1.11.4.1.tar.gz new file mode 100644 index 0000000..8b2e6c1 --- /dev/null +++ b/OpenShadingLanguage-Release-1.11.4.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8d8f2a1544f537f5ff3fc033195e023546c51dadd700849ed5aaaf0cf5fb24dd +size 15083497 diff --git a/OpenShadingLanguage.changes b/OpenShadingLanguage.changes index 5bd5644..8c336f8 100644 --- a/OpenShadingLanguage.changes +++ b/OpenShadingLanguage.changes @@ -1,3 +1,37 @@ +------------------------------------------------------------------- +Wed May 13 19:11:41 UTC 2020 - Stefan Brüns + +- Use the correct CMake variable to set the shader install location. +- Replace osl-pkgconfig-versions.patch with correct upstream + 0001-Fix-typo-in-the-.pc.in-files-that-botched-the-versio.patch +- Adapt to LLVM 9/10 changes defaulting to single clang-cpp library, + add 0001-Use-single-shared-clang-cpp-library-starting-with-LL.patch + instead of mangling CMake output. +- Dropped osl-oslimageio-soname.patch, which erroneously adds a + version to the OpenImageIO plugin, voiding any chance for + OIIO to find and load the plugin. +- Rename the osl.imageio package to OpenImageIO-plugin-osl, to + better reflect its purpose, install the plugin to the default + OpenImageIO plugin directory. +- Use python3 for the build process. + +------------------------------------------------------------------- +Tue Apr 21 09:54:50 UTC 2020 - Dave Plater + +- 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 diff --git a/OpenShadingLanguage.spec b/OpenShadingLanguage.spec index c24c69e..34f8fd5 100644 --- a/OpenShadingLanguage.spec +++ b/OpenShadingLanguage.spec @@ -1,7 +1,7 @@ # # spec file for package OpenShadingLanguage # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,32 +19,39 @@ # 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 . _) +# 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.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 +URL: https://github.com/imageworks/OpenShadingLanguage +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 +# PATCH-FIX-UPSTREAM +Patch0: 0001-LLVM-10-odds-and-ends-1135.patch +# PATCH-FIX-UPSTREAM +Patch1: 0001-Some-SPI-build-fixes-for-finding-the-right-llvm.patch +# PATCH-FIX-UPSTREAM +Patch2: 0001-Fix-typo-in-the-.pc.in-files-that-botched-the-versio.patch +# PATCH-FIX-UPSTREAM - https://github.com/imageworks/OpenShadingLanguage/pull/1171 +Patch3: 0001-Use-single-shared-clang-cpp-library-starting-with-LL.patch +BuildRequires: OpenEXR-devel BuildRequires: bison -BuildRequires: cmake -BuildRequires: cmake(pugixml) -BuildRequires: clang-devel >= 4 +BuildRequires: clang-devel >= 7 +BuildRequires: cmake >= 3.12 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: python +BuildRequires: pkg-config +BuildRequires: python3-base +BuildRequires: cmake(OpenImageIO) >= 2.0 +BuildRequires: cmake(pugixml) Requires: %{name}-common-headers = %{version} Recommends: %{name}-doc = %{version} @@ -160,16 +167,20 @@ 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 -n osl.imageio%{sufx} -Summary: Shader interface to OpenImageIO functions +%package -n OpenImageIO-plugin-osl +Summary: OpenImageIO input plugin License: BSD-3-Clause Group: System/Libraries +Obsoletes: osl.imageio < 1.11.4.1 +Provides: osl.imageio = %{version} -%description -n osl.imageio%{sufx} +%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 devel Summary: Development files for %{name} License: BSD-3-Clause @@ -180,30 +191,34 @@ Requires: liboslexec%{sufx} = %{version} Requires: liboslnoise%{sufx} = %{version} Requires: liboslquery%{sufx} = %{version} Requires: libtestshade%{sufx} = %{version} -Requires: osl.imageio%{sufx} = %{version} %description devel 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 +find . -iname CMakeLists.txt -exec sed "-i" "-e s/COMMAND python/COMMAND python3/" "{}" \; %build %cmake \ -DCMAKE_INSTALL_DOCDIR:PATH=%{_docdir}/%{name} \ - -DOSL_INSTALL_SHADERDIR:PATH=%{_datadir}/%{name} - -make %{?_smp_mflags} + -DOSL_SHADER_INSTALL_DIR:PATH=%{_datadir}/%{name}/shaders/ \ + -DCMAKE_CXX_STANDARD:STRING=14 +%cmake_build %install %cmake_install # Add Creative Commons license for documentation cp -v %{SOURCE1} . +# 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}/ find %{buildroot} -name LICENSE -print -delete -find %{buildroot} -type f -name "*.la" -delete -print +find %{buildroot} -name README.md -print -delete +find %{buildroot} -name CHANGES.md -print -delete %post -n liboslcomp%{sufx} -p /sbin/ldconfig %postun -n liboslcomp%{sufx} -p /sbin/ldconfig @@ -220,10 +235,8 @@ find %{buildroot} -type f -name "*.la" -delete -print %post -n libtestshade%{sufx} -p /sbin/ldconfig %postun -n libtestshade%{sufx} -p /sbin/ldconfig -%post -n osl.imageio%{sufx} -p /sbin/ldconfig -%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}/%{name}/shaders/MaterialX %files example-shaders-source -%_datadir/%{name}/shaders/*.osl -%_datadir/%{name}/shaders/*.oso +%{_datadir}/%{name}/shaders/*.osl +%{_datadir}/%{name}/shaders/*.oso %files common-headers -%dir %_datadir/%{name} -%dir %_datadir/%{name}/shaders -%_datadir/%{name}/shaders/*.h +%dir %{_datadir}/%{name} +%dir %{_datadir}/%{name}/shaders +%{_datadir}/%{name}/shaders/*.h %files -n liboslcomp%{sufx} %license LICENSE @@ -262,13 +275,15 @@ find %{buildroot} -type f -name "*.la" -delete -print %license LICENSE %{_libdir}/libtestshade.so.%{sover}* -%files -n osl.imageio%{sufx} +%files -n OpenImageIO-plugin-osl %license LICENSE -%{_libdir}/osl.imageio.so.%{sover}* +%{_libdir}/OpenImageIO-%{oiio_major_minor_ver}/osl.imageio.so %files devel %license LICENSE %{_includedir}/* -%{_libdir}/*.so +%{_libdir}/lib*.so +%{_libdir}/cmake/ +%{_libdir}/pkgconfig/ %changelog