# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 PortSystem 1.0 PortGroup github 1.0 github.setup KhronosGroup MoltenVK 1.1.9 v epoch 1 revision 1 set sdkversion 1.3.211.0 categories graphics maintainers {ryandesign @ryandesign} openmaintainer platforms macosx license Apache-2 # MoltenVK would build for i386, but it uses Metal which only works on x86_64 and arm64 supported_archs arm64 x86_64 description an implementation of Vulkan for Metal long_description ${name} is an implementation of the high-performance, \ industry-standard Vulkan graphics and compute API, that \ runs on Apple's Metal graphics framework. distname vulkansdk-macos-${sdkversion} use_dmg yes # url only works for the latest avalible SDK, older versions will 404 master_sites https://sdk.lunarg.com/sdk/download/${sdkversion}/mac/ checksums sha256 bfe654af00030b6e65521f834f0830f15e18c828594226865f15c92a9ea68363 \ rmd160 3674f67b37f7bcc1746d55c3baa975d0cca9dbaa \ size 275553243 depends_build port:p7zip depends_skip_archcheck p7zip variant universal {} use_configure no build { # bypass the installer that requires macOS 10.13 system "${prefix}/bin/7z x -aoa ${worksrcpath}/InstallVulkan.app/Contents/Resources/installer.dat -o${workpath}/VulkanSDK" } destroot { set output_dir ${workpath}/VulkanSDK # Xcode11 and later are required to use "xcframework" # Headers currently break build due to Xcode 12 ProcessXCFramework bug: # https://developer.apple.com/forums/thread/651043?answerId=628400022#628400022 if {${os.major} >= 18} { file copy ${output_dir}/MoltenVK/MoltenVK.xcframework ${destroot}${frameworks_dir} } file copy ${output_dir}/macOS/bin/MoltenVKShaderConverter ${destroot}${prefix}/bin file attributes ${destroot}${prefix}/bin/MoltenVKShaderConverter -permissions +x file copy ${output_dir}/macOS/lib/libMoltenVK.dylib ${destroot}${prefix}/lib # vulkan and vk_video are provided via vulkan-headers file copy ${output_dir}/MoltenVK/include/MoltenVK ${destroot}${prefix}/include if {(![variant_isset universal])} { system -W ${destroot}${prefix}/lib "lipo -thin ${configure.build_arch} libMoltenVK.dylib -o libMoltenVK.dylib 2> /dev/null" } } platform darwin { if {${os.major} < 16} { archive_sites distfiles depends_build known_fail yes pre-fetch { ui_error "${subport} @${version} requires macOS Sierra or later" return -code error "incompatible OS X version" } } }