45 lines
1.3 KiB
Python
45 lines
1.3 KiB
Python
import os
|
|
|
|
from lib import cpp
|
|
from lib.make import *
|
|
|
|
|
|
version("1.9.1")
|
|
description("Library for parsing Linux raw trace events")
|
|
maintainer("sisungo <[email protected]>")
|
|
source_url("https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/snapshot/libtraceevent-1.9.1.tar.gz")
|
|
|
|
builddep("shortcut/c")
|
|
builddep("shortcut/autotools")
|
|
|
|
|
|
def build():
|
|
cpp.make()
|
|
cpp.make_install([
|
|
"prefix=/",
|
|
f"libdir={get_prefix('libtraceevent')}/lib",
|
|
f"includedir={get_prefix('libtraceevent-dev')}/include/traceevent",
|
|
"DESTDIR=../cpp_install"
|
|
])
|
|
os.makedirs("lib/pkgconfig", exist_ok=True)
|
|
with open(f"lib/{current_target()}/pkgconfig/libtraceevent.pc") as fd:
|
|
pc = fd.read()
|
|
pc = pc.replace("prefix=/usr/local", "/")
|
|
pc = pc.replace("libdir=${prefix}/lib64", f"libdir={get_prefix('libtraceevent')}/lib")
|
|
pc = pc.replace("includedir=${prefix}/include", f"includedir={get_prefix('libtraceevent-dev')}/include")
|
|
with open("lib/pkgconfig/libtraceevent.pc", "wt+") as fd:
|
|
fd.write(pc)
|
|
|
|
on_build(build)
|
|
|
|
|
|
package("libtraceevent")
|
|
dep("semi-libc @same-arch")
|
|
cpp.use_auto_pack(["lib"])
|
|
|
|
package("libtraceevent-dev")
|
|
dep("libtraceevent (same)")
|
|
dep("semi-libc-dev @same-arch")
|
|
dep("linux-dev @same-arch")
|
|
cpp.use_auto_pack(["dev"])
|