add pciutils (#705)

pull/706/head
Hoildkv 3 years ago committed by GitHub
parent c2b3a855ae
commit 6153bc548e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      packages/l/libudev/xmake.lua
  2. 40
      packages/p/pciutils/xmake.lua

@ -0,0 +1,12 @@
package("libudev")
set_homepage("https://www.freedesktop.org/wiki/Software/systemd/")
set_description("API for enumerating and introspecting local devices")
on_fetch("linux", function (package, opt)
if opt.system then
return package:find_package("pkgconfig::libudev") or package:find_package("system::udev")
end
end)
add_extsources("apt::libudev-dev")

@ -0,0 +1,40 @@
package("pciutils")
set_homepage("https://mj.ucw.cz/sw/pciutils/")
set_description("The PCI Utilities")
set_license("GPL-2.0")
add_urls("https://mj.ucw.cz/download/linux/pci/pciutils-$(version).tar.gz")
add_versions("3.7.0", "08c27e01030d1fcc700d02bc2ea66c638f58a3d150e45e58852aa82ad4160d84")
if is_plat("macosx") then
add_frameworks("IOKit")
end
add_deps("zlib")
add_deps("libudev", {system = true, optional = true})
on_install("macosx", "linux", function (package)
local configs = {"ZLIB=yes"}
table.insert(configs, "SHARED=" .. (package:config("shared") and "yes" or "no"))
table.insert(configs, "PREFIX=" .. package:installdir())
local cflags = {}
local ldflags = {}
for _, dep in ipairs(package:orderdeps()) do
local fetchinfo = dep:fetch()
if fetchinfo then
for _, includedir in ipairs(fetchinfo.includedirs or fetchinfo.sysincludedirs) do
table.insert(cflags, "-I" .. includedir)
end
for _, linkdir in ipairs(fetchinfo.linkdirs) do
table.insert(ldflags, "-L" .. linkdir)
end
end
end
import("package.tools.make").build(package, configs, {cflags = cflags, ldflags = ldflags})
os.vrunv("make", table.join({"install"}, configs))
os.vrunv("make", table.join({"install-lib"}, configs))
package:addenv("PATH", "sbin")
end)
on_test(function (package)
assert(package:has_cfuncs("pci_init", {includes = "pci/pci.h"}))
end)
Loading…
Cancel
Save