Compare commits

..
1 Commits
Author SHA1 Message Date
sisungo c540480e7e feat: add package cairo
Signed-off-by: sisungo <[email protected]>
2026-08-19 12:40:18 +08:00
3 changed files with 99 additions and 44 deletions
-1
View File
@@ -117,7 +117,6 @@ def _is_dev_file(ent) -> bool:
or ent.name.endswith(".la")
or ent.name.endswith(".pc")
or ent.name.endswith(".h")
or ent.name.endswith(".hpp")
or ent.name.endswith(".cmake")
or ent.name.endswith(".inc")
or ("Makefile" in ent.name)
+99
View File
@@ -0,0 +1,99 @@
import os
from lib import cpp
from lib.make import *
version("1.18.4")
description("a 2D graphics library with support for multiple output devices")
maintainer("sisungo <[email protected]>")
source_url("https://cairographics.org/releases/cairo-1.18.4.tar.xz")
builddep("shortcut/c")
builddep("shortcut/meson")
builddep("pkgconf")
builddep(f"glib-dev @{arch.get_target()}")
builddep(f"libfontconfig-dev @{arch.get_target()}")
builddep(f"libfreetype-dev @{arch.get_target()}")
builddep(f"libpng-dev @{arch.get_target()}")
def build():
cpp.meson_setup([
f"--libdir={get_prefix('libcairo')}/lib",
f"--includedir={get_prefix('libcairo-dev')}/include",
f"--bindir={get_prefix('libcairo-dev')}/bin",
"-Dfontconfig=enabled",
"-Dfreetype=enabled",
"-Dpng=enabled",
"-Dtee=enabled",
"-Dglib=enabled",
])
cpp.meson_compile()
cpp.meson_install()
on_build(build)
def pack_libcairo(composer):
composer.makedir("lib")
for i in os.listdir("lib"):
if ".so" in i and "gobject" not in i:
composer.addfile(f"lib/{i}", f"lib/{i}")
composer.add_dir("lib/cairo", "lib/cairo")
def pack_libcairo_dev(composer):
composer.makedirs("lib/pkgconfig")
for i in os.listdir("lib/pkgconfig"):
if "gobject" not in i:
composer.addfile(f"lib/pkgconfig/{i}", f"lib/pkgconfig/{i}")
composer.makedirs("include/cairo")
for i in os.listdir("include/cairo"):
if "gobject" not in i:
composer.addfile(f"include/cairo/{i}", f"include/cairo/{i}")
composer.add_dir("bin", "bin")
def pack_libcairo_gobject(composer):
composer.makedir("lib")
for i in os.listdir("lib"):
if ".so" in i and "gobject" in i:
composer.addfile(f"lib/{i}", f"lib/{i}")
def pack_libcairo_gobject_dev(composer):
composer.makedirs("lib/pkgconfig")
for i in os.listdir("lib/pkgconfig"):
if "gobject" in i:
composer.addfile(f"lib/pkgconfig/{i}", f"lib/pkgconfig/{i}")
composer.makedirs("include/cairo")
for i in os.listdir("include/cairo"):
if "gobject" in i:
composer.addfile(f"include/cairo/{i}", f"include/cairo/{i}")
package("libcairo")
dep("libfontconfig @same-arch")
dep("libpng @same-arch")
dep("libpixman @same-arch")
dep("libfreetype @same-arch")
dep("libz @same-arch")
on_pack(pack_libcairo)
package("libcairo-dev")
dep("libcairo (same)")
dep("libfontconfig-dev @same-arch")
dep("libpng-dev @same-arch")
dep("libpixman-dev @same-arch")
dep("libfreetype-dev @same-arch")
dep("libz-dev @same-arch")
on_pack(pack_libcairo_dev)
package("libcairo-gobject")
dep("libcairo (same)")
dep("libglib @same-arch")
dep("libgobject @same-arch")
on_pack(pack_libcairo_gobject)
package("libcairo-gobject-dev")
dep("libcairo-dev (same)")
dep("glib-dev @same-arch")
on_pack(pack_libcairo_gobject)
-43
View File
@@ -1,43 +0,0 @@
import os
import shutil
from lib.make import *
from lib import cpp, arch
sdk_version = "1.4.357.0"
version(sdk_version)
description("an API and commands for processing SPIR-V modules")
maintainer("sisungo <[email protected]>")
source_url("https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/vulkan-sdk-1.4.357.0.tar.gz")
builddep("shortcut/cmake")
builddep("shortcut/c++")
builddep(f"spirv-headers (={sdk_version}) @{arch.get_target()}")
def build():
cpp.cmake([
f"-DSPIRV-Headers_SOURCE_DIR=/lib/{arch.get_target()}",
"-DCMAKE_CXX_FLAGS=-Wno-error=switch",
f"-DCMAKE_INSTALL_PREFIX={get_prefix('spirv-tools-dev')}",
])
cpp.ninja()
cpp.ninja_install()
try:
os.rename("lib64", "lib")
os.rename("lib32", "lib")
except:
pass
on_build(build)
package("spirv-tools")
dep("libcxx @same-arch")
cpp.use_auto_pack(["bin"])
package("spirv-tools-dev")
dep("spirv-tools (same)")
cpp.use_auto_pack(["lib", "dev"])