$NetBSD: patch-meson.build,v 1.3 2022/09/10 16:32:37 wiz Exp $ Avoid libdl dependency on NetBSD. https://gitlab.gnome.org/GNOME/gimp/-/issues/8604 Fix Linux Input detection, using patch from upstream. https://gitlab.gnome.org/GNOME/gimp/-/issues/8605 --- meson.build.orig 2022-08-21 19:21:38.000000000 +0000 +++ meson.build @@ -321,7 +321,11 @@ conf.set('ENABLE_RELOCATABLE_RESOURCES', math = cc.find_library('m') -dl = platform_windows ? no_dep : cc.find_library('dl') +# libdl is only required on Linux. On Windows and some (all?) BSD, it +# doesn't exist, but the API exists in libc by default (see #8604). On +# macOS, it apparently exists but linking it explicitly is actually +# unneeded as well. +dl = cc.find_library('dl', required: platform_linux) rpc = platform_windows ? cc.find_library('rpcrt4') : no_dep dbghelp = platform_windows ? cc.find_library('dbghelp') : no_dep winsock = platform_windows ? cc.find_library('ws2_32') : no_dep @@ -845,15 +849,23 @@ endif alsa = dependency('alsa', version: '>=1.0.0', required: get_option('alsa')) conf.set('HAVE_ALSA', alsa.found()) +# Linux Input if get_option('linux-input').disabled() have_linuxinput = false -elif get_option('linux-input').enabled() and not cc.has_header('linux/input.h') - error('linux/input.h header not found.') else - have_linuxinput = x11_target + have_linuxinput = cc.has_header('linux/input.h', + required: get_option('linux-input')) endif +if have_linuxinput + gudev = dependency('gudev-1.0', version: '>=167', required: get_option('gudev')) +else + gudev = no_dep +endif +conf.set('HAVE_LIBGUDEV', gudev.found()) + + # DirectX DirectInput directx = no_dep directx_sdk_path = get_option('directx-sdk-dir') @@ -874,9 +886,6 @@ if directx_sdk_path != '' and platform_w endif conf.set('HAVE_DX_DINPUT', directx.found()) -gudev = dependency('gudev-1.0', version: '>=167', required: get_option('gudev')) -conf.set('HAVE_LIBGUDEV', gudev.found()) - ################################################################################ # Email sending