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

tcl: Add 8.6.15 and 9.0.0 #25911

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
10 changes: 10 additions & 0 deletions recipes/tcl/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
sources:
"9.0.0":
url: "https://downloads.sourceforge.net/project/tcl/Tcl/9.0.0/tcl9.0.0-src.tar.gz"
sha256: "3bfda6dbaee8e9b1eeacc1511b4e18a07a91dff82d9954cdb9c729d8bca4bbb7"
"8.6.15":
url: "https://downloads.sourceforge.net/project/tcl/Tcl/8.6.15/tcl8.6.15-src.tar.gz"
sha256: "861e159753f2e2fbd6ec1484103715b0be56be3357522b858d3cbb5f893ffef1"
"8.6.13":
url: "https://downloads.sourceforge.net/project/tcl/Tcl/8.6.13/tcl8.6.13-src.tar.gz"
sha256: "43a1fae7412f61ff11de2cfd05d28cfc3a73762f354a417c62370a54e2caf066"
Expand All @@ -9,6 +15,10 @@ sources:
url: "https://downloads.sourceforge.net/project/tcl/Tcl/8.6.10/tcl8.6.10-src.tar.gz"
sha256: "5196dbf6638e3df8d5c87b5815c8c2b758496eb6f0e41446596c9a4e638d87ed"
patches:
"9.0.0":
- patch_file: "patches/0001-8.6.11-no-read-only-data.patch"
"8.6.15":
- patch_file: "patches/0001-8.6.11-no-read-only-data.patch"
"8.6.13":
- patch_file: "patches/0001-8.6.11-no-read-only-data.patch"
"8.6.11":
Expand Down
23 changes: 19 additions & 4 deletions recipes/tcl/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,15 @@ def _patch_sources(self):
unix_config_dir = os.path.join(self.source_folder, "unix")
# When disabling 64-bit support (in 32-bit), this test must be 0 in order to use "long long" for 64-bit ints
# (${tcl_type_64bit} can be either "__int64" or "long long")
replace_in_file(self, os.path.join(unix_config_dir, "configure"),
"(sizeof(${tcl_type_64bit})==sizeof(long))",
"(sizeof(${tcl_type_64bit})!=sizeof(long))")
if Version(self.version) < "9.0.0":
replace_in_file(self, os.path.join(unix_config_dir, "configure"),
"(sizeof(${tcl_type_64bit})==sizeof(long))",
"(sizeof(${tcl_type_64bit})!=sizeof(long))")

unix_makefile_in = os.path.join(unix_config_dir, "Makefile.in")
# Avoid building internal libraries as shared libraries
replace_in_file(self, unix_makefile_in, "--enable-shared --enable-threads", "--enable-threads")
if Version(self.version) < "9.0.0":
replace_in_file(self, unix_makefile_in, "--enable-shared --enable-threads", "--enable-threads")
# Avoid clearing CFLAGS and LDFLAGS in the makefile
replace_in_file(self, unix_makefile_in, "\nCFLAGS\t", "\n#CFLAGS\t")
replace_in_file(self, unix_makefile_in, "\nLDFLAGS\t", "\n#LDFLAGS\t")
Expand Down Expand Up @@ -180,10 +182,23 @@ def build(self):
else:
autotools = Autotools(self)
autotools.configure(build_script_folder=self._get_configure_subdir())

exe = ".exe" if self.settings.os == "Windows" else ""
minizip = os.path.join(self.build_folder, f"minizip{exe}")

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

if "configure" in list_of_files:
# In case it tries to use the built minizip (which it uses if it can't find
# a system `zip`), fix the path to it.
replace_in_file(self, os.path.join(root, "configure"),
'ZIP_PROG="./minizip${EXEEXT_FOR_BUILD}"',
f'ZIP_PROG="{minizip}"',
strict=False)

# For some reason this target "binaries" may not be built before others
# on Windows while it's a dependency of many other targets
autotools.make(target="binaries")
Expand Down
1 change: 1 addition & 0 deletions recipes/tcl/all/test_package/library/init.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# This file is only necessary for TCL 9.0.0+
4 changes: 4 additions & 0 deletions recipes/tcl/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
versions:
"9.0.0":
folder: "all"
"8.6.15":
folder: "all"
"8.6.13":
folder: "all"
"8.6.11":
Expand Down