From 0c35d2b8a2f7a24a94e3b6b47c69f29b2524e72b Mon Sep 17 00:00:00 2001 From: Ahajha Date: Sun, 10 Nov 2024 21:03:19 -0500 Subject: [PATCH 1/3] Add TCL 8.6.15 and 9.0.0 --- recipes/tcl/all/conandata.yml | 10 ++++++++++ recipes/tcl/all/conanfile.py | 10 ++++++---- recipes/tcl/all/test_package/library/init.tcl | 1 + recipes/tcl/config.yml | 4 ++++ 4 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 recipes/tcl/all/test_package/library/init.tcl diff --git a/recipes/tcl/all/conandata.yml b/recipes/tcl/all/conandata.yml index 027d30d480cf0..0730bb94a4bd8 100644 --- a/recipes/tcl/all/conandata.yml +++ b/recipes/tcl/all/conandata.yml @@ -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" @@ -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": diff --git a/recipes/tcl/all/conanfile.py b/recipes/tcl/all/conanfile.py index f3487edb47074..dceffc26f011c 100644 --- a/recipes/tcl/all/conanfile.py +++ b/recipes/tcl/all/conanfile.py @@ -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") diff --git a/recipes/tcl/all/test_package/library/init.tcl b/recipes/tcl/all/test_package/library/init.tcl new file mode 100644 index 0000000000000..f6273d291fa5a --- /dev/null +++ b/recipes/tcl/all/test_package/library/init.tcl @@ -0,0 +1 @@ +# This file is only necessary for TCL 9.0.0+ diff --git a/recipes/tcl/config.yml b/recipes/tcl/config.yml index 108b4ab57b9c6..7730d572d17f7 100644 --- a/recipes/tcl/config.yml +++ b/recipes/tcl/config.yml @@ -1,4 +1,8 @@ versions: + "9.0.0": + folder: "all" + "8.6.15": + folder: "all" "8.6.13": folder: "all" "8.6.11": From a6867f96f7b6dc10a86c1e45155a2d60ce35788e Mon Sep 17 00:00:00 2001 From: Ahajha Date: Sun, 10 Nov 2024 22:41:14 -0500 Subject: [PATCH 2/3] Build minizip first --- recipes/tcl/all/conanfile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/tcl/all/conanfile.py b/recipes/tcl/all/conanfile.py index dceffc26f011c..e0d5330ed0e0a 100644 --- a/recipes/tcl/all/conanfile.py +++ b/recipes/tcl/all/conanfile.py @@ -186,6 +186,8 @@ def build(self): 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) + # Potentially used by some of the subpackages - make sure it is built first + autotools.make(target="minizip") # 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") From 56ce1c8134151e8a7d9ffd2c3dc3d36f009d40f0 Mon Sep 17 00:00:00 2001 From: Alex Trotta Date: Mon, 11 Nov 2024 01:50:05 -0500 Subject: [PATCH 3/3] Fix path to minizip --- recipes/tcl/all/conanfile.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/recipes/tcl/all/conanfile.py b/recipes/tcl/all/conanfile.py index e0d5330ed0e0a..cf2bebf0444e8 100644 --- a/recipes/tcl/all/conanfile.py +++ b/recipes/tcl/all/conanfile.py @@ -182,12 +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) - # Potentially used by some of the subpackages - make sure it is built first - autotools.make(target="minizip") + + 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")