From 1c4af470c7829f7315d6756a87d18b77a71589d0e9e52554a678dd8c9c077cb9 Mon Sep 17 00:00:00 2001 From: Dave Plater Date: Fri, 24 Apr 2020 08:17:39 +0000 Subject: [PATCH 1/2] 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 --- ...p-of-stdosl.h-in-install-directory-a.patch | 147 ------------------ 0001-LLVM-10-odds-and-ends-1135.patch | 94 +++++++++++ ...ild-fixes-for-finding-the-right-llvm.patch | 133 ++++++++++++++++ OpenShadingLanguage-Release-1.10.7.tar.gz | 3 - OpenShadingLanguage-Release-1.11.4.1.tar.gz | 3 + OpenShadingLanguage.changes | 17 ++ OpenShadingLanguage.spec | 55 ++++--- osl-oslimageio-soname.patch | 33 ++++ osl-pkgconfig-versions.patch | 22 +++ 9 files changed, 337 insertions(+), 170 deletions(-) delete mode 100644 0001-Generalize-lookup-of-stdosl.h-in-install-directory-a.patch create mode 100644 0001-LLVM-10-odds-and-ends-1135.patch create mode 100644 0001-Some-SPI-build-fixes-for-finding-the-right-llvm.patch delete mode 100644 OpenShadingLanguage-Release-1.10.7.tar.gz create mode 100644 OpenShadingLanguage-Release-1.11.4.1.tar.gz create mode 100644 osl-oslimageio-soname.patch create mode 100644 osl-pkgconfig-versions.patch 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/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..7592d9d 100644 --- a/OpenShadingLanguage.changes +++ b/OpenShadingLanguage.changes @@ -1,3 +1,20 @@ +------------------------------------------------------------------- +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..ebf6ee5 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 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 diff --git a/osl-oslimageio-soname.patch b/osl-oslimageio-soname.patch new file mode 100644 index 0000000..def3eb6 --- /dev/null +++ b/osl-oslimageio-soname.patch @@ -0,0 +1,33 @@ +From: Dave Plater +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}) diff --git a/osl-pkgconfig-versions.patch b/osl-pkgconfig-versions.patch new file mode 100644 index 0000000..7036a31 --- /dev/null +++ b/osl-pkgconfig-versions.patch @@ -0,0 +1,22 @@ +From: Dave Plater +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 From 9b69c3bc12f3214f38834ca0761d25c93a13715c4d63c04dd5ca14e310699485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= Date: Sun, 17 May 2020 13:18:08 +0000 Subject: [PATCH 2/2] Accepting request 805561 from home:frispete:blender OBS-URL: https://build.opensuse.org/request/show/805561 OBS-URL: https://build.opensuse.org/package/show/graphics/OpenShadingLanguage?expand=0&rev=12 --- ....pc.in-files-that-botched-the-versio.patch | 51 +++++++++++++ ...d-clang-cpp-library-starting-with-LL.patch | 41 +++++++++++ OpenShadingLanguage.changes | 17 +++++ OpenShadingLanguage.spec | 72 +++++++++---------- osl-oslimageio-soname.patch | 33 --------- osl-pkgconfig-versions.patch | 22 ------ 6 files changed, 145 insertions(+), 91 deletions(-) create mode 100644 0001-Fix-typo-in-the-.pc.in-files-that-botched-the-versio.patch create mode 100644 0001-Use-single-shared-clang-cpp-library-starting-with-LL.patch delete mode 100644 osl-oslimageio-soname.patch delete mode 100644 osl-pkgconfig-versions.patch 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-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.changes b/OpenShadingLanguage.changes index 7592d9d..8c336f8 100644 --- a/OpenShadingLanguage.changes +++ b/OpenShadingLanguage.changes @@ -1,3 +1,20 @@ +------------------------------------------------------------------- +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 diff --git a/OpenShadingLanguage.spec b/OpenShadingLanguage.spec index ebf6ee5..34f8fd5 100644 --- a/OpenShadingLanguage.spec +++ b/OpenShadingLanguage.spec @@ -1,7 +1,7 @@ # # spec file for package OpenShadingLanguage # -# Copyright (c) 2020 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,8 +19,8 @@ # 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) +# 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.4.1 @@ -28,26 +28,29 @@ Release: 0 Summary: A language for programmable shading License: BSD-3-Clause Group: Productivity/Graphics/Other -Url: https://github.com/imageworks/OpenShadingLanguage +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 Patch0: 0001-LLVM-10-odds-and-ends-1135.patch +# PATCH-FIX-UPSTREAM Patch1: 0001-Some-SPI-build-fixes-for-finding-the-right-llvm.patch -Patch2: osl-pkgconfig-versions.patch -Patch3: osl-oslimageio-soname.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: OpenImageIO-devel >= 2.0 BuildRequires: bison -BuildRequires: clang-devel >= 4 -BuildRequires: cmake +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: pkg-config -BuildRequires: python +BuildRequires: python3-base +BuildRequires: cmake(OpenImageIO) >= 2.0 BuildRequires: cmake(pugixml) Requires: %{name}-common-headers = %{version} Recommends: %{name}-doc = %{version} @@ -164,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 @@ -184,7 +191,6 @@ 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 @@ -193,29 +199,26 @@ developing applications that use %{name}. %prep %setup -q -n %{name}-Release-%{version}-dev %autopatch -p1 -echo "Using LLVM%{llvm_version}" +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} \ + -DOSL_SHADER_INSTALL_DIR:PATH=%{_datadir}/%{name}/shaders/ \ -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} +%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} -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 %postun -n liboslcomp%{sufx} -p /sbin/ldconfig @@ -232,9 +235,6 @@ 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}/* @@ -244,16 +244,16 @@ find %{buildroot} -type f -name "*.la" -delete -print %doc %{_docdir}/%{name}/ %files MaterialX-shaders-source -%{_datadir}/OSL/shaders/MaterialX +%{_datadir}/%{name}/shaders/MaterialX %files example-shaders-source -%{_datadir}/OSL/shaders/*.osl -%{_datadir}/OSL/shaders/*.oso +%{_datadir}/%{name}/shaders/*.osl +%{_datadir}/%{name}/shaders/*.oso %files common-headers -%dir %{_datadir}/OSL -%dir %{_datadir}/OSL/shaders -%{_datadir}/OSL/shaders/*.h +%dir %{_datadir}/%{name} +%dir %{_datadir}/%{name}/shaders +%{_datadir}/%{name}/shaders/*.h %files -n liboslcomp%{sufx} %license LICENSE @@ -275,14 +275,14 @@ 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/ diff --git a/osl-oslimageio-soname.patch b/osl-oslimageio-soname.patch deleted file mode 100644 index def3eb6..0000000 --- a/osl-oslimageio-soname.patch +++ /dev/null @@ -1,33 +0,0 @@ -From: Dave Plater -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}) diff --git a/osl-pkgconfig-versions.patch b/osl-pkgconfig-versions.patch deleted file mode 100644 index 7036a31..0000000 --- a/osl-pkgconfig-versions.patch +++ /dev/null @@ -1,22 +0,0 @@ -From: Dave Plater -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