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

update tcl/* dependencies #15384

Merged
merged 2 commits into from
Feb 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 18 additions & 15 deletions recipes/tcl/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from conans import AutoToolsBuildEnvironment, tools
from conan.tools.microsoft import is_msvc, msvc_runtime_flag
from conans import ConanFile, AutoToolsBuildEnvironment, tools
from conans.errors import ConanInvalidConfiguration
from conan.tools import files
from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
import functools
import os

Expand Down Expand Up @@ -48,7 +50,7 @@ def configure(self):
del self.settings.compiler.cppstd

def requirements(self):
self.requires("zlib/1.2.12")
self.requires("zlib/1.2.13")

def validate(self):
if self.settings.os not in ("FreeBSD", "Linux", "Macos", "Windows"):
Expand All @@ -59,15 +61,15 @@ def build_requirements(self):
self.build_requires("msys2/cci.latest")

def source(self):
tools.get(**self.conan_data["sources"][self.version],
files.get(self, **self.conan_data["sources"][self.version],
destination=self._source_subfolder, strip_root=True)

def _get_default_build_system_subdir(self):
return {
"Macos": "macosx",
"Linux": "unix",
"Windows": "win",
}[str(self.settings.os)]
return {
"Macos": "macosx",
"Linux": "unix",
"Windows": "win",
}[str(self.settings.os)]

def _get_configure_dir(self, build_system_subdir=None):
if build_system_subdir is None:
Expand Down Expand Up @@ -137,7 +139,8 @@ def _build_nmake(self, targets):
@functools.lru_cache(1)
def _configure_autotools(self):
autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows)
yes_no = lambda v: "yes" if v else "no"
def yes_no(v):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please, avoid updating methods which are working already, like this lamdba which largely used in CCI (around 470 occurrences)

return "yes" if v else "no"
conf_args = [
"--enable-threads",
"--enable-shared={}".format(yes_no(self.options.shared)),
Expand All @@ -147,8 +150,8 @@ def _configure_autotools(self):
autotools.configure(configure_dir=self._get_configure_dir(), args=conf_args, vars={"PKG_CFG_ARGS": " ".join(conf_args)})

# https://core.tcl.tk/tcl/tktview/840660e5a1
for root, _, files in os.walk(self.build_folder):
if "Makefile" in files:
for root, _, list_of_files in os.walk(self.build_folder):
if "Makefile" in list_of_files:
tools.replace_in_file(os.path.join(root, "Makefile"), "-Dstrtod=fixstrtod", "", strict=False)
return autotools

Expand All @@ -169,9 +172,9 @@ def package(self):
autotools.install()
autotools.make(target="install-private-headers")

tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig"))
tools.rmdir(os.path.join(self.package_folder, "man"))
tools.rmdir(os.path.join(self.package_folder, "share"))
files.rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig"))
files.rmdir(self, os.path.join(self.package_folder, "man"))
files.rmdir(self, os.path.join(self.package_folder, "share"))

tclConfigShPath = os.path.join(self.package_folder, "lib", "tclConfig.sh")
package_path = self.package_folder
Expand Down