From 5d733b324717d7e698efde48224de63236fc2abb Mon Sep 17 00:00:00 2001 From: Alexey Pavlov Date: Thu, 8 Oct 2020 12:20:59 +0300 Subject: [PATCH] openshadinglanguage: Update to 1.11.8.0 --- .../0003-fix-OIIO-windows.patch | 12 +++---- .../0005-Fix-cast-from-void-ptr.patch | 12 +++---- .../0007-Fix-bad-casts-with-intptr_t.patch | 2 +- .../0012-isatty-mingw.patch | 2 +- .../0013-disable-assert-partio.patch | 17 +++++++-- .../0014-fix-testshade-library-name.patch | 25 +++++++------ .../0015-llvm-linking.patch | 12 +++++++ .../0016-OIIO-API.patch | 13 +++++++ .../0017-public-structs.patch | 20 +++++++++++ mingw-w64-openshadinglanguage/PKGBUILD | 35 +++++++++++++------ 10 files changed, 110 insertions(+), 40 deletions(-) create mode 100644 mingw-w64-openshadinglanguage/0015-llvm-linking.patch create mode 100644 mingw-w64-openshadinglanguage/0016-OIIO-API.patch create mode 100644 mingw-w64-openshadinglanguage/0017-public-structs.patch diff --git a/mingw-w64-openshadinglanguage/0003-fix-OIIO-windows.patch b/mingw-w64-openshadinglanguage/0003-fix-OIIO-windows.patch index 37086c6314..c3e10b6cd6 100644 --- a/mingw-w64-openshadinglanguage/0003-fix-OIIO-windows.patch +++ b/mingw-w64-openshadinglanguage/0003-fix-OIIO-windows.patch @@ -17,14 +17,14 @@ diff -Naur openshadinglanguage-orig/src/liboslexec/llvm_ops.cpp openshadinglangu diff -Naur openshadinglanguage-orig/src/liboslexec/shadingsys.cpp openshadinglanguage/src/liboslexec/shadingsys.cpp --- openshadinglanguage-orig/src/liboslexec/shadingsys.cpp 2014-08-31 21:12:36.587200000 +0400 +++ openshadinglanguage/src/liboslexec/shadingsys.cpp 2014-08-31 21:31:52.245600000 +0400 -@@ -47,6 +47,10 @@ - #include - #include - #include +@@ -21,6 +21,10 @@ + #include + #include + #include + +#ifdef __MINGW64_VERSION_MAJOR +using OIIO::isfinite; +#endif - using namespace OSL; - using namespace OSL::pvt; + #include "opcolor.h" + diff --git a/mingw-w64-openshadinglanguage/0005-Fix-cast-from-void-ptr.patch b/mingw-w64-openshadinglanguage/0005-Fix-cast-from-void-ptr.patch index a021cc412b..5cf5ed4102 100644 --- a/mingw-w64-openshadinglanguage/0005-Fix-cast-from-void-ptr.patch +++ b/mingw-w64-openshadinglanguage/0005-Fix-cast-from-void-ptr.patch @@ -1,20 +1,20 @@ --- openshadinglanguage/src/liboslexec/automata.cpp.orig 2014-01-08 02:50:41.861748000 +0000 +++ openshadinglanguage/src/liboslexec/automata.cpp 2014-01-08 02:51:50.600679600 +0000 -@@ -137,7 +137,7 @@ +@@ -113,7 +113,7 @@ // and finally the rule if we have it if (m_rule) { s += " | "; -- s += Strutil::format("%lx", (long unsigned int)m_rule); -+ s += Strutil::format("%p", m_rule); +- s += Strutil::sprintf("%lx", (long unsigned int)m_rule); ++ s += Strutil::sprintf("%p", m_rule); } return s; } -@@ -387,7 +387,7 @@ +@@ -362,7 +362,7 @@ for (RuleSet::const_iterator i = m_rules.begin(); i != m_rules.end(); ++i) { if (s[s.size()-1] != '[') s += ", "; -- s += Strutil::format("%lx", (long unsigned int)*i); -+ s += Strutil::format("%p", *i); +- s += Strutil::sprintf("%lx", (long unsigned int)*i); ++ s += Strutil::sprintf("%p", *i); } s += "]"; } diff --git a/mingw-w64-openshadinglanguage/0007-Fix-bad-casts-with-intptr_t.patch b/mingw-w64-openshadinglanguage/0007-Fix-bad-casts-with-intptr_t.patch index 74bbc6ffd3..8ebf8ded6c 100644 --- a/mingw-w64-openshadinglanguage/0007-Fix-bad-casts-with-intptr_t.patch +++ b/mingw-w64-openshadinglanguage/0007-Fix-bad-casts-with-intptr_t.patch @@ -1,9 +1,9 @@ --- openshadinglanguage/src/liboslexec/accum_test.cpp.orig 2014-01-08 18:29:57.054742600 +0000 +++ openshadinglanguage/src/liboslexec/accum_test.cpp 2014-01-08 18:38:57.404742600 +0000 @@ -28,6 +28,7 @@ - #include #include + #include +#include using namespace OSL; diff --git a/mingw-w64-openshadinglanguage/0012-isatty-mingw.patch b/mingw-w64-openshadinglanguage/0012-isatty-mingw.patch index 3978bd1a6a..cac2a171c7 100644 --- a/mingw-w64-openshadinglanguage/0012-isatty-mingw.patch +++ b/mingw-w64-openshadinglanguage/0012-isatty-mingw.patch @@ -19,4 +19,4 @@ +#ifdef _WIN32 #include #define isatty _isatty - #endif \ No newline at end of file + #endif diff --git a/mingw-w64-openshadinglanguage/0013-disable-assert-partio.patch b/mingw-w64-openshadinglanguage/0013-disable-assert-partio.patch index 878eccbc83..9c6c0a20cd 100644 --- a/mingw-w64-openshadinglanguage/0013-disable-assert-partio.patch +++ b/mingw-w64-openshadinglanguage/0013-disable-assert-partio.patch @@ -1,13 +1,24 @@ --- OpenShadingLanguage-Release-1.10.6/src/liboslexec/pointcloud.cpp.orig 2019-07-31 23:15:48.917595100 +0300 +++ OpenShadingLanguage-Release-1.10.6/src/liboslexec/pointcloud.cpp 2019-07-31 23:16:06.701626300 +0300 -@@ -383,8 +383,8 @@ - count = maxn; +@@ -244,8 +244,8 @@ + return 0; // No "position" attribute -- fail } - static_assert (sizeof(size_t) == sizeof(Partio::ParticleIndex), -- "Only will work if Partio ParticleIndex is the size of a size_t"); +- "Partio ParticleIndex should be the size of a size_t"); + // static_assert (sizeof(size_t) == sizeof(Partio::ParticleIndex), + // "Only will work if Partio ParticleIndex is the size of a size_t"); // FIXME -- if anybody cares about an architecture in which that is not // the case, we can easily allocate local space to retrieve the indices, // then copy them back to the caller's indices. +@@ -362,8 +362,8 @@ + count = maxn; + } + +- static_assert (sizeof(size_t) == sizeof(Partio::ParticleIndex), +- "Partio ParticleIndex should be the size of a size_t"); ++ // static_assert (sizeof(size_t) == sizeof(Partio::ParticleIndex), ++ // "Partio ParticleIndex should be the size of a size_t"); + // FIXME -- if anybody cares about an architecture in which that is not + // the case, we can easily allocate local space to retrieve the indices, + // then copy them back to the caller's indices. diff --git a/mingw-w64-openshadinglanguage/0014-fix-testshade-library-name.patch b/mingw-w64-openshadinglanguage/0014-fix-testshade-library-name.patch index 73bda9bfc6..9c82d0ffc5 100644 --- a/mingw-w64-openshadinglanguage/0014-fix-testshade-library-name.patch +++ b/mingw-w64-openshadinglanguage/0014-fix-testshade-library-name.patch @@ -1,14 +1,13 @@ ---- OpenShadingLanguage-Release-1.10.11/src/testshade/CMakeLists.txt.orig 2020-06-10 10:46:40.209699400 +0300 -+++ OpenShadingLanguage-Release-1.10.11/src/testshade/CMakeLists.txt 2020-06-10 10:48:16.731089800 +0300 -@@ -20,7 +20,10 @@ - endif () - - TARGET_LINK_LIBRARIES (libtestshade oslexec oslquery ${OPENIMAGEIO_LIBRARIES} ${OPENEXR_LIBRARIES} ${Boost_LIBRARIES} ${CMAKE_DL_LIBS} ) --SET_TARGET_PROPERTIES (libtestshade PROPERTIES PREFIX "") -+set_target_properties(libtestshade PROPERTIES -+ OUTPUT_NAME testshade -+ RUNTIME_OUTPUT_NAME testshade -+ ARCHIVE_OUTPUT_NAME testshade) - - install_targets ( libtestshade ) +--- OpenShadingLanguage-Release-1.11.8.0/src/testshade/CMakeLists.txt.orig 2020-06-10 10:46:40.209699400 +0300 ++++ OpenShadingLanguage-Release-1.11.8.0/src/testshade/CMakeLists.txt 2020-06-10 10:48:16.731089800 +0300 +@@ -56,7 +56,9 @@ + PROPERTIES + VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH} + SOVERSION ${SOVERSION} +- OUTPUT_NAME libtestshade${OSL_LIBNAME_SUFFIX} ++ OUTPUT_NAME testshade ++ RUNTIME_OUTPUT_NAME libtestshade${OSL_LIBNAME_SUFFIX} ++ ARCHIVE_OUTPUT_NAME testshade + ) + target_link_libraries (libtestshade diff --git a/mingw-w64-openshadinglanguage/0015-llvm-linking.patch b/mingw-w64-openshadinglanguage/0015-llvm-linking.patch new file mode 100644 index 0000000000..6c7fad70a2 --- /dev/null +++ b/mingw-w64-openshadinglanguage/0015-llvm-linking.patch @@ -0,0 +1,12 @@ +--- OpenShadingLanguage-Release-1.11.8.0/src/cmake/modules/FindLLVM.cmake.orig 2020-10-08 11:14:41.035584100 +0300 ++++ OpenShadingLanguage-Release-1.11.8.0/src/cmake/modules/FindLLVM.cmake 2020-10-08 11:15:12.426896100 +0300 +@@ -142,6 +142,9 @@ + endif () + endif () + ++if (MINGW) ++ set (LLVM_LIBRARIES "${LLVM_LIBRARIES};-lversion") ++endif() + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args (LLVM diff --git a/mingw-w64-openshadinglanguage/0016-OIIO-API.patch b/mingw-w64-openshadinglanguage/0016-OIIO-API.patch new file mode 100644 index 0000000000..21204848db --- /dev/null +++ b/mingw-w64-openshadinglanguage/0016-OIIO-API.patch @@ -0,0 +1,13 @@ +--- OpenShadingLanguage-Release-1.11.8.0/src/liboslexec/shadingsys.cpp.orig 2020-10-08 11:06:00.929372700 +0300 ++++ OpenShadingLanguage-Release-1.11.8.0/src/liboslexec/shadingsys.cpp 2020-10-08 11:23:40.846943100 +0300 +@@ -3400,8 +3402,8 @@ + + bool ok = true; + std::string groupfilename = tmpdir + "/shadergroup"; +- std::ofstream groupfile; +- OIIO::Filesystem::open(groupfile, groupfilename); ++ OIIO::ofstream groupfile; ++ OIIO::Filesystem::open(groupfile, OIIO::string_view(groupfilename).c_str()); + if (groupfile.good()) { + groupfile << group.serialize(); + groupfile.close (); diff --git a/mingw-w64-openshadinglanguage/0017-public-structs.patch b/mingw-w64-openshadinglanguage/0017-public-structs.patch new file mode 100644 index 0000000000..ffc9df4ffc --- /dev/null +++ b/mingw-w64-openshadinglanguage/0017-public-structs.patch @@ -0,0 +1,20 @@ +--- OpenShadingLanguage-Release-1.11.8.0/src/include/OSL/llvm_util.h.orig 2020-10-08 11:48:44.613246000 +0300 ++++ OpenShadingLanguage-Release-1.11.8.0/src/include/OSL/llvm_util.h 2020-10-08 11:48:51.814905400 +0300 +@@ -74,7 +74,7 @@ + /// tied to OSL internals at all. + class OSLEXECPUBLIC LLVM_Util { + public: +- struct PerThreadInfo { ++ struct OSLEXECPUBLIC PerThreadInfo { + PerThreadInfo() {} + ~PerThreadInfo(); + private: +@@ -93,7 +93,7 @@ + // controlled by the the existence of ScopedJitMemoryUser objects. + // When the last ScopedJitMemoryUser goes out of scope or is deleted, + // then the underlying memory managers will be deleted +- struct ScopedJitMemoryUser { ++ struct OSLEXECPUBLIC ScopedJitMemoryUser { + ScopedJitMemoryUser(); + ~ScopedJitMemoryUser(); + }; diff --git a/mingw-w64-openshadinglanguage/PKGBUILD b/mingw-w64-openshadinglanguage/PKGBUILD index 62ae5e8393..ab36e3dd64 100644 --- a/mingw-w64-openshadinglanguage/PKGBUILD +++ b/mingw-w64-openshadinglanguage/PKGBUILD @@ -5,7 +5,7 @@ pkgbase=mingw-w64-${_realname} pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" conflicts=("${MINGW_PACKAGE_PREFIX}-${_realname}-git") replaces=("${MINGW_PACKAGE_PREFIX}-${_realname}-git") -pkgver=1.10.11 +pkgver=1.11.8.0 pkgrel=1 pkgdesc="Advanced shading language for production GI renderers (mingw-w64)" arch=('any') @@ -37,17 +37,23 @@ source=(${_realname}-${pkgver}.tar.gz::https://github.com/imageworks/OpenShading 0010-macros-undef-mingw.patch 0012-isatty-mingw.patch 0013-disable-assert-partio.patch - 0014-fix-testshade-library-name.patch) -sha256sums=('1622582de42f6458fff44a0f85bf90ed56b50d4ec97b7637c14ce3b5bdb666b5' + 0014-fix-testshade-library-name.patch + 0015-llvm-linking.patch + 0016-OIIO-API.patch + 0017-public-structs.patch) +sha256sums=('bdda3089ea2071f19d8103c68c24d9924a98fc2f5f89512ff5a9c2c3e22a98b2' 'e3f6ad09619d122ada129cbc77d7778751abfecef9ac7e0a60d9550c811df643' '70d4ce3c69ed072eee0d2bb84cecea5ff9ff35e258a24a7a78ec94e4b626e493' - '355120807bab0e7c0ba08d9831ee8e64f4faaedc07a769bad28aca8732880d18' - '541cc1eb0c506e253de2f26af37dc6e35de891a940906c6e33a2f4774a4a844e' - 'b6ac561e4f450324ff4d60f363de9f266dd4d01d43bc1ec0ee1190cfb7f35c2c' + '6b1e4065292361c724a53f6961b72ff74dde9349a3c1e42a1ab8e883d902f5e4' + '8bc55ff08257d9482d32efe25a416b02acca345897acc46c09c71b6a496e55cc' + '756ed1e1bf3acad0766ac17be979ff84e51fac5cd6adab99e9118a872f3011bf' 'd6fe2f65d219b124f9155a7c362cffb085134acd0882786870d72b519994f4cc' - '7d9de868949b83d20b1807a8eb6d21402a4fc141c85cd1ca6e74a326b79be284' - '8094cd52922f20523a74bb0d249dcf74c1c7ec7b5b25cbef0217955986642558' - 'c506a905b5549356d1674924be3ddc23d4173ddf3c562c077d076cd9c52c0756') + 'c7c125e6fed4650f9770d92ea24771e5518b344718dde291a6d5d4ad945c6222' + 'c0d66bd0c38fc3627d8bf17c7f9331ac66a2a02e22820208d81400f2ed01543b' + '3146942267540de2a3146ef8222d59fdb265dc8fffa3f3a2207bbc851fc99ab8' + 'b614bccd0f754412da693de457d7a9bbc3374902b8b62fbf1344f559c68271af' + '01a9e6543159b8c966fa31755781f028b156fb799ae1c8eab94cd8d4c2ce48a6' + 'a1c0c2ee03a6e77b17acc9ef155ec0008da561258b8b97642df741936d6e2b30') prepare() { cd ${srcdir}/OpenShadingLanguage-Release-${pkgver} @@ -60,6 +66,9 @@ prepare() { patch -p1 -i ${srcdir}/0012-isatty-mingw.patch patch -p1 -i ${srcdir}/0013-disable-assert-partio.patch patch -p1 -i ${srcdir}/0014-fix-testshade-library-name.patch + patch -p1 -i ${srcdir}/0015-llvm-linking.patch + patch -p1 -i ${srcdir}/0016-OIIO-API.patch + patch -p1 -i ${srcdir}/0017-public-structs.patch } build() { @@ -103,5 +112,11 @@ package() { mkdir -p "${pkgdir}${MINGW_PREFIX}"/share/OSL/ mkdir -p "${pkgdir}${MINGW_PREFIX}"/share/licenses/${_realname} - install -Dm644 "${srcdir}/OpenShadingLanguage-Release-${pkgver}/LICENSE" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE" + install -Dm644 "${srcdir}/OpenShadingLanguage-Release-${pkgver}/LICENSE.md" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE.md" + + local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX}) + for _f in "${pkgdir}${MINGW_PREFIX}"/lib/cmake/OSL/*.cmake; do + sed -e "s|${PREFIX_WIN}|\$\{_IMPORT_PREFIX\}|g" -i ${_f} + sed -e "s|${MINGW_PREFIX}|\$\{_IMPORT_PREFIX\}|g" -i ${_f} + done }