51 lines
1.1 KiB
Python
51 lines
1.1 KiB
Python
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)
|