# -*- 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.2.5 v github.tarball_from releases categories graphics maintainers {@gcenx gmail.com:gcenx83} openmaintainer platforms {darwin any} {macosx any >= 15} 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 MoltenVK-macos use_tar yes checksums sha256 bd9fde5a0a10e4b8f85cc2a77a958c560fcf57fa5da39dab85748d31f78ecce2 \ rmd160 42cba8034d4138f90ca562da95c01048b8d775c9 \ size 48031744 variant universal {} use_configure no build {} destroot { set output_dir ${workpath}/MoltenVK # 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}/MoltenVK/dylib/macOS/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] || ![variant_exists universal]} { system -W ${destroot}${prefix}/lib "lipo -thin ${configure.build_arch} libMoltenVK.dylib -o libMoltenVK.dylib 2> /dev/null" } } if {${subport} eq ${name}} { PortGroup stub 1.0 version 1.0 epoch 2 if {${os.major} == 15} { depends_run port:MoltenVK-1.0.41 } elseif {${os.major} == 16} { depends_run port:MoltenVK-1.1.9 } else { depends_run port:MoltenVK-latest } } # GitHub artifacts deployment target is 10.13 (Xcode14+) subport MoltenVK-latest { platforms {darwin any} {macosx >= 17} conflicts MoltenVK-1.1.9 MoltenVK-1.0.41 dist_subdir ${name}/${version} } subport MoltenVK-1.1.9 { github.setup KhronosGroup MoltenVK 1.1.9 v platforms {darwin any} {macosx >= 16} conflicts MoltenVK-latest MoltenVK-1.0.41 set sdkversion 1.3.211.0 distname vulkansdk-macos-${sdkversion} use_dmg yes use_tar no # 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 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 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] || ![variant_exists universal]} { system -W ${destroot}${prefix}/lib "lipo -thin ${configure.build_arch} libMoltenVK.dylib -o libMoltenVK.dylib 2> /dev/null" } } } # The last version before moving to APFS format dmg subport MoltenVK-1.0.41 { github.setup KhronosGroup MoltenVK 1.0.41 v conflicts MoltenVK-latest MoltenVK-1.1.9 set sdkversion 1.2.135.0 distname vulkansdk-macos-${sdkversion} extract.suffix .tar.gz master_sites https://web.archive.org/web/20200413122419if_/https://sdk.lunarg.com/sdk/download/${sdkversion}/mac/ checksums sha256 81da27908836f6f5f41ed7962ff1b4be56ded3b447d4802a98b253d492f985cf \ rmd160 a3300b70e81d2968161f194eff50c4992835a0bc \ size 183100867 build {} destroot { file copy ${worksrcpath}/MoltenVK/macOS/framework/MoltenVK.framework ${destroot}${frameworks_dir} file copy ${worksrcpath}/MoltenVK/macOS/dynamic/libMoltenVK.dylib ${destroot}${prefix}/lib # vulkan and vk_video are provided via vulkan-headers file copy ${worksrcpath}/MoltenVK/include/MoltenVK ${destroot}${prefix}/include } } if {${subport} ne ${name} && ${subport} ne "${name}-latest"} { livecheck.type none }