FreeBSD CUPS-base gnutls error

 

cups in  FreeBSD doesn't have a maintainer anymore.

 

I had been trying to trying to build with OpenSSL 

 

                           ┌──────────────────────────── cups-base-1.7.3_4 ───────────────────────────────┐
                           │ ┌──────────────────────────────────────────────────────────────────────────┐ │  
                           │ │+[ ] DBUS           D-Bus IPC system support                              │ │  
                           │ │+[x] ICONS          Desktop icons                                         │ │  
                           │ │+[x] LIBPAPER       Paper size selection support via libpaper             │ │  
                           │ │+[ ] LIBUSB         USB support                                           │ │  
                           │ │+[ ] PAM            Pluggable authentication module support               │ │  
                           │ │+[ ] XDG_OPEN       Build with XDG_OPEN as browser                        │ │  
                           │ │───────────────────── Interpreters for web interfaces ────────────────────│ │  
                           │ │+[ ] JAVA           Java platform support                                 │ │  
                           │ │+[ ] PERL           Perl scripting language support                       │ │  
                           │ │+[ ] PHP            PHP bindings or support                               │ │  
                           │ │+[ ] PYTHON         Python bindings or support                            │ │  
                           │ │─────────────────────────── SSL protocol support ─────────────────────────│ │  
                           │ │+( ) GNUTLS         SSL/TLS support via GnuTLS                            │ │  
                           │ │+(*) OPENSSL        SSL/TLS support via OpenSSL                           │ │  
                           │ │───────────────────────────── Zeroconf support ───────────────────────────│ │  
                           │ │+( ) AVAHI          Zeroconf support via Avahi                            │ │  
                           │ │+(*) MDNSRESPONDER  Zeroconf support via mDNSResponder                    │ │  
                           │ └──────────────────────────────────────────────────────────────────────────┘ │  
                           ├──────────────────────────────────────────────────────────────────────────────┤  
                           │                       <  OK  >            <Cancel>                           │  
                           └──────────────────────────────────────────────────────────────────────────────┘  
                                                                                                             


 

But it constantly gave the following gnutls error. Very weird and un-fix-able, no matter what I tried.

../cups/libcups.a(http.o): In function `http_read_ssl':
/usr/ports/print/cups-client/work/cups-1.7.3/cups/http.c:4635: undefined reference to `gnutls_record_recv'
../cups/libcups.a(http.o): In function `httpInitialize':
/usr/ports/print/cups-client/work/cups-1.7.3/cups/http.c:1637: undefined reference to `gnutls_global_init'
../cups/libcups.a(http.o): In function `http_setup_ssl':
/usr/ports/print/cups-client/work/cups-1.7.3/cups/http.c:5151: undefined reference to `gnutls_certificate_allocate_credentials'
/usr/ports/print/cups-client/work/cups-1.7.3/cups/http.c:5153: undefined reference to `gnutls_init'
/usr/ports/print/cups-client/work/cups-1.7.3/cups/http.c:5154: undefined reference to `gnutls_set_default_priority'
/usr/ports/print/cups-client/work/cups-1.7.3/cups/http.c:5155: undefined reference to `gnutls_server_name_set'
/usr/ports/print/cups-client/work/cups-1.7.3/cups/http.c:5157: undefined reference to `gnutls_credentials_set'
/usr/ports/print/cups-client/work/cups-1.7.3/cups/http.c:5158: undefined reference to `gnutls_transport_set_ptr'
/usr/ports/print/cups-client/work/cups-1.7.3/cups/http.c:5159: undefined reference to `gnutls_transport_set_pull_function'
/usr/ports/print/cups-client/work/cups-1.7.3/cups/http.c:5160: undefined reference to `gnutls_transport_set_push_function'
/usr/ports/print/cups-client/work/cups-1.7.3/cups/http.c:5162: undefined reference to `gnutls_handshake'
/usr/ports/print/cups-client/work/cups-1.7.3/cups/http.c:5167: undefined reference to `gnutls_error_is_fatal'
/usr/ports/print/cups-client/work/cups-1.7.3/cups/http.c:5172: undefined reference to `gnutls_strerror'
/usr/ports/print/cups-client/work/cups-1.7.3/cups/http.c:5174: undefined reference to `gnutls_deinit'
/usr/ports/print/cups-client/work/cups-1.7.3/cups/http.c:5175: undefined reference to `gnutls_certificate_free_credentials'
cc: error: linker command failed with exit code 1 (use -v to see invocation)
Makefile:192: recipe for target 'ippserver' failed
gmake[3]: *** [ippserver] Error 1
gmake[3]: *** Waiting for unfinished jobs....
gmake[3]: Leaving directory '/usr/ports/print/cups-base/work/cups-1.7.3/test'
Makefile:31: recipe for target 'all' failed
gmake[2]: *** [all] Error 1
gmake[2]: Leaving directory '/usr/ports/print/cups-base/work/cups-1.7.3'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.

 

 

Now, the trick is to simply to SWITCH TO GNUTLS.

 

                           ┌──────────────────────────── cups-base-1.7.3_4 ───────────────────────────────┐
                           │ ┌──────────────────────────────────────────────────────────────────────────┐ │  
                           │ │+[ ] DBUS           D-Bus IPC system support                              │ │  
                           │ │+[x] ICONS          Desktop icons                                         │ │  
                           │ │+[x] LIBPAPER       Paper size selection support via libpaper             │ │  
                           │ │+[ ] LIBUSB         USB support                                           │ │  
                           │ │+[ ] PAM            Pluggable authentication module support               │ │  
                           │ │+[ ] XDG_OPEN       Build with XDG_OPEN as browser                        │ │  
                           │ │───────────────────── Interpreters for web interfaces ────────────────────│ │  
                           │ │+[ ] JAVA           Java platform support                                 │ │  
                           │ │+[ ] PERL           Perl scripting language support                       │ │  
                           │ │+[ ] PHP            PHP bindings or support                               │ │  
                           │ │+[ ] PYTHON         Python bindings or support                            │ │  
                           │ │─────────────────────────── SSL protocol support ─────────────────────────│ │  
                           │ │+(*) GNUTLS         SSL/TLS support via GnuTLS                            │ │  
                           │ │+( ) OPENSSL        SSL/TLS support via OpenSSL                           │ │  
                           │ │───────────────────────────── Zeroconf support ───────────────────────────│ │  
                           │ │+( ) AVAHI          Zeroconf support via Avahi                            │ │  
                           │ │+(*) MDNSRESPONDER  Zeroconf support via mDNSResponder                    │ │  
                           │ └──────────────────────────────────────────────────────────────────────────┘ │  
                           ├──────────────────────────────────────────────────────────────────────────────┤  
                           │                       <  OK  >            <Cancel>                           │  
                           └──────────────────────────────────────────────────────────────────────────────┘  
                                                                                                             

 

 

And here we go

===>  Installing for cups-base-1.7.3_4
===>   cups-base-1.7.3_4 depends on executable: gtk-update-icon-cache - found
===>   cups-base-1.7.3_4 depends on shared library: libcups.so - found (/usr/local/lib/libcups.so.2)
===>   cups-base-1.7.3_4 depends on shared library: libcupsimage.so - found (/usr/local/lib/libcupsimage.so.2)
===>   cups-base-1.7.3_4 depends on shared library: libgcrypt.so - found (/usr/local/lib/libgcrypt.so.20.0.2)
===>   cups-base-1.7.3_4 depends on shared library: libgnutls.so - found (/usr/local/lib/libgnutls.so.28.30.12)
===>   cups-base-1.7.3_4 depends on shared library: libpaper.so - found (/usr/local/lib/libpaper.so.1.1.2)
===>   cups-base-1.7.3_4 depends on shared library: libdns_sd.so - found (/usr/local/lib/libdns_sd.so.1)
===>   cups-base-1.7.3_4 depends on shared library: libatk-1.0.so - found (/usr/local/lib/libatk-1.0.so.0.21409.1)
===>   cups-base-1.7.3_4 depends on shared library: libgdk_pixbuf-2.0.so - found (/usr/local/lib/libgdk_pixbuf-2.0.so.0.3100.2)
===>   cups-base-1.7.3_4 depends on shared library: libglib-2.0.so - found (/usr/local/lib/libglib-2.0.so.0.4200.1)
===>   cups-base-1.7.3_4 depends on shared library: libpango-1.0.so - found (/usr/local/lib/libpango-1.0.so.0.3600.8)
===>  Checking if cups-base already installed
===>   Registering installation for cups-base-1.7.3_4
Installing cups-base-1.7.3_4...
===> Creating users and/or groups.
Using existing group 'cups'.
Using existing user 'cups'.
======================================================================
To enable printing with local printer you need to give group 'cups'
r/w access to printer device:
1) Add following to /etc/devfs.rules (create if it doesn't exist):
[system=10]
# FreeBSD 7.x
add path 'unlpt*' mode 0660 group cups
add path 'ulpt*' mode 0660 group cups
add path 'lpt*' mode 0660 group cups
# FreeBSD 8.x
add path 'usb*' mode 0770 group cups
add path 'ugen*' mode 0660 group cups
2) And following to /etc/rc.conf:
devfs_system_ruleset="system"
3) Restart devfs: /etc/rc.d/devfs restart
If your system supports 'devd' you can copy
$PREFIX/share/examples/cups/ulpt-cupsd.conf to $PREFIX/etc/devd/
To enable printing under Gimp and MS-Windows clients do the following:
1) Uncomment application/octet-stream line in mime.types
2) Uncomment application/octet-stream line in mime.convs
3) Restart cupsd
If you are using libusb, it is important that no device driver, e.g.
ulpt(4) is attached to the device you wish to use. In this case please
ensure the cups user and group has read/write access to /dev/ugen*
If you are using a USB printer wtih FreeBSD 8.0 or later, you will
need to find the proper /dev/usb/* device pointed at by the /dev/ugen*
entry. Follow the instructions for devfs.rules as above, but append a 
rule similar to the following for a printer attached as /dev/ugen0.2:
add path 'usb/0.2.*' mode 0660 group cups
======================================================================