Files
2025-11-20 11:28:47 -05:00

74 lines
2.8 KiB
Tcl

# -*- 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
# Upstream build source (until more official): https://github.com/slp/homebrew-krunkit/blob/main/Formula/virglrenderer.rb
PortSystem 1.0
PortGroup gitlab 1.0
PortGroup meson 1.0
PortGroup active_variants 1.1
gitlab.instance https://gitlab.freedesktop.org
gitlab.setup slp virglrenderer 0.10.4e "" -krunkit
distname ${gitlab.project}-${gitlab.version}${gitlab.tag_suffix}
revision 2
categories graphics
license MIT
maintainers {@tsujp wz.ht:jc+macports} openmaintainer
description VirGL virtual OpenGL renderer
long_description Library that gives emulators the necessary tools to \
implement a virtio-gpu device, in particular one with 3D support.
homepage https://gitlab.freedesktop.org/virgl/virglrenderer
# XXX: Unsure if this does support x86_64. Upstream only really deals with arm64 so use only that for now.
supported_archs arm64
checksums rmd160 cfbd11ccf4e2f805c369c51fff8ca3fa6fbf5c16 \
sha256 f1bc601ac95eb03f5d24c2e767d4d26df89fa459105273010a1d8ec5319a75c5 \
size 701915
# Disable unexpected download of subprojects
meson.wrap_mode nodownload
depends_build port:pkgconfig \
port:vulkan-headers
depends_lib port:libepoxy \
port:moltenvk
configure.args \
-Dvenus=true \
-Drender-server=false
# Needed for libMoltenVK.dylib
configure.ldflags-append -Wl,-rpath,${prefix}/lib
# This port builds different depending on whether libepoxy is installed +x11 or
# +quartz. If libepoxy is +quartz and virglrenderer is installed from a binary,
# it fails to run because it expects an X11-specific symbol in libepoxy that
# isn't there.
#
# Add empty variants that do nothing but ensure this port is built with the
# same variants as libepoxy, and that a binary isn't used when libepoxy +quartz
# is installed.
variant x11 conflicts quartz {
require_active_variants libepoxy x11 quartz
}
variant quartz conflicts x11 {
require_active_variants libepoxy quartz x11
}
# If libepoxy is installed with +quartz, automatically default to using +quartz
# for this port. Otherwise, default to +x11.
if {![catch {set result [active_variants libepoxy quartz x11]}] && $result} {
default_variants +quartz
} elseif {![variant_isset quartz]} {
default_variants +x11
}
# TODO: Any tests?
# TODO: Currently this Portfile is only for the variant required for use in libkrun. There should (maybe) be a normal variant and then a +krunkit or +libkrun variant which is the equivalent of this. Look at that later, just get krunkit working for now.