From c7fb5839dc9d2e68b9e1fdd662a08ff43daf4599 Mon Sep 17 00:00:00 2001 From: tannevaled Date: Fri, 29 May 2026 11:55:59 +0200 Subject: [PATCH 1/9] =?UTF-8?q?new(tcl-lang.org/tk):=20Tk=20=E2=80=94=20Tc?= =?UTF-8?q?l's=20cross-platform=20GUI=20toolkit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Companion to tcl-lang.org. Required to build any Tcl-based GUI: git-gui, gitk, IDLE/python-tk, etc. Same upstream as Tcl (tcl-lang.org / sourceforge.net/projects/tcl). Linux uses unix/ build with X11 backend. Darwin uses macosx/ build with --enable-aqua (native Cocoa). Provides bin/wish (the Tk shell). Used as a build dep by: - python.org with Tk support (python-tk) - git-scm.org with --enable-gui (git-gui) --- projects/tcl-lang.org/tk/package.yml | 62 ++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 projects/tcl-lang.org/tk/package.yml diff --git a/projects/tcl-lang.org/tk/package.yml b/projects/tcl-lang.org/tk/package.yml new file mode 100644 index 0000000000..a2f480352c --- /dev/null +++ b/projects/tcl-lang.org/tk/package.yml @@ -0,0 +1,62 @@ +# Tk — Tcl's cross-platform GUI toolkit. +# +# Companion to tcl-lang.org. Needed to build any Tcl-based GUI: +# git-gui, gitk, IDLE/python-tk, AWR, etc. + +distributable: + url: https://downloads.sourceforge.net/project/tcl/Tcl/{{version}}/tk{{version}}-src.tar.gz + strip-components: 1 + +versions: + url: https://www.tcl-lang.org/software/tcltk/download.html + match: /tk\d+\.\d+\.\d+-src\.tar\.gz/ + strip: + - /^tk/ + - /-src\.tar\.gz/ + +platforms: + - linux/x86-64 + - linux/aarch64 + - darwin/x86-64 + - darwin/aarch64 + +dependencies: + tcl-lang.org: '*' + freedesktop.org/pkg-config: '*' + linux: + x.org/x11: '*' + x.org/exts: '*' + freetype.org: '*' + +build: + working-directory: unix + darwin: + working-directory: macosx + script: + - ./configure $ARGS + - make --jobs {{ hw.concurrency }} + - make install + - make install-private-headers || true + + - run: | + cd "{{prefix}}/bin" + [ ! -e wish ] && ln -sf "wish{{version.major}}.{{version.minor}}" wish || true + env: + ARGS: + - --prefix={{ prefix }} + - --exec-prefix={{ prefix }} + - --with-tcl={{deps.tcl-lang.org.prefix}}/lib + - --enable-shared + - --enable-threads + - --enable-64bit + darwin: + ARGS: + - --enable-aqua + +test: + - test -f "{{prefix}}/lib/libtk{{version.major}}.{{version.minor}}.dylib" -o -f "{{prefix}}/lib/libtk{{version.major}}.{{version.minor}}.so" + - echo 'puts $tk_version' | wish -display :0 2>&1 | head -1 || true + +provides: + - bin/wish + - bin/wish{{version.major}}.{{version.minor}} From 5907aa6f6fd75e768815344f3bf68fd58147e87e Mon Sep 17 00:00:00 2001 From: tannevaled Date: Fri, 29 May 2026 13:30:58 +0200 Subject: [PATCH 2/9] fix(tk): pass CPPFLAGS + --with-tclinclude (tcl.h not found) --- projects/tcl-lang.org/tk/package.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/projects/tcl-lang.org/tk/package.yml b/projects/tcl-lang.org/tk/package.yml index a2f480352c..97ebbd8c53 100644 --- a/projects/tcl-lang.org/tk/package.yml +++ b/projects/tcl-lang.org/tk/package.yml @@ -42,10 +42,16 @@ build: cd "{{prefix}}/bin" [ ! -e wish ] && ln -sf "wish{{version.major}}.{{version.minor}}" wish || true env: + # Tk needs tcl.h at compile time. CPATH from the tcl-lang.org dep + # doesn't cover it because tcl headers live in $prefix/include + # (which IS on CPATH) — but Tk's configure also needs to know the + # path explicitly for some macro tests. Belt + braces. + CPPFLAGS: -I{{deps.tcl-lang.org.prefix}}/include ARGS: - --prefix={{ prefix }} - --exec-prefix={{ prefix }} - --with-tcl={{deps.tcl-lang.org.prefix}}/lib + - --with-tclinclude={{deps.tcl-lang.org.prefix}}/include - --enable-shared - --enable-threads - --enable-64bit From f194f9b739cf70009c4d97fd9ab95e4b57487340 Mon Sep 17 00:00:00 2001 From: tannevaled Date: Fri, 29 May 2026 13:53:21 +0200 Subject: [PATCH 3/9] fix(tk): tcl.h is at include/tcl-tk/ (subdir, not flat) --- projects/tcl-lang.org/tk/package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/tcl-lang.org/tk/package.yml b/projects/tcl-lang.org/tk/package.yml index 97ebbd8c53..30801375e8 100644 --- a/projects/tcl-lang.org/tk/package.yml +++ b/projects/tcl-lang.org/tk/package.yml @@ -46,12 +46,12 @@ build: # doesn't cover it because tcl headers live in $prefix/include # (which IS on CPATH) — but Tk's configure also needs to know the # path explicitly for some macro tests. Belt + braces. - CPPFLAGS: -I{{deps.tcl-lang.org.prefix}}/include + CPPFLAGS: -I{{deps.tcl-lang.org.prefix}}/include/tcl-tk ARGS: - --prefix={{ prefix }} - --exec-prefix={{ prefix }} - --with-tcl={{deps.tcl-lang.org.prefix}}/lib - - --with-tclinclude={{deps.tcl-lang.org.prefix}}/include + - --with-tclinclude={{deps.tcl-lang.org.prefix}}/include/tcl-tk - --enable-shared - --enable-threads - --enable-64bit From b94766a8c4c34e6a9d7216789f9700be7b99286d Mon Sep 17 00:00:00 2001 From: tannevaled Date: Fri, 29 May 2026 15:18:49 +0200 Subject: [PATCH 4/9] fix(tk): cover both Tcl 8.6 + 9.0 header layouts --- projects/tcl-lang.org/tk/package.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/projects/tcl-lang.org/tk/package.yml b/projects/tcl-lang.org/tk/package.yml index 30801375e8..06e76b5362 100644 --- a/projects/tcl-lang.org/tk/package.yml +++ b/projects/tcl-lang.org/tk/package.yml @@ -42,16 +42,15 @@ build: cd "{{prefix}}/bin" [ ! -e wish ] && ln -sf "wish{{version.major}}.{{version.minor}}" wish || true env: - # Tk needs tcl.h at compile time. CPATH from the tcl-lang.org dep - # doesn't cover it because tcl headers live in $prefix/include - # (which IS on CPATH) — but Tk's configure also needs to know the - # path explicitly for some macro tests. Belt + braces. - CPPFLAGS: -I{{deps.tcl-lang.org.prefix}}/include/tcl-tk + # tcl.h's install path varies by Tcl version: 8.6 puts it at + # $prefix/include/tcl-tk/tcl.h, 9.0 at $prefix/include/tcl.h. + # Cover both with multiple -I flags. + CPPFLAGS: -I{{deps.tcl-lang.org.prefix}}/include -I{{deps.tcl-lang.org.prefix}}/include/tcl-tk ARGS: - --prefix={{ prefix }} - --exec-prefix={{ prefix }} - --with-tcl={{deps.tcl-lang.org.prefix}}/lib - - --with-tclinclude={{deps.tcl-lang.org.prefix}}/include/tcl-tk + - --with-tclinclude={{deps.tcl-lang.org.prefix}}/include - --enable-shared - --enable-threads - --enable-64bit From 07a72a82babfe9064217cdabb68605e09dedeba4 Mon Sep 17 00:00:00 2001 From: tannevaled Date: Sat, 30 May 2026 09:29:10 +0200 Subject: [PATCH 5/9] fix(tk): add info-zip.org/zip build dep (Tk 9.0+ needs zip(1)) Tk 9.0 embeds a zipfs of its own resources into libtk*.zip at build time. configure probes for `zip(1)` on PATH; if absent it prints "Building minizip" but the resulting Makefile has no rule for the `minizip` target, so make dies with "No rule to make target 'minizip', needed by 'libtk9.0.3.zip'" Providing info-zip.org/zip as a build dep lets configure pick the simple path. This is the same fix as Debian's tk-9.0 package. Co-Authored-By: Claude Opus 4.7 --- projects/tcl-lang.org/tk/package.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/projects/tcl-lang.org/tk/package.yml b/projects/tcl-lang.org/tk/package.yml index 06e76b5362..b3c650635b 100644 --- a/projects/tcl-lang.org/tk/package.yml +++ b/projects/tcl-lang.org/tk/package.yml @@ -29,6 +29,14 @@ dependencies: freetype.org: '*' build: + # Tk 9.0+ embeds a zipfs of its own resources into libtk*.zip at + # build time. configure probes for `zip(1)` on PATH; if absent it + # prints "Building minizip" but the resulting Makefile has no + # rule for the `minizip` target and `make` dies with + # "No rule to make target 'minizip', needed by 'libtk9.0.3.zip'" + # Providing zip(1) lets configure pick the simple path. + dependencies: + info-zip.org/zip: '*' working-directory: unix darwin: working-directory: macosx From 6347c16d4645d19b1b3a7aa90b7ff864dc83916e Mon Sep 17 00:00:00 2001 From: tannevaled Date: Sat, 30 May 2026 09:35:46 +0200 Subject: [PATCH 6/9] fix(tk): glob-match libtk* in test (Tk 9.0 lib naming varies) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After the zip-dep fix the build itself succeeded but the test step's literal test -f libtk9.0.so -o -f libtk9.0.dylib came back FAIL. Tk 9.0's `make install` writes the shared library under several names depending on platform and configure flags — e.g. libtk9.0.so.0, libtcl9tk9.0.so on some builds. Replace the literal-name check with a glob that accepts any libtk*.{so,dylib}* under {{prefix}}/lib/ and emits a diagnostic listing if nothing matches (so a future failure tells us the actual name rather than just "false"). Co-Authored-By: Claude Opus 4.7 --- projects/tcl-lang.org/tk/package.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/projects/tcl-lang.org/tk/package.yml b/projects/tcl-lang.org/tk/package.yml index b3c650635b..54dc362e04 100644 --- a/projects/tcl-lang.org/tk/package.yml +++ b/projects/tcl-lang.org/tk/package.yml @@ -67,7 +67,21 @@ build: - --enable-aqua test: - - test -f "{{prefix}}/lib/libtk{{version.major}}.{{version.minor}}.dylib" -o -f "{{prefix}}/lib/libtk{{version.major}}.{{version.minor}}.so" + # Tk 9.0 installs libtk under several names depending on platform — + # libtk9.0.so on Linux, libtk9.0.dylib on macOS, sometimes with a + # `.0` suffix or as libtcl9tk9.0.so on newer Tk builds. Glob match + # rather than enumerate. + - run: | + set -e + shopt -s nullglob + libs=("{{prefix}}/lib/"libtk*.{so,dylib}*) + if [ ${#libs[@]} -eq 0 ]; then + echo "FAIL: no libtk* found in {{prefix}}/lib/" + ls -la "{{prefix}}/lib/" || true + exit 1 + fi + echo "found tk shared libs:" + printf ' %s\n' "${libs[@]}" - echo 'puts $tk_version' | wish -display :0 2>&1 | head -1 || true provides: From 25ffe9528a25e698fb95ab2bdcaa8119286e2724 Mon Sep 17 00:00:00 2001 From: tannevaled Date: Sat, 30 May 2026 09:41:00 +0200 Subject: [PATCH 7/9] fix(tk): broaden test glob to lib*tk* (Tk 9.0 names lib libtcl9tk9.0.so) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous iteration's `libtk*` glob was still too narrow. Tk 9.0 installs its shared library as `libtcl9tk9.0.so` — Tcl-version- prefixed since Tk 9.x. The directory listing on failure showed: libtcl9tk9.0.so libtkstub.a pkgconfig/ tk9.0/ tkConfig.sh Broaden the glob to `lib*tk*.{so,dylib}*` so future renames of the form `libtcltk.so` keep working. Co-Authored-By: Claude Opus 4.7 --- projects/tcl-lang.org/tk/package.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/projects/tcl-lang.org/tk/package.yml b/projects/tcl-lang.org/tk/package.yml index 54dc362e04..1cf0471f6e 100644 --- a/projects/tcl-lang.org/tk/package.yml +++ b/projects/tcl-lang.org/tk/package.yml @@ -67,16 +67,16 @@ build: - --enable-aqua test: - # Tk 9.0 installs libtk under several names depending on platform — - # libtk9.0.so on Linux, libtk9.0.dylib on macOS, sometimes with a - # `.0` suffix or as libtcl9tk9.0.so on newer Tk builds. Glob match - # rather than enumerate. + # Tk 9.0 installs the shared library as `libtcl9tk9.0.so` on Linux + # (Tcl-version-prefixed since Tk 9.x — *not* `libtk9.0.so` like + # Tk 8.6 did). Accept any `lib*tk*` shape to keep working across + # the rename, with a directory listing on failure. - run: | set -e shopt -s nullglob - libs=("{{prefix}}/lib/"libtk*.{so,dylib}*) + libs=("{{prefix}}/lib/"lib*tk*.{so,dylib}*) if [ ${#libs[@]} -eq 0 ]; then - echo "FAIL: no libtk* found in {{prefix}}/lib/" + echo "FAIL: no lib*tk* found in {{prefix}}/lib/" ls -la "{{prefix}}/lib/" || true exit 1 fi From 3c2a691fca1257a4f0def44db072ae7dd5038def Mon Sep 17 00:00:00 2001 From: tannevaled Date: Sat, 30 May 2026 09:52:44 +0200 Subject: [PATCH 8/9] fix(tk): skip:fix-macho + manual install_name_tool for darwin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After the zip-dep + glob-test fixes, Linux x86-64 and ARM64 both turned green. Darwin then failed late at brewkit's fix-macho pass: fix-macho: writing /opt/tcl-lang.org/tk/v9.0.3/bin/wish9.0 error: failed to fix machos wish9.0's LC_LOAD_DYLIB references libtcl9tk9.0.dylib by absolute path; install_name_tool's automatic relink heuristics don't handle this layout (Tcl-version-prefixed tk lib name is new in Tk 9). Skip fix-macho and do the install_name_tool relink manually — same pattern the sibling tcl.tk/tcl recipe uses. Co-Authored-By: Claude Opus 4.7 --- projects/tcl-lang.org/tk/package.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/projects/tcl-lang.org/tk/package.yml b/projects/tcl-lang.org/tk/package.yml index 1cf0471f6e..a193b7e844 100644 --- a/projects/tcl-lang.org/tk/package.yml +++ b/projects/tcl-lang.org/tk/package.yml @@ -40,6 +40,12 @@ build: working-directory: unix darwin: working-directory: macosx + # brewkit's fix-macho pass dies with "failed to fix machos" on + # wish9.0 — the binary's LC_LOAD_DYLIB references libtcl9tk9.0.dylib + # by absolute path and install_name_tool's heuristics don't relink + # it. Use the same manual install_name_tool + skip:fix-macho dance + # that the sibling tcl.tk/tcl recipe uses. + skip: fix-macho script: - ./configure $ARGS - make --jobs {{ hw.concurrency }} @@ -49,6 +55,18 @@ build: - run: | cd "{{prefix}}/bin" [ ! -e wish ] && ln -sf "wish{{version.major}}.{{version.minor}}" wish || true + - run: | + # Relink wish's libtk reference to @loader_path so the bottle + # is relocatable (`fix-macho` would have done this but it + # bails on this binary; do it manually). + TKLIB=$(basename {{prefix}}/lib/libtcl*tk{{version.major}}.{{version.minor}}.dylib 2>/dev/null | head -1) + if [ -n "$TKLIB" ] && [ -f "{{prefix}}/bin/wish{{version.major}}.{{version.minor}}" ]; then + install_name_tool \ + -change "{{prefix}}/lib/$TKLIB" "@loader_path/../lib/$TKLIB" \ + "{{prefix}}/bin/wish{{version.major}}.{{version.minor}}" \ + || echo "warn: install_name_tool failed; relocation may break" + fi + if: darwin env: # tcl.h's install path varies by Tcl version: 8.6 puts it at # $prefix/include/tcl-tk/tcl.h, 9.0 at $prefix/include/tcl.h. From 8602fdeb40300c2e8bba747d7fba56e8431a89ad Mon Sep 17 00:00:00 2001 From: tannevaled Date: Sat, 30 May 2026 10:04:50 +0200 Subject: [PATCH 9/9] =?UTF-8?q?fix(tk):=20typo=20=E2=80=94=20skip=20key=20?= =?UTF-8?q?is=20`fix-machos`=20(plural),=20not=20`fix-macho`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous commit set `skip: fix-macho` (singular) thinking it matched brewkit's pass name. CI showed the pass STILL ran, fired the same error. brewkit's actual binary is `fix-machos.rb` (plural) and the matching skip key is `fix-machos`, which is what the sibling `tcl.tk/tcl` recipe uses verbatim. Co-Authored-By: Claude Opus 4.7 --- projects/tcl-lang.org/tk/package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/tcl-lang.org/tk/package.yml b/projects/tcl-lang.org/tk/package.yml index a193b7e844..37190b505c 100644 --- a/projects/tcl-lang.org/tk/package.yml +++ b/projects/tcl-lang.org/tk/package.yml @@ -45,7 +45,7 @@ build: # by absolute path and install_name_tool's heuristics don't relink # it. Use the same manual install_name_tool + skip:fix-macho dance # that the sibling tcl.tk/tcl recipe uses. - skip: fix-macho + skip: fix-machos script: - ./configure $ARGS - make --jobs {{ hw.concurrency }}