Re: Prima & Debian

From: Serge Olkhowik <solo_at_isd.dp.ua>
Date: Mon, 24 Nov 2003 11:28:23 +0200
To: prima_at_prima.eu.org

On 21 Nov 2003 23:40:04 +0100
 Dmitry Karasik (Dmitry) wrote:

 Serge> Is there any debian-ready packages of Prima?

 Dmitry> No, I don't know how to make any.

Ok, so I'll build my own and send you them to share for downloading if you
wish ;)

 Dmitry> 1.13 is out - the trouble with codec_Xpm.c is fixed there.

There is no 1.13 at http://www.prima.eu.org/download/, just
http://www.prima.eu.org/download/Prima.tar.gz and I don't know whether this
is 1.13? So I tried CVS.

 Serge> But 'make install' copies files into
 Serge> `pwd`/debian/tmp/usr/local/perl/5.8.1.

 Dmitry> I would recommend to check how debian handles other
 Dmitry> perl packages, which install same way as Prima do.

Of course I checked. Debian uses /usr/lib/perl5 for packages wich don't
depend on subversion of perl (i.e. 5.8.1 or 5.8.0, just "current") and use
.so binaries and it uses /usr/share/perl5/ for packages which don't have
.so objects.

For example DBD::Mysql:

% dpkg -L libdbd-mysql-perl
/.
/usr
/usr/lib
/usr/lib/perl5
/usr/lib/perl5/auto
/usr/lib/perl5/auto/DBD
/usr/lib/perl5/auto/DBD/mysql
/usr/lib/perl5/auto/DBD/mysql/mysql.so
/usr/lib/perl5/auto/DBD/mysql/mysql.bs
/usr/lib/perl5/Mysql.pm
/usr/lib/perl5/Bundle
/usr/lib/perl5/Bundle/DBD
/usr/lib/perl5/Bundle/DBD/mysql.pm
/usr/lib/perl5/Mysql
/usr/lib/perl5/Mysql/Statement.pm
/usr/lib/perl5/DBD
/usr/lib/perl5/DBD/mysql.pm
/usr/lib/perl5/DBD/mysql.pod
/usr/lib/perl5/DBD/mysql
/usr/lib/perl5/DBD/mysql/INSTALL.pod

and so on.

 Serge> So I have to modify Makefile.PL and change $Config{installsitearch}
 Serge> to $Config{installvendorarch} and so on.

 Dmitry> Don't - run perl Makefile.PL INSTALLSITEARCH=myfolder

No. As I understand INSTALLSITEARCH should point to the final directory
i.e. /usr/lib/perl5 in my case, but I want to point to my prefix, i.e. /usr
because I even don't know which version of Perl do I use in my makefile. Of
course I can do something like:

perl Makefile.PL INSTALLSITEARCH=`perl -MConfig -e 'print "$Config{installvendorarch}\n";'`

So I specify perl Makefile.PL PREFIX=.... but it isn't enough :(

INSTALLVENDORARCH would be nice in my case:

% perl -MConfig -e 'print "$Config{installvendorarch}\n";'
/usr/lib/perl5

% perl -MConfig -e 'print "$Config{installsitearch}\n";'
/usr/local/lib/perl/5.8.1

I looked into HTML::Template debianizing and found very nice solution:

build-stamp:
        dh_testdir
        $(PERL) Makefile.PL INSTALLDIRS=vendor PERL=$(PERL)
        $(MAKE) LD_RUN_PATH=
        touch $@

The same schema is in Perl/Tk.

 Serge> I tried examples and I got a trouble:

 Serge> - Default font in all applications is very small as compared with
 Serge> Win32. Only font in entry field in 'e' example is normal and
 Serge> selected font in 'fontsel' is looking good to.

 Serge> Is it normal?

 Dmitry> No. 1.13 supports lot of command-line arguments, run the suspicious
 Dmitry> program with --debug=mf . Alternatively, the trouble may be with your
 Dmitry> X server's resolution. By default, font size is 10 points. If you've
 Dmitry> got Prima compiled with xft, try --font=Arial-12 ( if don't,

How can I check for xft?

 Dmitry> --font=-*-*-*-*-blablabla-fixed- ) and see what happens.

Ok, let's check.

I wrote simple example with utf-8. At my home machine (15" monitor and 75
dpi) font size is normal.

At my work host (17" monitor) X11 are started:

/usr/X11R6/bin/X :0 -dpi 100 -nolisten tcp vt7 -auth /var/lib/kdm/A:0-V2Nr7M

As you can see the resolution is normal.

There is a line in my ~/.Xresources:

*font: -*-arial-medium-r-*-*-14-*-*-*-*-*-koi8-r

(I have msttcorefonts installed).

I ran xfontsel -pattern '-*-arial-medium-r-*-*-14-*-*-*-*-*-koi8-r' but it
looks normal as contrary to simple Prima example.

Please look at these windows shots:

http://www.bamba.dp.ua/Prima/prima-xfontsel.png
http://www.bamba.dp.ua/Prima/prima-koi8.png

 Serge> And one more question - does Prima support utf-8?

 Dmitry> Yes.

Let me check.

I wrote simple example in koi8 and it worked. But it worked with
.Xresources file only. I tried even --font=Tahoma-16 - none happens :(

So I tried to view get_default_font result:

,----
| #!/usr/bin/env perl
|
| use strict;
| use warnings;
| use Prima qw/Application Buttons/;
|
| my $w = Prima::Window->create(text => 'Тест для koi8-r');
| $w->insert('Button',
| pack => {fill => 'both', expand => 1},
| text => 'Выход/Exit',
| onClick => sub { exit });
|
| print join(', ', @{$::application->font_encodings}) . "\n";
| print "default font:\n";
| my %f = %{$::application->get_default_font};
| while ((my ($k, $v)) = each %f) {
| print "$k => $v\n";
| }
|
| run Prima;
|
| # Local Variables:
| # mode: perl
| # coding: koi8-r
| # End:
`----

Results are:

% ./prima-koi8 --font=Tahoma-16
paratype-pt154, iso8859-3, iso8859-16, dec-dectech, iso8859-2, ksc5601.1987-0 so8859-9, koi8-u, iso8859-14, iso8859-6, misc-fontspecific, gost19768.74-1, i 859-10, iso8859-5, koi8-r, fontspecific-0, sunolcursor-1, iso8859-13, iso8859 , iso8859-7, iso8859-8, iso8859-1, adobe-fontspecific, gb2312.1980-0, iso646. 1-irv, sunolglyph-1, jisx0208.1983-0, iso10646-1, microsoft-cp1251, iso8859-4 isx0201.1976-0, koi8-1
default font:
width => 7
ascent => 16
yDeviceRes => 100
defaultChar => 0
size => 12
breakChar => 0
direction => 0
lastChar => 255
weight => 5
pitch => 0
encoding => iso8859-1
vector => 1
internalLeading => 0
descent => 4
xDeviceRes => 100
style => 0
name => helvetica
height => 20
resolution => 6553700
externalLeading => 1
maximalWidth => 14
family => adobe
firstChar => 0

and:

% ./prima-koi8 --font='-*-arial-medium-r-*-*-24-*-*-*-*-*-koi8-r'
paratype-pt154, iso8859-3, iso8859-16, dec-dectech, iso8859-2, ksc5601.1987-0, iso8859-9, koi8-u, iso8859-14, iso8859-6, misc-fontspecific, gost19768.74-1, iso8859-10, iso8859-5, koi8-r, fontspecific-0, sunolcursor-1, iso8859-13, iso8859-15, iso8859-7, iso8859-8, iso8859-1, adobe-fontspecific, gb2312.1980-0, iso646.1991-irv, sunolglyph-1, jisx0208.1983-0, iso10646-1, microsoft-cp1251, iso8859-4, jisx0201.1976-0, koi8-1
default font:
width => 7
ascent => 18
yDeviceRes => 100
defaultChar => 0
size => 12
breakChar => 0
direction => 0
lastChar => 255
weight => 5
pitch => 1
encoding => koi8-r
vector => 1
internalLeading => 0
descent => 6
xDeviceRes => 100
style => 0
name => arial
height => 24
resolution => 6553700
externalLeading => 5
maximalWidth => 17
family => monotype
firstChar => 0

Button font doesn't change at all, but get_default_font differs.

So I changed my script for utf-8 (added 'use utf8;', changed 'coding:
utf-8') and I got:

http://www.bamba.dp.ua/Prima/prima-utf.png

And any --font doesn't affect button text.

So I have to modify my .Xresources:

Prima*font: -*-arial-medium-r-*-*-14-*-*-*-*-*-*-*

and text is ok (and it's still small). But my koi8 script fails ;)

So what I have to do?

I tried --debug=mf but this doesn't give me more information.

For all testings I used Prima snapshot on 2003-11-21.

Can you point me to any documentation how I can specify font for special
widget? Is there any methods to specify some options (font, colors,
borders, styles and so on) for all widgets of application? (I can do this
with resources when initializing Perl/Tk application)

Where can I find documentation about geometry management (pack)? I found
some about 'pack =>' option in examples but I think this isn't enough. I
need information about something like Perl/Tk frames.

Thank you! ;)

-- 
Serge Olkhowik <solo_at_isd.dp.ua>
ISD Configuration Management Team <cm_at_isd.dp.ua>
Received on Mon 24 Nov 2003 - 10:29:19 CET

This archive was generated by hypermail 2.2.0 : Sat 19 Mar 2011 - 18:35:05 CET