mirror of
https://github.com/mpv-player/mpv
synced 2025-02-09 08:27:18 +00:00
build: fixup vendored wayland protocols with variants
Utilize the SRC variable for this to get a built-in relative path. Can be tested by adding `--variant="random_string"` to configure and build.
This commit is contained in:
parent
9de51b6032
commit
46d2f1f08d
@ -9,8 +9,11 @@ def __zshcomp_cmd__(ctx, argument):
|
|||||||
return '"${{BIN_PERL}}" "{0}/TOOLS/zsh.pl" "{1}" > "${{TGT}}"' \
|
return '"${{BIN_PERL}}" "{0}/TOOLS/zsh.pl" "{1}" > "${{TGT}}"' \
|
||||||
.format(ctx.srcnode.abspath(), argument)
|
.format(ctx.srcnode.abspath(), argument)
|
||||||
|
|
||||||
def __wayland_scanner_cmd__(ctx, mode, dir, src):
|
def __wayland_scanner_cmd__(ctx, mode, dir, src, vendored_file):
|
||||||
return "${{WAYSCAN}} {0} < {1}/{2} > ${{TGT}}".format(mode, dir, src)
|
return "${{WAYSCAN}} {0} < {1} > ${{TGT}}".format(
|
||||||
|
mode,
|
||||||
|
"${SRC}" if vendored_file else "{}/{}".format(dir, src)
|
||||||
|
)
|
||||||
|
|
||||||
def __file2string__(ctx, **kwargs):
|
def __file2string__(ctx, **kwargs):
|
||||||
ctx(
|
ctx(
|
||||||
@ -55,17 +58,33 @@ def __zshcomp__(ctx, **kwargs):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def __wayland_protocol_code__(ctx, **kwargs):
|
def __wayland_protocol_code__(ctx, **kwargs):
|
||||||
|
protocol_is_vendored = kwargs.get("vendored_protocol", False)
|
||||||
|
file_name = kwargs['protocol'] + '.xml'
|
||||||
|
|
||||||
|
if protocol_is_vendored:
|
||||||
|
del kwargs['vendored_protocol']
|
||||||
|
kwargs['source'] = '{}/{}'.format(kwargs['proto_dir'], file_name)
|
||||||
|
|
||||||
ctx(
|
ctx(
|
||||||
rule = __wayland_scanner_cmd__(ctx, 'code', kwargs['proto_dir'],
|
rule = __wayland_scanner_cmd__(ctx, 'code', kwargs['proto_dir'],
|
||||||
kwargs['protocol'] + '.xml'),
|
file_name,
|
||||||
|
protocol_is_vendored),
|
||||||
name = os.path.basename(kwargs['target']),
|
name = os.path.basename(kwargs['target']),
|
||||||
**kwargs
|
**kwargs
|
||||||
)
|
)
|
||||||
|
|
||||||
def __wayland_protocol_header__(ctx, **kwargs):
|
def __wayland_protocol_header__(ctx, **kwargs):
|
||||||
|
protocol_is_vendored = kwargs.get("vendored_protocol", False)
|
||||||
|
file_name = kwargs['protocol'] + '.xml'
|
||||||
|
|
||||||
|
if protocol_is_vendored:
|
||||||
|
del kwargs['vendored_protocol']
|
||||||
|
kwargs['source'] = '{}/{}'.format(kwargs['proto_dir'], file_name)
|
||||||
|
|
||||||
ctx(
|
ctx(
|
||||||
rule = __wayland_scanner_cmd__(ctx, 'client-header', kwargs['proto_dir'],
|
rule = __wayland_scanner_cmd__(ctx, 'client-header', kwargs['proto_dir'],
|
||||||
kwargs['protocol'] + '.xml'),
|
file_name,
|
||||||
|
protocol_is_vendored),
|
||||||
before = ('c',),
|
before = ('c',),
|
||||||
name = os.path.basename(kwargs['target']),
|
name = os.path.basename(kwargs['target']),
|
||||||
**kwargs
|
**kwargs
|
||||||
|
@ -129,11 +129,13 @@ def build(ctx):
|
|||||||
ctx.wayland_protocol_header(proto_dir = ctx.env.WL_PROTO_DIR,
|
ctx.wayland_protocol_header(proto_dir = ctx.env.WL_PROTO_DIR,
|
||||||
protocol = "unstable/idle-inhibit/idle-inhibit-unstable-v1",
|
protocol = "unstable/idle-inhibit/idle-inhibit-unstable-v1",
|
||||||
target = "video/out/wayland/idle-inhibit-v1.h")
|
target = "video/out/wayland/idle-inhibit-v1.h")
|
||||||
ctx.wayland_protocol_code(proto_dir = "../video/out/wayland",
|
ctx.wayland_protocol_code(proto_dir = "video/out/wayland",
|
||||||
protocol = "server-decoration",
|
protocol = "server-decoration",
|
||||||
|
vendored_protocol = True,
|
||||||
target = "video/out/wayland/srv-decor.c")
|
target = "video/out/wayland/srv-decor.c")
|
||||||
ctx.wayland_protocol_header(proto_dir = "../video/out/wayland",
|
ctx.wayland_protocol_header(proto_dir = "video/out/wayland",
|
||||||
protocol = "server-decoration",
|
protocol = "server-decoration",
|
||||||
|
vendored_protocol = True,
|
||||||
target = "video/out/wayland/srv-decor.h")
|
target = "video/out/wayland/srv-decor.h")
|
||||||
|
|
||||||
ctx(features = "ebml_header", target = "ebml_types.h")
|
ctx(features = "ebml_header", target = "ebml_types.h")
|
||||||
|
Loading…
Reference in New Issue
Block a user