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,20 @@
{ callPackage, fetchurl, ... }@args:
callPackage ./generic.nix (
args
// rec {
release = "8.5";
version = "${release}.19";
# Note: when updating, the hash in pkgs/development/libraries/tk/8.5.nix must also be updated!
src = fetchurl {
url = "mirror://sourceforge/tcl/tcl${version}-src.tar.gz";
sha256 = "066vlr9k5f44w9gl9382hlxnryq00d5p6c7w5vq1fgc7v9b49w6k";
};
extraPatch = ''
substituteInPlace 'generic/tclInt.h' --replace-fail 'typedef int ptrdiff_t;' ""
'';
}
)

View File

@@ -0,0 +1,16 @@
{ callPackage, fetchurl, ... }@args:
callPackage ./generic.nix (
args
// rec {
release = "8.6";
version = "${release}.16";
# Note: when updating, the hash in pkgs/development/libraries/tk/8.6.nix must also be updated!
src = fetchurl {
url = "mirror://sourceforge/tcl/tcl${version}-src.tar.gz";
hash = "sha256-kcuPphdxxjwmLvtVMFm3x61nV6+lhXr2Jl5LC9wqFKU=";
};
}
)

View File

@@ -0,0 +1,16 @@
{ callPackage, fetchzip, ... }@args:
callPackage ./generic.nix (
args
// rec {
release = "9.0";
version = "${release}.1";
# 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";
hash = "sha256-NWwCQGyaUzfTgHqpib4lLeflULWKuLE4qYxP+0EizHs=";
};
}
)

View File

@@ -0,0 +1,149 @@
{
lib,
stdenv,
callPackage,
makeSetupHook,
runCommand,
tzdata,
zip,
zlib,
# Version specific stuff
release,
version,
src,
extraPatch ? "",
...
}:
let
baseInterp = stdenv.mkDerivation rec {
pname = "tcl";
inherit version src;
outputs = [
"out"
"man"
];
setOutputFlags = false;
postPatch = ''
substituteInPlace library/clock.tcl \
--replace "/usr/share/zoneinfo" "${tzdata}/share/zoneinfo" \
--replace "/usr/share/lib/zoneinfo" "" \
--replace "/usr/lib/zoneinfo" "" \
--replace "/usr/local/etc/zoneinfo" ""
''
+ extraPatch;
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
'';
# 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.versionOlder version "8.6") [
# configure check broke due to GCC 14
"ac_cv_header_stdc=yes"
]
++ 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"
]
++ [
# During cross compilation, the tcl build system assumes that libc
# functions are broken if it cannot test if they are broken or not and
# then causes a link error on static platforms due to symbol conflict.
# These functions are *checks notes* strtoul and strstr. These are
# never broken on modern platforms!
"tcl_cv_strtod_unbroken=ok"
"tcl_cv_strtoul_unbroken=ok"
"tcl_cv_strstr_unbroken=ok"
]
++ lib.optional stdenv.hostPlatform.is64bit "--enable-64bit";
enableParallelBuilding = true;
postInstall =
let
dllExtension = stdenv.hostPlatform.extensions.sharedLibrary;
staticExtension = stdenv.hostPlatform.extensions.staticLibrary;
in
''
make install-private-headers
ln -s $out/bin/tclsh${release} $out/bin/tclsh
if [[ -e $out/lib/libtcl${release}${staticExtension} ]]; then
ln -s $out/lib/libtcl${release}${staticExtension} $out/lib/libtcl${staticExtension}
fi
${lib.optionalString (!stdenv.hostPlatform.isStatic) ''
ln -s $out/lib/libtcl${release}${dllExtension} $out/lib/libtcl${dllExtension}
''}
'';
meta = with lib; {
description = "Tcl scripting language";
homepage = "https://www.tcl.tk/";
license = licenses.tcltk;
platforms = platforms.all;
maintainers = with maintainers; [ agbrooks ];
};
passthru = rec {
inherit release version;
libPrefix = "tcl${release}";
libdir = "lib/${libPrefix}";
tclPackageHook = callPackage (
{ buildPackages }:
makeSetupHook {
name = "tcl-package-hook";
propagatedBuildInputs = [ buildPackages.makeBinaryWrapper ];
meta = {
inherit (meta) maintainers platforms;
};
} ./tcl-package-hook.sh
) { };
# verify that Tcl's clock library can access tzdata
tests.tzdata = runCommand "${pname}-test-tzdata" { } ''
${baseInterp}/bin/tclsh <(echo "set t [clock scan {2004-10-30 05:00:00} \
-format {%Y-%m-%d %H:%M:%S} \
-timezone :America/New_York]") > $out
'';
};
};
mkTclDerivation = callPackage ./mk-tcl-derivation.nix { tcl = baseInterp; };
in
baseInterp.overrideAttrs (self: {
passthru = self.passthru // {
inherit mkTclDerivation;
};
})

View File

@@ -0,0 +1,88 @@
# Generic builder for tcl packages/applications, generally based on mk-python-derivation.nix
{
tcl,
lib,
makeWrapper,
runCommand,
writeScript,
}:
{
buildInputs ? [ ],
nativeBuildInputs ? [ ],
propagatedBuildInputs ? [ ],
checkInputs ? [ ],
nativeCheckInputs ? [ ],
# true if we should skip the configuration phase altogether
dontConfigure ? false,
# Extra flags passed to configure step
configureFlags ? [ ],
# Whether or not we should add common Tcl-related configure flags
addTclConfigureFlags ? true,
meta ? { },
passthru ? { },
doCheck ? true,
...
}@attrs:
let
inherit (tcl) stdenv;
inherit (lib) getBin optionalAttrs;
defaultTclPkgConfigureFlags = [
"--with-tcl=${tcl}/lib"
"--with-tclinclude=${tcl}/include"
"--exec-prefix=${placeholder "out"}"
];
self = (
stdenv.mkDerivation (
(removeAttrs attrs [
"addTclConfigureFlags"
"checkPhase"
"checkInputs"
"nativeCheckInputs"
"doCheck"
])
// {
buildInputs = buildInputs ++ [ tcl.tclPackageHook ];
nativeBuildInputs = nativeBuildInputs ++ [
makeWrapper
tcl
];
propagatedBuildInputs = propagatedBuildInputs ++ [ tcl ];
TCLSH = "${getBin tcl}/bin/tclsh";
# Run tests after install, at which point we've done all TCLLIBPATH setup
doCheck = false;
doInstallCheck = attrs.doCheck or (attrs.doInstallCheck or false);
installCheckInputs = checkInputs ++ (attrs.installCheckInputs or [ ]);
nativeInstallCheckInputs = nativeCheckInputs ++ (attrs.nativeInstallCheckInputs or [ ]);
# Add typical values expected by TEA for configureFlags
configureFlags =
if (!dontConfigure && addTclConfigureFlags) then
(configureFlags ++ defaultTclPkgConfigureFlags)
else
configureFlags;
meta = {
platforms = tcl.meta.platforms;
}
// meta;
}
// optionalAttrs (attrs ? checkPhase) {
installCheckPhase = attrs.checkPhase;
}
)
);
in
lib.extendDerivation true passthru self

View File

@@ -0,0 +1,80 @@
# This hook ensures that we do the following in post-fixup:
# * wrap any installed executables with a wrapper that configures TCLLIBPATH
# * write a setup hook that extends the TCLLIBPATH of any anti-dependencies
tclWrapperArgs=( ${tclWrapperArgs-} )
# Add a directory to TCLLIBPATH, provided that it exists
_addToTclLibPath() {
local tclPkg="$1"
if [[ -z "$tclPkg" ]]; then
return
fi
if [[ ! -d "$tclPkg" ]]; then
>&2 echo "can't add $tclPkg to TCLLIBPATH; that directory doesn't exist"
exit 1
fi
if [[ "$tclPkg" == *" "* ]]; then
tclPkg="{$tclPkg}"
fi
if [[ -z "${TCLLIBPATH-}" ]]; then
export TCLLIBPATH="$tclPkg"
else
if [[ "$TCLLIBPATH " != *"$tclPkg "* ]]; then
export TCLLIBPATH="${TCLLIBPATH} $tclPkg"
fi
fi
}
# Locate any directory containing an installed pkgIndex file
findInstalledTclPkgs() {
local -r newLibDir="${!outputLib}/lib"
if [[ ! -d "$newLibDir" ]]; then
>&2 echo "Assuming no loadable tcl packages installed ($newLibDir does not exist)"
return
fi
echo "$(find "$newLibDir" -name pkgIndex.tcl -exec dirname {} \;)"
}
# Wrap any freshly-installed binaries and set up their TCLLIBPATH
wrapTclBins() {
if [ "$dontWrapTclBinaries" ]; then return; fi
if [[ -z "${TCLLIBPATH-}" ]]; then
echo "skipping automatic Tcl binary wrapping (nothing to do)"
return
fi
local -r tclBinsDir="${!outputBin}/bin"
if [[ ! -d "$tclBinsDir" ]]; then
echo "No outputBin found, not using any TCLLIBPATH wrapper"
return
fi
tclWrapperArgs+=(--prefix TCLLIBPATH ' ' "$TCLLIBPATH")
find "$tclBinsDir" -type f -executable -print |
while read -r someBin; do
echo "Adding TCLLIBPATH wrapper for $someBin"
wrapProgram "$someBin" "${tclWrapperArgs[@]}"
done
}
# Generate hook to adjust TCLLIBPATH in anti-dependencies
writeTclLibPathHook() {
local -r hookPath="${!outputLib}/nix-support/setup-hook"
mkdir -p "$(dirname "$hookPath")"
typeset -f _addToTclLibPath >> "$hookPath"
local -r tclPkgs=$(findInstalledTclPkgs)
while IFS= read -r tclPkg; do
echo "_addToTclLibPath \"$tclPkg\"" >> "$hookPath"
_addToTclLibPath "$tclPkg" true
done <<< "$tclPkgs"
}
postFixupHooks+=(writeTclLibPathHook)
postFixupHooks+=(wrapTclBins)