@ -12,12 +12,15 @@ package("libxkbcommon")
add_extsources ( " apt::libxkbcommon-dev " )
end
add_configs ( " x11 " , { description = " Switch backend to X11 (default is wayland). " , default = false , type = " boolean " } )
add_configs ( " x11 " , { description = " Enable backend to X11 (default is false). " , default = false , type = " boolean " } )
add_configs ( " wayland " , { description = " Enable backend to X11 (default is true). " , default = true , type = " boolean " } )
on_load ( " linux " , function ( package )
if package : config ( " x11 " ) then
package : add ( " deps " , " libxcb " , " xcb-proto " , " libxml2 " )
package : add ( " extsources " , " pacman::libxkbcommon-x11 " )
else
end
if package : config ( " wayland " ) then
package : add ( " deps " , " wayland " )
package : add ( " extsources " , " pacman::libxkbcommon " )
end
@ -26,13 +29,16 @@ package("libxkbcommon")
add_deps ( " meson " )
on_install ( " linux " , function ( package )
package : addenv ( " PATH " , " bin " )
local configs = { " -Denable-docs=false " , " -Dc_link_args=-lm " }
table.insert ( configs , " --libdir=lib " )
if package : config ( " x11 " ) then
table.join2 ( configs , { " -Denable-wayland=false " , " -Dxkb-config-root=/usr/share/X11/xkb " , " -Dx-locale-root=/usr/share/X11/locale " } )
else
table.join2 ( configs , { " -Denable-x11=false " , " -Dxkb-config-root=/usr/share/X11/xkb " , " -Dx-locale-root=/usr/share/X11/locale " } )
end
local configs = {
" -Denable-docs=false " ,
" -Dc_link_args=-lm " ,
" -Dxkb-config-root=/usr/share/X11/xkb " ,
" -Dx-locale-root=/usr/share/X11/locale " ,
" --libdir=lib " ,
format ( " -Denable-x11=%s " , package : config ( " x11 " ) ) ,
format ( " -Denable-wayland=%s " , package : config ( " wayland " ) ) ,
}
import ( " package.tools.meson " ) . install ( package , configs )
end )