forked from semios/ports
feat: add general gui libraries
Signed-off-by: sisungo <[email protected]>
This commit is contained in:
@@ -0,0 +1,100 @@
|
||||
import glob
|
||||
import os
|
||||
import shutil
|
||||
|
||||
from lib.make import *
|
||||
from lib import cpp
|
||||
|
||||
|
||||
version("14.3.1")
|
||||
description("HarfBuzz text shaping engine")
|
||||
maintainer("sisungo <[email protected]>")
|
||||
source_url("https://github.com/harfbuzz/harfbuzz/releases/download/14.3.1/harfbuzz-14.3.1.tar.xz")
|
||||
|
||||
builddep("shortcut/meson")
|
||||
builddep("shortcut/c++")
|
||||
builddep("glib-dev @target")
|
||||
builddep("libicu4c-dev @target")
|
||||
builddep("libcairo-dev @target")
|
||||
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"--includedir={get_prefix('libharfbuzz-dev')}/include",
|
||||
f"-Dcmakepackagedir={get_prefix('libharfbuzz-dev')}/lib/cmake",
|
||||
"-Dglib=disabled",
|
||||
"-Dgobject=enabled",
|
||||
"-Dcairo=enabled",
|
||||
"-Dicu=enabled",
|
||||
"-Dfreetype=enabled",
|
||||
"-Dintrospection=enabled",
|
||||
"-Dtests=disabled",
|
||||
])
|
||||
cpp.meson_compile()
|
||||
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("libz @same-arch")
|
||||
on_pack(lambda c: pack_glob(c, ["lib/*.so*"], ["gobject"]))
|
||||
|
||||
package("libharfbuzz-dev")
|
||||
dep("libharfbuzz (same)")
|
||||
dep("libfreetype-dev @same-arch")
|
||||
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"]))
|
||||
Reference in New Issue
Block a user