Merge pull request 'feat: add package libtraceevent' (#58) from sisungo/ports:libtraceevent into main
Reviewed-on: #58
This commit was merged in pull request #58.
This commit is contained in:
commit
78de289631
1 file changed
+44
@@ -0,0 +1,44 @@
|
||||
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"])
|
||||
Reference in new issue
Block a user