philpem / printer-driver-ptouch

P-Touch PT-series and QL-series printer driver for Linux (under CUPS)
GNU General Public License v2.0
97 stars 24 forks source link

Build requirements Ubuntu 22.04 #42

Closed patvdleer closed 8 months ago

patvdleer commented 10 months ago

Since I didn't see it mentioned in the README nor in the INSTALL, I needed to install the following additional packages to compile and a parameters to configure to set the directory from /usr/local/lib/cups to /usr/lib/cups.

Steps:

  1. ./autogen.sh
  2. ./configure --prefix=/usr
  3. make
  4. sudo make install

Packages (via apt)

Without libcups2-dev

in ./configure

Easily to overlook

checking for cups/raster.h... no

make

make  all-am
make[1]: Entering directory '/home/patrick/git/printer-driver-ptouch'
gcc -DHAVE_CONFIG_H -I.  -D_GNU_SOURCE   -g -O2 -MT rastertoptch-rastertoptch.o -MD -MP -MF .deps/rastertoptch-rastertoptch.Tpo -c -o rastertoptch-rastertoptch.o `test -f 'rastertoptch.c' || echo './'`rastertoptch.c
rastertoptch.c:273:10: fatal error: cups/raster.h: No such file or directory
  273 | #include <cups/raster.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:550: rastertoptch-rastertoptch.o] Error 1
make[1]: Leaving directory '/home/patrick/git/printer-driver-ptouch'
make: *** [Makefile:410: all] Error 2

Without libxml

Can't locate XML/LibXML.pm in @INC (you may need to install the XML::LibXML module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.34.0 /usr/local/share/perl/5.34.0 /usr/lib/x86_64-linux-gnu/perl5/5.34 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.34 /usr/share/perl/5.34 /usr/local/lib/site_perl) at ./foomaticalize line 36.
BEGIN failed--compilation aborted at ./foomaticalize line 36.
make[1]: *** [Makefile:1019: generated/stamp-h1] Error 2
make[1]: Leaving directory '/home/patrick/git/printer-driver-ptouch'
make: *** [Makefile:410: all] Error 2
montanaviking commented 10 months ago

What directory in the downloaded .zip file is configure in? I cannot find the configure script. Thanks

patvdleer commented 10 months ago

What directory in the downloaded .zip file is configure in? I cannot find the configure script. Thanks

My bad, I forgot to include "run ./autogen.sh", I've updated the above instructions.

philpem commented 10 months ago

My bad, I forgot to include "run ./autogen.sh", I've updated the above instructions.

You should only have to do this for the Github-generated source code TAR/ZIP files, which are snapshots of the source tree.

The official release tarballs e.g. https://github.com/philpem/printer-driver-ptouch/releases/download/v1.7/ptouch-driver-1.7.tar.gz have had autogen.sh run before they were released and shouldn't need it (unless your system has a wildly different version or Autoconf or Automake).

It annoys me that Github insists it knows better than I do in relation to source tarballs ... autoconf/automake may be old, but they're still widely used.