feat: add package xxhash

Signed-off-by: sisungo <[email protected]>
This commit is contained in:
sisungo committed 2026-10-18 06:37:24 +00:00
1 parent 7cce55fdee
commit e1de773fa4
1 file changed
+50
+50
View File
@@ -0,0 +1,50 @@
from lib.make import *
from lib import cpp, arch
version("0.8.4")
description("Extremely fast non-cryptographic hash algorithm")
maintainer("sisungo <[email protected]>")
source_managed("github://Cyan4973/xxHash#v0.8.4")
builddep("shortcut/c")
builddep("shortcut/autotools")
def patch_pc():
with open("lib/pkgconfig/libxxhash.pc") as fd:
pc = fd.read()
pc = pc.replace("prefix=/usr/local", "prefix=/")
pc = pc.replace("includedir=${prefix}/include", f"includedir={get_prefix('libxxhash-dev')}/include")
pc = pc.replace("libdir=${exec_prefix}/lib", f"libdir={get_prefix('libxxhash')}/lib")
with open("lib/pkgconfig/libxxhash.pc", "wt") as fd:
fd.write(pc)
def build():
cpp.make()
cpp.make_install()
patch_pc()
on_build(build)
package("libxxhash")
dep("semi-libc @same-arch")
cpp.use_auto_pack(["lib"])
package("xxhash")
dep("libxxhash (same)")
provide("xxhsum")
cpp.use_auto_pack(["bin"])
package("libxxhash-dev")
dep("libxxhash (same)")
dep("semi-libc-dev @same-arch")
cpp.use_auto_pack(["dev"])
def pack_docs(composer):
composer.add("share")
package("xxhash-docs")
on_pack(pack_docs)