Skip to content

Commit

Permalink
netpbm: clean up package folder
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Apr 6, 2024
1 parent b1203de commit 55a1f89
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions recipes/netpbm/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ def generate(self):
config.append(f"NETPBMLIBTYPE={lib_type}")
config.append(f"NETPBMLIBSUFFIX={suffix}")
config.append(f"STATICLIB_TOO={'N' if self.options.shared else 'Y'}")
config.append(f"PKGDIR_DEFAULT={self.package_folder}")
config.append(f"WANT_SSE={'Y' if self.settings.arch in ['x86', 'x86_64'] else 'N'}")
config.append("DEFAULT_TARGET=nonmerge")
config.append("LDRELOC=ld --reloc")
Expand Down Expand Up @@ -171,21 +170,22 @@ def build(self):
def package(self):
for file in ["copyright_summary", "patent_summary", "GPL_LICENSE.txt", "lgpl_v21.txt", "COPYRIGHT.PATENT"]:
copy(self, file, os.path.join(self.source_folder, "doc"), os.path.join(self.package_folder, "licenses"))
temp_dir = os.path.join(self.build_folder, "tmp")
with chdir(self, self.source_folder):
autotools = Autotools(self)
autotools.make(target="package")
autotools.make(target="package", args=[f"pkgdir={temp_dir}"])
rename(self, os.path.join(temp_dir, "include"), os.path.join(self.package_folder, "include"))
rename(self, os.path.join(temp_dir, "lib"), os.path.join(self.package_folder, "lib"))
rename(self, os.path.join(temp_dir, "misc"), os.path.join(self.package_folder, "res"))
if self.options.tools:
rename(self, os.path.join(temp_dir, "bin"), os.path.join(self.package_folder, "bin"))
rmdir(self, temp_dir)
if self.settings.os in ["Linux", "FreeBSD"]:
if self.options.shared:
soname_file = next(self.package_path.joinpath("lib").glob("libnetpbm.so.*")).name
self.run(f"ln -s {soname_file} libnetpbm.so", cwd=os.path.join(self.package_folder, "lib"))
else:
copy(self, "*.a", os.path.join(self.source_folder, "lib"), os.path.join(self.package_folder, "lib"))
rename(self, os.path.join(self.package_folder, "misc"), os.path.join(self.package_folder, "res"))
rm(self, "*_template", self.package_folder)
rmdir(self, os.path.join(self.package_folder, "staticlink"))
rmdir(self, os.path.join(self.package_folder, "sharedlink"))
if not self.options.tools:
rmdir(self, os.path.join(self.package_folder, "bin"))

def package_info(self):
self.cpp_info.set_property("pkg_config_name", "netpbm")
Expand Down

0 comments on commit 55a1f89

Please sign in to comment.