diff --git a/mesonbuild/scripts/env2mfile.py b/mesonbuild/scripts/env2mfile.py index 93a111ddc4a0..bd7b8d5682c0 100755 --- a/mesonbuild/scripts/env2mfile.py +++ b/mesonbuild/scripts/env2mfile.py @@ -155,6 +155,11 @@ def get_args_from_envvars(infos: MachineInfo) -> None: 'powerpc64le': 'ppc64', } +# map from DEB_HOST_ARCH_OS to Meson machine.system() +deb_os_map = { + 'hurd': 'gnu', +} + def deb_detect_cmake(infos: MachineInfo, data: T.Dict[str, str]) -> None: system_name_map = {'linux': 'Linux', 'kfreebsd': 'kFreeBSD', 'hurd': 'GNU'} system_processor_map = {'arm': 'armv7l', 'mips64el': 'mips64', 'powerpc64le': 'ppc64le'} @@ -195,7 +200,8 @@ def dpkg_architecture_to_machine_info(output: str, options: T.Any) -> MachineInf k, v = line.split('=', 1) data[k] = v host_arch = data['DEB_HOST_GNU_TYPE'] - host_os = data['DEB_HOST_ARCH_OS'] + host_os = deb_os_map.get(data['DEB_HOST_ARCH_OS'], + data['DEB_HOST_ARCH_OS']) host_subsystem = host_os host_kernel = 'linux' host_cpu_family = deb_cpu_family_map.get(data['DEB_HOST_GNU_CPU'], diff --git a/unittests/internaltests.py b/unittests/internaltests.py index 13eb68752c4e..ccec6d5eae34 100644 --- a/unittests/internaltests.py +++ b/unittests/internaltests.py @@ -1976,10 +1976,8 @@ def locate_path(program: str) -> T.List[str]: 'CMAKE_SYSTEM_NAME': 'GNU', 'CMAKE_SYSTEM_PROCESSOR': 'i686', }, - # TODO: Currently hurd, but should be gnu as per - # https://mesonbuild.com/Reference-tables.html - system='TODO', - subsystem='TODO', + system='gnu', + subsystem='gnu', # TODO: Currently linux, but should be gnu/hurd/mach? # https://github.com/mesonbuild/meson/issues/13740 kernel='TODO',