Skip to content

Commit

Permalink
set win_bash in build_requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceIm committed Sep 25, 2022
1 parent 1f811f4 commit 45b0636
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions recipes/xz_utils/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,10 @@ def layout(self):
basic_layout(self, src_folder="src")

def build_requirements(self):
if self._settings_build.os == "Windows" and not is_msvc(self) and \
not self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool):
self.tool_requires("msys2/cci.latest")
if self._settings_build.os == "Windows" and not is_msvc(self):
if not self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool):
self.tool_requires("msys2/cci.latest")
self.win_bash = True

def source(self):
get(self, **self.conan_data["sources"][self.version],
Expand Down Expand Up @@ -169,10 +170,8 @@ def build(self):
self._build_msvc()
else:
autotools = Autotools(self)
self.win_bash = True
autotools.configure()
autotools.make()
self.win_bash = None

def package(self):
copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"))
Expand All @@ -195,10 +194,8 @@ def package(self):
os.path.join(self.package_folder, "lib", "lzma.lib"))
else:
autotools = Autotools(self)
self.win_bash = True
# TODO: replace by autotools.install() once https://github.com/conan-io/conan/issues/12153 fixed
autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}"])
self.win_bash = None
rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig"))
rmdir(self, os.path.join(self.package_folder, "share"))
rm(self, "*.la", os.path.join(self.package_folder, "lib"))
Expand Down

0 comments on commit 45b0636

Please sign in to comment.