mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-24 17:27:39 +02:00
Read the required wayland protocols version from upstream instead of hardcoding it
This commit is contained in:
13
glfw/glfw.py
13
glfw/glfw.py
@@ -52,7 +52,7 @@ def init_env(env, pkg_config, at_least_version, module='x11'):
|
|||||||
ans.ldpaths.extend(('-framework', f))
|
ans.ldpaths.extend(('-framework', f))
|
||||||
|
|
||||||
elif module == 'wayland':
|
elif module == 'wayland':
|
||||||
at_least_version('wayland-protocols', 1, 6)
|
at_least_version('wayland-protocols', *sinfo['wayland_protocols'])
|
||||||
ans.wayland_packagedir = os.path.abspath(pkg_config('wayland-protocols', '--variable=pkgdatadir')[0])
|
ans.wayland_packagedir = os.path.abspath(pkg_config('wayland-protocols', '--variable=pkgdatadir')[0])
|
||||||
ans.wayland_scanner = os.path.abspath(pkg_config('wayland-scanner', '--variable=wayland_scanner')[0])
|
ans.wayland_scanner = os.path.abspath(pkg_config('wayland-scanner', '--variable=wayland_scanner')[0])
|
||||||
ans.wayland_protocols = tuple(sinfo[module]['protocols'])
|
ans.wayland_protocols = tuple(sinfo[module]['protocols'])
|
||||||
@@ -82,6 +82,7 @@ def build_wayland_protocols(env, run_tool, emphasis, newer, dest_dir):
|
|||||||
|
|
||||||
def collect_source_information():
|
def collect_source_information():
|
||||||
raw = open('src/CMakeLists.txt').read()
|
raw = open('src/CMakeLists.txt').read()
|
||||||
|
mraw = open('CMakeLists.txt').read()
|
||||||
|
|
||||||
def extract_sources(group, start_pos=0):
|
def extract_sources(group, start_pos=0):
|
||||||
for which in 'HEADERS SOURCES'.split():
|
for which in 'HEADERS SOURCES'.split():
|
||||||
@@ -93,8 +94,11 @@ def collect_source_information():
|
|||||||
).group(1).strip().split()
|
).group(1).strip().split()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
wayland_protocols = re.search('WaylandProtocols\s+(\S+)\s+', mraw).group(1)
|
||||||
|
wayland_protocols = list(map(int, wayland_protocols.split('.')))
|
||||||
ans = {
|
ans = {
|
||||||
'common': dict(extract_sources('common')),
|
'common': dict(extract_sources('common')),
|
||||||
|
'wayland_protocols': wayland_protocols,
|
||||||
}
|
}
|
||||||
for group in 'cocoa win32 x11 wayland osmesa'.split():
|
for group in 'cocoa win32 x11 wayland osmesa'.split():
|
||||||
m = re.search('_GLFW_' + group.upper(), raw)
|
m = re.search('_GLFW_' + group.upper(), raw)
|
||||||
@@ -244,9 +248,10 @@ def main():
|
|||||||
sinfo = collect_source_information()
|
sinfo = collect_source_information()
|
||||||
files_to_copy = set()
|
files_to_copy = set()
|
||||||
for x in sinfo.values():
|
for x in sinfo.values():
|
||||||
headers, sources = x['headers'], x['sources']
|
if isinstance(x, dict):
|
||||||
for name in headers + sources:
|
headers, sources = x['headers'], x['sources']
|
||||||
files_to_copy.add(os.path.abspath(os.path.join('src', name)))
|
for name in headers + sources:
|
||||||
|
files_to_copy.add(os.path.abspath(os.path.join('src', name)))
|
||||||
glfw_header = os.path.abspath('include/GLFW/glfw3.h')
|
glfw_header = os.path.abspath('include/GLFW/glfw3.h')
|
||||||
glfw_native_header = os.path.abspath('include/GLFW/glfw3native.h')
|
glfw_native_header = os.path.abspath('include/GLFW/glfw3native.h')
|
||||||
os.chdir(base)
|
os.chdir(base)
|
||||||
|
|||||||
@@ -79,6 +79,10 @@
|
|||||||
"osmesa_context.c"
|
"osmesa_context.c"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"wayland_protocols": [
|
||||||
|
1,
|
||||||
|
6
|
||||||
|
],
|
||||||
"win32": {
|
"win32": {
|
||||||
"headers": [
|
"headers": [
|
||||||
"win32_platform.h",
|
"win32_platform.h",
|
||||||
|
|||||||
Reference in New Issue
Block a user