Skip to content

Commit

Permalink
(conan-io#15384) update tcl/* dependencies
Browse files Browse the repository at this point in the history
* update tcl dependencies

* update for conan v2

---------

Co-authored-by: Eric Yen <eric@ericyen.com>
  • Loading branch information
2 people authored and StellaSmith committed Feb 2, 2023
1 parent c81dd3b commit bf5fc0f
Showing 1 changed file with 18 additions and 15 deletions.
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):
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

0 comments on commit bf5fc0f

Please sign in to comment.