import glob from lib.make import * from lib import cpp, arch version("2.48") description("a consistent, well-structured, frequently released, open source database of keyboard configuration data") maintainer("sisungo ") source_url("https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/archive/xkeyboard-config-2.48/xkeyboard-config-xkeyboard-config-2.48.tar.gz") builddep("shortcut/c") builddep("shortcut/meson") builddep("libintl-dev @target") builddep("gettext") builddep("libexpat") builddep("perl") def build(): cpp.meson_setup([ f"--prefix={get_prefix('xkeyboard-config')}", ]) cpp.meson_compile() cpp.meson_install() on_build(build) def pack(composer): composer.makedir("share") composer.add("share/xkeyboard-config-2") package("xkeyboard-config") arch_any() on_pack(pack) def pack_dev(composer): for i in glob.glob("share/pkgconfig/*"): with open(i, "r") as file: content = file.read() content = content.replace(get_prefix("xkeyboard-config-dev"), get_prefix("xkeyboard-config")) with open(i, "wt+") as file: file.write(content) composer.makedir("share") composer.add("share/pkgconfig") package("xkeyboard-config-dev") arch_any() dep("xkeyboard-config (same-version) @any") on_pack(pack_dev)