Date: Fri, 02 Mar 2012 11:25:00 +0400 From: Boris Samorodov <bsam@passap.ru> To: Hiroki Sato <hrs@FreeBSD.org> Cc: FreeBSD ports list <freebsd-ports@FreeBSD.org> Subject: print/libpaper problem (was: Re: cvs commit: ports/print/ghostscript9 Makefile) Message-ID: <4F5075CC.9010507@passap.ru> In-Reply-To: <20120301.063715.1637304310088980264.hrs@allbsd.org> References: <201202291209.q1TC93Fc006227@repoman.freebsd.org> <4F4E63A3.7060000@passap.ru> <20120301.063715.1637304310088980264.hrs@allbsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi! (moved from cvs@ list) 01.03.2012 01:37, Hiroki Sato пишет: > Boris Samorodov <bsam@passap.ru> wrote > in <4F4E63A3.7060000@passap.ru>: > > bs> 29.02.2012 16:09, Hiroki Sato пишет: > bs> > hrs 2012-02-29 12:09:03 UTC > bs> > > bs> > FreeBSD ports repository > bs> > > bs> > Modified files: > bs> > print/ghostscript9 Makefile > bs> > Log: > bs> > Disable libpaper by default because it can override the A4SIZE option > bs> > unintentionally. > bs> > bs> Can you explain this a little bit wider? > > When libpaper is not linked, the default size is determined by > constants in the gs drivers. It seems that libreoffice depends at the mere existance of libpaper. I.e. I've got a system with libreoffice installed. The default paper size was A4. (BTW I'm not sure why and how did I managed to do so since it's Makefile does not check for paper size neither do use print/libpaper). Sometime later as a result of ports upgrading I've got print/libpaper installed. And what do you think? The default paper size for libreoffice (libreoffice itself was not touched by the ports upgading) has changed! Let me state that it was not so simple to detect the culprit and fix it. BTW the (system wide) fix was to create a file /usr/local/etc/papersize with a line "A4" in it. > WITH_A4SIZE option makes them "a4" in > compile-time. When linking libpaper, gs defines a paper size > returned by defaultpapername() (libpaper API) as /DEFAULTPAPERSIZE > via .defaultpapesize (this corresponds to gp_defaultpapersize() in C) > in gs_init.ps. It overrides the constants in the drivers. However, > the libpaper's default size is always "letter", so in that case the > gs would use US letter size by default even if WITH_A4SIZE option in > this port was enabled. So what if install a system wide default paper size while installing print/libpaper? That may help both in gs case (when a binary is linked with libpaper) and those that just use libpaper if it is installed. > I think WITH_A4SIZE option should be deprecated at some point and the > default paper size can be selected by libpaper in run-time because it > will be more consistent and flexible, I'd propose to leave a system wide default variable for a paper size. I don't care if it is WITH_A4SIZE, DEFAULT_PAPERSIZE=A4 or else. > but the current code in gs > prevents it because it uses defaultpapername(), not systempapername() > for some reason. > > So, the functionality the libpaper provides in gs is only to define > /DEFAULTPAPERSIZE but it is confusing due to the above reason. This > was why I decided to disable libpaper at this moment. Yea, but those who will choose that non-default option and install print/libpaper (in current state, i.e. without installing /usr/local/etc/papersize file) will fall in trouble anyway. -- WBR, Boris Samorodov (bsam) FreeBSD Committer, http://www.FreeBSD.org The Power To Serve
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4F5075CC.9010507>