Skip to content

Commit 6128ec9

Browse files
System-ArchStellaSmith
authored andcommitted
(conan-io#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 conan-io#12685 * Tweaked how win_bash is set * Removed workaround for Conan issue conan-io#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)
1 parent 350a1d6 commit 6128ec9

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

recipes/m4/all/conanfile.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
from conan.tools.microsoft import is_msvc, unix_path
77
from conan.tools.scm import Version
88
import os
9+
import shutil
910

10-
required_conan_version = ">=1.52.0"
11+
required_conan_version = ">=1.55.0"
1112

1213

1314
class M4Conan(ConanFile):
@@ -35,9 +36,9 @@ def package_id(self):
3536

3637
def build_requirements(self):
3738
if self._settings_build.os == "Windows":
38-
if not self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool):
39-
self.tool_requires("msys2/cci.latest")
4039
self.win_bash = True
40+
if not self.conf.get("tools.microsoft.bash:path", check_type=str):
41+
self.tool_requires("msys2/cci.latest")
4142

4243
def source(self):
4344
get(self, **self.conan_data["sources"][self.version],
@@ -88,11 +89,12 @@ def generate(self):
8889

8990
def _patch_sources(self):
9091
apply_conandata_patches(self)
91-
# dummy file for configure
92-
help2man = os.path.join(self.source_folder, "help2man")
93-
save(self, help2man, "#!/usr/bin/env bash\n:")
94-
if os.name == "posix":
95-
os.chmod(help2man, os.stat(help2man).st_mode | 0o111)
92+
if shutil.which("help2man") == None:
93+
# dummy file for configure
94+
help2man = os.path.join(self.source_folder, "help2man")
95+
save(self, help2man, "#!/usr/bin/env bash\n:")
96+
if os.name == "posix":
97+
os.chmod(help2man, os.stat(help2man).st_mode | 0o111)
9698

9799
def build(self):
98100
self._patch_sources()
@@ -103,8 +105,7 @@ def build(self):
103105
def package(self):
104106
copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"))
105107
autotools = Autotools(self)
106-
# TODO: replace by autotools.install() once https://github.com/conan-io/conan/issues/12153 fixed
107-
autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}"])
108+
autotools.install()
108109
rmdir(self, os.path.join(self.package_folder, "share"))
109110

110111
def package_info(self):

0 commit comments

Comments
 (0)