From 6128ec926fd28859ca3b743ef0301d4eed3780ff Mon Sep 17 00:00:00 2001 From: System-Arch <33330183+System-Arch@users.noreply.github.com> Date: Fri, 27 Jan 2023 07:45:55 -0500 Subject: [PATCH] (#14544) M4 Conan 2.0 compatibility * M4 Conan 2.0 compatibility * Restore v1 support for M4 env. var. * Set env_info.PATH in Conan 2 compatible manner * Removed cond. logic for self.output.PATH.append (see conan-io/conan#12673) * Added workaround for Conan issue #12685 * Tweaked how win_bash is set * Removed workaround for Conan issue #12685 (fixed in beta8) * Fixed lint issue * Conan 2.0 renamed output in self.run() * Bumped required_conan_version to clear "failed" label * Removed optional bootstrap support per CCI decision * Removed import for chdir * Removed handling of COPYING as symlink (which it is in Git repo) --- recipes/m4/all/conanfile.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/recipes/m4/all/conanfile.py b/recipes/m4/all/conanfile.py index 0420d3bb0e6418..7ed736181065e0 100644 --- a/recipes/m4/all/conanfile.py +++ b/recipes/m4/all/conanfile.py @@ -6,8 +6,9 @@ from conan.tools.microsoft import is_msvc, unix_path from conan.tools.scm import Version import os +import shutil -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.55.0" class M4Conan(ConanFile): @@ -35,9 +36,9 @@ def package_id(self): def build_requirements(self): if self._settings_build.os == "Windows": - if not self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool): - self.tool_requires("msys2/cci.latest") self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") def source(self): get(self, **self.conan_data["sources"][self.version], @@ -88,11 +89,12 @@ def generate(self): def _patch_sources(self): apply_conandata_patches(self) - # dummy file for configure - help2man = os.path.join(self.source_folder, "help2man") - save(self, help2man, "#!/usr/bin/env bash\n:") - if os.name == "posix": - os.chmod(help2man, os.stat(help2man).st_mode | 0o111) + if shutil.which("help2man") == None: + # dummy file for configure + help2man = os.path.join(self.source_folder, "help2man") + save(self, help2man, "#!/usr/bin/env bash\n:") + if os.name == "posix": + os.chmod(help2man, os.stat(help2man).st_mode | 0o111) def build(self): self._patch_sources() @@ -103,8 +105,7 @@ def build(self): def package(self): copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) autotools = Autotools(self) - # 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)}"]) + autotools.install() rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self):