package An official xmake package repository
https://xrepo.xmake.io/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.6 KiB
41 lines
1.6 KiB
3 years ago
|
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)
|