Ticket #7201: Portfile.9

File Portfile.9, 6.8 KB (added by okmacports@…, 14 years ago)

working Portfile for hplip-3.10.9

Line 
1# $Id: $
2
3PortSystem       1.0
4name                 hplip
5version              3.10.9
6revision             0
7categories           print
8platforms        macosx
9maintainers          darwinports@opendarwin.org
10description          printing, scanning, and faxing for HP inkjet and laser printers
11long_description HPLIP is an HP developed solution for printing, scanning, and \
12                 faxing with HP inkjet and laser based printers
13master_sites     sourceforge
14
15checksums       md5 609718830a26874fc0ea84a47b8132f3 \
16                rmd160 37f512c73768e7a02bdf2814bb7528804cfada32 \
17                sha1 5e145eafefbc5122bbe98345f2984fc0a55e5787
18
19
20patchfiles      patch-prnt_hpijs_context2.cpp \
21                patch-prnt_hpijs_ljzjscolor.cpp \
22                patch-io_hpmud_hpmud.c
23                   
24depends_lib      port:libusb \
25                 port:jpeg \
26                 port:sane-backends \
27                port:dbus-python26 \
28                port:openssl \
29                port:net-snmp \
30                port:xorg-libpthread-stubs
31
32depends_run      bin:gs:espgs
33
34configure.args    --disable-gui-build \
35  --disable-qt4   \
36  --with-cupsbackenddir=${prefix}/libexec/cups/backend \
37  --with-cupsfilterdir=${prefix}/libexec/cups/filter
38
39configure.env    LDFLAGS="-L${prefix}/lib" \
40                 CPPFLAGS="-I${prefix}/include"
41                 
42variant gui      {
43        depends_lib-append port:PyQt
44        depends_run-append port:py-readline  port:py-reportlab
45        configure.args-delete --disable-gui-build --disable-qt4   
46                                               
47        post-destroot {
48                # need to use pythonw for PyQt scripts
49                reinplace "s|/usr/bin/env python|/usr/bin/env pythonw|" \
50                         ${destroot}${prefix}/bin/hp-check
51                reinplace "s|/usr/bin/env python|/usr/bin/env pythonw|" \
52                         ${destroot}${prefix}/bin/hp-print
53                reinplace "s|/usr/bin/env python|/usr/bin/env pythonw|" \
54                         ${destroot}${prefix}/bin/hp-toolbox                                               
55                reinplace "s|/usr/bin/env python|/usr/bin/env pythonw|" \
56                         ${destroot}${prefix}/bin/hp-fab
57                reinplace "s|/usr/bin/env python|/usr/bin/env pythonw|" \
58                         ${destroot}${prefix}/bin/hp-sendfax
59                reinplace "s|/usr/bin/env python|/usr/bin/env pythonw|" \
60                         ${destroot}${prefix}/bin/hp-unload 
61        }
62}
63
64pre-configure    {
65# change location so we don't have to install hplip.conf in root /etc
66        reinplace "s|/etc/hp|${prefix}/etc/hp|g" ${worksrcpath}/base/g.py
67        reinplace "s|/etc/hp|${prefix}/etc/hp|g" ${worksrcpath}/check.py
68        reinplace "s|/etc/hp|${prefix}/etc/hp|g" ${worksrcpath}/base/codes.py
69        reinplace "s|/etc/hp|${prefix}/etc/hp|g" ${worksrcpath}/base/utils.py
70        reinplace "s|/etc/hp|${prefix}/etc/hp|g" ${worksrcpath}/fax/backend/hpfax.py
71        reinplace "s|/etc/hp|${prefix}/etc/hp|g" ${worksrcpath}/installer/distros.dat
72        reinplace "s|/etc/hp|${prefix}/etc/hp|g" ${worksrcpath}/prnt/hpcups/Utils.cpp
73        reinplace "s|/etc/hp|${prefix}/etc/hp|g" ${worksrcpath}/prnt/hpijs/globals.cpp
74        reinplace "s|/etc/hp|${prefix}/etc/hp|g" ${worksrcpath}/ui/devmgr4.py
75        reinplace "s|/etc/hp|${prefix}/etc/hp|g" ${worksrcpath}/ui4/devmgr5.py
76        reinplace "s|/etc/hp|${prefix}/etc/hp|g" ${worksrcpath}/installer/core_install.py
77        reinplace "s|/etc/hp|${prefix}/etc/hp|g" ${worksrcpath}/hplip.list.in
78        reinplace "s|/etc/hp|${prefix}/etc/hp|g" ${worksrcpath}/Makefile.am
79        reinplace "s|/etc/hp|${prefix}/etc/hp|g" ${worksrcpath}/Makefile.in
80
81# change location so we don't have to install hplip.state in root /var/lib
82        reinplace "s|/var/lib/hp|${prefix}/var/lib/hp|g" ${worksrcpath}/base/g.py
83        reinplace "s|/var/lib/hp|${prefix}/var/lib/hp|g" ${worksrcpath}/check.py
84        reinplace "s|/var/lib/hp|${prefix}/var/lib/hp|g" ${worksrcpath}/hplip.list.in
85        reinplace "s|/var/lib/hp|${prefix}/var/lib/hp|g" ${worksrcpath}/Makefile.am
86        reinplace "s|/var/lib/hp|${prefix}/var/lib/hp|g" ${worksrcpath}/Makefile.in
87
88# change location so we don't have to install rules in root /etc/udev/rules.d
89        reinplace "s|/etc/udev/rules.d|${prefix}/etc/udev/rules.d|g" ${worksrcpath}/hplip.list.in
90        reinplace "s|/etc/udev/rules.d|${prefix}/etc/udev/rules.d|g" ${worksrcpath}/Makefile.in
91        reinplace "s|/etc/udev/rules.d|${prefix}/etc/udev/rules.d|g" ${worksrcpath}/Makefile.am
92
93# change location so we don't have to install hpaio driver in root /etc/sane.d/dll.conf
94        reinplace "s|/etc/sane.d|${prefix}/etc/sane.d|g" ${worksrcpath}/check.py
95        reinplace "s|/etc/sane.d|${prefix}/etc/sane.d|g" ${worksrcpath}/data/rules/55-hpmud.rules
96        reinplace "s|/etc/sane.d|${prefix}/etc/sane.d|g" ${worksrcpath}/hplip.list.in
97        reinplace "s|/etc/sane.d|${prefix}/etc/sane.d|g" ${worksrcpath}/Makefile.am
98        reinplace "s|/etc/sane.d|${prefix}/etc/sane.d|g" ${worksrcpath}/Makefile.in
99
100}
101
102
103post-destroot    { 
104
105        # this file, provided by sane-backends port,
106        # is fixed up in post-install, so delete this version
107        file delete ${destroot}${prefix}/etc/sane.d/dll.conf
108
109        # Deleting fax drivers
110        file delete ${destroot}/usr/share/cups/mime/pstotiff.convs
111        file delete ${destroot}/usr/share/cups/mime/pstotiff.types
112
113        # dont need these
114        file delete ${destroot}/etc/xdg/autostart/hplip-systray.desktop
115        file delete ${destroot}/usr/share/hal/fdi/preprobe/10osvendor/20-hplip-devices.fdi
116        file delete ${destroot}/usr/share/applications/hplip.desktop
117
118}
119
120post-install     {
121        # if sane-backends is installed, add "hpaio" to dll.conf if needed
122        # so it will recognize the hpaio backend
123        if { [ file exists ${prefix}/etc/sane.d/dll.conf ] } then {
124                system \
125"if ! grep ^hpaio ${prefix}/etc/sane.d/dll.conf >/dev/null 2>/dev/null ; then \
126echo 'hpaio' >> ${prefix}/etc/sane.d/dll.conf;fi"
127        }
128
129        # symlink local Python extensions to real Python
130        ln -sf ${prefix}/lib/python2.6/site-packages/cupsext.so /Library/Python/2.6/site-packages
131        ln -sf ${prefix}/lib/python2.6/site-packages/cupsext.la /Library/Python/2.6/site-packages
132        ln -sf ${prefix}/lib/python2.6/site-packages/hpmudext.so /Library/Python/2.6/site-packages
133        ln -sf ${prefix}/lib/python2.6/site-packages/hpmudext.la /Library/Python/2.6/site-packages
134        ln -sf ${prefix}/lib/python2.6/site-packages/pcardext.so /Library/Python/2.6/site-packages
135        ln -sf ${prefix}/lib/python2.6/site-packages/pcardext.la /Library/Python/2.6/site-packages
136        ln -sf ${prefix}/lib/python2.6/site-packages/scanext.so /Library/Python/2.6/site-packages
137        ln -sf ${prefix}/lib/python2.6/site-packages/scanext.la /Library/Python/2.6/site-packages
138
139}
140
141notes "####################################################################
142You will get the following error if you have not properly set up dbus:
143Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that org.freedesktop.dbus-session.plist is loaded!
144
145To repair this, you must launch the dbus daemon systemwide:
146sudo launchctl load -w /Library/LaunchDaemons/org.freedesktop.dbus-system.plist
147
148Then for EACH user who wants access, the user must launch the dbus agent:
149launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist
150############################################################################"
151