|
|
|
@ -3,11 +3,18 @@ package("libusb") |
|
|
|
|
set_homepage("https://libusb.info") |
|
|
|
|
set_description("A cross-platform library to access USB devices.") |
|
|
|
|
|
|
|
|
|
add_urls("https://github.com/libusb/libusb/releases/download/$(version).tar.bz2", {version = function (version) |
|
|
|
|
return version .. "/libusb-" .. (version:gsub("v", "")) |
|
|
|
|
end}) |
|
|
|
|
add_urls("https://github.com/libusb/libusb.git") |
|
|
|
|
add_versions("v1.0.24", "7efd2685f7b327326dcfb85cee426d9b871fd70e22caa15bb68d595ce2a2b12a") |
|
|
|
|
if is_plat("mingw") then |
|
|
|
|
add_urls("https://github.com/libusb/libusb/releases/download/$(version).7z", {version = function (version) |
|
|
|
|
return version .. "/libusb-" .. (version:gsub("v", "")) |
|
|
|
|
end}) |
|
|
|
|
add_versions("v1.0.24", "620CEC4DBE4868202949294157DA5ADB75C9FBB4F04266146FC833EEF85F90FB") |
|
|
|
|
else |
|
|
|
|
add_urls("https://github.com/libusb/libusb/releases/download/$(version).tar.bz2", {version = function (version) |
|
|
|
|
return version .. "/libusb-" .. (version:gsub("v", "")) |
|
|
|
|
end}) |
|
|
|
|
add_urls("https://github.com/libusb/libusb.git") |
|
|
|
|
add_versions("v1.0.24", "7efd2685f7b327326dcfb85cee426d9b871fd70e22caa15bb68d595ce2a2b12a") |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
if is_plat("macosx", "linux") then |
|
|
|
|
add_deps("autoconf", "automake", "libtool", "pkg-config") |
|
|
|
@ -53,6 +60,17 @@ package("libusb") |
|
|
|
|
end |
|
|
|
|
end) |
|
|
|
|
|
|
|
|
|
on_install("mingw", function (package) |
|
|
|
|
os.cp("include/libusb-1.0/*.h",package:installdir("include/libusb-1.0")) |
|
|
|
|
if package:is_arch("x64", "x86_64") then |
|
|
|
|
os.cp("MinGW64/dll/*", package:installdir("bin")) |
|
|
|
|
os.cp("MinGW64/static/*", package:installdir("lib")) |
|
|
|
|
elseif package:is_arch("x86", "i386") then |
|
|
|
|
os.cp("MinGW32/dll/*", package:installdir("bin")) |
|
|
|
|
os.cp("MinGW32/static/*", package:installdir("lib")) |
|
|
|
|
end |
|
|
|
|
end) |
|
|
|
|
|
|
|
|
|
on_install("macosx", "linux", function (package) |
|
|
|
|
local configs = {} |
|
|
|
|
table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no")) |
|
|
|
|