diff --git a/mesonbuild/scripts/env2mfile.py b/mesonbuild/scripts/env2mfile.py index bd7b8d5682c0..62fc42258b51 100755 --- a/mesonbuild/scripts/env2mfile.py +++ b/mesonbuild/scripts/env2mfile.py @@ -160,6 +160,11 @@ def get_args_from_envvars(infos: MachineInfo) -> None: 'hurd': 'gnu', } +# map from DEB_HOST_ARCH_OS to Meson machine.kernel() +deb_kernel_map = { + 'kfreebsd': 'freebsd', +} + 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'} @@ -203,7 +208,8 @@ def dpkg_architecture_to_machine_info(output: str, options: T.Any) -> MachineInf host_os = deb_os_map.get(data['DEB_HOST_ARCH_OS'], data['DEB_HOST_ARCH_OS']) host_subsystem = host_os - host_kernel = 'linux' + host_kernel = deb_kernel_map.get(data['DEB_HOST_ARCH_OS'], + data['DEB_HOST_ARCH_OS']) host_cpu_family = deb_cpu_family_map.get(data['DEB_HOST_GNU_CPU'], data['DEB_HOST_GNU_CPU']) host_cpu = deb_cpu_map.get(data['DEB_HOST_ARCH'], diff --git a/unittests/internaltests.py b/unittests/internaltests.py index ccec6d5eae34..915e2881ac60 100644 --- a/unittests/internaltests.py +++ b/unittests/internaltests.py @@ -1978,7 +1978,9 @@ def locate_path(program: str) -> T.List[str]: }, system='gnu', subsystem='gnu', - # TODO: Currently linux, but should be gnu/hurd/mach? + # TODO: Currently hurd; should match whatever happens + # during native builds, but at the moment native builds + # fail when kernel() is called. # https://github.com/mesonbuild/meson/issues/13740 kernel='TODO', # TODO: Currently hurd-i386, but should be i686 @@ -2036,8 +2038,7 @@ def locate_path(program: str) -> T.List[str]: }, system='kfreebsd', subsystem='kfreebsd', - # TODO: Currently linux but should be freebsd - kernel='TODO', + kernel='freebsd', # TODO: Currently kfreebsd-amd64 but should be x86_64 cpu='TODO', cpu_family='x86_64',