pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Import graphics/vulkan-tools
Module Name: pkgsrc-wip
Committed By: kikadf <kikadf.01%gmail.com@localhost>
Pushed By: kikadf
Date: Sat Apr 11 14:50:46 2026 +0200
Changeset: fc24cee6483631cf97dda72c2c4c85a9dde16d37
Modified Files:
Makefile
Added Files:
vulkan-tools/DESCR
vulkan-tools/Makefile
vulkan-tools/PLIST
vulkan-tools/distinfo
vulkan-tools/patches/patch-cube_CMakeLists.txt
vulkan-tools/patches/patch-cube_cube.c
vulkan-tools/patches/patch-cube_cube.cpp
Log Message:
Import graphics/vulkan-tools
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=fc24cee6483631cf97dda72c2c4c85a9dde16d37
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
Makefile | 1 +
vulkan-tools/DESCR | 2 +
vulkan-tools/Makefile | 24 ++++++++++++
vulkan-tools/PLIST | 4 ++
vulkan-tools/distinfo | 8 ++++
vulkan-tools/patches/patch-cube_CMakeLists.txt | 32 ++++++++++++++++
vulkan-tools/patches/patch-cube_cube.c | 53 ++++++++++++++++++++++++++
vulkan-tools/patches/patch-cube_cube.cpp | 53 ++++++++++++++++++++++++++
8 files changed, 177 insertions(+)
diffs:
diff --git a/Makefile b/Makefile
index e83c5b417c..77d1c1a4e7 100644
--- a/Makefile
+++ b/Makefile
@@ -6026,6 +6026,7 @@ SUBDIR+= vscode
SUBDIR+= vsearch
SUBDIR+= vulkan-headers
SUBDIR+= vulkan-loader
+SUBDIR+= vulkan-tools
SUBDIR+= w3c-httpd
SUBDIR+= wackamole
SUBDIR+= wadgadget
diff --git a/vulkan-tools/DESCR b/vulkan-tools/DESCR
new file mode 100644
index 0000000000..86f2423deb
--- /dev/null
+++ b/vulkan-tools/DESCR
@@ -0,0 +1,2 @@
+Vulkan-Tools provides Vulkan tools and utilities that can assist development by
+enabling developers to verify their application's correct use of the Vulkan API.
diff --git a/vulkan-tools/Makefile b/vulkan-tools/Makefile
new file mode 100644
index 0000000000..97401f2bab
--- /dev/null
+++ b/vulkan-tools/Makefile
@@ -0,0 +1,24 @@
+# $NetBSD: Makefile,v 1.2 2025/10/04 12:39:56 tnn Exp $
+
+DISTNAME= vulkan-tools-1.4.321.0 # matches vulkan-headers
+CATEGORIES= graphics
+MASTER_SITES= ${MASTER_SITE_GITHUB:=KhronosGroup/}
+GITHUB_PROJECT= Vulkan-Tools
+GITHUB_TAG= vulkan-sdk-${PKGVERSION_NOREV}
+
+MAINTAINER= pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE= https://github.com/KhronosGroup/Vulkan-Tools/
+COMMENT= Vulkan information and demo utilities
+LICENSE= apache-2.0
+
+WRKSRC= ${WRKDIR}/${GITHUB_PROJECT}-${GITHUB_TAG}
+
+USE_LANGUAGES= c c++
+
+USE_TOOLS+= pkg-config
+
+.include "../../devel/cmake/build.mk"
+.include "../../devel/wayland/buildlink3.mk"
+.include "../../devel/wayland-protocols/buildlink3.mk"
+.include "../../graphics/vulkan-headers/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/vulkan-tools/PLIST b/vulkan-tools/PLIST
new file mode 100644
index 0000000000..94473e386f
--- /dev/null
+++ b/vulkan-tools/PLIST
@@ -0,0 +1,4 @@
+@comment $NetBSD: PLIST,v 1.1 2025/03/08 22:57:40 jakllsch Exp $
+bin/vkcube
+bin/vkcubepp
+bin/vulkaninfo
diff --git a/vulkan-tools/distinfo b/vulkan-tools/distinfo
new file mode 100644
index 0000000000..54ed6ee4d2
--- /dev/null
+++ b/vulkan-tools/distinfo
@@ -0,0 +1,8 @@
+$NetBSD: distinfo,v 1.4 2025/11/24 20:52:55 tnn Exp $
+
+BLAKE2s (vulkan-tools-1.4.321.0.tar.gz) = fe0751c267a45a60b5b477b3ab7bf316868b033fb0563bcd7b39be0f3a70fc9d
+SHA512 (vulkan-tools-1.4.321.0.tar.gz) = 163b6348064b807ae22ed14945d558fdb18789af22f4bca4dcd017699eef41bae4ca86114297c02f6caed7206882676fca9bc58b9acdae2db46356d266af307a
+Size (vulkan-tools-1.4.321.0.tar.gz) = 807441 bytes
+SHA1 (patch-cube_CMakeLists.txt) = 12be43fe76672724a01116f91b02b4c72a5ca2ec
+SHA1 (patch-cube_cube.c) = 662d641041852e2fc049abba57623ca52a88eb5b
+SHA1 (patch-cube_cube.cpp) = 8e960de47586bf0bc8e148b1c3b288d305c58831
diff --git a/vulkan-tools/patches/patch-cube_CMakeLists.txt b/vulkan-tools/patches/patch-cube_CMakeLists.txt
new file mode 100644
index 0000000000..294783f600
--- /dev/null
+++ b/vulkan-tools/patches/patch-cube_CMakeLists.txt
@@ -0,0 +1,32 @@
+$NetBSD: patch-cube_CMakeLists.txt,v 1.1 2025/11/24 20:52:56 tnn Exp $
+
+On NetBSD wayland-client.pc has:
+Libs: -Wl,-R${libdir} -L${libdir} -lwayland-client -lm
+
+We need to pull out the first library in the list for dlopen purposes
+and skip the rest.
+
+--- cube/CMakeLists.txt.orig 2025-11-24 20:44:04.253915997 +0000
++++ cube/CMakeLists.txt
+@@ -314,7 +314,9 @@ if (X11_LINK_LIBRARIES)
+ target_compile_definitions(vkcube PRIVATE "XLIB_LIBRARY=\"${X11_LINK_LIBRARIES}\"")
+ endif()
+ if (WAYLAND_CLIENT_LINK_LIBRARIES)
+- target_compile_definitions(vkcube PRIVATE "WAYLAND_LIBRARY=\"${WAYLAND_CLIENT_LINK_LIBRARIES}\"")
++ #target_compile_definitions(vkcube PRIVATE "WAYLAND_LIBRARY=\"${WAYLAND_CLIENT_LINK_LIBRARIES}\"")
++ list(GET WAYLAND_CLIENT_LINK_LIBRARIES 0 WAYLAND_CLIENT_LIB)
++ target_compile_definitions(vkcube PRIVATE "WAYLAND_LIBRARY=\"${WAYLAND_CLIENT_LIB}\"")
+ endif()
+
+ # ----------------------------------------------------------------------------
+@@ -367,7 +369,9 @@ if (X11_LINK_LIBRARIES)
+ target_compile_definitions(vkcubepp PUBLIC "XLIB_LIBRARY=\"${X11_LINK_LIBRARIES}\"")
+ endif()
+ if (WAYLAND_CLIENT_LINK_LIBRARIES)
+- target_compile_definitions(vkcubepp PUBLIC "WAYLAND_LIBRARY=\"${WAYLAND_CLIENT_LINK_LIBRARIES}\"")
++ #target_compile_definitions(vkcubepp PUBLIC "WAYLAND_LIBRARY=\"${WAYLAND_CLIENT_LINK_LIBRARIES}\"")
++ list(GET WAYLAND_CLIENT_LINK_LIBRARIES 0 WAYLAND_CLIENT_LIB)
++ target_compile_definitions(vkcubepp PUBLIC "WAYLAND_LIBRARY=\"${WAYLAND_CLIENT_LIB}\"")
+ endif()
+
+ if(APPLE)
diff --git a/vulkan-tools/patches/patch-cube_cube.c b/vulkan-tools/patches/patch-cube_cube.c
new file mode 100644
index 0000000000..84334563c2
--- /dev/null
+++ b/vulkan-tools/patches/patch-cube_cube.c
@@ -0,0 +1,53 @@
+$NetBSD: patch-cube_cube.c,v 1.1 2025/10/04 12:39:56 tnn Exp $
+
+Allow building on NetBSD.
+
+--- cube/cube.c.orig 2025-10-04 12:29:59.680457395 +0000
++++ cube/cube.c
+@@ -44,7 +44,9 @@
+ #include "xcb_loader.h"
+ #endif
+ #if defined(VK_USE_PLATFORM_WAYLAND_KHR)
++#if defined(__linux__)
+ #include <linux/input.h>
++#endif
+ #include "wayland_loader.h"
+ #endif
+
+@@ -3581,9 +3583,11 @@ static void pointer_handle_motion(void *
+ static void pointer_handle_button(void *data, struct wl_pointer *wl_pointer, uint32_t serial, uint32_t time, uint32_t button,
+ uint32_t state) {
+ struct demo *demo = data;
++#if defined(__linux__)
+ if (button == BTN_LEFT && state == WL_POINTER_BUTTON_STATE_PRESSED) {
+ xdg_toplevel_move(demo->xdg_toplevel, demo->seat, serial);
+ }
++#endif
+ }
+
+ static void pointer_handle_axis(void *data, struct wl_pointer *wl_pointer, uint32_t time, uint32_t axis, wl_fixed_t value) {}
+@@ -3603,6 +3607,7 @@ static void keyboard_handle_key(void *da
+ uint32_t state) {
+ if (state != WL_KEYBOARD_KEY_STATE_RELEASED) return;
+ struct demo *demo = data;
++#if defined(__linux__)
+ switch (key) {
+ case KEY_ESC: // Escape
+ demo->quit = true;
+@@ -3617,6 +3622,7 @@ static void keyboard_handle_key(void *da
+ demo->pause = !demo->pause;
+ break;
+ }
++#endif
+ }
+
+ static void keyboard_handle_modifiers(void *data, struct wl_keyboard *keyboard, uint32_t serial, uint32_t mods_depressed,
+@@ -5079,7 +5085,7 @@ void android_main(struct android_app *ap
+ }
+ }
+ }
+-#elif defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__QNX__) || defined(__GNU__)
++#elif defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__QNX__) || defined(__GNU__) || defined(__NetBSD__)
+ int main(int argc, char **argv) {
+ struct demo demo;
+
diff --git a/vulkan-tools/patches/patch-cube_cube.cpp b/vulkan-tools/patches/patch-cube_cube.cpp
new file mode 100644
index 0000000000..0906587035
--- /dev/null
+++ b/vulkan-tools/patches/patch-cube_cube.cpp
@@ -0,0 +1,53 @@
+$NetBSD: patch-cube_cube.cpp,v 1.2 2025/10/04 12:39:56 tnn Exp $
+
+Allow building on NetBSD.
+
+--- cube/cube.cpp.orig 2025-10-04 12:29:34.996749955 +0000
++++ cube/cube.cpp
+@@ -40,7 +40,9 @@
+ #include "xcb_loader.h"
+ #endif
+ #if defined(VK_USE_PLATFORM_WAYLAND_KHR)
++#if defined(__linux__)
+ #include <linux/input.h>
++#endif
+ #include "wayland_loader.h"
+ #endif
+ #if defined(VK_USE_PLATFORM_FUCHSIA)
+@@ -578,9 +580,11 @@ static void pointer_handle_motion(void *
+ static void pointer_handle_button(void *data, struct wl_pointer *wl_pointer, uint32_t serial, uint32_t time, uint32_t button,
+ uint32_t state) {
+ Demo &demo = *static_cast<Demo *>(data);
++#if defined(__linux__)
+ if (button == BTN_LEFT && state == WL_POINTER_BUTTON_STATE_PRESSED) {
+ xdg_toplevel_move(demo.window_toplevel, demo.seat, serial);
+ }
++#endif
+ }
+
+ static void pointer_handle_axis(void *data, struct wl_pointer *wl_pointer, uint32_t time, uint32_t axis, wl_fixed_t value) {}
+@@ -600,6 +604,7 @@ static void keyboard_handle_key(void *da
+ uint32_t state) {
+ if (state != WL_KEYBOARD_KEY_STATE_RELEASED) return;
+ Demo &demo = *static_cast<Demo *>(data);
++#if defined(__linux__)
+ switch (key) {
+ case KEY_ESC: // Escape
+ demo.quit = true;
+@@ -614,6 +619,7 @@ static void keyboard_handle_key(void *da
+ demo.pause = !demo.pause;
+ break;
+ }
++#endif
+ }
+
+ static void keyboard_handle_modifiers(void *data, wl_keyboard *keyboard, uint32_t serial, uint32_t mods_depressed,
+@@ -4133,7 +4139,7 @@ int WINAPI WinMain(HINSTANCE hInstance,
+ }
+
+ #elif defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__QNX__) || defined(__GNU__) || \
+- defined(__Fuchsia__)
++ defined(__Fuchsia__) || defined(__NetBSD__)
+
+ template <WsiPlatform WSI_PLATFORM>
+ void Demo::execute() {
Home |
Main Index |
Thread Index |
Old Index