push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
{
lib,
stdenv,
callPackage,
fetchurl,
fetchpatch,
tcl,
...
}@args:
callPackage ./generic.nix (
args
// {
src = fetchurl {
url = "mirror://sourceforge/tcl/tk${tcl.version}-src.tar.gz";
sha256 = "1yhgcalldrjlc5q614rlzg1crgd3b52dhrk1pncdaxvl2vgg2yj0";
};
patches = lib.optionals stdenv.hostPlatform.isDarwin [
# Define MODULE_SCOPE before including tkPort.h
# https://core.tcl-lang.org/tk/info/dba9f5ce3b
(fetchpatch {
name = "module_scope.patch";
url = "https://core.tcl-lang.org/tk/vpatch?from=ef6c6960c53ea30c&to=9b8aa74eebed509a";
extraPrefix = "";
sha256 = "0crhf4zrzdpc1jdgyv6l6mxqgmny12r3i39y1i0j8q3pbqkd04bv";
})
];
}
)

View File

@@ -0,0 +1,22 @@
{
callPackage,
fetchurl,
tcl,
...
}@args:
callPackage ./generic.nix (
args
// {
src = fetchurl {
url = "mirror://sourceforge/tcl/tk${tcl.version}-src.tar.gz";
hash = "sha256-vp+U01ddSzCZ2EvDwQ3omU3y16pAUggXPHCcxASn5f4=";
};
patches = [
./tk-8_6_13-find-library.patch
];
}
)

View File

@@ -0,0 +1,23 @@
{
callPackage,
fetchzip,
tcl,
...
}@args:
callPackage ./generic.nix (
args
// {
src = fetchzip {
url = "mirror://sourceforge/tcl/tk${tcl.version}-src.tar.gz";
hash = "sha256-eX9HSPnNHeWkCaH0TBhmxQ3keTb4he3KY5rS1w4ubTo=";
};
patches = [
# https://core.tcl-lang.org/tk/tktview/765642ffffffffffffff
./tk-8_6_13-find-library.patch
];
}
)

View File

@@ -0,0 +1,106 @@
{
stdenv,
lib,
src,
pkg-config,
tcl,
libXft,
zip,
zlib,
patches ? [ ],
enableAqua ? stdenv.hostPlatform.isDarwin,
...
}:
tcl.mkTclDerivation {
pname = "tk";
version = tcl.version;
inherit src patches;
outputs = [
"out"
"man"
"dev"
];
setOutputFlags = false;
preConfigure = ''
configureFlagsArray+=(--mandir=$man/share/man --enable-man-symlinks)
cd unix
'';
postPatch = ''
for file in $(find library/demos/. -type f ! -name "*.*"); do
substituteInPlace $file --replace "exec wish" "exec $out/bin/wish"
done
'';
postInstall =
let
# From version 9, the tcl version is included in the lib filename
libtclstring = lib.optionalString (lib.versionAtLeast tcl.version "9.0") "tcl${lib.versions.major tcl.version}";
libfile = "$out/lib/lib${libtclstring}tk${tcl.release}${stdenv.hostPlatform.extensions.sharedLibrary}";
in
''
ln -s $out/bin/wish* $out/bin/wish
cp ../{unix,generic}/*.h $out/include
ln -s ${libfile} $out/lib/libtk${stdenv.hostPlatform.extensions.sharedLibrary}
''
+ lib.optionalString (stdenv.hostPlatform.isDarwin) ''
cp ../macosx/*.h $out/include
'';
configureFlags = [
"--enable-threads"
]
++ lib.optional stdenv.hostPlatform.is64bit "--enable-64bit"
++ lib.optional enableAqua "--enable-aqua"
++
lib.optional (lib.versionAtLeast tcl.version "9.0")
# By default, tk libraries get zipped and embedded into libtcl9tk*.so,
# which gets `zipfs mount`ed at runtime. This is fragile (for example
# stripping the .so removes the zip trailer), so we install them as
# traditional files.
# This might make tcl slower to start from slower storage on cold cache,
# however according to my benchmarks on fast storage and warm cache
# tcl built with --disable-zipfs actually starts in half the time.
"--disable-zipfs";
nativeBuildInputs = [
pkg-config
]
++ lib.optionals (lib.versionAtLeast tcl.version "9.0") [
# Only used to detect the presence of zlib. Could be replaced with a stub.
zip
];
buildInputs = lib.optionals (lib.versionAtLeast tcl.version "9.0") [
zlib
];
propagatedBuildInputs = [
libXft
];
enableParallelBuilding = true;
doCheck = false; # fails. can't find itself
inherit tcl;
passthru = rec {
inherit (tcl) release version;
libPrefix = "tk${tcl.release}";
libdir = "lib/${libPrefix}";
};
meta = with lib; {
description = "Widget toolkit that provides a library of basic elements for building a GUI in many different programming languages";
homepage = "https://www.tcl.tk/";
license = licenses.tcltk;
platforms = platforms.all;
maintainers = [ ];
broken = stdenv.hostPlatform.isDarwin && lib.elem (lib.versions.majorMinor tcl.version) [ "8.5" ];
};
}

View File

@@ -0,0 +1,25 @@
diff --git a/generic/tkWindow.c b/generic/tkWindow.c
index fa25553..ad45598 100644
--- a/generic/tkWindow.c
+++ b/generic/tkWindow.c
@@ -1045,6 +1045,7 @@ TkCreateMainWindow(
Tcl_SetVar2(interp, "tk_patchLevel", NULL, TK_PATCH_LEVEL, TCL_GLOBAL_ONLY);
Tcl_SetVar2(interp, "tk_version", NULL, TK_VERSION, TCL_GLOBAL_ONLY);
+ Tcl_SetVar2(interp, "tk_library", NULL, TK_LIBRARY, TCL_GLOBAL_ONLY);
tsdPtr->numMainWindows++;
return tkwin;
diff --git a/unix/Makefile.in b/unix/Makefile.in
index e98070e..f417753 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -1033,7 +1033,7 @@ tkVisual.o: $(GENERIC_DIR)/tkVisual.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkVisual.c
tkWindow.o: $(GENERIC_DIR)/tkWindow.c tkUuid.h
- $(CC) -c $(CC_SWITCHES) -I. $(GENERIC_DIR)/tkWindow.c
+ $(CC) -c $(CC_SWITCHES) -I. -DTK_LIBRARY=\"${TK_LIBRARY}\" $(GENERIC_DIR)/tkWindow.c
tkButton.o: $(GENERIC_DIR)/tkButton.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkButton.c