Compare commits

..
1 Commits
Author SHA1 Message Date
sisungo ea675e4c5e feat: add package libglvnd
Signed-off-by: sisungo <[email protected]>
2026-08-11 18:45:15 +08:00
2 changed files with 98 additions and 46 deletions
-46
View File
@@ -1,46 +0,0 @@
import subprocess
import os
from lib.make import *
from lib import cpp, arch
version("16.5.0")
description("Khronos-reference front end for GLSL/ESSL, partial front end for HLSL, and a SPIR-V generator")
maintainer("sisungo <[email protected]>")
source_url("https://github.com/KhronosGroup/glslang/archive/refs/tags/16.5.0.tar.gz")
builddep("shortcut/cmake")
builddep("shortcut/c++")
builddep("spirv-tools-dev")
def build():
cpp.cmake([
"-DALLOW_EXTERNAL_SPIRV_TOOLS=ON",
f"-DSPIRV-Tools-opt_DIR=/lib/{arch.get_target()}/cmake/SPIRV-Tools-opt",
f"-DSPIRV-Tools_DIR=/lib/{arch.get_target()}/cmake/SPIRV-Tools",
"-DGLSLANG_TESTS=OFF",
f"-DCMAKE_INSTALL_PREFIX={get_prefix('glslang-dev')}"
])
cpp.ninja()
cpp.ninja_install()
on_build(build)
def pack_bin(composer):
composer.add_dir("bin", "bin")
package("glslang")
dep("libcxx @same-arch")
on_pack(pack_bin)
def pack_dev(composer):
composer.add_dir("include", "include")
composer.add_dir("lib64", "lib")
os.symlink("lib", f"{composer.workdir}/bundle/lib64")
package("glslang-dev")
dep("libcxx @same-arch")
on_pack(pack_dev)
+98
View File
@@ -0,0 +1,98 @@
import os
from lib.make import *
from lib import cpp
version("1.7.0")
description("The GL Vendor-Neutral Dispatch library")
maintainer("sisungo <[email protected]>")
source_git("https://gitlab.freedesktop.org/glvnd/libglvnd.git", "v1.7.0")
builddep("shortcut/meson")
builddep("shortcut/c")
builddep("libexpat")
def build():
cpp.meson_setup([
"-Degl=true",
"-Dentrypoint-patching=disabled",
# X11 Stuff
# We don't have X11 yet, so leave them disabled
"-Dx11=disabled",
"-Dglx=disabled",
])
cpp.meson_compile()
cpp.meson_install()
on_build(build)
def fix_pc(path, name):
with open(path, 'r') as file:
content = file.read()
devpkgname = f"{name}-dev"
content = content.replace("prefix=/usr/local", f"prefix=/")
content = content.replace("includedir=${prefix}/include", f"includedir={get_prefix(devpkgname)}/include")
content = content.replace("libdir=${prefix}/lib", f"libdir={get_prefix(name)}/lib")
with open(path, 'wt+') as file:
file.write(content)
def pack_librun(composer, libname):
composer.makedir("lib")
for i in os.listdir("lib"):
if ".so" in i and i.startswith(libname):
composer.addfile(f"lib/{i}", f"lib/{i}")
def pack_libdev(composer, pkgname, pkgconfname, includenames):
composer.makedirs("lib/pkgconfig")
for i in os.listdir("lib/pkgconfig"):
if pkgconfname == i:
composer.addfile(f"lib/pkgconfig/{i}", f"lib/pkgconfig/{i}")
fix_pc(f"{composer.workdir}/bundle/lib/pkgconfig/{i}", pkgname)
composer.makedir("include")
for i in includenames:
composer.add_dir(f"include/{i}", f"include/{i}")
package("libgldispatch")
dep("semi-libc @same-arch")
on_pack(lambda composer: pack_librun(composer, "libGLdispatch"))
package("libgldispatch-dev")
dep("semi-libc @same-arch")
on_pack(lambda composer: pack_libdev(composer, "libgldispatch", "libglvnd.pc", ["glvnd", "KHR"]))
package("libegl")
dep("libgldispatch (same)")
on_pack(lambda composer: pack_librun(composer, "libEGL"))
package("libegl-dev")
dep("libegl (same)")
on_pack(lambda composer: pack_libdev(composer, "libegl", "egl.pc", ["EGL"]))
package("libglesv1-cm")
dep("libgldispatch (same)")
on_pack(lambda composer: pack_librun(composer, "libGLESv1_CM"))
package("libglesv1-cm-dev")
dep("libglesv1-cm (same)")
on_pack(lambda composer: pack_libdev(composer, "libglesv1-cm", "glesv1_cm.pc", ["GLES"]))
package("libglesv2")
dep("libgldispatch (same)")
on_pack(lambda composer: pack_librun(composer, "libGLESv2"))
package("libglesv2-dev")
dep("libglesv2 (same)")
on_pack(lambda composer: pack_libdev(composer, "libglesv2", "glesv2.pc", ["GLES2", "GLES3"]))
package("libopengl")
dep("libgldispatch (same)")
on_pack(lambda composer: pack_librun(composer, "libOpenGL"))
package("libopengl-dev")
dep("libopengl (same)")
on_pack(lambda composer: pack_libdev(composer, "libopengl", "opengl.pc", ["GL"]))