Skip to content

Commit

Permalink
(conan-io#14544) M4 Conan 2.0 compatibility
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
System-Arch authored and StellaSmith committed Feb 2, 2023
1 parent 350a1d6 commit 6128ec9
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions recipes/m4/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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],
Expand Down Expand Up @@ -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()
Expand All @@ -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):
Expand Down

0 comments on commit 6128ec9

Please sign in to comment.