From d45bbf150de2303cbd7983ca553b57ea9f61c49b Mon Sep 17 00:00:00 2001 From: Alexander Khodyrev Date: Tue, 18 Jul 2023 23:52:06 +0300 Subject: [PATCH] tcl: add test for #243831 As suggested in pull request discussion https://github.com/NixOS/nixpkgs/pull/243838 Explicitly verify that the installed Tcl can find tzdata. If the fix from 8d0dce91bc0190eab64811aa40c9ae021891032f is commented out, the test fails. --- pkgs/development/interpreters/tcl/generic.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkgs/development/interpreters/tcl/generic.nix b/pkgs/development/interpreters/tcl/generic.nix index 894ed91de5c9..8d4903add899 100644 --- a/pkgs/development/interpreters/tcl/generic.nix +++ b/pkgs/development/interpreters/tcl/generic.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, callPackage, makeSetupHook +{ lib, stdenv, callPackage, makeSetupHook, runCommand , tzdata # Version specific stuff @@ -8,7 +8,7 @@ let baseInterp = - stdenv.mkDerivation { + stdenv.mkDerivation rec { pname = "tcl"; inherit version src; @@ -64,6 +64,12 @@ let name = "tcl-package-hook"; propagatedBuildInputs = [ buildPackages.makeWrapper ]; } ./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 + ''; }; };