Merge pull request 'feat: add package gtk4' (#14) from sisungo/ports:gtk4 into main

Reviewed-on: #14
This commit was merged in pull request #14.
This commit is contained in:
sisungo committed 2026-11-09 10:04:27 +00:00
commit 2bc64bf1ce
2 files changed
+130 -43

No files matched your search

+117
View File
@@ -0,0 +1,117 @@
from lib.make import *
from lib import cpp, arch
version("4.23.3")
description("The main GTK4 library.")
maintainer("sisungo <[email protected]>")
source_url("https://download.gnome.org/sources/gtk/4.23/gtk-4.23.3.tar.xz")
builddep("shortcut/c++")
builddep("shortcut/meson")
builddep("glib-dev @target")
builddep("gdk-pixbuf-dev @target")
builddep("gobject-introspection @target")
builddep("glib-tools")
builddep("libwayland-dev @target")
builddep("wayland-protocols @target")
builddep("libpango-dev @target")
builddep("libcairo-gobject-dev @target")
builddep("libepoxy-dev @target")
builddep("libxkbcommon-dev @target")
builddep("libgraphene-dev @target")
builddep("cups-dev @target")
builddep("libvulkan-dev @target")
builddep("vulkan-headers @target")
builddep("libgstreamer-dev @target")
#builddep("libgstgl-dev @target")
#builddep("libgstplay-dev @target")
builddep("libgstallocators-dev @target")
builddep("shaderc")
builddep("linux-dev @target")
def build():
cpp.meson_setup([
"--prefix=/",
f"--libdir={get_prefix('libgtk')}/lib",
f"--datadir={get_prefix('gtk-common')}/share",
f"--includedir={get_prefix('libgtk-dev')}/include",
"-Dx11-backend=false",
"-Dwayland-backend=true",
"-Dmedia-gstreamer=disabled",
"-Dprint-cups=enabled",
"-Dvulkan=enabled",
"-Dintrospection=enabled",
])
cpp.meson_compile()
cpp.meson_install()
on_build(build)
def pack_common(composer):
composer.makedir("share")
composer.add("share/mime")
composer.add("share/gtk-4.0")
def pack_bin(composer):
composer.makedir("bin")
composer.add("bin/gtk4-image-tool")
composer.add("bin/gtk4-launch")
composer.add("bin/gtk4-query-settings")
composer.add("bin/gtk4-update-icon-cache")
package("gtk-common")
arch_any()
on_pack(pack_common)
package("libgtk")
dep("gtk-common (same-version) @any")
dep("libgmodule @same-arch")
dep("libglib @same-arch")
dep("libgobject @same-arch")
dep("libpango @same-arch")
dep("libcairo @same-arch")
dep("libharfbuzz @same-arch")
dep("libfribidi @same-arch")
dep("libcairo-gobject @same-arch")
dep("gdk-pixbuf @same-arch")
dep("libepoxy @same-arch")
dep("libgraphene @same-arch")
dep("libfontconfig @same-arch")
dep("libvulkan @same-arch")
dep("libpng @same-arch")
dep("libtiff @same-arch")
dep("libjpeg @same-arch")
dep("libxkbcommon @same-arch")
dep("libwayland @same-arch")
dep("libcups @same-arch")
dep("semi-libc @same-arch")
cpp.use_auto_pack(["lib"])
package("gtk-bin")
dep("libgtk (same)")
on_pack(pack_bin)
package("libgtk-dev")
dep("libgtk (same)")
dep("glib-dev @same-arch")
dep("libpango-dev @same-arch")
dep("libcairo-dev @same-arch")
dep("libharfbuzz-dev @same-arch")
dep("libfribidi-dev @same-arch")
dep("libcairo-gobject-dev @same-arch")
dep("gdk-pixbuf-dev @same-arch")
dep("libepoxy-dev @same-arch")
dep("libgraphene-dev @same-arch")
dep("libfontconfig-dev @same-arch")
dep("libvulkan-dev @same-arch")
dep("libpng-dev @same-arch")
dep("libtiff-dev @same-arch")
dep("libjpeg-dev @same-arch")
dep("libxkbcommon-dev @same-arch")
dep("libwayland-dev @same-arch")
dep("cups-dev @same-arch")
dep("semi-libc-dev @same-arch")
cpp.use_auto_pack(["dev"])
+13 -43
View File
@@ -6,7 +6,7 @@ from lib.make import *
from lib import cpp
version("14.3.1")
version("14.3.1+1")
description("HarfBuzz text shaping engine")
maintainer("sisungo <[email protected]>")
source_managed("github://harfbuzz/harfbuzz#14.3.1")
@@ -20,26 +20,14 @@ builddep("gobject-introspection @target")
builddep("glib-tools")
def fix_pc(newpkgname):
path = f"lib/pkgconfig/harfbuzz-{newpkgname}.pc"
with open(path, 'r') as file:
content = file.read()
content = content.replace(
"-I${includedir}/harfbuzz",
f"-I${{includedir}}/harfbuzz -I{get_prefix(f'libharfbuzz-{newpkgname}-dev')}/include/harfbuzz"
)
content = content.replace("-L${libdir}", f"-L${{libdir}} -L{get_prefix(f'libharfbuzz-{newpkgname}')}/lib")
with open(path, 'wt+') as file:
file.write(content)
def build():
cpp.meson_setup([
"--prefix=/",
f"--libdir={get_prefix('libharfbuzz')}/lib",
f"--bindir={get_prefix('harfbuzz-tools')}/bin",
f"--includedir={get_prefix('libharfbuzz-dev')}/include",
f"-Dcmakepackagedir={get_prefix('libharfbuzz-dev')}/lib/cmake",
"-Dglib=disabled",
"-Dglib=enabled",
"-Dgobject=enabled",
"-Dcairo=enabled",
"-Dicu=enabled",
@@ -51,32 +39,24 @@ def build():
if os.path.exists("../cpp_install"):
shutil.rmtree("../cpp_install")
cpp.meson_install()
os.mkdir("include/gir")
os.rename("share/gir-1.0", "include/gir/gir-1.0")
fix_pc("gobject")
on_build(build)
def pack_glob(composer, globs, excluded_kw=[]):
for iglob in globs:
for i in glob.glob(iglob):
if any(excluded_pattern in i for excluded_pattern in excluded_kw):
continue
composer.makedirs(os.path.dirname(i))
if os.path.islink(i) or os.path.isfile(i):
composer.addfile(i)
else:
composer.add_dir(i)
package("libharfbuzz")
dep("libfreetype @same-arch")
dep("libcairo @same-arch")
dep("libicu4c @same-arch")
dep("libpng @same-arch")
dep("libglib @same-arch")
dep("libgobject @same-arch")
dep("libz @same-arch")
on_pack(lambda c: pack_glob(c, ["lib/*.so*"], ["gobject"]))
provide("libharfbuzz-gobject @same-arch")
cpp.use_auto_pack(["lib"])
package("harfbuzz-tools")
dep("libharfbuzz (same)")
cpp.use_auto_pack(["bin"])
package("libharfbuzz-dev")
dep("libharfbuzz (same)")
@@ -85,16 +65,6 @@ dep("libcairo-dev @same-arch")
dep("libicu4c-dev @same-arch")
dep("libpng-dev @same-arch")
dep("libz-dev @same-arch")
on_pack(lambda c: pack_glob(c, ["lib/cmake", "lib/pkgconfig/*", "include/harfbuzz/*"], ["gobject"]))
package("libharfbuzz-gobject")
dep("libharfbuzz (same)")
dep("libglib @same-arch")
dep("libgobject @same-arch")
on_pack(lambda c: pack_glob(c, ["lib/*gobject*", "lib/girepository-1.0"]))
package("libharfbuzz-gobject-dev")
dep("libharfbuzz-gobject (same)")
dep("libharfbuzz-dev (same)")
dep("glib-dev @same-arch")
on_pack(lambda c: pack_glob(c, ["lib/pkgconfig/*gobject*", "include/harfbuzz/*gobject*", "include/gir"]))
provide("libharfbuzz-gobject-dev @same-arch")
cpp.use_auto_pack(["dev"])