From a847823411dfe82149232a6b2c96fcd430904034 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Sat, 28 Jun 2025 20:53:27 +0300 Subject: [PATCH] ports: Add tcl port --- ports/tcl/build.sh | 22 +++++++++++++++++++ ports/tcl/patches/0001-remove-ipv6.patch | 21 ++++++++++++++++++ ports/tcl/patches/0002-remove-gr_passwd.patch | 19 ++++++++++++++++ ports/tcl/patches/0003-include-alloca.patch | 13 +++++++++++ 4 files changed, 75 insertions(+) create mode 100755 ports/tcl/build.sh create mode 100644 ports/tcl/patches/0001-remove-ipv6.patch create mode 100644 ports/tcl/patches/0002-remove-gr_passwd.patch create mode 100644 ports/tcl/patches/0003-include-alloca.patch diff --git a/ports/tcl/build.sh b/ports/tcl/build.sh new file mode 100755 index 00000000..954fd87f --- /dev/null +++ b/ports/tcl/build.sh @@ -0,0 +1,22 @@ +#!/bin/bash ../install.sh + +NAME='tcl' +VERSION='8.6.12' +DOWNLOAD_URL="http://prdownloads.sourceforge.net/tcl/tcl$VERSION-src.tar.gz#26c995dd0f167e48b11961d891ee555f680c175f7173ff8cb829f4ebcde4c1a6" +TAR_CONTENT="tcl$VERSION" + +pre_configure() { + pushd unix || exit 1 +} + +post_configure() { + popd +} + +build() { + make -C unix -j$(nproc) all || exit 1 +} + +install() { + make -C unix install "DESTDIR=$BANAN_SYSROOT" || exit 1 +} diff --git a/ports/tcl/patches/0001-remove-ipv6.patch b/ports/tcl/patches/0001-remove-ipv6.patch new file mode 100644 index 00000000..8247d276 --- /dev/null +++ b/ports/tcl/patches/0001-remove-ipv6.patch @@ -0,0 +1,21 @@ +diff -ruN tcl8.6.12/unix/tclUnixSock.c tcl8.6.12-banan_os/unix/tclUnixSock.c +--- tcl8.6.12/unix/tclUnixSock.c 2021-10-29 20:08:08.000000000 +0300 ++++ tcl8.6.12-banan_os/unix/tclUnixSock.c 2025-06-26 01:23:59.649074073 +0300 +@@ -706,6 +706,7 @@ + IPv6AddressNeedsNumericRendering( + struct in6_addr addr) + { ++#ifndef __banan_os__ + if (IN6_ARE_ADDR_EQUAL(&addr, &in6addr_any)) { + return 1; + } +@@ -721,6 +722,9 @@ + + return (addr.s6_addr[12] == 0 && addr.s6_addr[13] == 0 + && addr.s6_addr[14] == 0 && addr.s6_addr[15] == 0); ++#else ++ return 0; ++#endif + } + #if defined (__clang__) || ((__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))) + #pragma GCC diagnostic pop diff --git a/ports/tcl/patches/0002-remove-gr_passwd.patch b/ports/tcl/patches/0002-remove-gr_passwd.patch new file mode 100644 index 00000000..b282ccfe --- /dev/null +++ b/ports/tcl/patches/0002-remove-gr_passwd.patch @@ -0,0 +1,19 @@ +diff -ruN tcl8.6.12/unix/tclUnixCompat.c tcl8.6.12-banan_os/unix/tclUnixCompat.c +--- tcl8.6.12/unix/tclUnixCompat.c 2021-10-29 20:08:08.000000000 +0300 ++++ tcl8.6.12-banan_os/unix/tclUnixCompat.c 2025-06-26 01:26:39.033530792 +0300 +@@ -702,6 +702,7 @@ + len += copied; + p = buf + len; + ++#ifndef __banan_os__ + /* + * Copy password. + */ +@@ -713,6 +714,7 @@ + tgtPtr->gr_passwd = (copied > 0) ? p : NULL; + len += copied; + p = buf + len; ++#endif + + /* + * Copy group members. diff --git a/ports/tcl/patches/0003-include-alloca.patch b/ports/tcl/patches/0003-include-alloca.patch new file mode 100644 index 00000000..4cfac4eb --- /dev/null +++ b/ports/tcl/patches/0003-include-alloca.patch @@ -0,0 +1,13 @@ +diff -ruN tcl8.6.12/pkgs/sqlite3.36.0/compat/sqlite3/sqlite3.c tcl8.6.12-banan_os/pkgs/sqlite3.36.0/compat/sqlite3/sqlite3.c +--- tcl8.6.12/pkgs/sqlite3.36.0/compat/sqlite3/sqlite3.c 2021-09-13 01:15:31.000000000 +0300 ++++ tcl8.6.12-banan_os/pkgs/sqlite3.36.0/compat/sqlite3/sqlite3.c 2025-06-28 02:27:43.042768624 +0300 +@@ -19854,6 +19854,9 @@ + #if !defined(alloca) && defined(_WIN32) + # define alloca _alloca + #endif ++#if !defined(alloca) && defined(__banan_os__) ++# include ++#endif + # define sqlite3StackAllocRaw(D,N) alloca(N) + # define sqlite3StackAllocZero(D,N) memset(alloca(N), 0, N) + # define sqlite3StackFree(D,P)