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.

36 lines
1.3 KiB

6 years ago
package("bzip2")
set_homepage("https://sourceware.org/bzip2/")
set_description("Freely available, patent free, high-quality data compressor.")
6 years ago
add_urls("https://sourceware.org/pub/bzip2/bzip2-$(version).tar.gz")
add_versions("1.0.8", "ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269")
6 years ago
on_load("windows", function (package)
package:add("links", "libbz2")
end)
on_install("windows", function (package)
package:addenv("PATH", "bin")
6 years ago
io.gsub("makefile.msc", "%-MD", "-" .. package:config("vs_runtime"))
import("package.tools.nmake").build(package, {"-f", "makefile.msc", "bzip2"})
6 years ago
os.cp("libbz2.lib", package:installdir("lib"))
os.cp("*.h", package:installdir("include"))
os.cp("*.exe", package:installdir("bin"))
end)
on_install("macosx", "linux", function (package)
package:addenv("PATH", "bin")
4 years ago
local configs = {}
if package:config("pic") ~= false then
table.insert(configs, "CFLAGS=-fPIC")
end
4 years ago
io.gsub("Makefile", "PREFIX=.-\n", "PREFIX=" .. package:installdir() .. "\n")
import("package.tools.make").install(package, configs)
6 years ago
end)
on_test(function (package)
os.vrun("bzip2 --help")
assert(package:has_cfuncs("BZ2_bzCompressInit", {includes = "bzlib.h"}))
end)