Skip to content

Commit

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

callPackage ./generic.nix (
args
// rec {
release = "9.0";
version = "${release}.0";

# Note: when updating, the hash in pkgs/development/libraries/tk/9.0.nix must also be updated!

src = fetchzip {
url = "mirror://sourceforge/tcl/tcl${version}-src.tar.gz";
sha256 = "sha256-QaPSY6kfxyc3x+2ptzEmN2puZ0gSFSeeNjPuxsVKXYE=";
};
}
)
26 changes: 24 additions & 2 deletions pkgs/development/interpreters/tcl/generic.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ lib, stdenv, callPackage, makeSetupHook, runCommand
, tzdata
, tzdata, zip, zlib

# Version specific stuff
, release, version, src
Expand All @@ -24,17 +24,39 @@ let
--replace "/usr/local/etc/zoneinfo" ""
'';

nativeBuildInputs = lib.optionals (lib.versionAtLeast version "9.0") [
# Only used to detect the presence of zlib. Could be replaced with a stub.
zip
];

buildInputs = lib.optionals (lib.versionAtLeast version "9.0") [
zlib
];

preConfigure = ''
cd unix
'';

configureFlags = [
# Note: pre-9.0 flags are temporarily interspersed to avoid a mass rebuild.
configureFlags = lib.optionals (lib.versionOlder version "9.0") [
"--enable-threads"
] ++ [
# Note: using $out instead of $man to prevent a runtime dependency on $man.
"--mandir=${placeholder "out"}/share/man"
] ++ lib.optionals (lib.versionOlder version "9.0") [
"--enable-man-symlinks"
# Don't install tzdata because NixOS already has a more up-to-date copy.
"--with-tzdata=no"
] ++ lib.optionals (lib.versionAtLeast version "9.0") [
# By default, tcl libraries get zipped and embedded into libtcl*.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"
] ++ [
"tcl_cv_strtod_unbroken=ok"
] ++ lib.optional stdenv.hostPlatform.is64bit "--enable-64bit";

Expand Down
1 change: 1 addition & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16619,6 +16619,7 @@ with pkgs;
tcl = tcl-8_6;
tcl-8_5 = callPackage ../development/interpreters/tcl/8.5.nix { };
tcl-8_6 = callPackage ../development/interpreters/tcl/8.6.nix { };
tcl-9_0 = callPackage ../development/interpreters/tcl/9.0.nix { };

tclreadline = callPackage ../development/interpreters/tclreadline { };

Expand Down

0 comments on commit ec6950e

Please sign in to comment.