GNOME Bugzilla – Bug 382676
PAPI backend is required
Last modified: 2009-05-23 04:32:23 UTC
Currently GTK+ Printing supports provides the following backends: - CUPS - FILE - LPR On Solaris, we have Solaris Print Server access through PAPI backend by default. Even though Solaris does provide a CUPS implemnetation but it is not installed nor run by default. We need a PAPI backend. I have a implementation for the PAPI backend which is currently being soaked in Solaris release, of which I should attach to this bug as soon as I can.
Well-soaked by now ?
My bad me! Too shame to give any excuse. I will attach it as soon I apply to head. No later than end of the week :)
Created attachment 132689 [details] [review] PAPI print backend patch
Attached patch against trunk code. Please review Matthias. Thanks.
+if HAVE_PAPI +GTK_PRINT_BACKENDS=file,lpr,papi +else Does it make sense to have lpr and papi on by default ? I would have expected just file,papi. +# Checks to see if we should compile with PAPI backend for GTK+ +# I'd prefer to have an explicit option to control this, like the AC_ARG_ENABLE(cups ... we have for cups. +AM_CONDITIONAL(HAVE_PAPI_CUPS, test $have_papi = yes && test "x$CUPS_CONFIG" != "xno") This seems to be unused ? Other than these things, looks ok
(In reply to comment #5) > +if HAVE_PAPI > +GTK_PRINT_BACKENDS=file,lpr,papi > +else > > Does it make sense to have lpr and papi on by default ? > I would have expected just file,papi. Fair point. I took it out now. > > > > +# Checks to see if we should compile with PAPI backend for GTK+ > +# > > I'd prefer to have an explicit option to control this, like the > AC_ARG_ENABLE(cups ... we have for cups. I have created a new patch using this macro. Now the configure script also take --disable-papi. > > > +AM_CONDITIONAL(HAVE_PAPI_CUPS, test $have_papi = yes && test "x$CUPS_CONFIG" > != "xno") > > This seems to be unused ? My mistake. I have another patch which is also to build a cups backend. Since on OpenSolaris, we can have either PAPI backend or CUPS backend depend on the print system user set to. We need to build both, though only one of them can be active at any one time. I have now also include that changes in this new patch. Essentially, the new changes between the previous patch and the current patch are: bash-3.2$ svn diff configure.in gtk/Makefile.am Index: configure.in =================================================================== --- configure.in (revision 22596) +++ configure.in (working copy) @@ -1879,6 +1879,28 @@ AM_CONDITIONAL(HAVE_CUPS, false) fi +# Checks to see if we should compile with PAPI backend for GTK+ +# + +AC_ARG_ENABLE(papi, + [AC_HELP_STRING([--disable-papi] + [disable papi print backend])],, + [enable_papi=auto]) + +if test "x$enable_papi" = "xauto" +then + AC_MSG_CHECKING(libpapi) + AC_CHECK_LIB(papi, papiServiceCreate, have_papi=yes, have_papi=no) + if test $have_papi = yes; then + AC_DEFINE([HAVE_PAPI], [], [Define to 1 if libpapi available]) + fi + AM_CONDITIONAL(HAVE_PAPI, test $have_papi = yes) +else + AM_CONDITIONAL(HAVE_PAPI, false) +fi + +AM_CONDITIONAL(HAVE_PAPI_CUPS, test $have_papi = yes && test "x$CUPS_CONFIG" != "xno") + gtk_save_cppflags="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $GTK_DEP_CFLAGS" @@ -2107,6 +2129,7 @@ modules/printbackends/cups/Makefile modules/printbackends/lpr/Makefile modules/printbackends/file/Makefile +modules/printbackends/papi/Makefile modules/printbackends/test/Makefile perf/Makefile contrib/Makefile Index: gtk/Makefile.am =================================================================== --- gtk/Makefile.am (revision 22596) +++ gtk/Makefile.am (working copy) @@ -10,11 +10,19 @@ SUBDIRS = theme-bits . tests DIST_SUBDIRS=theme-bits tests +if HAVE_PAPI_CUPS +GTK_PRINT_BACKENDS=file,papi,cups +else if HAVE_CUPS GTK_PRINT_BACKENDS=file,cups else +if HAVE_PAPI +GTK_PRINT_BACKENDS=file,papi +else GTK_PRINT_BACKENDS=file,lpr endif +endif +endif INCLUDES = \ -DG_LOG_DOMAIN=\"Gtk\" \ > > > Other than these things, looks ok >
Created attachment 134198 [details] [review] updated patch based on comments.
Thanks, looks good now.
Should I try to put back?
To the 2.16 branch, you mean ? Up to you, I'd say. We don't normally add new features to the stable branch, but since this is a totally self-contained new print backend, I don't have objections if you want to do the work...
Thanks! I will do the put back to trunk first and then to branch. Saved me the possibility of re-visit this again later. Now need to work the patch against git trunk :)
Just push to HEAD, git push origin HEAD Will try out branch tomorrow. -Ghee
Push to gtk+-2-16 branch as well. Thanks. Matthias!