From 8c943cad21ed756cec6ef00b648b20e17e8918de Mon Sep 17 00:00:00 2001 From: christophecvr Date: Fri, 18 Oct 2024 20:24:08 +0200 Subject: [PATCH] glslang: update to 1.3.296.0 See: https://trac.macports.org/ticket/71081 Set python to version 3.12 Added the lates remark on: https://github.com/KhronosGroup/glslang/pull/3371 to patchfile. --- graphics/glslang/Portfile | 25 ++++++++++++------- .../glslang/files/create-pkgconfig-file.diff | 21 ++++++++++++---- 2 files changed, 32 insertions(+), 14 deletions(-) diff --git a/graphics/glslang/Portfile b/graphics/glslang/Portfile index ef0056f5cba56..1aea837d12f83 100644 --- a/graphics/glslang/Portfile +++ b/graphics/glslang/Portfile @@ -5,8 +5,8 @@ PortGroup github 1.0 PortGroup cmake 1.1 PortGroup legacysupport 1.1 -github.setup KhronosGroup glslang 13.0.0 -revision 3 +github.setup KhronosGroup glslang 1.3.296.0 vulkan-sdk- +revision 0 categories graphics devel license {BSD Permissive} @@ -17,11 +17,11 @@ long_description Glslang is the official reference compiler for \ the OpenGL and OpenGL ES shading languages. homepage https://www.khronos.org/opengles/sdk/tools/Reference-Compiler/ -checksums sha256 d4eece144c4930b4793779396665bd415dd641c8f33115b4de4c83d42a39d9f1 \ - rmd160 a187c2d1c75a05eb5aba4afadf9ba689b15c63f9 \ - size 3712855 +checksums sha256 4d455a9a9a0d23231b22c7595ee343989a5f6ee50b5eb05aa663b92352bb51e8 \ + rmd160 c0e219aee3a62a8d0fd25c2f96a5a5851437963d \ + size 3867163 -set py_ver 3.11 +set py_ver 3.12 set py_ver_nodot [string map {. {}} ${py_ver}] compiler.cxx_standard 2017 @@ -29,7 +29,7 @@ compiler.cxx_standard 2017 # Need to use MacPorts libc++ on macOS 10.14 Mojave and older, because # Apple Clang only added support for the C++17 library # starting in Xcode 11 (clang-1100) for macOS 10.15+. -# +# # References: # * https://stackoverflow.com/a/55353263 # * https://developer.apple.com/documentation/xcode-release-notes/xcode-11-release-notes @@ -45,9 +45,16 @@ legacysupport.use_mp_libcxx yes # https://github.com/KhronosGroup/glslang/pull/3371 patchfiles-append create-pkgconfig-file.diff +depends_lib-append port:spirv-tools +depends_lib-append port:python${py_ver_nodot} + depends_build-append port:python${py_ver_nodot} + configure.python ${prefix}/bin/python${py_ver} -configure.args-append -DPYTHON_EXECUTABLE:FILEPATH=${configure.python} + +# there is no such option in CMakeLists.txt, cmake discovers and uses right python +#configure.args-append -DPYTHON_EXECUTABLE:FILEPATH=${configure.python} configure.args-append -DBUILD_SHARED_LIBS=ON \ - -DENABLE_GLSLANG_INSTALL=ON + -DGLSLANG_ENABLE_INSTALL=ON \ + -DALLOW_EXTERNAL_SPIRV_TOOLS=ON diff --git a/graphics/glslang/files/create-pkgconfig-file.diff b/graphics/glslang/files/create-pkgconfig-file.diff index 1979079a910e6..4b97cb26c76be 100644 --- a/graphics/glslang/files/create-pkgconfig-file.diff +++ b/graphics/glslang/files/create-pkgconfig-file.diff @@ -1,6 +1,17 @@ ---- CMakeLists.txt.orig 2023-08-23 19:24:25.000000000 -0400 -+++ CMakeLists.txt 2023-10-13 18:07:29.000000000 -0400 -@@ -361,4 +361,34 @@ +--- CMakeLists.txt.orig 2024-09-26 01:10:44.000000000 +0200 ++++ CMakeLists.txt 2024-10-17 09:21:40.000000000 +0200 +@@ -300,6 +300,10 @@ + message(WARNING "ENABLE_OPT set but SPIR-V tools not found! Disabling SPIR-V optimization.") + endif() + set(ENABLE_OPT OFF) ++ else() ++ message(STATUS "XDEBUG Using external SPIRV-Tools") ++ message(STATUS "XDEBUG\n ENABLE_OPT=${ENABLE_OPT}\n ENABLE_HLSL=${ENABLE_HLSL}\n ENABLE_SPIRV=${ENABLE_SPIRV} ++ ENABLE_GLSLANG_BINARIES=${ENABLE_GLSLANG_BINARIES}\n GLSLANG_TESTS=${GLSLANG_TESTS}\n PROJECT_IS_TOP_LEVEL=${PROJECT_IS_TOP_LEVEL}") + endif() + else() + if(ENABLE_OPT) +@@ -397,4 +401,34 @@ DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" ) @@ -16,7 +27,7 @@ +prefix="@CMAKE_INSTALL_PREFIX@" +exec_prefix="${prefix}" +libdir="${prefix}/lib" -+includedir="${prefix}/include" ++includedir="${prefix}/@CMAKE_INSTALL_INCLUDEDIR@" + +Name: @PROJECT_NAME@ +Description: official reference compiler front end for the OpenGL ES and OpenGL shading languages @@ -34,4 +45,4 @@ + DESTINATION + "${CMAKE_INSTALL_LIBDIR}/pkgconfig" + ) - endif() + endif(GLSLANG_ENABLE_INSTALL)