1 | # $Id: $ |
---|
2 | |
---|
3 | PortSystem 1.0 |
---|
4 | name hplip |
---|
5 | version 1.6.9 |
---|
6 | revision 3 |
---|
7 | categories print |
---|
8 | platforms macosx |
---|
9 | maintainers darwinports@opendarwin.org |
---|
10 | description printing, scanning, and faxing for HP inkjet and laser printers |
---|
11 | long_description HPLIP is an HP developed solution for printing, scanning, and \ |
---|
12 | faxing with HP inkjet and laser based printers |
---|
13 | master_sites http://sourceforge.net/projects/hplip/files/hplip/1.6.9/ |
---|
14 | distfiles hplip-1.6.9.tar.gz |
---|
15 | |
---|
16 | checksums md5 38d57f58b48b5b0729d1de507776e7d1 \ |
---|
17 | rmd160 d3f8344459830dd9bcced54a1f9e37cd957bb72d \ |
---|
18 | sha1 7c50a59493f592bd53fb92e94c6ced9e98bc2c1d |
---|
19 | |
---|
20 | |
---|
21 | # create startup item for the hplip daemons |
---|
22 | startupitem.create yes |
---|
23 | startupitem.start "${prefix}/etc/init.d/hplip start" |
---|
24 | startupitem.stop "${prefix}/etc/init.d/hplip stop" |
---|
25 | startupitem.restart "${prefix}/etc/init.d/hplip restart" |
---|
26 | |
---|
27 | patchfiles patch-io_hpiod_device.cpp \ |
---|
28 | patch-Makefile |
---|
29 | |
---|
30 | depends_lib port:libusb \ |
---|
31 | port:jpeg \ |
---|
32 | port:sane-backends |
---|
33 | depends_run bin:gs:espgs |
---|
34 | |
---|
35 | configure.args --disable-pp-build --disable-gui-build |
---|
36 | configure.env LDFLAGS="-L${prefix}/lib" \ |
---|
37 | CPPFLAGS="-I${prefix}/include" |
---|
38 | |
---|
39 | variant gui { |
---|
40 | depends_lib-append port:PyQt |
---|
41 | depends_run-append port:py-readline port:py-reportlab |
---|
42 | configure.args-delete --disable-gui-build |
---|
43 | |
---|
44 | post-destroot { |
---|
45 | # need to use pythonw for PyQt scripts |
---|
46 | reinplace "s|/usr/bin/env python|/usr/bin/env pythonw|" \ |
---|
47 | ${destroot}${prefix}/bin/hp-check |
---|
48 | reinplace "s|/usr/bin/env python|/usr/bin/env pythonw|" \ |
---|
49 | ${destroot}${prefix}/bin/hp-print |
---|
50 | reinplace "s|/usr/bin/env python|/usr/bin/env pythonw|" \ |
---|
51 | ${destroot}${prefix}/bin/hp-toolbox |
---|
52 | reinplace "s|/usr/bin/env python|/usr/bin/env pythonw|" \ |
---|
53 | ${destroot}${prefix}/bin/hp-fab |
---|
54 | reinplace "s|/usr/bin/env python|/usr/bin/env pythonw|" \ |
---|
55 | ${destroot}${prefix}/bin/hp-sendfax |
---|
56 | reinplace "s|/usr/bin/env python|/usr/bin/env pythonw|" \ |
---|
57 | ${destroot}${prefix}/bin/hp-unload |
---|
58 | } |
---|
59 | } |
---|
60 | |
---|
61 | # change location so we don't have to install hplip.conf in root /etc |
---|
62 | pre-configure { |
---|
63 | reinplace "s|/etc/hp|${prefix}/etc/hp|g" ${worksrcpath}/base/g.py |
---|
64 | reinplace "s|/etc/hp|${prefix}/etc/hp|g" ${worksrcpath}/fax/backend/hpfax.py |
---|
65 | reinplace "s|/etc/hp|${prefix}/etc/hp|g" ${worksrcpath}/hpssd.py |
---|
66 | reinplace "s|/etc/hp|${prefix}/etc/hp|g" ${worksrcpath}/io/hpiod/hpiod.h |
---|
67 | reinplace "s|/etc/hp|${prefix}/etc/hp|g" ${worksrcpath}/Makefile.am |
---|
68 | reinplace "s|/etc/hp|${prefix}/etc/hp|g" ${worksrcpath}/Makefile.in |
---|
69 | reinplace "s|/etc/hp|${prefix}/etc/hp|g" ${worksrcpath}/prnt/hpijs/hplip_api.h |
---|
70 | } |
---|
71 | |
---|
72 | # SANE needs backends in shared object (.so) format; for some reason this file is not |
---|
73 | # built by the hplip Makefile, so we need to do it ourselves |
---|
74 | post-build { |
---|
75 | system "gcc -bundle -flat_namespace \ |
---|
76 | -L${worksrcpath}/.libs -o ${worksrcpath}/.libs/libsane-hpaio.1.0.0.so \ |
---|
77 | ${worksrcpath}/.libs/*.o" |
---|
78 | } |
---|
79 | |
---|
80 | post-destroot { |
---|
81 | # install the (correct) backend library |
---|
82 | file delete ${destroot}${prefix}/lib/sane/libsane-hpaio.so |
---|
83 | file delete ${destroot}${prefix}/lib/sane/libsane-hpaio.so.1 |
---|
84 | file delete ${destroot}${prefix}/lib/sane/libsane-hpaio.so.1.0.0 |
---|
85 | file copy ${worksrcpath}/.libs/libsane-hpaio.1.0.0.so \ |
---|
86 | ${destroot}${prefix}/lib/sane/libsane-hpaio.1.0.0.so |
---|
87 | system "cd ${destroot}${prefix}/lib/sane && ln -s -f libsane-hpaio.1.0.0.so \ |
---|
88 | libsane-hpaio.1.so && ln -s -f libsane-hpaio.1.0.0.so \ |
---|
89 | libsane-hpaio.so" |
---|
90 | file copy ${destroot}${prefix}/lib/libsane-hpaio.la \ |
---|
91 | ${destroot}${prefix}/lib/sane/libsane-hpaio.la |
---|
92 | reinplace "s|dylib|so|g" ${destroot}${prefix}/lib/sane/libsane-hpaio.la |
---|
93 | reinplace "s|shouldnotlink=no|shouldnotlink=yes|" ${destroot}${prefix}/lib/sane/libsane-hpaio.la |
---|
94 | reinplace "s|libdir='/opt/local/lib'|libdir='/opt/local/lib/sane'|" \ |
---|
95 | ${destroot}${prefix}/lib/sane/libsane-hpaio.la |
---|
96 | file delete ${destroot}${prefix}/lib/libsane-hpaio.1.dylib |
---|
97 | file delete ${destroot}${prefix}/lib/libsane-hpaio.1.0.0.dylib |
---|
98 | file delete ${destroot}${prefix}/lib/libsane-hpaio.dylib |
---|
99 | file delete ${destroot}${prefix}/lib/libsane-hpaio.la |
---|
100 | |
---|
101 | # this file is provided by sane-backends port; don't need it |
---|
102 | file delete ${destroot}/etc/sane.d/dll.conf |
---|
103 | |
---|
104 | # dont need this; moved to ${prefix}/etc |
---|
105 | file delete ${destroot}/etc/hp/hplip.conf |
---|
106 | |
---|
107 | # this file is the hplip daemons script |
---|
108 | xinstall -m 755 -d ${destroot}${prefix}/etc/init.d/ |
---|
109 | file copy ${destroot}/etc/init.d/hplip ${destroot}${prefix}/etc/init.d/hplip |
---|
110 | file delete ${destroot}/etc/init.d/hplip |
---|
111 | |
---|
112 | # need to change foomatic-rip to find Mac OS X CUPS filters |
---|
113 | reinplace "s|/usr/local|${prefix}|g" ${destroot}${prefix}/bin/foomatic-rip |
---|
114 | reinplace "s|/usr/lib/cups/filter|/usr/libexec/cups/filter|" \ |
---|
115 | ${destroot}${prefix}/bin/foomatic-rip |
---|
116 | } |
---|
117 | |
---|
118 | post-install { |
---|
119 | # if sane-backends is installed, add "hpaio" to dll.conf so it |
---|
120 | # will recognize the hpaio backend |
---|
121 | if { [ file exists ${prefix}/etc/sane.d/dll.conf ] } then { |
---|
122 | system "echo '# the following line is added by hplip to support scanning by SANE' >> ${prefix}/etc/sane.d/dll.conf" |
---|
123 | system "echo 'hpaio' >> ${prefix}/etc/sane.d/dll.conf" |
---|
124 | } |
---|
125 | } |
---|