Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autoconf Conan 2.0 compatibility #14925

Merged
merged 14 commits into from
Feb 15, 2023
12 changes: 8 additions & 4 deletions recipes/autoconf/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

class AutoconfConan(ConanFile):
name = "autoconf"
package_type = "application"
description = (
"Autoconf is an extensible package of M4 macros that produce shell "
"scripts to automatically configure software source code packages"
Expand All @@ -32,12 +33,12 @@ def export_sources(self):
def layout(self):
basic_layout(self, src_folder="src")

def requirements(self):
self.requires("m4/1.4.19")

def package_id(self):
self.info.clear()

def requirements(self):
self.requires("m4/1.4.19") # Needed at runtime by downstream clients as well

def build_requirements(self):
self.tool_requires("m4/1.4.19")
if self._settings_build.os == "Windows":
Expand Down Expand Up @@ -79,6 +80,10 @@ def _patch_sources(self):
apply_conandata_patches(self)
replace_in_file(self, os.path.join(self.source_folder, "Makefile.in"),
"M4 = /usr/bin/env m4", "#M4 = /usr/bin/env m4")
if self._settings_build.os == "Windows":
# Handle vagaries of Windows line endings
replace_in_file(self, os.path.join(self.source_folder, "bin", "autom4te.in"),
"$result =~ s/^\\n//mg;", "$result =~ s/^\\R//mg;")

def build(self):
self._patch_sources()
Expand All @@ -101,7 +106,6 @@ def package_info(self):

# TODO: These variables can be removed since the scripts now locate the resources
# relative to themselves.

dataroot_path = os.path.join(self.package_folder, "res", "autoconf")
self.output.info(f"Defining AC_MACRODIR environment variable: {dataroot_path}")
self.buildenv_info.define_path("AC_MACRODIR", dataroot_path)
Expand Down