feat: add package spirv-headers
Signed-off-by: sisungo <[email protected]>
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
from lib.make import *
|
||||
from lib import cpp
|
||||
|
||||
|
||||
version("1.4.357.0")
|
||||
description("SPIR-V headers")
|
||||
maintainer("sisungo <[email protected]>")
|
||||
source_url("https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/vulkan-sdk-1.4.357.0.tar.gz")
|
||||
|
||||
builddep("shortcut/cmake")
|
||||
builddep("shortcut/c")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.cmake()
|
||||
cpp.ninja()
|
||||
cpp.ninja_install()
|
||||
|
||||
on_build(build)
|
||||
|
||||
|
||||
def fix_pc(path):
|
||||
with open(path, 'r') as file:
|
||||
content = file.read()
|
||||
content = content.replace("includedir=//usr/include", f"includedir={get_prefix('spirv-headers')}/include")
|
||||
with open(path, 'wt+') as file:
|
||||
file.write(content)
|
||||
|
||||
def pack(composer):
|
||||
composer.add_dir("include", "include")
|
||||
composer.add_dir("share", "lib")
|
||||
fix_pc(f"{composer.workdir}/bundle/lib/pkgconfig/SPIRV-Headers.pc")
|
||||
|
||||
package("spirv-headers")
|
||||
on_pack(pack)
|
||||
Reference in New Issue
Block a user