From 0eb7197aad26f734b0762372c3630c21481354b6 Mon Sep 17 00:00:00 2001 From: Mark Harfouche Date: Mon, 9 Sep 2024 21:55:48 -0400 Subject: [PATCH 01/11] Add vulkan-volk --- recipes/vulkan-volk/build.sh | 10 +++++++ recipes/vulkan-volk/meta.yaml | 49 +++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 recipes/vulkan-volk/build.sh create mode 100644 recipes/vulkan-volk/meta.yaml diff --git a/recipes/vulkan-volk/build.sh b/recipes/vulkan-volk/build.sh new file mode 100644 index 0000000000000..19a49a253b607 --- /dev/null +++ b/recipes/vulkan-volk/build.sh @@ -0,0 +1,10 @@ +set -ex + +mkdir build +pushd build + +cmake ${CMAKE_ARGS} .. +ninja -j${CPU_COUNT} +ninja install + +popd diff --git a/recipes/vulkan-volk/meta.yaml b/recipes/vulkan-volk/meta.yaml new file mode 100644 index 0000000000000..169098a61ec56 --- /dev/null +++ b/recipes/vulkan-volk/meta.yaml @@ -0,0 +1,49 @@ +{% set version = "1.3.295" %} + +package: + name: vulkan-volk + version: {{ version }} + +source: + url: https://github.com/zeux/volk/releases/download/{{ version }}/vulkan-{{ version }}.tar.gz + sha256: aea9f09c49f8a4e36738003c7aa5f08f99d68b96e4028ad9fa9039d2ee9fb251 + +build: + number: 0 + run_exports: + - {{ pin_compatible('volkan-volk', max_pin='x.x.x') }} + +requirements: + build: + - {{ compiler('c') }} + - cmake + - ninja + host: + run: + +test: + commands: + - echo hi + +about: + home: https://github.com/zeux/volk + summary: volk is a meta-loader for Vulkan. + description: | + + It allows you to dynamically load entrypoints required to use Vulkan + without linking to vulkan-1.dll or statically linking Vulkan loader. + Additionally, volk simplifies the use of Vulkan extensions by automatically + loading all associated entrypoints. Finally, volk enables loading Vulkan + entrypoints directly from the driver which can increase performance by + skipping loader dispatch overhead. + + volk is written in C89 and supports Windows, Linux, Android and macOS (via + MoltenVK). + + license: MIT + license_family: MIT + license_file: LICENSE.md + +extra: + recipe-maintainers: + - hmaarrfk From a011f83fed631f3f2440c616920b1397df817566 Mon Sep 17 00:00:00 2001 From: Mark Harfouche Date: Mon, 9 Sep 2024 21:57:22 -0400 Subject: [PATCH 02/11] Add stdlib-c --- recipes/vulkan-volk/meta.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/vulkan-volk/meta.yaml b/recipes/vulkan-volk/meta.yaml index 169098a61ec56..7330476313839 100644 --- a/recipes/vulkan-volk/meta.yaml +++ b/recipes/vulkan-volk/meta.yaml @@ -16,6 +16,7 @@ build: requirements: build: - {{ compiler('c') }} + - {{ stdlib('c') }} - cmake - ninja host: From 0a8d02fdd9db937906cea6c53e38eaae85a59c01 Mon Sep 17 00:00:00 2001 From: Mark Harfouche Date: Mon, 9 Sep 2024 22:00:57 -0400 Subject: [PATCH 03/11] Explain --- recipes/vulkan-volk/meta.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/recipes/vulkan-volk/meta.yaml b/recipes/vulkan-volk/meta.yaml index 7330476313839..606e793c47e3c 100644 --- a/recipes/vulkan-volk/meta.yaml +++ b/recipes/vulkan-volk/meta.yaml @@ -1,11 +1,14 @@ {% set version = "1.3.295" %} package: + # There is already a conda-forge packaged named volk + # We use the ubuntu name vulkan-volk to avoid conflict + # https://launchpad.net/ubuntu/+source/vulkan-volk name: vulkan-volk version: {{ version }} source: - url: https://github.com/zeux/volk/releases/download/{{ version }}/vulkan-{{ version }}.tar.gz + url: https://github.com/zeux/volk/releases/download/{{ version }}/volk-{{ version }}.tar.gz sha256: aea9f09c49f8a4e36738003c7aa5f08f99d68b96e4028ad9fa9039d2ee9fb251 build: From 4be48f3b76d0821a3295ef902e77309b7df19248 Mon Sep 17 00:00:00 2001 From: Mark Harfouche Date: Mon, 9 Sep 2024 22:20:08 -0400 Subject: [PATCH 04/11] Update --- recipes/vulkan-volk/201.patch | 32 ++++++++++++++++++++++++++++++++ recipes/vulkan-volk/202.patch | 22 ++++++++++++++++++++++ recipes/vulkan-volk/bld.bat | 17 +++++++++++++++++ recipes/vulkan-volk/build.sh | 10 +++++++--- recipes/vulkan-volk/meta.yaml | 18 ++++++++++++++---- 5 files changed, 92 insertions(+), 7 deletions(-) create mode 100644 recipes/vulkan-volk/201.patch create mode 100644 recipes/vulkan-volk/202.patch create mode 100644 recipes/vulkan-volk/bld.bat diff --git a/recipes/vulkan-volk/201.patch b/recipes/vulkan-volk/201.patch new file mode 100644 index 0000000000000..a72d7b76670ac --- /dev/null +++ b/recipes/vulkan-volk/201.patch @@ -0,0 +1,32 @@ +From 9a5ce14be44b829d088601e192f91d6d88a278cd Mon Sep 17 00:00:00 2001 +From: Mark Harfouche +Date: Mon, 9 Sep 2024 22:13:21 -0400 +Subject: [PATCH] Provide a switch to control shared vs static lib + +Default is still static as you had it. +--- + CMakeLists.txt | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d3684b3..b903a90 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -27,11 +27,17 @@ if(NOT DEFINED VULKAN_HEADERS_INSTALL_DIR) + set(VULKAN_HEADERS_INSTALL_DIR "" CACHE PATH "Where to get the Vulkan headers") + endif() + ++option(BUILD_SHARED_LIBS "Build shared libraries" OFF) ++ + # ----------------------------------------------------- + # Static library + + if(NOT VOLK_HEADERS_ONLY OR VOLK_INSTALL) ++ if(BUILD_SHARED_LIBS) ++ add_library(volk STATIC volk.h volk.c) ++ else() + add_library(volk STATIC volk.h volk.c) ++ endif() + add_library(volk::volk ALIAS volk) + target_include_directories(volk PUBLIC + $ diff --git a/recipes/vulkan-volk/202.patch b/recipes/vulkan-volk/202.patch new file mode 100644 index 0000000000000..3432cfe078f8e --- /dev/null +++ b/recipes/vulkan-volk/202.patch @@ -0,0 +1,22 @@ +From 689d6b60043ecf9850047e3977ff2b52d4f2dc19 Mon Sep 17 00:00:00 2001 +From: Mark Harfouche +Date: Mon, 9 Sep 2024 22:16:03 -0400 +Subject: [PATCH] don't install volk.c + +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d3684b3..e2af272 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -97,7 +97,7 @@ if(VOLK_INSTALL) + set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/volk) + + # Install files +- install(FILES volk.h volk.c DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) ++ install(FILES volk.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + + # Install library target and add it and any dependencies to export set. + install(TARGETS volk volk_headers diff --git a/recipes/vulkan-volk/bld.bat b/recipes/vulkan-volk/bld.bat new file mode 100644 index 0000000000000..90679a95cc642 --- /dev/null +++ b/recipes/vulkan-volk/bld.bat @@ -0,0 +1,17 @@ +@echo on +setlocal EnableDelayedExpansion + +mkdir build +pushd build + +cmake .. ^ + %CMAKE_ARGS% ^ + -DVOLK_INSTALL=ON ^ + -DBUILD_SHARED_LIBS=ON +if errorlevel 1 exit 1 + +cmake --build . --target install +if errorlevel 1 exit 1 + +popd + diff --git a/recipes/vulkan-volk/build.sh b/recipes/vulkan-volk/build.sh index 19a49a253b607..961723f04e597 100644 --- a/recipes/vulkan-volk/build.sh +++ b/recipes/vulkan-volk/build.sh @@ -3,8 +3,12 @@ set -ex mkdir build pushd build -cmake ${CMAKE_ARGS} .. -ninja -j${CPU_COUNT} -ninja install +cmake .. \ + ${CMAKE_ARGS} \ + -DVOLK_INSTALL=ON \ + -DBUILD_SHARED_LIBS=ON + +make -j${CPU_COUNT} +make install popd diff --git a/recipes/vulkan-volk/meta.yaml b/recipes/vulkan-volk/meta.yaml index 606e793c47e3c..3701b578ebb82 100644 --- a/recipes/vulkan-volk/meta.yaml +++ b/recipes/vulkan-volk/meta.yaml @@ -8,8 +8,15 @@ package: version: {{ version }} source: - url: https://github.com/zeux/volk/releases/download/{{ version }}/volk-{{ version }}.tar.gz + url: https://github.com/zeux/volk/archive/refs/tags/{{ version }}.tar.gz sha256: aea9f09c49f8a4e36738003c7aa5f08f99d68b96e4028ad9fa9039d2ee9fb251 + patches: + # Enable BUILD_SHARED_LIBS + # https://github.com/zeux/volk/pull/201 + - 201.patch + # Don't install volk.c + # https://github.com/zeux/volk/pull/202 + - 202.patch build: number: 0 @@ -21,13 +28,16 @@ requirements: - {{ compiler('c') }} - {{ stdlib('c') }} - cmake - - ninja + - ninja # [not unix] + - make # [unix] host: - run: + - libvulkan-headers + - libvulkan-loader test: commands: - - echo hi + - test -f ${PREFIX}/lib/libvolk${SHLIB_EXT} # [unix] + - if not exist %PREFIX%\\Library\\bin\\libvolk.dll exit 1 # [win] about: home: https://github.com/zeux/volk From d5772d162b30f47cc0444de54206be31f912b280 Mon Sep 17 00:00:00 2001 From: Mark Harfouche Date: Mon, 9 Sep 2024 22:24:19 -0400 Subject: [PATCH 05/11] Oops --- recipes/vulkan-volk/201.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/vulkan-volk/201.patch b/recipes/vulkan-volk/201.patch index a72d7b76670ac..738eda079e168 100644 --- a/recipes/vulkan-volk/201.patch +++ b/recipes/vulkan-volk/201.patch @@ -23,7 +23,7 @@ index d3684b3..b903a90 100644 if(NOT VOLK_HEADERS_ONLY OR VOLK_INSTALL) + if(BUILD_SHARED_LIBS) -+ add_library(volk STATIC volk.h volk.c) ++ add_library(volk SHARED volk.h volk.c) + else() add_library(volk STATIC volk.h volk.c) + endif() From 0d270decec52aa9dba17e6357ac86edcc195b24e Mon Sep 17 00:00:00 2001 From: Mark Harfouche Date: Mon, 9 Sep 2024 22:25:40 -0400 Subject: [PATCH 06/11] Fixup --- recipes/vulkan-volk/202.patch | 22 ---------------------- recipes/vulkan-volk/meta.yaml | 3 --- 2 files changed, 25 deletions(-) delete mode 100644 recipes/vulkan-volk/202.patch diff --git a/recipes/vulkan-volk/202.patch b/recipes/vulkan-volk/202.patch deleted file mode 100644 index 3432cfe078f8e..0000000000000 --- a/recipes/vulkan-volk/202.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 689d6b60043ecf9850047e3977ff2b52d4f2dc19 Mon Sep 17 00:00:00 2001 -From: Mark Harfouche -Date: Mon, 9 Sep 2024 22:16:03 -0400 -Subject: [PATCH] don't install volk.c - ---- - CMakeLists.txt | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index d3684b3..e2af272 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -97,7 +97,7 @@ if(VOLK_INSTALL) - set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/volk) - - # Install files -- install(FILES volk.h volk.c DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -+ install(FILES volk.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) - - # Install library target and add it and any dependencies to export set. - install(TARGETS volk volk_headers diff --git a/recipes/vulkan-volk/meta.yaml b/recipes/vulkan-volk/meta.yaml index 3701b578ebb82..4a4b2ce431b2a 100644 --- a/recipes/vulkan-volk/meta.yaml +++ b/recipes/vulkan-volk/meta.yaml @@ -14,9 +14,6 @@ source: # Enable BUILD_SHARED_LIBS # https://github.com/zeux/volk/pull/201 - 201.patch - # Don't install volk.c - # https://github.com/zeux/volk/pull/202 - - 202.patch build: number: 0 From 7ac95a6b89f3dbe92660bc317d85ebd4cbf15f29 Mon Sep 17 00:00:00 2001 From: Mark Harfouche Date: Mon, 9 Sep 2024 22:26:19 -0400 Subject: [PATCH 07/11] update test --- recipes/vulkan-volk/meta.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipes/vulkan-volk/meta.yaml b/recipes/vulkan-volk/meta.yaml index 4a4b2ce431b2a..ae712294cd591 100644 --- a/recipes/vulkan-volk/meta.yaml +++ b/recipes/vulkan-volk/meta.yaml @@ -33,6 +33,9 @@ requirements: test: commands: + # https://github.com/zeux/volk/pull/202 + - test -f ${PREFIX}/include/volk.h # [unix] + - test -f ${PREFIX}/include/volk.c # [unix] - test -f ${PREFIX}/lib/libvolk${SHLIB_EXT} # [unix] - if not exist %PREFIX%\\Library\\bin\\libvolk.dll exit 1 # [win] From 8de7f2091e96005ea570e9809db9bf9d35b4d7c6 Mon Sep 17 00:00:00 2001 From: Mark Harfouche Date: Mon, 9 Sep 2024 22:41:01 -0400 Subject: [PATCH 08/11] fixup --- recipes/vulkan-volk/201.patch | 32 -------------------------------- recipes/vulkan-volk/bld.bat | 3 +-- recipes/vulkan-volk/build.sh | 3 +-- recipes/vulkan-volk/meta.yaml | 11 +++-------- 4 files changed, 5 insertions(+), 44 deletions(-) delete mode 100644 recipes/vulkan-volk/201.patch diff --git a/recipes/vulkan-volk/201.patch b/recipes/vulkan-volk/201.patch deleted file mode 100644 index 738eda079e168..0000000000000 --- a/recipes/vulkan-volk/201.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 9a5ce14be44b829d088601e192f91d6d88a278cd Mon Sep 17 00:00:00 2001 -From: Mark Harfouche -Date: Mon, 9 Sep 2024 22:13:21 -0400 -Subject: [PATCH] Provide a switch to control shared vs static lib - -Default is still static as you had it. ---- - CMakeLists.txt | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index d3684b3..b903a90 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -27,11 +27,17 @@ if(NOT DEFINED VULKAN_HEADERS_INSTALL_DIR) - set(VULKAN_HEADERS_INSTALL_DIR "" CACHE PATH "Where to get the Vulkan headers") - endif() - -+option(BUILD_SHARED_LIBS "Build shared libraries" OFF) -+ - # ----------------------------------------------------- - # Static library - - if(NOT VOLK_HEADERS_ONLY OR VOLK_INSTALL) -+ if(BUILD_SHARED_LIBS) -+ add_library(volk SHARED volk.h volk.c) -+ else() - add_library(volk STATIC volk.h volk.c) -+ endif() - add_library(volk::volk ALIAS volk) - target_include_directories(volk PUBLIC - $ diff --git a/recipes/vulkan-volk/bld.bat b/recipes/vulkan-volk/bld.bat index 90679a95cc642..b10104d247903 100644 --- a/recipes/vulkan-volk/bld.bat +++ b/recipes/vulkan-volk/bld.bat @@ -6,8 +6,7 @@ pushd build cmake .. ^ %CMAKE_ARGS% ^ - -DVOLK_INSTALL=ON ^ - -DBUILD_SHARED_LIBS=ON + -DVOLK_INSTALL=ON if errorlevel 1 exit 1 cmake --build . --target install diff --git a/recipes/vulkan-volk/build.sh b/recipes/vulkan-volk/build.sh index 961723f04e597..6fe058d2a9bf7 100644 --- a/recipes/vulkan-volk/build.sh +++ b/recipes/vulkan-volk/build.sh @@ -5,8 +5,7 @@ pushd build cmake .. \ ${CMAKE_ARGS} \ - -DVOLK_INSTALL=ON \ - -DBUILD_SHARED_LIBS=ON + -DVOLK_INSTALL=ON make -j${CPU_COUNT} make install diff --git a/recipes/vulkan-volk/meta.yaml b/recipes/vulkan-volk/meta.yaml index ae712294cd591..573aeb622b5fe 100644 --- a/recipes/vulkan-volk/meta.yaml +++ b/recipes/vulkan-volk/meta.yaml @@ -10,15 +10,11 @@ package: source: url: https://github.com/zeux/volk/archive/refs/tags/{{ version }}.tar.gz sha256: aea9f09c49f8a4e36738003c7aa5f08f99d68b96e4028ad9fa9039d2ee9fb251 - patches: - # Enable BUILD_SHARED_LIBS - # https://github.com/zeux/volk/pull/201 - - 201.patch build: number: 0 run_exports: - - {{ pin_compatible('volkan-volk', max_pin='x.x.x') }} + - {{ pin_compatible('vulkan-volk', max_pin='x.x.x') }} requirements: build: @@ -33,11 +29,10 @@ requirements: test: commands: - # https://github.com/zeux/volk/pull/202 - test -f ${PREFIX}/include/volk.h # [unix] - test -f ${PREFIX}/include/volk.c # [unix] - - test -f ${PREFIX}/lib/libvolk${SHLIB_EXT} # [unix] - - if not exist %PREFIX%\\Library\\bin\\libvolk.dll exit 1 # [win] + - test -f ${PREFIX}/lib/libvolk.a # [unix] + - if not exist %PREFIX%\\Library\\lib\\libvolk.lib exit 1 # [win] about: home: https://github.com/zeux/volk From fcfb98ba1e7662ad54529723bc10d1016eafe3ca Mon Sep 17 00:00:00 2001 From: Mark Harfouche Date: Mon, 9 Sep 2024 22:42:17 -0400 Subject: [PATCH 09/11] Pin subpackage --- recipes/vulkan-volk/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/vulkan-volk/meta.yaml b/recipes/vulkan-volk/meta.yaml index 573aeb622b5fe..08fc211bfea1e 100644 --- a/recipes/vulkan-volk/meta.yaml +++ b/recipes/vulkan-volk/meta.yaml @@ -14,7 +14,7 @@ source: build: number: 0 run_exports: - - {{ pin_compatible('vulkan-volk', max_pin='x.x.x') }} + - {{ pin_subpackage('vulkan-volk', max_pin='x.x.x') }} requirements: build: From f82d056666a0f3289137dc44424342f60659a0cc Mon Sep 17 00:00:00 2001 From: Mark Harfouche Date: Mon, 9 Sep 2024 22:54:34 -0400 Subject: [PATCH 10/11] fixup windows --- recipes/vulkan-volk/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/vulkan-volk/meta.yaml b/recipes/vulkan-volk/meta.yaml index 08fc211bfea1e..32ee815428187 100644 --- a/recipes/vulkan-volk/meta.yaml +++ b/recipes/vulkan-volk/meta.yaml @@ -32,7 +32,7 @@ test: - test -f ${PREFIX}/include/volk.h # [unix] - test -f ${PREFIX}/include/volk.c # [unix] - test -f ${PREFIX}/lib/libvolk.a # [unix] - - if not exist %PREFIX%\\Library\\lib\\libvolk.lib exit 1 # [win] + - if not exist %PREFIX%\\Library\\lib\\volk.lib exit 1 # [win] about: home: https://github.com/zeux/volk From ad58bb4b5325f9d900a3821cb990ae195cac6eef Mon Sep 17 00:00:00 2001 From: Mark Harfouche Date: Mon, 9 Sep 2024 23:10:25 -0400 Subject: [PATCH 11/11] Update meta.yaml --- recipes/vulkan-volk/meta.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/recipes/vulkan-volk/meta.yaml b/recipes/vulkan-volk/meta.yaml index 32ee815428187..f458a533e3bf8 100644 --- a/recipes/vulkan-volk/meta.yaml +++ b/recipes/vulkan-volk/meta.yaml @@ -13,8 +13,9 @@ source: build: number: 0 - run_exports: - - {{ pin_subpackage('vulkan-volk', max_pin='x.x.x') }} + # This is designed to be a header only / statically linked library + # run_exports: + # - {{ pin_subpackage('vulkan-volk', max_pin='x.x.x') }} requirements: build: