Skip Menu |

This queue is for tickets about the Tcl-Tk CPAN distribution.

Report information
The Basics
Id: 125488
Status: resolved
Priority: 0/
Queue: Tcl-Tk

People
Owner: Nobody in particular
Requestors: PERLMAX [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Make snit optional
Hello, I had a problem with some tests, because on Mageia Linux there is no tklib package. In this context, I thought, perhaps it would be good, if one could install Tcl::Tk without "snit" and "tklib" (which is needed for widget::scrolledwindow). The most functionality of Tcl can be reached without these packages (prima facie they are only needed for the MetaFunction Scrolled, isn't it?). At least it should be documented in the POD, that one need tcllib and (!) tklib, which is done by the first patch regardin Tk.pm. Of course, I understand, that you want from the beginning a correct Tcl::Tk installation, so it is your decision. At least the POD extension should be useful, I think... Best wishes, Max
Subject: Makefile_patch.PL
#!perl -w use strict; use Getopt::Long qw(GetOptions); use ExtUtils::MakeMaker; my $tclshArg; my $tclsh = "tclsh"; if ($^O eq 'freebsd') {$tclsh.='8.4'} GetOptions("tclsh=s", \$tclshArg, ) || die <<EOT; Usage: perl Makefile.PL [--tclsh <path>] [<makemaker opts>...] EOT # Allow the tclsh prog to be provided by env var or arg if ($tclshArg) { $tclsh = $tclshArg; } elsif (defined($ENV{'TCLSH_PROG'})) { $tclsh = $ENV{'TCLSH_PROG'}; } open TCLSH, "$tclsh test-for-tk.tcl|"; my $res = join '', <TCLSH>; unless ($res =~ /^ok1/m) { die <<EOS; Your Tcl installation ($tclsh) fails to find Tk package. One of possible reasons is missing file 'pkgIndex.tcl' in ..../tk8.4/ directory; Please check if you can feed 'package require Tk' to tclsh EOS } unless ($res =~ /^ok2/m) { warn <<EOS; Your Tk installation fails to find 'snit' package. For full functionality this package is required. Make sure that it is installed within your Tcl/Tk. EOS } unless ($res =~ /^ok3/m) { warn <<EOS; Your Tk installation fails to find 'tklib' package. For full functionality this package is required. Make sure that it is installed within your Tcl/Tk. EOS } WriteMakefile( NAME => "Tcl::Tk", VERSION_FROM => 'lib/Tcl/Tk.pm', NO_META => 1, PREREQ_PM => { Tcl => 0.98, }, );
Subject: Sniff_patch_Tk.pm.diff
--- ./Tk.pm 2018-06-05 07:33:16.358789371 +0200 +++ ./Tk_patch_sniff.pm 2018-06-05 07:33:49.171402822 +0200 @@ -49,6 +49,12 @@ BWidgets, BLT, etc) and existing features (for example natively looking widgets using C<tile>). +=head2 Prerequisites + +For full functionality you need the Tcl packages "snit", which is part +of the standard tcl library (see L<core.tcl.tk/tcllib>), and the standard +tk library (see L<https://core.tcl.tk/tklib/home>). + =head2 Access to the Tcl and Tcl::Tk extensions To get access to the Tcl and Tcl::Tk extensions, put the command near
Subject: SnitPatch_text.t.diff
--- ./text.t 2011-01-15 20:01:56.000000000 +0100 +++ ./text_patch.t 2018-05-30 07:59:17.241326000 +0200 @@ -1,10 +1,22 @@ # very simplistic - +BEGIN { $|=1; $^W=1; } use Test; -BEGIN {plan tests=>3} use Tcl::Tk; my $mw = Tcl::Tk::MainWindow->new; + +if (!$mw->interp->pkg_require('snit')) { + print "1..0 # skip: no snit extension available\n"; + exit; +} + +if (!$mw->interp->pkg_require('scrolledwindow')) { + print "1..0 # skip: no tklib extension available\n"; + exit; +} + +plan tests=>3; + my $tw = $mw->Scrolled('Text',-font=>32)->pack; ok(1); $tw->_insert('end',qq/\n/);
thanks, applied. yet now snit will be packed into distribution, but also needed parts from tklib will be same