# $Id: $ PortSystem 1.0 name hplip version 0.9.11 revision 0 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 sourceforge checksums md5 5cf362c972d5b1733af4fb8e2ade92e4 # 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 depends_lib port:libusb \ port:jpeg \ port:PyQt \ port:sane-backends depends_run bin:gs:espgs \ port:py-readline \ port:py-reportlab configure.args --disable-pp-build configure.env LDFLAGS="-L${prefix}/lib" \ CPPFLAGS="-I${prefix}/include" # 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 -undefined suppress \ -L${worksrcpath}/.libs -o ${worksrcpath}/.libs/libsane-hpaio.1.0.0.so \ ${worksrcpath}/.libs/*.o -fno-common -fPIC" } 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 # 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 # 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" } }