Re: [ptxdist] [PATCH v2 6/7] host-cups: new package: CUPS host tools

2017-09-30 Thread Michael Olbrich
On Wed, Sep 27, 2017 at 02:22:21PM +0200, Roland Hieber wrote:
> Most printer drivers compile model-specific PPDs from a generic schema
> during the build process, using ppdc, the PPD compiler. ppdc must be
> able to find CUPS' internal include files, which are architecture-
> independent and can be used from sysroot-host.
> 
> Unfortunately, the CUPS build system is rather inflexible, so we have to
> build the whole core distribution to get a working ppdc.
> 
> Signed-off-by: Roland Hieber 
> ---
> 
> Notes:
> changes in v1 -> v2:
>  - remove unused code in host-cups.make
>  - compile ppdc in compile stage, not in install stage
>  - use @$(call compile) and $(call install), not $(MAKE) directly
>  - use --exec-prefix=/ and --libdir=/lib/ to get rid of LD_LIBRARY_PATH
>  - set CUPS_DATADIR in sysroot-cross wrapper, so an additional include 
> path is
>no longer needed, and ppdc also doesn't look for files on the host file
>system!
>  - make clean stage more silent
> 
>  rules/host-cups.in   |   7 
>  rules/host-cups.make | 114 
> +++
>  2 files changed, 121 insertions(+)
>  create mode 100644 rules/host-cups.in
>  create mode 100644 rules/host-cups.make
> 
> diff --git a/rules/host-cups.in b/rules/host-cups.in
> new file mode 100644
> index 0..45edccada
> --- /dev/null
> +++ b/rules/host-cups.in
> @@ -0,0 +1,7 @@
> +## SECTION=hosttools_noprompt
> +
> +config HOST_CUPS
> + tristate
> + default ALLYES
> +
> +# vim: ft=kconfig ts=8 noet tw=80
> diff --git a/rules/host-cups.make b/rules/host-cups.make
> new file mode 100644
> index 0..5dd88e47b
> --- /dev/null
> +++ b/rules/host-cups.make
> @@ -0,0 +1,114 @@
> +# -*-makefile-*-
> +#
> +# Copyright (C) 2017 by Roland Hieber 
> +#
> +# See CREDITS for details about who has contributed to this project.
> +#
> +# For further information about the PTXdist project and license conditions
> +# see the README file.
> +#
> +
> +#
> +# We provide this package
> +#
> +HOST_PACKAGES-$(PTXCONF_HOST_CUPS) += host-cups
> +
> +# 
> 
> +# Prepare
> +# 
> 
> +
> +#
> +# autoconf
> +#
> +# The --with-* options are only used to specify strings, --without-* does
> +# nothing. So we're omitting them here. The only exception is
> +# --with-components=core, which we are setting to only builds libcups* 
> (which is
> +# needed by ppdc).
> +#
> +# We have to set --exec-prefix and --libdir, otherwise the libs end up in
> +# ${prefix}/lib64, which is not what we want.
> +#
> +HOST_CUPS_CONF_TOOL  := autoconf
> +HOST_CUPS_CONF_OPT   := \
> + $(HOST_AUTOCONF) \
> + --exec-prefix=/ \
> + --libdir=/lib/ \

same as with cups.

> + --disable-mallinfo \
> + --disable-libpaper \
> + --disable-libusb \
> + --disable-tcp-wrappers \
> + --disable-acl \
> + --disable-dbus \
> + --disable-libtool-unsupported \
> + --disable-debug \
> + --disable-debug-guards \
> + --disable-debug-printfs \
> + --disable-unit-tests \
> + --disable-relro \
> + --disable-gssapi \
> + --disable-threads \
> + --disable-ssl \
> + --disable-cdsassl \
> + --disable-gnutls \
> + --disable-pam \
> + --disable-largefile \
> + --disable-avahi \
> + --disable-dnssd \
> + --disable-launchd \
> + --disable-systemd \
> + --disable-upstart \
> + --disable-page-logging \
> + --disable-browsing \
> + --disable-default-shared \
> + --disable-raw-printing \
> + --disable-webif \
> + --with-components=core
> +
> +# 
> 
> +# Compile
> +# 
> 
> +
> +$(STATEDIR)/host-cups.compile:
> + @$(call targetinfo)
> + @$(call world/compile, HOST_CUPS)
> + @# ppdc isn't built by --with-components=core
> + @$(call compile, HOST_CUPS, -C ${HOST_CUPS_DIR}/ppdc)
> + @$(call touch)
> +
> +# 
> 
> +# Install
> +# 
> 
> +
> +HOST_CUPS_MAKE_ENV := \
> + DSTROOT=$(HOST_CUPS_PKGDIR)
> +
> +$(STATEDIR)/host-cups.install:
> + @$(call targetinfo)
> + @$(call world/install, HOST_CUPS)
> + @# ppdc isn't included in --with-components=core
> + @$(call install, HOST_CUPS, ${HOST_CUPS_DIR}/ppdc)
> + @$(call touch)
> +
> +CROSS_PPDC = $(PTXDIST_SYSROOT_CROSS)/bin/ppdc
> +$(STATEDIR)/host-cups.install.post:
> + @$(call targetinfo)
> + @$(call world/install.post, HOST_CUPS)
> +
> + ( \
> + echo '#!/bin/sh'; \
> + echo 'CUPS_DATADIR=$(PTXDIST_SYSROOT_HOST)/share/cups 
> $(PTXDIST_SYSROOT_HOST)/bin/ppdc

Re: [ptxdist] [PATCH v2 6/7] host-cups: new package: CUPS host tools

2017-09-30 Thread Michael Olbrich
On Wed, Sep 27, 2017 at 11:40:38PM +0200, Roland Hieber wrote:
> On 27.09.2017 14:22, Roland Hieber wrote:
> [...]
> > diff --git a/rules/host-cups.make b/rules/host-cups.make
> > new file mode 100644
> > index 0..5dd88e47b
> > --- /dev/null
> > +++ b/rules/host-cups.make
> > @@ -0,0 +1,114 @@
> > +# -*-makefile-*-
> > +#
> > +# Copyright (C) 2017 by Roland Hieber 
> > +#
> > +# See CREDITS for details about who has contributed to this project.
> > +#
> > +# For further information about the PTXdist project and license conditions
> > +# see the README file.
> > +#
> > +
> > +#
> > +# We provide this package
> > +#
> > +HOST_PACKAGES-$(PTXCONF_HOST_CUPS) += host-cups
> > +
> > +# 
> > 
> > +# Prepare
> > +# 
> > 
> > +
> > +#
> > +# autoconf
> > +#
> > +# The --with-* options are only used to specify strings, --without-* does
> > +# nothing. So we're omitting them here. The only exception is
> > +# --with-components=core, which we are setting to only builds libcups* 
> > (which is
> > +# needed by ppdc).
> > +#
> > +# We have to set --exec-prefix and --libdir, otherwise the libs end up in
> > +# ${prefix}/lib64, which is not what we want.
> > +#
> > +HOST_CUPS_CONF_TOOL:= autoconf
> > +HOST_CUPS_CONF_OPT := \
> > +   $(HOST_AUTOCONF) \
> > +   --exec-prefix=/ \
> > +   --libdir=/lib/ \
> > +   --disable-mallinfo \
> > +   --disable-libpaper \
> > +   --disable-libusb \
> > +   --disable-tcp-wrappers \
> > +   --disable-acl \
> > +   --disable-dbus \
> > +   --disable-libtool-unsupported \
> > +   --disable-debug \
> > +   --disable-debug-guards \
> > +   --disable-debug-printfs \
> > +   --disable-unit-tests \
> > +   --disable-relro \
> > +   --disable-gssapi \
> > +   --disable-threads \
> > +   --disable-ssl \
> > +   --disable-cdsassl \
> > +   --disable-gnutls \
> > +   --disable-pam \
> > +   --disable-largefile \
> > +   --disable-avahi \
> > +   --disable-dnssd \
> > +   --disable-launchd \
> > +   --disable-systemd \
> > +   --disable-upstart \
> > +   --disable-page-logging \
> > +   --disable-browsing \
> > +   --disable-default-shared \
> > +   --disable-raw-printing \
> > +   --disable-webif \
> > +   --with-components=core
> > +
> > +# 
> > 
> > +# Compile
> > +# 
> > 
> > +
> > +$(STATEDIR)/host-cups.compile:
> > +   @$(call targetinfo)
> > +   @$(call world/compile, HOST_CUPS)
> > +   @# ppdc isn't built by --with-components=core
> > +   @$(call compile, HOST_CUPS, -C ${HOST_CUPS_DIR}/ppdc)
> > +   @$(call touch)
> > +
> > +# 
> > 
> > +# Install
> > +# 
> > 
> > +
> > +HOST_CUPS_MAKE_ENV := \
> > +   DSTROOT=$(HOST_CUPS_PKGDIR)
> > +
> > +$(STATEDIR)/host-cups.install:
> > +   @$(call targetinfo)
> > +   @$(call world/install, HOST_CUPS)
> > +   @# ppdc isn't included in --with-components=core
> > +   @$(call install, HOST_CUPS, ${HOST_CUPS_DIR}/ppdc)
> 
> Strange, this single call seems to delete already installed files. I've
> guarded this line with a
> 
>   find ${HOST_CUPS_PKGDIR}/share/
>   @$(call install, HOST_CUPS, ${HOST_CUPS_DIR}/ppdc)
>   find ${HOST_CUPS_PKGDIR}/share/
> 
> and the first call shows files which are all missing in the second call.
> But it works like intended if I replace this line with
> 
>   @$(call compile, HOST_CUPS, -C ${HOST_CUPS_DIR}/ppdc install)
> 
> (like suggested by mol last month). Any hints what's going on here, so I
> can fix this in v3?

world/install and install both delete _PKGDIR. This is to make sure
that the directory does not contain old files, e.g. after a config change
triggered a new prepare/compile/install run.
Things like install_tree depend on this.

Michael

> > +   @$(call touch)
> > +
> > +CROSS_PPDC = $(PTXDIST_SYSROOT_CROSS)/bin/ppdc
> > +$(STATEDIR)/host-cups.install.post:
> > +   @$(call targetinfo)
> > +   @$(call world/install.post, HOST_CUPS)
> > +
> > +   ( \
> > +   echo '#!/bin/sh'; \
> > +   echo 'CUPS_DATADIR=$(PTXDIST_SYSROOT_HOST)/share/cups 
> > $(PTXDIST_SYSROOT_HOST)/bin/ppdc "$$@"'; \
> > +   ) > $(CROSS_PPDC)
> > +   chmod +x $(CROSS_PPDC)
> > +
> > +   @$(call touch)
> > +
> > +# 
> > 
> > +# Clean
> > +# 
> > 
> > +
> > +$(STATEDIR)/host-cups.clean:
> > +   @$(call targetinfo)
> > +   @$(call clean_pkg, HOST_CUPS)
> > +   @rm -vf $(CROSS_PPDC)
> > +
> > +# vim: ft=make ts=8 tw=80
> > 
> 
> 
> -- 
> Pengutronix e.K.  | Roland Hieber   |
> Indu

Re: [ptxdist] [PATCH v2 6/7] host-cups: new package: CUPS host tools

2017-09-27 Thread Roland Hieber
On 27.09.2017 14:22, Roland Hieber wrote:
[...]
> diff --git a/rules/host-cups.make b/rules/host-cups.make
> new file mode 100644
> index 0..5dd88e47b
> --- /dev/null
> +++ b/rules/host-cups.make
> @@ -0,0 +1,114 @@
> +# -*-makefile-*-
> +#
> +# Copyright (C) 2017 by Roland Hieber 
> +#
> +# See CREDITS for details about who has contributed to this project.
> +#
> +# For further information about the PTXdist project and license conditions
> +# see the README file.
> +#
> +
> +#
> +# We provide this package
> +#
> +HOST_PACKAGES-$(PTXCONF_HOST_CUPS) += host-cups
> +
> +# 
> 
> +# Prepare
> +# 
> 
> +
> +#
> +# autoconf
> +#
> +# The --with-* options are only used to specify strings, --without-* does
> +# nothing. So we're omitting them here. The only exception is
> +# --with-components=core, which we are setting to only builds libcups* 
> (which is
> +# needed by ppdc).
> +#
> +# We have to set --exec-prefix and --libdir, otherwise the libs end up in
> +# ${prefix}/lib64, which is not what we want.
> +#
> +HOST_CUPS_CONF_TOOL  := autoconf
> +HOST_CUPS_CONF_OPT   := \
> + $(HOST_AUTOCONF) \
> + --exec-prefix=/ \
> + --libdir=/lib/ \
> + --disable-mallinfo \
> + --disable-libpaper \
> + --disable-libusb \
> + --disable-tcp-wrappers \
> + --disable-acl \
> + --disable-dbus \
> + --disable-libtool-unsupported \
> + --disable-debug \
> + --disable-debug-guards \
> + --disable-debug-printfs \
> + --disable-unit-tests \
> + --disable-relro \
> + --disable-gssapi \
> + --disable-threads \
> + --disable-ssl \
> + --disable-cdsassl \
> + --disable-gnutls \
> + --disable-pam \
> + --disable-largefile \
> + --disable-avahi \
> + --disable-dnssd \
> + --disable-launchd \
> + --disable-systemd \
> + --disable-upstart \
> + --disable-page-logging \
> + --disable-browsing \
> + --disable-default-shared \
> + --disable-raw-printing \
> + --disable-webif \
> + --with-components=core
> +
> +# 
> 
> +# Compile
> +# 
> 
> +
> +$(STATEDIR)/host-cups.compile:
> + @$(call targetinfo)
> + @$(call world/compile, HOST_CUPS)
> + @# ppdc isn't built by --with-components=core
> + @$(call compile, HOST_CUPS, -C ${HOST_CUPS_DIR}/ppdc)
> + @$(call touch)
> +
> +# 
> 
> +# Install
> +# 
> 
> +
> +HOST_CUPS_MAKE_ENV := \
> + DSTROOT=$(HOST_CUPS_PKGDIR)
> +
> +$(STATEDIR)/host-cups.install:
> + @$(call targetinfo)
> + @$(call world/install, HOST_CUPS)
> + @# ppdc isn't included in --with-components=core
> + @$(call install, HOST_CUPS, ${HOST_CUPS_DIR}/ppdc)

Strange, this single call seems to delete already installed files. I've
guarded this line with a

find ${HOST_CUPS_PKGDIR}/share/
@$(call install, HOST_CUPS, ${HOST_CUPS_DIR}/ppdc)
find ${HOST_CUPS_PKGDIR}/share/

and the first call shows files which are all missing in the second call.
But it works like intended if I replace this line with

@$(call compile, HOST_CUPS, -C ${HOST_CUPS_DIR}/ppdc install)

(like suggested by mol last month). Any hints what's going on here, so I
can fix this in v3?

 - Roland

> + @$(call touch)
> +
> +CROSS_PPDC = $(PTXDIST_SYSROOT_CROSS)/bin/ppdc
> +$(STATEDIR)/host-cups.install.post:
> + @$(call targetinfo)
> + @$(call world/install.post, HOST_CUPS)
> +
> + ( \
> + echo '#!/bin/sh'; \
> + echo 'CUPS_DATADIR=$(PTXDIST_SYSROOT_HOST)/share/cups 
> $(PTXDIST_SYSROOT_HOST)/bin/ppdc "$$@"'; \
> + ) > $(CROSS_PPDC)
> + chmod +x $(CROSS_PPDC)
> +
> + @$(call touch)
> +
> +# 
> 
> +# Clean
> +# 
> 
> +
> +$(STATEDIR)/host-cups.clean:
> + @$(call targetinfo)
> + @$(call clean_pkg, HOST_CUPS)
> + @rm -vf $(CROSS_PPDC)
> +
> +# vim: ft=make ts=8 tw=80
> 


-- 
Pengutronix e.K.  | Roland Hieber   |
Industrial Linux Solutions| http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim | Phone: +49-5121-206917-5086 |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917- |

___
ptxdist mailing list
ptxdist@pengutronix.de

[ptxdist] [PATCH v2 6/7] host-cups: new package: CUPS host tools

2017-09-27 Thread Roland Hieber
Most printer drivers compile model-specific PPDs from a generic schema
during the build process, using ppdc, the PPD compiler. ppdc must be
able to find CUPS' internal include files, which are architecture-
independent and can be used from sysroot-host.

Unfortunately, the CUPS build system is rather inflexible, so we have to
build the whole core distribution to get a working ppdc.

Signed-off-by: Roland Hieber 
---

Notes:
changes in v1 -> v2:
 - remove unused code in host-cups.make
 - compile ppdc in compile stage, not in install stage
 - use @$(call compile) and $(call install), not $(MAKE) directly
 - use --exec-prefix=/ and --libdir=/lib/ to get rid of LD_LIBRARY_PATH
 - set CUPS_DATADIR in sysroot-cross wrapper, so an additional include path 
is
   no longer needed, and ppdc also doesn't look for files on the host file
   system!
 - make clean stage more silent

 rules/host-cups.in   |   7 
 rules/host-cups.make | 114 +++
 2 files changed, 121 insertions(+)
 create mode 100644 rules/host-cups.in
 create mode 100644 rules/host-cups.make

diff --git a/rules/host-cups.in b/rules/host-cups.in
new file mode 100644
index 0..45edccada
--- /dev/null
+++ b/rules/host-cups.in
@@ -0,0 +1,7 @@
+## SECTION=hosttools_noprompt
+
+config HOST_CUPS
+   tristate
+   default ALLYES
+
+# vim: ft=kconfig ts=8 noet tw=80
diff --git a/rules/host-cups.make b/rules/host-cups.make
new file mode 100644
index 0..5dd88e47b
--- /dev/null
+++ b/rules/host-cups.make
@@ -0,0 +1,114 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2017 by Roland Hieber 
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+HOST_PACKAGES-$(PTXCONF_HOST_CUPS) += host-cups
+
+# 
+# Prepare
+# 
+
+#
+# autoconf
+#
+# The --with-* options are only used to specify strings, --without-* does
+# nothing. So we're omitting them here. The only exception is
+# --with-components=core, which we are setting to only builds libcups* (which 
is
+# needed by ppdc).
+#
+# We have to set --exec-prefix and --libdir, otherwise the libs end up in
+# ${prefix}/lib64, which is not what we want.
+#
+HOST_CUPS_CONF_TOOL:= autoconf
+HOST_CUPS_CONF_OPT := \
+   $(HOST_AUTOCONF) \
+   --exec-prefix=/ \
+   --libdir=/lib/ \
+   --disable-mallinfo \
+   --disable-libpaper \
+   --disable-libusb \
+   --disable-tcp-wrappers \
+   --disable-acl \
+   --disable-dbus \
+   --disable-libtool-unsupported \
+   --disable-debug \
+   --disable-debug-guards \
+   --disable-debug-printfs \
+   --disable-unit-tests \
+   --disable-relro \
+   --disable-gssapi \
+   --disable-threads \
+   --disable-ssl \
+   --disable-cdsassl \
+   --disable-gnutls \
+   --disable-pam \
+   --disable-largefile \
+   --disable-avahi \
+   --disable-dnssd \
+   --disable-launchd \
+   --disable-systemd \
+   --disable-upstart \
+   --disable-page-logging \
+   --disable-browsing \
+   --disable-default-shared \
+   --disable-raw-printing \
+   --disable-webif \
+   --with-components=core
+
+# 
+# Compile
+# 
+
+$(STATEDIR)/host-cups.compile:
+   @$(call targetinfo)
+   @$(call world/compile, HOST_CUPS)
+   @# ppdc isn't built by --with-components=core
+   @$(call compile, HOST_CUPS, -C ${HOST_CUPS_DIR}/ppdc)
+   @$(call touch)
+
+# 
+# Install
+# 
+
+HOST_CUPS_MAKE_ENV := \
+   DSTROOT=$(HOST_CUPS_PKGDIR)
+
+$(STATEDIR)/host-cups.install:
+   @$(call targetinfo)
+   @$(call world/install, HOST_CUPS)
+   @# ppdc isn't included in --with-components=core
+   @$(call install, HOST_CUPS, ${HOST_CUPS_DIR}/ppdc)
+   @$(call touch)
+
+CROSS_PPDC = $(PTXDIST_SYSROOT_CROSS)/bin/ppdc
+$(STATEDIR)/host-cups.install.post:
+   @$(call targetinfo)
+   @$(call world/install.post, HOST_CUPS)
+
+   ( \
+   echo '#!/bin/sh'; \
+   echo 'CUPS_DATADIR=$(PTXDIST_SYSROOT_HOST)/share/cups 
$(PTXDIST_SYSROOT_HOST)/bin/ppdc "$$@"'; \
+   ) > $(CROSS_PPDC)
+   chmod +x $(CROSS_PPDC)
+
+   @$(call touch)
+
+# 
+# Clean
+# 
+
+$(STATEDIR)/host-cups.clean:
+