Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libhybris: add package #5460

Draft
wants to merge 11 commits into
base: dev
Choose a base branch
from
37 changes: 37 additions & 0 deletions packages/l/libhybris/xmake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package("libhybris")
set_homepage("https://github.com/libhybris/libhybris")
set_description("Hybris is a solution that commits hybris, by allowing us to use bionic-based HW adaptations in glibc systems ")

add_urls("https://github.com/libhybris/libhybris.git")
add_versions("2024.09.01", "936279916605003fba95a0f3629a6bc5e6caa343")

add_deps("autoconf", "automake", "libtool", "pkgconf", "ndk")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove ndk deps

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename pkgconf to pkg-config


on_install("linux", function (package)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you are using ndk to build android program, please use android platform, not linux

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This package is similar to dyncall and allows linux to use android .so files

local configs = {}
table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
if package:is_debug() then
table.insert(configs, "--enable-debug")
end
local ndk_version = package:dep("ndk"):version()
local ndk_version_major = ndk_version:major() or 0
local ndk_version_minor = ndk_version:minor() or 0
local ndk_version_patch = ndk_version:patch() or 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see

local ndkver = ndk:config("ndkver")

os.run(
"sh utils/extract-headers.sh --version %s %s %s",
ndk_version_major .. '.' .. ndk_version_minor .. '.' .. ndk_version_patch,
package:dep("ndk"):installdir(),
package:installdir("include")
)
os.cd("hybris")
import("package.tools.autoconf").install(package, configs)
end)

on_test(function (package)
assert(package:check_cxxsnippets({test = [[
void test() {
void* handle = hybris_dlopen("libc.so", RTLD_LAZY);
hybris_dlclose(handle);
}
]]}, {configs = {languages = "c++11"}, includes = "hybris/common/binding.h"}))
end)
Loading