bzip2: add pkg-config file (#38355)
Co-authored-by: HongZhi He <a13041902330@outlook.com>
This commit is contained in:
parent
95ca9dea89
commit
887d356e01
@ -160,3 +160,22 @@ def install(self, spec, prefix):
|
||||
force_remove("bunzip2", "bzcat")
|
||||
symlink("bzip2", "bunzip2")
|
||||
symlink("bzip2", "bzcat")
|
||||
|
||||
@run_after("install")
|
||||
def install_pkgconfig(self):
|
||||
# Add pkgconfig file after installation
|
||||
libdir = self.spec["bzip2"].libs.directories[0]
|
||||
pkg_path = join_path(self.prefix.lib, "pkgconfig")
|
||||
mkdirp(pkg_path)
|
||||
|
||||
with open(join_path(pkg_path, "bzip2.pc"), "w") as f:
|
||||
f.write("prefix={0}\n".format(self.prefix))
|
||||
f.write("exec_prefix=${prefix}/bin\n")
|
||||
f.write("libdir={0}\n".format(libdir))
|
||||
f.write("includedir={0}\n".format(self.prefix.include))
|
||||
f.write("\n")
|
||||
f.write("Name: bzip2\n")
|
||||
f.write("Description: a file compression library\n")
|
||||
f.write("Version: {0}\n".format(self.spec.version))
|
||||
f.write("Libs: -L${libdir} -lbz2\n")
|
||||
f.write("Cflags: -I${includedir}\n")
|
||||
|
Loading…
Reference in New Issue
Block a user