Skip to content

Commit

Permalink
tk-9_0: init
Browse files Browse the repository at this point in the history
  • Loading branch information
fgaz committed Oct 20, 2024
1 parent ec6950e commit 291d0cd
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 3 deletions.
23 changes: 23 additions & 0 deletions pkgs/development/libraries/tk/9.0.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
callPackage,
fetchzip,
tcl,
...
}@args:

callPackage ./generic.nix (
args
// {

src = fetchzip {
url = "mirror://sourceforge/tcl/tk${tcl.version}-src.tar.gz";
sha256 = "sha256-jQ9kZuFx6ikQ+SpY7kSbvXJ5hjw4WB9VgRaNlQLtG0s=";
};

patches = [
# https://core.tcl-lang.org/tk/tktview/765642ffffffffffffff
./tk-8_6_13-find-library.patch
];

}
)
25 changes: 22 additions & 3 deletions pkgs/development/libraries/tk/generic.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, lib, src, pkg-config, tcl, libXft, patches ? []
{ stdenv, lib, src, pkg-config, tcl, libXft, zip, zlib, patches ? []
, enableAqua ? stdenv.hostPlatform.isDarwin, darwin
, ... }:

Expand Down Expand Up @@ -39,9 +39,26 @@ tcl.mkTclDerivation {
configureFlags = [
"--enable-threads"
] ++ lib.optional stdenv.hostPlatform.is64bit "--enable-64bit"
++ lib.optional enableAqua "--enable-aqua";
++ 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 ];
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
Expand Down Expand Up @@ -69,5 +86,7 @@ tcl.mkTclDerivation {
license = licenses.tcltk;
platforms = platforms.all;
maintainers = [ ];
broken = stdenv.hostPlatform.isDarwin
&& lib.elem (lib.versions.majorMinor tcl.version) ["8.5" "9.0"];
};
}
1 change: 1 addition & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23277,6 +23277,7 @@ with pkgs;

tk = tk-8_6;

tk-9_0 = callPackage ../development/libraries/tk/9.0.nix { tcl = tcl-9_0; };
tk-8_6 = callPackage ../development/libraries/tk/8.6.nix { };
tk-8_5 = callPackage ../development/libraries/tk/8.5.nix { tcl = tcl-8_5; };

Expand Down

0 comments on commit 291d0cd

Please sign in to comment.