pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Update vulkan-loader to version 1.2.162.0



Module Name:	pkgsrc-wip
Committed By:	Niclas Rosenvik <nros%NetBSD.org@localhost>
Pushed By:	nros
Date:		Thu Feb 4 17:40:24 2021 +0000
Changeset:	039a800541ea1f096045df43d85e57014b1e6e27

Modified Files:
	vulkan-loader/Makefile
	vulkan-loader/PLIST
	vulkan-loader/distinfo
	vulkan-loader/patches/patch-CMakeLists.txt
	vulkan-loader/patches/patch-loader_CMakeLists.txt
	vulkan-loader/patches/patch-loader_loader.c
	vulkan-loader/patches/patch-loader_vk__loader__platform.h

Log Message:
Update vulkan-loader to version 1.2.162.0

update vulkan-loader to version 1.2.162.0
add some patches to make it compile on NetBSD

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=039a800541ea1f096045df43d85e57014b1e6e27

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 vulkan-loader/Makefile                             |  4 +-
 vulkan-loader/PLIST                                |  2 +-
 vulkan-loader/distinfo                             | 16 +++----
 vulkan-loader/patches/patch-CMakeLists.txt         | 23 +++++++---
 vulkan-loader/patches/patch-loader_CMakeLists.txt  | 52 +++++++++-------------
 vulkan-loader/patches/patch-loader_loader.c        | 12 ++---
 .../patches/patch-loader_vk__loader__platform.h    | 32 +++++++++++--
 7 files changed, 84 insertions(+), 57 deletions(-)

diffs:
diff --git a/vulkan-loader/Makefile b/vulkan-loader/Makefile
index 098927a3f4..3e1931507c 100644
--- a/vulkan-loader/Makefile
+++ b/vulkan-loader/Makefile
@@ -1,7 +1,7 @@
 # $NetBSD$
 
 GITHUB_PROJECT=	Vulkan-Loader
-DISTNAME=	sdk-1.1.126.0
+DISTNAME=	sdk-1.2.162.0
 PKGNAME=	${GITHUB_PROJECT:tl}-${DISTNAME:S/sdk-//}
 CATEGORIES=	graphics
 MASTER_SITES=	${MASTER_SITE_GITHUB:=KhronosGroup/}
@@ -22,6 +22,8 @@ USE_LANGUAGES=	c c++
 CMAKE_ARGS+=	-DBUILD_WSI_WAYLAND_SUPPORT=OFF
 CMAKE_ARGS+=	-DBUILD_TESTS=ON
 
+CFLAGS.NetBSD+=	-D_NETBSD_SOURCE
+
 PKGCONFIG_OVERRIDE+=	loader/vulkan.pc.in
 
 .include "../../devel/googletest/buildlink3.mk"
diff --git a/vulkan-loader/PLIST b/vulkan-loader/PLIST
index 043ff15388..8a6386b86e 100644
--- a/vulkan-loader/PLIST
+++ b/vulkan-loader/PLIST
@@ -1,5 +1,5 @@
 @comment $NetBSD$
 lib/libvulkan.so
 lib/libvulkan.so.1
-lib/libvulkan.so.1.1.126
+lib/libvulkan.so.1.2.162
 lib/pkgconfig/vulkan.pc
diff --git a/vulkan-loader/distinfo b/vulkan-loader/distinfo
index 0783d9cc71..29a20485ac 100644
--- a/vulkan-loader/distinfo
+++ b/vulkan-loader/distinfo
@@ -1,11 +1,11 @@
 $NetBSD$
 
-SHA1 (Vulkan-Loader/sdk-1.1.126.0.tar.gz) = 899a419aa4330f2093366e8a10ddba4ae325afa9
-RMD160 (Vulkan-Loader/sdk-1.1.126.0.tar.gz) = 7e6f4aa16996f7f4c4901101888c3f3fccbe591d
-SHA512 (Vulkan-Loader/sdk-1.1.126.0.tar.gz) = 8712542b722f786e818f0bf7ded45a1a5153f31d64e8481816032a332b654b29fc198dd3c2a4845b0b51c9e5dccb99fdf2d9e4d068972277109f007174f72c3d
-Size (Vulkan-Loader/sdk-1.1.126.0.tar.gz) = 1399019 bytes
-SHA1 (patch-CMakeLists.txt) = b7d2ca7074327dbebe99d6b6d1fad4805c564858
-SHA1 (patch-loader_CMakeLists.txt) = f61a39ee9b97858931474f20ec1b05d33ef0d231
-SHA1 (patch-loader_loader.c) = 1b5a4d1c9591690944b0e23076c06dba92d36773
-SHA1 (patch-loader_vk__loader__platform.h) = 4f71c25fc8b9b1a5ce622a402549874907f58fe3
+SHA1 (Vulkan-Loader/sdk-1.2.162.0.tar.gz) = df585c26d3a04fa521bf5c051f04a3e2e8a8b088
+RMD160 (Vulkan-Loader/sdk-1.2.162.0.tar.gz) = dc8a47de9dcefbe29b6a48b0d9fd914f390c397b
+SHA512 (Vulkan-Loader/sdk-1.2.162.0.tar.gz) = 13e2ff119828cadf87aad0f2c54a577801ff817fcaa10c11e3c2af768a1e2809ffff9b14c63cd0993cc1d9458f06d69b7949ab024eecf8141c794c394e8a6542
+Size (Vulkan-Loader/sdk-1.2.162.0.tar.gz) = 1422604 bytes
+SHA1 (patch-CMakeLists.txt) = 12ac6ae27cbb51d2da4306f72c8e500bbe1a459b
+SHA1 (patch-loader_CMakeLists.txt) = ef042d20d2a01a01ee3df832dfea40c1e4c9f3b7
+SHA1 (patch-loader_loader.c) = 0eba348c6f3146cb0f0ff0c190e17c3f076f12c0
+SHA1 (patch-loader_vk__loader__platform.h) = 6297921cb7eb3717622bd586acc38a7bccf99f3c
 SHA1 (patch-tests_test__common.h) = 8a1a730027929791b7bbc9ffc0172f0fc8aafb73
diff --git a/vulkan-loader/patches/patch-CMakeLists.txt b/vulkan-loader/patches/patch-CMakeLists.txt
index 6654ae696d..53be45cc55 100644
--- a/vulkan-loader/patches/patch-CMakeLists.txt
+++ b/vulkan-loader/patches/patch-CMakeLists.txt
@@ -1,21 +1,22 @@
 $NetBSD$
 * Use cmakes way of setting language standards.
---- CMakeLists.txt.orig	2019-10-28 17:29:17.000000000 +0000
+--- CMakeLists.txt.orig	2020-12-01 20:50:08.000000000 +0000
 +++ CMakeLists.txt
-@@ -132,6 +132,12 @@ else()
-     option(BUILD_TESTS "Build Tests" OFF)
- endif()
+@@ -148,6 +148,13 @@ endif()
+ 
+ option(BUILD_LOADER "Build loader" ON)
  
 +set(CMAKE_C_STANDARD 99)
 +set(CMAKE_C_STANDARD_REQUIRED ON)
-+
++set(CMAKE_C_VISIBILITY_PRESET "hidden")
 +set(CMAKE_CXX_STANDARD 11)
 +set(CMAKE_CXX_STANDARD_REQUIRED ON)
++set(CMAKE_CXX_VISIBILITY_PRESET "hidden")
 +
  if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
      set(COMMON_COMPILE_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers")
      set(COMMON_COMPILE_FLAGS "${COMMON_COMPILE_FLAGS} -fno-strict-aliasing -fno-builtin-memcmp")
-@@ -153,8 +159,8 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_CO
+@@ -169,16 +176,11 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_CO
          set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xclang -std=c++11 -fno-rtti")
      # clang (not clang-cl) or gcc
      else()
@@ -26,7 +27,15 @@ $NetBSD$
      endif()
  
      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_COMPILE_FLAGS}")
-@@ -216,7 +222,7 @@ if(BUILD_LOADER)
+-
+-    if(UNIX)
+-        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
+-        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
+-    endif()
+ endif()
+ 
+ if(MSVC)
+@@ -232,7 +234,7 @@ if(BUILD_LOADER)
      add_subdirectory(loader)
  endif()
  
diff --git a/vulkan-loader/patches/patch-loader_CMakeLists.txt b/vulkan-loader/patches/patch-loader_CMakeLists.txt
index 65f318f81a..79df0f78a9 100644
--- a/vulkan-loader/patches/patch-loader_CMakeLists.txt
+++ b/vulkan-loader/patches/patch-loader_CMakeLists.txt
@@ -2,7 +2,7 @@ $NetBSD$
 * use CMake findthreads instead of hardcoding -lpthread
 * install pkg-config file on mac
 * set the right libs in Libs.private
---- loader/CMakeLists.txt.orig	2019-10-28 17:29:17.000000000 +0000
+--- loader/CMakeLists.txt.orig	2020-12-01 20:50:08.000000000 +0000
 +++ loader/CMakeLists.txt
 @@ -21,6 +21,10 @@ include_directories(${CMAKE_CURRENT_SOUR
  include(CheckFunctionExists)
@@ -14,45 +14,37 @@ $NetBSD$
 +
  check_function_exists(secure_getenv HAVE_SECURE_GETENV)
  check_function_exists(__secure_getenv HAVE___SECURE_GETENV)
- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/loader_cmake_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/loader_cmake_config.h)
-@@ -236,7 +240,7 @@ else()
+ if(NOT (HAVE_SECURE_GETENV OR HAVE__SECURE_GETENV))
+@@ -259,7 +263,7 @@ else()
                                       "1"
                                       VERSION
                                       "${VulkanHeaders_VERSION_MAJOR}.${VulkanHeaders_VERSION_MINOR}.${VulkanHeaders_VERSION_PATCH}")
 -    target_link_libraries(vulkan ${CMAKE_DL_LIBS} pthread m)
 +    target_link_libraries(vulkan ${CMAKE_DL_LIBS} Threads::Threads m)
      target_link_libraries(vulkan Vulkan::Headers)
- 
      if(APPLE)
-@@ -264,7 +268,7 @@ else()
-         add_library(vulkan-framework SHARED ${NORMAL_LOADER_SRCS} ${OPT_LOADER_SRCS} ${FRAMEWORK_HEADERS})
+         find_library(COREFOUNDATION_LIBRARY NAMES CoreFoundation)
+@@ -289,7 +293,7 @@ else()
+             add_library(vulkan-framework SHARED ${NORMAL_LOADER_SRCS} ${OPT_LOADER_SRCS} ${FRAMEWORK_HEADERS})
+         endif()
          add_dependencies(vulkan-framework loader_asm_gen_files)
-         target_compile_definitions(vulkan-framework PUBLIC LOADER_DYNAMIC_LIB)
 -        target_link_libraries(vulkan-framework -ldl -lpthread -lm "-framework CoreFoundation")
 +        target_link_libraries(vulkan-framework -ldl Threads::Threads -lm "-framework CoreFoundation")
          target_link_libraries(vulkan-framework Vulkan::Headers)
  
          # The FRAMEWORK_VERSION needs to be "A" here so that Xcode code-signing works when a user adds their framework to an Xcode
-@@ -289,17 +293,18 @@ else()
- # cmake-format: on
-     endif()
- 
--    if(NOT APPLE)
-         # Generate pkg-config file.
-         include(FindPkgConfig QUIET)
-         if(PKG_CONFIG_FOUND)
-             set(VK_API_VERSION "${VulkanHeaders_VERSION_MAJOR}.${VulkanHeaders_VERSION_MINOR}.${VulkanHeaders_VERSION_PATCH}")
--            foreach(LIB ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES} ${PLATFORM_LIBS})
--                set(PRIVATE_LIBS "${PRIVATE_LIBS} -l${LIB}")
-+            foreach(LIB ${CMAKE_C_IMPLICIT_LINK_LIBRARIES} ${PLATFORM_LIBS} ${CMAKE_DL_LIBS} m)
-+                list(APPEND PRIVATE_LIBS_LIST "-l${LIB}")
-             endforeach()
-+	    list(APPEND PRIVATE_LIBS_LIST "${CMAKE_THREAD_LIBS_INIT}")
-+	    list(REMOVE_DUPLICATES PRIVATE_LIBS_LIST)
-+	    list(JOIN PRIVATE_LIBS_LIST " " PRIVATE_LIBS)
-             configure_file("vulkan.pc.in" "vulkan.pc" @ONLY)
-             install(FILES "${CMAKE_CURRENT_BINARY_DIR}/vulkan.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
--        endif()
-     endif()
- endif()
- 
+@@ -323,9 +327,12 @@ endif()
+ include(FindPkgConfig QUIET)
+ if(PKG_CONFIG_FOUND)
+     set(VK_API_VERSION "${VulkanHeaders_VERSION_MAJOR}.${VulkanHeaders_VERSION_MINOR}.${VulkanHeaders_VERSION_PATCH}")
+-    foreach(LIB ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES} ${PLATFORM_LIBS})
+-        set(PRIVATE_LIBS "${PRIVATE_LIBS} -l${LIB}")
++    foreach(LIB ${CMAKE_C_IMPLICIT_LINK_LIBRARIES} ${PLATFORM_LIBS} ${CMAKE_DL_LIBS} m)
++        list(APPEND PRIVATE_LIBS_LIST "-l${LIB}")
+     endforeach()
++    list(APPEND PRIVATE_LIBS_LIST "${CMAKE_THREAD_LIBS_INIT}")
++    list(REMOVE_DUPLICATES PRIVATE_LIBS_LIST)
++    list(JOIN PRIVATE_LIBS_LIST " " PRIVATE_LIBS)
+     if(WIN32)
+         set(LIB_SUFFIX "-1")
+     endif ()
diff --git a/vulkan-loader/patches/patch-loader_loader.c b/vulkan-loader/patches/patch-loader_loader.c
index aba4e8519a..1c88d0431e 100644
--- a/vulkan-loader/patches/patch-loader_loader.c
+++ b/vulkan-loader/patches/patch-loader_loader.c
@@ -1,6 +1,6 @@
 $NetBSD$
 * add netbsd support
---- loader/loader.c.orig	2019-09-11 17:39:09.000000000 +0000
+--- loader/loader.c.orig	2020-12-01 20:50:08.000000000 +0000
 +++ loader/loader.c
 @@ -44,6 +44,8 @@
  
@@ -11,19 +11,19 @@ $NetBSD$
  #include <sys/param.h>
  #endif
  
-@@ -241,7 +243,7 @@ void *loader_device_heap_realloc(const s
+@@ -253,7 +255,7 @@ void *loader_device_heap_realloc(const s
  }
  
  // Environment variables
--#if defined(__linux__) || defined(__APPLE__)
-+#if defined(__linux__) || defined(__APPLE__) || defined(__NetBSD__)
+-#if defined(__linux__) || defined(__APPLE__) || defined(__Fuchsia__)
++#if defined(__linux__) || defined(__APPLE__) || defined(__Fuchsia__) || defined(__NetBSD__)
  
  static inline bool IsHighIntegrity() {
      return geteuid() != getuid() || getegid() != getgid();
-@@ -255,7 +257,7 @@ static inline char *loader_getenv(const 
- }
+@@ -268,7 +270,7 @@ static inline char *loader_getenv(const 
  
  static inline char *loader_secure_getenv(const char *name, const struct loader_instance *inst) {
+     char *out;
 -#if defined(__APPLE__)
 +#if defined(__APPLE__) || defined(__NetBSD__)
      // Apple does not appear to have a secure getenv implementation.
diff --git a/vulkan-loader/patches/patch-loader_vk__loader__platform.h b/vulkan-loader/patches/patch-loader_vk__loader__platform.h
index a94e867d7b..a6a5c316b4 100644
--- a/vulkan-loader/patches/patch-loader_vk__loader__platform.h
+++ b/vulkan-loader/patches/patch-loader_vk__loader__platform.h
@@ -1,13 +1,37 @@
 $NetBSD$
 * add netbsd support
---- loader/vk_loader_platform.h.orig	2019-09-18 15:49:42.194132122 +0000
+--- loader/vk_loader_platform.h.orig	2020-12-01 20:50:08.000000000 +0000
 +++ loader/vk_loader_platform.h
-@@ -31,7 +31,7 @@
+@@ -35,7 +35,7 @@
  #include "vulkan/vk_platform.h"
  #include "vulkan/vk_sdk_platform.h"
  
--#if defined(__linux__) || defined(__APPLE__)
-+#if defined(__linux__) || defined(__APPLE__) || defined(__NetBSD__)
+-#if defined(__linux__) || defined(__APPLE__) || defined(__Fuchsia__)
++#if defined(__linux__) || defined(__APPLE__) || defined(__Fuchsia__) || defined(__NetBSD__)
  /* Linux-specific common code: */
  
  // Headers:
+@@ -122,6 +122,23 @@ static inline char *loader_platform_exec
+     buffer[ret] = '\0';
+     return buffer;
+ }
++#elif defined(__NetBSD__)
++#include <sys/sysctl.h>
++static inline char *loader_platform_executable_path(char *buffer, size_t size) {
++    int mib[4];
++    size_t len;
++
++    mib[0] = CTL_KERN;
++    mib[1] = KERN_PROC_ARGS;
++    mib[2] = getpid();
++    mib[3] = KERN_PROC_PATHNAME;
++
++    if (sysctl(mib, 4, NULL, &len, NULL, 0)) return NULL;
++    if (len > size) return NULL;
++    if (sysctl(mib, 4, buffer, &len, NULL, 0)) return NULL;
++
++    return buffer;
++}
+ #elif defined(__Fuchsia__)
+ static inline char *loader_platform_executable_path(char *buffer, size_t size) { return NULL; }
+ #endif  // defined (__APPLE__)


Home | Main Index | Thread Index | Old Index