git: c1b8092c8abb - main - misc/ncnn: unbreak after 51a9ba187752 via bundling

From: Jan Beich <jbeich_at_FreeBSD.org>
Date: Thu, 13 Oct 2022 21:18:36 UTC
The branch main has been updated by jbeich:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c1b8092c8abb0d95d9e3a6e353a0fe7d5b90a5a3

commit c1b8092c8abb0d95d9e3a6e353a0fe7d5b90a5a3
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2022-10-13 20:52:23 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2022-10-13 21:17:32 +0000

    misc/ncnn: unbreak after 51a9ba187752 via bundling
    
    CMake Warning at /usr/local/lib/cmake/OSDependentTargets.cmake:2 (message):
      Using `OSDependentTargets.cmake` is deprecated: use `find_package(glslang)`
      to find glslang CMake targets.
    Call Stack (most recent call first):
      CMakeLists.txt:481 (include)
    
    CMake Error at /usr/local/lib/cmake/OSDependentTargets.cmake:5 (include):
      include could not find requested file:
    
        /usr/local/lib/cmake/../../lib/glslang/glslang-targets.cmake
    Call Stack (most recent call first):
      CMakeLists.txt:481 (include)
    
    CMake Error at /usr/local/lib/cmake/OSDependentTargets.cmake:8 (add_library):
      add_library cannot create ALIAS target "OSDependent" because target
      "glslang::OSDependent" does not already exist.
    Call Stack (most recent call first):
      CMakeLists.txt:481 (include)
    
    CMake Warning at /usr/local/lib/cmake/OGLCompilerTargets.cmake:2 (message):
      Using `OGLCompilerTargets.cmake` is deprecated: use `find_package(glslang)`
      to find glslang CMake targets.
    Call Stack (most recent call first):
      CMakeLists.txt:482 (include)
    
    CMake Error at /usr/local/lib/cmake/OGLCompilerTargets.cmake:5 (include):
      include could not find requested file:
    
        /usr/local/lib/cmake/../../lib/glslang/glslang-targets.cmake
    Call Stack (most recent call first):
      CMakeLists.txt:482 (include)
    
    CMake Error at /usr/local/lib/cmake/OGLCompilerTargets.cmake:8 (add_library):
      add_library cannot create ALIAS target "OGLCompiler" because target
      "glslang::OGLCompiler" does not already exist.
    Call Stack (most recent call first):
      CMakeLists.txt:482 (include)
    
    CMake Warning at /usr/local/lib/cmake/HLSLTargets.cmake:2 (message):
      Using `HLSLTargets.cmake` is deprecated: use `find_package(glslang)` to
      find glslang CMake targets.
    Call Stack (most recent call first):
      CMakeLists.txt:485 (include)
    
    CMake Error at /usr/local/lib/cmake/HLSLTargets.cmake:5 (include):
      include could not find requested file:
    
        /usr/local/lib/cmake/../../lib/glslang/glslang-targets.cmake
    Call Stack (most recent call first):
      CMakeLists.txt:485 (include)
    
    CMake Error at /usr/local/lib/cmake/HLSLTargets.cmake:8 (add_library):
      add_library cannot create ALIAS target "HLSL" because target
      "glslang::HLSL" does not already exist.
    Call Stack (most recent call first):
      CMakeLists.txt:485 (include)
    
    CMake Warning at /usr/local/lib/cmake/glslangTargets.cmake:2 (message):
      Using `glslangTargets.cmake` is deprecated: use `find_package(glslang)` to
      find glslang CMake targets.
    Call Stack (most recent call first):
      CMakeLists.txt:487 (include)
    
    CMake Error at /usr/local/lib/cmake/glslangTargets.cmake:5 (include):
      include could not find requested file:
    
        /usr/local/lib/cmake/../../lib/glslang/glslang-targets.cmake
    Call Stack (most recent call first):
      CMakeLists.txt:487 (include)
    
    CMake Error at /usr/local/lib/cmake/glslangTargets.cmake:11 (add_library):
      add_library cannot create ALIAS target "glslang" because target
      "glslang::glslang" does not already exist.
    Call Stack (most recent call first):
      CMakeLists.txt:487 (include)
    
    CMake Error at /usr/local/lib/cmake/glslangTargets.cmake:12 (add_library):
      add_library cannot create ALIAS target "MachineIndependent" because target
      "glslang::MachineIndependent" does not already exist.
    Call Stack (most recent call first):
      CMakeLists.txt:487 (include)
    
    CMake Error at /usr/local/lib/cmake/glslangTargets.cmake:13 (add_library):
      add_library cannot create ALIAS target "GenericCodeGen" because target
      "glslang::GenericCodeGen" does not already exist.
    Call Stack (most recent call first):
      CMakeLists.txt:487 (include)
    
    CMake Warning at /usr/local/lib/cmake/SPIRVTargets.cmake:2 (message):
      Using `SPIRVTargets.cmake` is deprecated: use `find_package(glslang)` to
      find glslang CMake targets.
    Call Stack (most recent call first):
      CMakeLists.txt:488 (include)
    
    CMake Error at /usr/local/lib/cmake/SPIRVTargets.cmake:5 (include):
      include could not find requested file:
    
        /usr/local/lib/cmake/../../lib/glslang/glslang-targets.cmake
    Call Stack (most recent call first):
      CMakeLists.txt:488 (include)
    
    CMake Error at /usr/local/lib/cmake/SPIRVTargets.cmake:8 (add_library):
      add_library cannot create ALIAS target "SPIRV" because target
      "glslang::SPIRV" does not already exist.
    Call Stack (most recent call first):
      CMakeLists.txt:488 (include)
    
    CMake Warning at CMakeLists.txt:491 (message):
      glslang or SPIRV target not found! NCNN_SYSTEM_GLSLANG will be turned off.
    
    CMake Error at CMakeLists.txt:499 (message):
      The submodules were not downloaded! Please update submodules with "git
      submodule update --init" and try again.
    
    This reverts commit 3fb41287be4428e362311ead29135c264d19d4fd.
---
 misc/ncnn/Makefile                   | 12 ++----
 misc/ncnn/distinfo                   |  2 +
 misc/ncnn/files/patch-CMakeLists.txt | 82 ++++++++++++++++++++++++++++++++++++
 3 files changed, 88 insertions(+), 8 deletions(-)

diff --git a/misc/ncnn/Makefile b/misc/ncnn/Makefile
index 19b546cb6860..971a97a6a62f 100644
--- a/misc/ncnn/Makefile
+++ b/misc/ncnn/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	ncnn
 DISTVERSION=	20220729
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	misc # machine-learning
 
 MAINTAINER=	yuri@FreeBSD.org
@@ -25,13 +25,9 @@ OPTIONS_DEFINE=		VULKAN
 OPTIONS_DEFAULT=	VULKAN
 
 VULKAN_DESC=		Vulkan compute support
-VULKAN_BUILD_DEPENDS=	glslang>0:graphics/glslang \
-			${LOCALBASE}/include/vulkan/vulkan.h:graphics/vulkan-headers
+VULKAN_GH_TUPLE=	KhronosGroup:glslang:11.9.0-19-g86ff4bca:glslang/glslang
+VULKAN_BUILD_DEPENDS=	${LOCALBASE}/include/vulkan/vulkan.h:graphics/vulkan-headers
 VULKAN_LIB_DEPENDS=	libvulkan.so:graphics/vulkan-loader
-VULKAN_CMAKE_BOOL=	NCNN_VULKAN NCNN_SYSTEM_GLSLANG
-VULKAN_CMAKE_ON=	-DGLSLANG_TARGET_DIR:PATH="${LOCALBASE}/lib/cmake"
-
-post-patch-VULKAN-on:
-	@${REINPLACE_CMD} 's,/glslang,,' ${WRKSRC}/src/gpu.cpp
+VULKAN_CMAKE_BOOL=	NCNN_VULKAN
 
 .include <bsd.port.mk>
diff --git a/misc/ncnn/distinfo b/misc/ncnn/distinfo
index 191900aeeb6a..002a78cd91cb 100644
--- a/misc/ncnn/distinfo
+++ b/misc/ncnn/distinfo
@@ -1,3 +1,5 @@
 TIMESTAMP = 1664765781
 SHA256 (Tencent-ncnn-20220729_GH0.tar.gz) = fa337dce2db3aea82749633322c3572490a86d6f2e144e53aba03480f651991f
 SIZE (Tencent-ncnn-20220729_GH0.tar.gz) = 12235306
+SHA256 (KhronosGroup-glslang-11.9.0-19-g86ff4bca_GH0.tar.gz) = f7a19b57af200feeba77a5cc010fc031ba47c32287cb1438440ad32628fb798a
+SIZE (KhronosGroup-glslang-11.9.0-19-g86ff4bca_GH0.tar.gz) = 3535721
diff --git a/misc/ncnn/files/patch-CMakeLists.txt b/misc/ncnn/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..1e7ebf6f403d
--- /dev/null
+++ b/misc/ncnn/files/patch-CMakeLists.txt
@@ -0,0 +1,82 @@
+Don't try to install bundled glslang as part of ncnn
+
+====> Checking for pkg-plist issues (check-plist)
+===> Parsing plist
+===> Checking for items in STAGEDIR missing from pkg-plist
+Error: Orphaned: include/glslang/Include/BaseTypes.h
+Error: Orphaned: include/glslang/Include/Common.h
+Error: Orphaned: include/glslang/Include/ConstantUnion.h
+Error: Orphaned: include/glslang/Include/InfoSink.h
+Error: Orphaned: include/glslang/Include/InitializeGlobals.h
+Error: Orphaned: include/glslang/Include/PoolAlloc.h
+Error: Orphaned: include/glslang/Include/ResourceLimits.h
+Error: Orphaned: include/glslang/Include/ShHandle.h
+Error: Orphaned: include/glslang/Include/SpirvIntrinsics.h
+Error: Orphaned: include/glslang/Include/Types.h
+Error: Orphaned: include/glslang/Include/arrays.h
+Error: Orphaned: include/glslang/Include/glslang_c_interface.h
+Error: Orphaned: include/glslang/Include/glslang_c_shader_types.h
+Error: Orphaned: include/glslang/Include/intermediate.h
+Error: Orphaned: include/glslang/MachineIndependent/Initialize.h
+Error: Orphaned: include/glslang/MachineIndependent/LiveTraverser.h
+Error: Orphaned: include/glslang/MachineIndependent/ParseHelper.h
+Error: Orphaned: include/glslang/MachineIndependent/RemoveTree.h
+Error: Orphaned: include/glslang/MachineIndependent/Scan.h
+Error: Orphaned: include/glslang/MachineIndependent/ScanContext.h
+Error: Orphaned: include/glslang/MachineIndependent/SymbolTable.h
+Error: Orphaned: include/glslang/MachineIndependent/Versions.h
+Error: Orphaned: include/glslang/MachineIndependent/attribute.h
+Error: Orphaned: include/glslang/MachineIndependent/gl_types.h
+Error: Orphaned: include/glslang/MachineIndependent/glslang_tab.cpp.h
+Error: Orphaned: include/glslang/MachineIndependent/iomapper.h
+Error: Orphaned: include/glslang/MachineIndependent/localintermediate.h
+Error: Orphaned: include/glslang/MachineIndependent/parseVersions.h
+Error: Orphaned: include/glslang/MachineIndependent/preprocessor/PpContext.h
+Error: Orphaned: include/glslang/MachineIndependent/preprocessor/PpTokens.h
+Error: Orphaned: include/glslang/MachineIndependent/propagateNoContraction.h
+Error: Orphaned: include/glslang/MachineIndependent/reflection.h
+Error: Orphaned: include/glslang/Public/ShaderLang.h
+Error: Orphaned: include/glslang/SPIRV/GLSL.ext.AMD.h
+Error: Orphaned: include/glslang/SPIRV/GLSL.ext.EXT.h
+Error: Orphaned: include/glslang/SPIRV/GLSL.ext.KHR.h
+Error: Orphaned: include/glslang/SPIRV/GLSL.ext.NV.h
+Error: Orphaned: include/glslang/SPIRV/GLSL.std.450.h
+Error: Orphaned: include/glslang/SPIRV/GlslangToSpv.h
+Error: Orphaned: include/glslang/SPIRV/Logger.h
+Error: Orphaned: include/glslang/SPIRV/NonSemanticDebugPrintf.h
+Error: Orphaned: include/glslang/SPIRV/SPVRemapper.h
+Error: Orphaned: include/glslang/SPIRV/SpvBuilder.h
+Error: Orphaned: include/glslang/SPIRV/SpvTools.h
+Error: Orphaned: include/glslang/SPIRV/bitutils.h
+Error: Orphaned: include/glslang/SPIRV/disassemble.h
+Error: Orphaned: include/glslang/SPIRV/doc.h
+Error: Orphaned: include/glslang/SPIRV/hex_float.h
+Error: Orphaned: include/glslang/SPIRV/spirv.hpp
+Error: Orphaned: include/glslang/SPIRV/spvIR.h
+Error: Orphaned: include/glslang/build_info.h
+Error: Orphaned: lib/cmake/OGLCompilerTargets-%%CMAKE_BUILD_TYPE%%.cmake
+Error: Orphaned: lib/cmake/OGLCompilerTargets.cmake
+Error: Orphaned: lib/cmake/OSDependentTargets-%%CMAKE_BUILD_TYPE%%.cmake
+Error: Orphaned: lib/cmake/OSDependentTargets.cmake
+Error: Orphaned: lib/cmake/SPIRVTargets-%%CMAKE_BUILD_TYPE%%.cmake
+Error: Orphaned: lib/cmake/SPIRVTargets.cmake
+Error: Orphaned: lib/cmake/glslangTargets-%%CMAKE_BUILD_TYPE%%.cmake
+Error: Orphaned: lib/cmake/glslangTargets.cmake
+Error: Orphaned: lib/libGenericCodeGen.a
+Error: Orphaned: lib/libMachineIndependent.a
+Error: Orphaned: lib/libOGLCompiler.a
+Error: Orphaned: lib/libOSDependent.a
+Error: Orphaned: lib/libSPIRV.a
+Error: Orphaned: lib/libglslang.a
+
+--- CMakeLists.txt.orig	2022-07-28 09:47:27 UTC
++++ CMakeLists.txt
+@@ -513,7 +513,7 @@ if(NCNN_VULKAN)
+             if(NCNN_SHARED_LIB)
+                 option(SKIP_GLSLANG_INSTALL "" ON)
+             endif()
+-            add_subdirectory(glslang)
++            add_subdirectory(glslang EXCLUDE_FROM_ALL)
+             if(NCNN_SHARED_LIB)
+                 if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT CMAKE_CXX_COMPILER_FRONTEND_VARIANT MATCHES "MSVC"))
+                     target_compile_options(glslang PRIVATE -fvisibility=hidden -fvisibility-inlines-hidden)