Browse Source

Revert "libbpf: try to fix build (#7975)" (#7979)

This reverts commit e62a124814e85872799f1d3b94c1931181bb0e51.
ruki 3 weeks ago
parent
commit
6689df40ce
1 changed files with 10 additions and 17 deletions
  1. 10 17
      packages/l/libbpf/xmake.lua

+ 10 - 17
packages/l/libbpf/xmake.lua

@@ -1,38 +1,31 @@
 package("libbpf")
+
     set_homepage("https://github.com/libbpf/libbpf")
     set_description("Automated upstream mirror for libbpf stand-alone build.")
-    set_license("BSD-2-Clause")
 
     add_urls("https://github.com/libbpf/libbpf/archive/refs/tags/$(version).tar.gz",
              "https://github.com/libbpf/libbpf.git")
-    add_versions("v1.6.2", "16f31349c70764cba8e0fad3725cc9f52f6cf952554326aa0229daaa21ef4fbd")
     add_versions("v0.3", "c168d84a75b541f753ceb49015d9eb886e3fb5cca87cdd9aabce7e10ad3a1efc")
 
-    add_deps("zlib")
-
-    on_load(function (package)
-        if package:version() and package:version():lt("0.5") then
-            package:add("deps", "libelf")
-        else
-            package:add("deps", "elfutils")
-        end
-    end)
+    add_deps("libelf", "zlib")
 
     add_includedirs("include", "include/uapi")
 
-    on_install("linux", function (package)
-        local libelfname = package:version():lt("0.5") and "libelf" or "elfutils"
-        io.writefile("xmake.lua", format([[
+    on_install("linux", "android", function (package)
+        io.writefile("xmake.lua", [[
             add_rules("mode.debug", "mode.release")
-            add_requires("%s", "zlib")
+            add_requires("libelf", "zlib")
             target("bpf")
                 set_kind("$(kind)")
                 add_files("src/*.c")
                 add_includedirs("include", "include/uapi")
-                add_packages("%s", "zlib")
+                add_packages("libelf", "zlib")
                 add_headerfiles("src/(*.h)", {prefixdir = "bpf"})
                 add_headerfiles("include/(uapi/**.h)")
-        ]], libelfname, libelfname))
+                if is_plat("android") then
+                    add_defines("__user=", "__force=", "__poll_t=uint32_t")
+                end
+        ]])
         local configs = {}
         import("package.tools.xmake").install(package, configs)
     end)