# $Id: $ PortSystem 1.0 name hplip version 1.6.9 revision 3 categories print platforms macosx maintainers darwinports@opendarwin.org description printing, scanning, and faxing for HP inkjet and laser printers long_description HPLIP is an HP developed solution for printing, scanning, and \ faxing with HP inkjet and laser based printers master_sites http://sourceforge.net/projects/hplip/files/hplip/1.6.9/ distfiles hplip-1.6.9.tar.gz checksums md5 38d57f58b48b5b0729d1de507776e7d1 \ rmd160 d3f8344459830dd9bcced54a1f9e37cd957bb72d \ sha1 7c50a59493f592bd53fb92e94c6ced9e98bc2c1d # create startup item for the hplip daemons startupitem.create yes startupitem.start "${prefix}/etc/init.d/hplip start" startupitem.stop "${prefix}/etc/init.d/hplip stop" startupitem.restart "${prefix}/etc/init.d/hplip restart" patchfiles patch-io_hpiod_device.cpp \ patch-Makefile depends_lib port:libusb \ port:jpeg \ port:sane-backends depends_run bin:gs:espgs configure.args --disable-pp-build --disable-gui-build configure.env LDFLAGS="-L${prefix}/lib" \ CPPFLAGS="-I${prefix}/include" variant gui { depends_lib-append port:PyQt depends_run-append port:py-readline port:py-reportlab configure.args-delete --disable-gui-build post-destroot { # need to use pythonw for PyQt scripts reinplace "s|/usr/bin/env python|/usr/bin/env pythonw|" \ ${destroot}${prefix}/bin/hp-check reinplace "s|/usr/bin/env python|/usr/bin/env pythonw|" \ ${destroot}${prefix}/bin/hp-print reinplace "s|/usr/bin/env python|/usr/bin/env pythonw|" \ ${destroot}${prefix}/bin/hp-toolbox reinplace "s|/usr/bin/env python|/usr/bin/env pythonw|" \ ${destroot}${prefix}/bin/hp-fab reinplace "s|/usr/bin/env python|/usr/bin/env pythonw|" \ ${destroot}${prefix}/bin/hp-sendfax reinplace "s|/usr/bin/env python|/usr/bin/env pythonw|" \ ${destroot}${prefix}/bin/hp-unload } } # change location so we don't have to install hplip.conf in root /etc pre-configure { reinplace "s|/etc/hp|${prefix}/etc/hp|g" ${worksrcpath}/base/g.py reinplace "s|/etc/hp|${prefix}/etc/hp|g" ${worksrcpath}/fax/backend/hpfax.py reinplace "s|/etc/hp|${prefix}/etc/hp|g" ${worksrcpath}/hpssd.py reinplace "s|/etc/hp|${prefix}/etc/hp|g" ${worksrcpath}/io/hpiod/hpiod.h reinplace "s|/etc/hp|${prefix}/etc/hp|g" ${worksrcpath}/Makefile.am reinplace "s|/etc/hp|${prefix}/etc/hp|g" ${worksrcpath}/Makefile.in reinplace "s|/etc/hp|${prefix}/etc/hp|g" ${worksrcpath}/prnt/hpijs/hplip_api.h } # SANE needs backends in shared object (.so) format; for some reason this file is not # built by the hplip Makefile, so we need to do it ourselves post-build { system "gcc -bundle -flat_namespace \ -L${worksrcpath}/.libs -o ${worksrcpath}/.libs/libsane-hpaio.1.0.0.so \ ${worksrcpath}/.libs/*.o" } post-destroot { # install the (correct) backend library file delete ${destroot}${prefix}/lib/sane/libsane-hpaio.so file delete ${destroot}${prefix}/lib/sane/libsane-hpaio.so.1 file delete ${destroot}${prefix}/lib/sane/libsane-hpaio.so.1.0.0 file copy ${worksrcpath}/.libs/libsane-hpaio.1.0.0.so \ ${destroot}${prefix}/lib/sane/libsane-hpaio.1.0.0.so system "cd ${destroot}${prefix}/lib/sane && ln -s -f libsane-hpaio.1.0.0.so \ libsane-hpaio.1.so && ln -s -f libsane-hpaio.1.0.0.so \ libsane-hpaio.so" file copy ${destroot}${prefix}/lib/libsane-hpaio.la \ ${destroot}${prefix}/lib/sane/libsane-hpaio.la reinplace "s|dylib|so|g" ${destroot}${prefix}/lib/sane/libsane-hpaio.la reinplace "s|shouldnotlink=no|shouldnotlink=yes|" ${destroot}${prefix}/lib/sane/libsane-hpaio.la reinplace "s|libdir='/opt/local/lib'|libdir='/opt/local/lib/sane'|" \ ${destroot}${prefix}/lib/sane/libsane-hpaio.la file delete ${destroot}${prefix}/lib/libsane-hpaio.1.dylib file delete ${destroot}${prefix}/lib/libsane-hpaio.1.0.0.dylib file delete ${destroot}${prefix}/lib/libsane-hpaio.dylib file delete ${destroot}${prefix}/lib/libsane-hpaio.la # this file is provided by sane-backends port; don't need it file delete ${destroot}/etc/sane.d/dll.conf # dont need this; moved to ${prefix}/etc file delete ${destroot}/etc/hp/hplip.conf # this file is the hplip daemons script xinstall -m 755 -d ${destroot}${prefix}/etc/init.d/ file copy ${destroot}/etc/init.d/hplip ${destroot}${prefix}/etc/init.d/hplip file delete ${destroot}/etc/init.d/hplip # need to change foomatic-rip to find Mac OS X CUPS filters reinplace "s|/usr/local|${prefix}|g" ${destroot}${prefix}/bin/foomatic-rip reinplace "s|/usr/lib/cups/filter|/usr/libexec/cups/filter|" \ ${destroot}${prefix}/bin/foomatic-rip } post-install { # if sane-backends is installed, add "hpaio" to dll.conf so it # will recognize the hpaio backend if { [ file exists ${prefix}/etc/sane.d/dll.conf ] } then { system "echo '# the following line is added by hplip to support scanning by SANE' >> ${prefix}/etc/sane.d/dll.conf" system "echo 'hpaio' >> ${prefix}/etc/sane.d/dll.conf" } }