Bug#907152: vulkan: Porting to non-linux systems

2023-07-03 Thread Pino Toscano
Source: vulkan-loader
Followup-For: Bug #907152
X-Debbugs-Cc: tjaal...@debian.org
Control: tag -1 = upstream fixed-upstream

Hi!

The vulkan source changed a while since this bug was originally
reported: it was split into components, with this bug reassigned to
to the loader, and in it was ported to more architectures.

I recently ported this to Hurd again, with good results: the upstream
tests pass, and it was reviewed and merged upstream:
https://github.com/KhronosGroup/Vulkan-Loader/pull/1244

Because of this, I submitted the enablement of src:vulkan-loader to
non-Linux architectures, as the actual Hurd porting will come in soon
in new upstream releases (I guess in versions greater than 1.3.250):
https://salsa.debian.org/xorg-team/vulkan/vulkan-loader/-/merge_requests/14

I'm *not* submitting the upstream Hurd patch to downstream backport:
the code upstream was refactored, so a good part of it would need to be
rewritten, which is not that worth of effort for something that has
never been available yet.

-- 
Pino



Bug#907152: vulkan: Porting to non-linux systems

2018-09-21 Thread Timo Aaltonen
On 24.08.2018 13:46, Svante Signell wrote:
> Source: vulkan
> Version: 1.1.73+dfsg-1
> Severity: important
> Tags: ftbfs, patch
> User: debian-h...@lists.debian.org, debian-k...@lists.debian.org
> Usertags: hurd-i386, kfreebsd-any
> 
> Hello,
> 
> Currently vulkan is not available on GNU/Hurd and GNU/kFreeBSD due to
> lack of porting to these architectures. Attached is a patch,
> debian_control.diff, to make the libwayland-dev dependency linux-only
> and add hurd, kfreebsd to the Architecture field of the packages.
> 
> The remaining patches:
> 
> CMakeLists.txt.diff
> demos_CMakeLists.txt.diff
> demos_smoke_CMakeLists.txt.diff
> external_glslang_External_spirv-tools_CMakeLists.txt.diff
> icd_CMakeLists.txt.diff
> layers_CMakeLists.txt.diff
> loader_CMakeLists.txt.diff
> loader_loader.c.diff
> loader_vk_loader_platform.h.diff
> tests_CMakeLists.txt.diff
> 
> are mainly patches for various CMakeLists.txt files. The last patch is
> not tested yet since the package build does not run tests.
> 
> Vulkan has been built successfully with the attached patches on hurd-
> i386 and kfreebsd-amd64 boxes. 
> 
> This package is important to have available due to the build dependency
> chain of wine-development:
> wine-development -> libvkd3d-dev -> libvulkan-dev

Hi, have you sent these upstream? There are four repositories upstream now:

https://github.com/KhronosGroup/Vulkan-Headers
https://github.com/KhronosGroup/Vulkan-Loader
https://github.com/KhronosGroup/Vulkan-ValidationLayers
https://github.com/KhronosGroup/Vulkan-Tools

and the new packaging is now in NEW.


-- 
t



Bug#907152: vulkan: Porting to non-linux systems

2018-08-24 Thread Svante Signell
Source: vulkan
Version: 1.1.73+dfsg-1
Severity: important
Tags: ftbfs, patch
User: debian-h...@lists.debian.org, debian-k...@lists.debian.org
Usertags: hurd-i386, kfreebsd-any

Hello,

Currently vulkan is not available on GNU/Hurd and GNU/kFreeBSD due to
lack of porting to these architectures. Attached is a patch,
debian_control.diff, to make the libwayland-dev dependency linux-only
and add hurd, kfreebsd to the Architecture field of the packages.

The remaining patches:

CMakeLists.txt.diff
demos_CMakeLists.txt.diff
demos_smoke_CMakeLists.txt.diff
external_glslang_External_spirv-tools_CMakeLists.txt.diff
icd_CMakeLists.txt.diff
layers_CMakeLists.txt.diff
loader_CMakeLists.txt.diff
loader_loader.c.diff
loader_vk_loader_platform.h.diff
tests_CMakeLists.txt.diff

are mainly patches for various CMakeLists.txt files. The last patch is
not tested yet since the package build does not run tests.

Vulkan has been built successfully with the attached patches on hurd-
i386 and kfreebsd-amd64 boxes. 

This package is important to have available due to the build dependency
chain of wine-development:
wine-development -> libvkd3d-dev -> libvulkan-dev

Thanks!--- a/debian/control	2018-08-22 07:52:50.0 +0200
+++ b/debian/control	2018-08-22 08:03:31.0 +0200
@@ -4,7 +4,7 @@
 Uploaders: Timo Aaltonen 
 Build-Depends: debhelper (>= 9),
  cmake,
- libwayland-dev,
+ libwayland-dev [linux-any],
  libx11-dev,
  libxcb1-dev,
  libxrandr-dev,
@@ -20,7 +20,7 @@
 Vcs-Browser: https://salsa.debian.org/xorg-team/vulkan/vulkan.git
 
 Package: libvulkan1
-Architecture: linux-any
+Architecture: linux-any kfreebsd-any hurd-any
 Depends: ${shlibs:Depends}, ${misc:Depends}
 Breaks: vulkan-loader,
  libvulkan-dev (<< 1.1.70+dfsg1-2),
@@ -37,7 +37,7 @@
 
 Package: libvulkan-dev
 Section: libdevel
-Architecture: linux-any
+Architecture: linux-any kfreebsd-any hurd-any
 Depends:
  libvulkan1 (= ${binary:Version}),
  ${misc:Depends},
@@ -53,7 +53,7 @@
  This package includes files needed for development.
 
 Package: vulkan-utils
-Architecture: linux-any
+Architecture: linux-any kfreebsd-any hurd-any
 Section: graphics
 Depends: ${shlibs:Depends}, ${misc:Depends},
  libvulkan1,
Index: vulkan-1.1.73+dfsg/demos/CMakeLists.txt
===
--- vulkan-1.1.73+dfsg.orig/demos/CMakeLists.txt
+++ vulkan-1.1.73+dfsg/demos/CMakeLists.txt
@@ -73,7 +73,71 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux
 include_directories ("${PROJECT_SOURCE_DIR}/icd/common")
 link_libraries(${API_LOWERCASE} m)
 elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
-add_definitions(-DVK_USE_PLATFORM_MACOS_MVK)
+add_definitions(-DVK_USE_PLATFORM_XCB_KHR)
+elseif(CMAKE_SYSTEM_NAME STREQUAL "kFreeBSD")
+if (NOT DEMOS_WSI_SELECTION)
+set(DEMOS_WSI_SELECTION "XCB")
+endif()
+
+if (DEMOS_WSI_SELECTION STREQUAL "XCB")
+if (NOT BUILD_WSI_XCB_SUPPORT)
+message( FATAL_ERROR "Selected XCB for demos build but not building Xcb support" )
+endif()
+set(DEMO_INCLUDE_DIRS
+${XCB_INCLUDE_DIRS}
+${DEMO_INCLUDE_DIRS}
+)
+link_libraries(${XCB_LIBRARIES})
+add_definitions(-DVK_USE_PLATFORM_XCB_KHR)
+elseif(DEMOS_WSI_SELECTION STREQUAL "XLIB")
+if (NOT BUILD_WSI_XLIB_SUPPORT)
+message( FATAL_ERROR "Selected XLIB for demos build but not building Xlib support" )
+endif()
+set(DEMO_INCLUDE_DIRS
+${X11_INCLUDE_DIR}
+${DEMO_INCLUDE_DIRS}
+)
+link_libraries(${X11_LIBRARIES})
+add_definitions(-DVK_USE_PLATFORM_XLIB_KHR)
+elseif(DEMOS_WSI_SELECTION STREQUAL "DISPLAY")
+add_definitions(-DVK_USE_PLATFORM_DISPLAY_KHR)
+else()
+message( FATAL_ERROR "Unrecognized value for DEMOS_WSI_SELECTION: ${DEMOS_WSI_SELECTION}" )
+ endif()
+include_directories ("${PROJECT_SOURCE_DIR}/icd/common")
+link_libraries(${API_LOWERCASE} m)
+elseif(CMAKE_SYSTEM_NAME STREQUAL "GNU")
+if (NOT DEMOS_WSI_SELECTION)
+set(DEMOS_WSI_SELECTION "XCB")
+endif()
+
+if (DEMOS_WSI_SELECTION STREQUAL "XCB")
+if (NOT BUILD_WSI_XCB_SUPPORT)
+message( FATAL_ERROR "Selected XCB for demos build but not building Xcb support" )
+endif()
+set(DEMO_INCLUDE_DIRS
+${XCB_INCLUDE_DIRS}
+${DEMO_INCLUDE_DIRS}
+)
+link_libraries(${XCB_LIBRARIES})
+add_definitions(-DVK_USE_PLATFORM_XCB_KHR)
+elseif(DEMOS_WSI_SELECTION STREQUAL "XLIB")
+if (NOT BUILD_WSI_XLIB_SUPPORT)
+message( FATAL_ERROR "Selected XLIB for demos build but not building Xlib support" )
+endif()
+set(DEMO_INCLUDE_DIRS
+${X11_INCLUDE_DIR}
+${DEMO_INCLUDE_DIRS}
+)
+link_libraries(${X11_LIBRARIES})
+add_definitions(-DVK_USE_PLATFORM_XLIB_KHR)
+elseif(DEMOS_WSI_SELECTION STREQUAL "DISPLAY")
+add_definiti