Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 1/1] package/ghostscript: add cups support
@ 2020-05-01  8:26 Alexey Lukyanchuk
  2020-05-01 12:50 ` Yann E. MORIN
  0 siblings, 1 reply; 2+ messages in thread
From: Alexey Lukyanchuk @ 2020-05-01  8:26 UTC (permalink / raw)
  To: buildroot

Ghostscript can be used for cups printing.

In current version it's disabled, but may be needed for some customers.

This patch add cups support if cups enabled.
Also patch fix configure.ac for cross-compilation.

Signed-off-by: Alexey Lukyanchuk <skif@skif-web.ru>

---
Changes v1 -> v2:
 - use $(STAGING_DIR) for GHOSTSCRIPT_CUPS_CONFIG_FIX
---
 .../ghostscript/0002-add-cups-support.patch   | 54 +++++++++++++++++++
 package/ghostscript/ghostscript.mk            | 13 +++++
 2 files changed, 67 insertions(+)
 create mode 100644 package/ghostscript/0002-add-cups-support.patch

diff --git a/package/ghostscript/0002-add-cups-support.patch b/package/ghostscript/0002-add-cups-support.patch
new file mode 100644
index 0000000000..262a06c102
--- /dev/null
+++ b/package/ghostscript/0002-add-cups-support.patch
@@ -0,0 +1,54 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -199,30 +199,6 @@
+ 
+ dnl pkg-config is used for several tests now...
+ AC_PATH_TOOL(PKGCONFIG, pkg-config)
+-
+-# this is an unpleasant hack
+-# but if we are cross compiling, and there isn't a matching
+-# pkconfig for the --host setting, then don't use the 'local'
+-# pkconfig at all
+-if test x"$cross_compiling" = x"yes"; then
+-  AC_PATH_PROG(BUILD_PKGCONFIG, pkg-config)
+-  if test x"$BUILD_PKGCONFIG" = x"$PKGCONFIG" ; then
+-    PKGCONFIG=
+-  fi
+-fi
+-
+-AC_PATH_TOOL(STRIP_XE, strip)
+-
+-# this is an unpleasant hack
+-# but if we are cross compiling, and there isn't a matching
+-# pkconfig for the --host setting, then don't use the 'local'
+-# pkconfig at all
+-if test x"$cross_compiling" = x"yes"; then
+-  AC_PATH_PROG(BUILD_STRIP_XE, strip)
+-  if test x"$BUILD_STRIP_XE" = x"$STRIP_XE" ; then
+-    STRIP_XE=
+-  fi
+-fi
+ 
+ dnl --------------------------------------------------  
+ dnl Allow excluding the contributed drivers
+@@ -1432,12 +1408,6 @@
+         if test x$with_local_cups != xyes; then
+             if test x"$CUPSCONFIG" = x""; then
+               AC_PATH_TOOL(CUPSCONFIG,cups-config)
+-              if test x"$cross_compiling" = x"yes"; then
+-                AC_PATH_PROG(BUILD_CUPSCONFIG, cups-config)
+-                if test x"$BUILD_CUPSCONFIG" = x"$CUPSCONFIG" ; then
+-                  CUPSCONFIG=
+-                fi
+-              fi
+             fi
+             # check for a libcups header
+             AC_CHECK_HEADER([cups/cups.h],[],[CUPSCONFIG=""])
+@@ -1473,7 +1443,6 @@
+                 else
+                   CUPSDATA="`$CUPSCONFIG --datadir`"
+                 fi
+-
+                 CUPSINCLUDE="include $srcdir/cups/cups.mak"
+                 CUPSDEV="cups"
+ 
diff --git a/package/ghostscript/ghostscript.mk b/package/ghostscript/ghostscript.mk
index 1d6f8d04a0..b515d8987a 100644
--- a/package/ghostscript/ghostscript.mk
+++ b/package/ghostscript/ghostscript.mk
@@ -10,6 +10,7 @@ GHOSTSCRIPT_SOURCE = ghostscript-$(GHOSTSCRIPT_VERSION).tar.xz
 GHOSTSCRIPT_LICENSE = AGPL-3.0
 GHOSTSCRIPT_LICENSE_FILES = LICENSE
 # 0001-Fix-cross-compilation-issue.patch
+GHOSTSCRIPT_INSTALL_STAGING = YES
 GHOSTSCRIPT_AUTORECONF = YES
 GHOSTSCRIPT_DEPENDENCIES = \
 	host-lcms2 \
@@ -68,6 +69,18 @@ else
 GHOSTSCRIPT_CONF_OPTS += --disable-openjpeg
 endif
 
+define GHOSTSCRIPT_CUPS_CONFIG_FIX
+cp $(STAGING_DIR)/usr/bin/cups-config  $(HOST_DIR)/usr/bin/
+endef
+
+ifeq ($(BR2_PACKAGE_CUPS),y)
+GHOSTSCRIPT_DEPENDENCIES += cups
+GHOSTSCRIPT_PRE_CONFIGURE_HOOKS += GHOSTSCRIPT_CUPS_CONFIG_FIX
+GHOSTSCRIPT_CONF_OPTS += --enable-cups
+else
+GHOSTSCRIPT_CONF_OPTS += --disable-cups
+endif
+
 ifeq ($(BR2_PACKAGE_XLIB_LIBX11),y)
 GHOSTSCRIPT_DEPENDENCIES += xlib_libX11
 GHOSTSCRIPT_CONF_OPTS += --with-x
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Buildroot] [PATCH v2 1/1] package/ghostscript: add cups support
  2020-05-01  8:26 [Buildroot] [PATCH v2 1/1] package/ghostscript: add cups support Alexey Lukyanchuk
@ 2020-05-01 12:50 ` Yann E. MORIN
  0 siblings, 0 replies; 2+ messages in thread
From: Yann E. MORIN @ 2020-05-01 12:50 UTC (permalink / raw)
  To: buildroot

Alexey, All,

On 2020-05-01 11:26 +0300, Alexey Lukyanchuk spake thusly:
> Ghostscript can be used for cups printing.
> 
> In current version it's disabled, but may be needed for some customers.
> 
> This patch add cups support if cups enabled.
> Also patch fix configure.ac for cross-compilation.



> Signed-off-by: Alexey Lukyanchuk <skif@skif-web.ru>
> 
> ---
> Changes v1 -> v2:
>  - use $(STAGING_DIR) for GHOSTSCRIPT_CUPS_CONFIG_FIX
> ---
>  .../ghostscript/0002-add-cups-support.patch   | 54 +++++++++++++++++++
>  package/ghostscript/ghostscript.mk            | 13 +++++
>  2 files changed, 67 insertions(+)
>  create mode 100644 package/ghostscript/0002-add-cups-support.patch
> 
> diff --git a/package/ghostscript/0002-add-cups-support.patch b/package/ghostscript/0002-add-cups-support.patch
> new file mode 100644
> index 0000000000..262a06c102
> --- /dev/null
> +++ b/package/ghostscript/0002-add-cups-support.patch

This patch must have a subject and a commit log, and must bear your SoB
line as well. And sicne ghostscript is hosted in a git repository, thios
patch should be a proper git commit exported with 'git format-patch'.

[--SNIP--]
> +@@ -1473,7 +1443,6 @@
> +                 else
> +                   CUPSDATA="`$CUPSCONFIG --datadir`"
> +                 fi
> +-

This hunk is most probably useless...

> +                 CUPSINCLUDE="include $srcdir/cups/cups.mak"
> +                 CUPSDEV="cups"
> + 
> diff --git a/package/ghostscript/ghostscript.mk b/package/ghostscript/ghostscript.mk
> index 1d6f8d04a0..b515d8987a 100644
> --- a/package/ghostscript/ghostscript.mk
> +++ b/package/ghostscript/ghostscript.mk
> @@ -10,6 +10,7 @@ GHOSTSCRIPT_SOURCE = ghostscript-$(GHOSTSCRIPT_VERSION).tar.xz
>  GHOSTSCRIPT_LICENSE = AGPL-3.0
>  GHOSTSCRIPT_LICENSE_FILES = LICENSE
>  # 0001-Fix-cross-compilation-issue.patch
> +GHOSTSCRIPT_INSTALL_STAGING = YES
>  GHOSTSCRIPT_AUTORECONF = YES
>  GHOSTSCRIPT_DEPENDENCIES = \
>  	host-lcms2 \
> @@ -68,6 +69,18 @@ else
>  GHOSTSCRIPT_CONF_OPTS += --disable-openjpeg
>  endif
>  
> +define GHOSTSCRIPT_CUPS_CONFIG_FIX
> +cp $(STAGING_DIR)/usr/bin/cups-config  $(HOST_DIR)/usr/bin/
> +endef

You must not do that; instead pass:

    GHOSTSCRIPT_CONF_OPTS += \
        CUPSCONFIG=$(STAGING_DIR)/usr/bin/cups-config \
        --enable-cups

Regards,
Yann E. MORIN.

> +ifeq ($(BR2_PACKAGE_CUPS),y)
> +GHOSTSCRIPT_DEPENDENCIES += cups
> +GHOSTSCRIPT_PRE_CONFIGURE_HOOKS += GHOSTSCRIPT_CUPS_CONFIG_FIX
> +GHOSTSCRIPT_CONF_OPTS += --enable-cups
> +else
> +GHOSTSCRIPT_CONF_OPTS += --disable-cups
> +endif
> +
>  ifeq ($(BR2_PACKAGE_XLIB_LIBX11),y)
>  GHOSTSCRIPT_DEPENDENCIES += xlib_libX11
>  GHOSTSCRIPT_CONF_OPTS += --with-x
> -- 
> 2.17.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-01 12:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-01  8:26 [Buildroot] [PATCH v2 1/1] package/ghostscript: add cups support Alexey Lukyanchuk
2020-05-01 12:50 ` Yann E. MORIN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox