1 Commits
Author SHA256 Message Date
sisungo 9b4eb1a6b1 feat: add package libxkbcommon & xkeyboard-config
Signed-off-by: sisungo <[email protected]>
2026-09-07 03:30:46 +00:00
7 changed files with 154 additions and 28 deletions
-8
View File
@@ -16,7 +16,6 @@ _key_links = "links"
_key_dependencies = "dependencies"
_key_recommendations = "recommendations"
_key_provides = "provides"
_key_configure = "configure"
_current_pkgname: str = _key_global
_pkginfo: dict[str, dict[str, typing.Any]] = {
@@ -26,7 +25,6 @@ _pkginfo: dict[str, dict[str, typing.Any]] = {
_key_maintainers: [],
_key_provides: [],
_key_recommendations: [],
_key_configure: [],
},
}
_supported_arch: typing.Callable[[str], bool] = lambda x: True
@@ -89,12 +87,6 @@ def provide(s: str):
]
def configure_script(s: str):
_pkginfo[_current_pkgname][_key_configure] += [
os.path.realpath(s)
]
def _translate_dep_spec(s: str) -> str:
return (
s.replace("(same)", "(same-version) @same-arch")
-9
View File
@@ -25,15 +25,6 @@ class PkgComposer:
json.dump(link, f)
f.write("\n")
def add_configure(self, path: str, name: str = None):
if name is None:
name = os.path.basename(path)
configuredir = self.workdir + "/configure/"
dstpath = configuredir + name
os.makedirs(configuredir, exist_ok=True)
shutil.copy2(path, dstpath)
os.chmod(dstpath, 0o755)
def compose(self):
subprocess.run(
[
@@ -1,6 +0,0 @@
#!/bin/sh
[ "${ACTION}" = "remove" ] && exit 0
command -v certutil >/dev/null 2>&1 || exit 0
certutil refresh
-2
View File
@@ -27,6 +27,4 @@ def pack(composer):
package("ca-certificates")
arch_any()
configure_script("configure/refresh")
recommend("certutil")
on_pack(pack)
+103
View File
@@ -0,0 +1,103 @@
import os
from lib.make import *
from lib import cpp, arch
version("1.14.0-beta.1")
description("keymap handling library for toolkits and window systems")
maintainer("sisungo <[email protected]>")
source_url("https://github.com/xkbcommon/libxkbcommon/archive/refs/tags/xkbcommon-1.14.0-beta1.tar.gz")
builddep("shortcut/c")
builddep("shortcut/meson")
builddep("flex")
builddep("bison")
builddep("libxml2-dev @target")
builddep("libwayland-dev @target")
builddep("wayland-protocols @target")
builddep("awk")
builddep("bash")
builddep("xkeyboard-config-dev (=2.48) @any")
def build():
os.environ["PKG_CONFIG_PATH"] = "/share/pkgconfig"
# FIXME: Building the package requires `/bin/sh` to be bash.
if in_atomic():
os.system("ln -sf /bin/bash /bin/sh")
cpp.meson_setup([
f"--libdir={get_prefix('libxkbcommon')}/lib",
f"--includedir={get_prefix('libxkbcommon-dev')}/include",
f"--bindir={get_prefix('xkbcli')}/bin",
f"--libexecdir={get_prefix('xkbcli')}/libexec",
"-Denable-x11=false",
])
cpp.meson_compile()
cpp.meson_install()
on_build(build)
def pack_libxkbcommon(composer):
composer.makedir("lib")
for i in glob.glob("lib/*common*so*"):
composer.add(i)
package("libxkbcommon")
dep("semi-libc @same-arch")
cpp.use_auto_pack(["lib"])
def pack_libxkbregistry(composer):
composer.makedir("lib")
for i in glob.glob("lib/*registry*so*"):
composer.add(i)
package("libxkbregistry")
dep("semi-libc @same-arch")
dep("libxml2 @same-arch")
dep("xkeyboard-config (=2.48) @any")
cpp.use_auto_pack(["lib"])
def pack_libxkbcommon_dev(composer):
composer.makedirs("lib/pkgconfig")
composer.add("lib/pkgconfig/xkbcommon.pc")
composer.makedirs("include/xkbcommon")
for i in glob.glob("include/xkbcommon/*"):
if "registry" in i:
continue
composer.add(i)
package("libxkbcommon-dev")
dep("libxkbcommon (same)")
cpp.use_auto_pack(["dev"])
def pack_libxkbregistry_dev(composer):
composer.makedirs("lib/pkgconfig")
with open("lib/pkgconfig/xkbregistry.pc", "r") as pcf:
pc = pcf.read()
pc = pc.replace(get_prefix("libxkbcommon"), get_prefix("libxkbregistry"))
pc = pc.replace(get_prefix("libxkbcommon-dev"), get_prefix("libxkbregistry-dev"))
with open("lib/pkgconfig/xkbregistry.pc", "wt+") as pcf:
pcf.write(pc)
composer.add("lib/pkgconfig/xkbregistry.pc")
composer.makedirs("include/xkbcommon")
for i in glob.glob("include/xkbcommon/*"):
if "registry" in i:
composer.add(i)
package("libxkbregistry-dev")
dep("libxkbregistry (same)")
dep("libxml2-dev @same-arch")
dep("xkeyboard-config-dev (=2.48) @any")
cpp.use_auto_pack(["dev"])
def pack_bin(composer):
composer.add("bin")
composer.add("libexec")
package("xkbcli")
dep("libxkbcommon (same)")
on_pack(pack_bin)
+51
View File
@@ -0,0 +1,51 @@
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 <[email protected]>")
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)
-3
View File
@@ -123,9 +123,6 @@ def cmd_build_package(package: str):
}
composer.write_manifest(manifest)
composer.write_links(pkginfo[lib.make._key_links])
for i in pkginfo[lib.make._key_configure]:
composer.add_configure(i)
composer.compose()
# Build success