On Tue, 5 Dec 2006, Karel Kulhavy wrote:
> Hello
>
> I want to use xpm2ppm, but it doesn't work because it says
> [EMAIL PROTECTED]:~$ xpmtoppm < vnc/img_00000.xpm
> xpmtoppm: Input file has line that is too long (longer than 2048 bytes).
>
> Obviously, someone programmed with fixed-size buffers.
Perhaps he had a reason. Maybe it was a bad reason.
>
> I would like to increase the compiled-in buffer size from 2048 to 4096 and
> try again. I would like to get the source for netpbm somewhere, change it
> and compile. However it turns out to be an impenetrable obstacle:
>
> - The OpenBSD website describes only some CVS method which seems to involve
> getting
> sources for all programs in the operating system and I don't have space for
> that: Filesystem 512-blocks Used Avail Capacity Mounted on
> /dev/wd0a 74935160 70114912 1073492 98% /
> - Getting sources -> web -> ports -> graphics -> netpbm there are no sources,
> only some auxilliary files
> - when I download the official netpbm 10.26.34 source and say "y enter
> openbsd enter enter enter enter library filename or 'none' [libjpeg.so]
> libjpeg.so.62.0 JPEG header directory [default] ==> /usr/local/include
> libtiff.so.37.3 /usr/local/include libpng.so.4.2 /usr/local/include
> libz.so.4.1 /usr/local/include" (the filenames were determined using locate),
> the compilation of netpbm crashes with
> libopt results: ' -L/home/clock/netpbm-10.26.34/lib -lnetpbm -ljpeg.so.62'
> /usr/bin/ld: cannot find -ljpeg.so.62
> collect2: ld returned 1 exit status
> gmake[3]: *** [ppmtompeg] Error 1
> gmake[3]: Leaving directory
> `/home/clock/netpbm-10.26.34/converter/ppm/ppmtompeg
>
> Is it possible to compile netpbm on openbsd from the sources without extensive
> OpenBSD maintainer expertise?
>
> CL<
Please run the following script as root:
#! /bin/sh
if ! cd /usr/ports/graphics/netpbm ; then
cd /tmp
ftp ftp://ftp.openbsd.org/pub/OpenBSD/4.0/ports.tar.gz
cd /usr
tar xzvf /tmp/ports.tar.gz
fi
cd /usr/ports/graphics/netpbm
more Makefile
make extract
ls # see the patches directory?
cat >patches/patch-converter_ppm_xpmtoppm_c <<__EOF__
--- converter/ppm/xpmtoppm.c.orig Tue Dec 5 06:53:10 2006
+++ converter/ppm/xpmtoppm.c Tue Dec 5 06:54:52 2006
@@ -38,7 +38,7 @@
#include "nstring.h"
#include "mallocvar.h"
-#define MAX_LINE 2048
+#define MAX_LINE 32768
/* The maximum size XPM input line we can handle. */
/* number of xpmColorKeys */
__EOF__
make build
# tempis fugit
make install
# now test it. I took a guess that the file xpmtoppm.c was the source
# of your problem. I changed the define. I did not look for ramifications
# from that change, I don't care, since I am not going to use the program.
# You, on the other hand, should spend some time seeing how that change
# may reverberate through the package.
man ports
echo Woodchuck, OpenBSD user