From patchwork Sun Mar 24 23:50:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 230529 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 1189B2C0089 for ; Mon, 25 Mar 2013 10:50:22 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id E93DE20217; Sun, 24 Mar 2013 23:50:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rNUIAAGPyUTs; Sun, 24 Mar 2013 23:50:18 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id C8FF626581; Sun, 24 Mar 2013 23:50:17 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id CC1118F753 for ; Sun, 24 Mar 2013 23:50:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 4BCB98C8F0 for ; Sun, 24 Mar 2013 23:50:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ytSdU5fccYj5 for ; Sun, 24 Mar 2013 23:50:13 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by whitealder.osuosl.org (Postfix) with ESMTPS id 427DF8C858 for ; Sun, 24 Mar 2013 23:50:13 +0000 (UTC) Received: by mail-wi0-f182.google.com with SMTP id hi18so6049969wib.15 for ; Sun, 24 Mar 2013 16:50:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=2GLh2g1mAA1RmHD3pr4tv86lUHu3FbkYr/yNL3I134M=; b=GMLj/SWwFiRmeJUreUpoLsRO75g9kTG0wGFuF1sstff+SzQZjUbiJHU8mKkgQ1PeVC OJOAcejTiktgjfB9ubz/ceF6BjB2hwiz6OlNOrl6Iqa1ppssf6scyCMoo2KnNnL5+yDR KZnnMk4IqxidNwoMi/gEr7a979jGi2fKFfTqdo6M+iLziS02GCJvhM1Ou093g72FSTc/ 4X6sfRBR4PQZjKHIpKxjnwR39g3f5lKo640+uEC8vdwDPfKsjjeZkSlywjLYKk7H/S0J wL9oafwbfWJwDPBEYmYzYS0OGcoWNvePXfBtxJqWW2euSN1jESTsZWMtBhmBrHGCdliG qJhg== X-Received: by 10.194.58.202 with SMTP id t10mr14616919wjq.4.1364169011449; Sun, 24 Mar 2013 16:50:11 -0700 (PDT) Received: from localhost.localdomain (ks3095497.kimsufi.com. [94.23.60.27]) by mx.google.com with ESMTPS id ex1sm19021805wib.7.2013.03.24.16.50.09 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 24 Mar 2013 16:50:10 -0700 (PDT) From: "Yann E. MORIN" To: buildroot@busybox.net Date: Mon, 25 Mar 2013 00:50:06 +0100 Message-Id: <1364169006-7874-1-git-send-email-yann.morin.1998@free.fr> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <20130325003718.2b239943@skate> References: <20130325003718.2b239943@skate> Cc: Thomas Petazzoni , Olivier Schonken , "Yann E. MORIN" Subject: [Buildroot] [PATCH] Added package Gutenprint X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net From: Olivier Schonken Gutenprint, formerly named Gimp-Print, is a suite of printer drivers that may be used with most common UNIX print spooling systems, including CUPS, lpr, LPRng, or others Signed-off-by: Olivier Schonken [yann.morin.1998@free.fr: needs libiconv, cleanup] Signed-off-by: "Yann E. MORIN" Cc: Thomas Petazzoni --- Changes v1 -> v2: - add licensing terms (Thomas) --- package/Config.in | 1 + package/gutenprint/Config.in | 14 ++++ .../gutenprint-000-use-pregen-xmli18n-header.patch | 48 +++++++++++++ package/gutenprint/gutenprint.mk | 73 ++++++++++++++++++++ 4 files changed, 136 insertions(+), 0 deletions(-) create mode 100644 package/gutenprint/Config.in create mode 100644 package/gutenprint/gutenprint-000-use-pregen-xmli18n-header.patch create mode 100644 package/gutenprint/gutenprint.mk diff --git a/package/Config.in b/package/Config.in index 74537e4..5d8f4f6 100644 --- a/package/Config.in +++ b/package/Config.in @@ -646,6 +646,7 @@ source "package/ctorrent/Config.in" source "package/conntrack-tools/Config.in" source "package/cups/Config.in" source "package/foomatic-filters/Config.in" +source "package/gutenprint/Config.in" source "package/hplip/Config.in" if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS source "package/dhcp/Config.in" diff --git a/package/gutenprint/Config.in b/package/gutenprint/Config.in new file mode 100644 index 0000000..eb06efd --- /dev/null +++ b/package/gutenprint/Config.in @@ -0,0 +1,14 @@ +config BR2_PACKAGE_GUTENPRINT + bool "gutenprint" + depends on BR2_INSTALL_LIBSTDCPP + depends on BR2_PACKAGE_CUPS + select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE + help + Gutenprint, formerly named Gimp-Print, is a suite of printer + drivers that may be used with most common UNIX print spooling + systems, including CUPS, lpr, LPRng, or others + + http://gimp-print.sourceforge.net/ + +comment "gutenprint requires a toolchain with C++ support enabled" + depends on !BR2_INSTALL_LIBSTDCPP diff --git a/package/gutenprint/gutenprint-000-use-pregen-xmli18n-header.patch b/package/gutenprint/gutenprint-000-use-pregen-xmli18n-header.patch new file mode 100644 index 0000000..533fe33 --- /dev/null +++ b/package/gutenprint/gutenprint-000-use-pregen-xmli18n-header.patch @@ -0,0 +1,48 @@ +src/xml: use preg-gen xmli18n_tmp.h if specified + +Ideally, the programs needed at build-time should be built with +CC_FOR_BUILD, and not with CC_FOR_HOST. + +Unfortunately, this program wants to link against the gutenprint libs, +so we would also need to build them with CC_FOR_HOST, that is build them +twice, once for build, once for host. + +Instead, in the Buildroot context, we first build gutenprint for the build +system, use that to generate the incriminated header, and then re-use that +header to build the gutenprint for the host. + +It is not possible to have such constructs in Makefile.am: + ifeq ($(FOO),) + bar: bla + cat $< >$@ + else + bar: + echo $(FOO) >$@ + endif + +as autoreconf will yell loudly that there is an 'endif' without an 'if'. +Sigh... :-( + +Signed-off-by: "Yann E. MORIN" + +diff -durN gutenprint-5.2.9.orig/src/xml/Makefile.am gutenprint-5.2.9/src/xml/Makefile.am +--- gutenprint-5.2.9.orig/src/xml/Makefile.am 2011-03-30 02:43:24.000000000 +0200 ++++ gutenprint-5.2.9/src/xml/Makefile.am 2013-03-24 17:08:08.435918773 +0100 +@@ -52,10 +52,13 @@ + + + xmli18n-tmp.h: xml-stamp extract-strings +- -rm -f $@ $@.tmp +- ./extract-strings `cat xml-stamp | sed -e 's;^;$(srcdir)/;'` > $@.tmp +- mv $@.tmp $@ +- ++ if [ -z "$(BR2_USE_PREGEN_XMLI18N_TMP_H)" ]; then \ ++ rm -f $@ $@.tmp; \ ++ ./extract-strings `cat xml-stamp | sed -e 's;^;$(srcdir)/;'` > $@.tmp; \ ++ mv $@.tmp $@; \ ++ else \ ++ cp $(BR2_USE_PREGEN_XMLI18N_TMP_H) $@; \ ++ fi + + dist-hook: xmli18n-tmp.h xml-stamp + # xmli18n-tmp.h is needed by po/POTFILES.in at dist time diff --git a/package/gutenprint/gutenprint.mk b/package/gutenprint/gutenprint.mk new file mode 100644 index 0000000..6e32a0d --- /dev/null +++ b/package/gutenprint/gutenprint.mk @@ -0,0 +1,73 @@ +############################################################# +# +# gutenprint +# +############################################################# + +GUTENPRINT_VERSION = 5.2.9 +GUTENPRINT_SITE = http://downloads.sourceforge.net/gimp-print/gutenprint-5.2/$(GUTENPRINT_VERSION) +GUTENPRINT_SOURCE = gutenprint-$(GUTENPRINT_VERSION).tar.bz2 +GUTENPRINT_LICENSE = GPLv2+ +GUTENPRINT_LICENSE_FILES = COPYING + +# Needed, as we touch Makefile.am +GUTENPRINT_AUTORECONF = YES + +GUTENPRINT_DEPENDENCIES = cups $(if $(BR2_PACKAGE_LIBICONV),libiconv) + +# host-gutenprint is needed to generate XML as part of compilation +# the program that generates the xml also links against libgutenprint +# so we need to build both a host package and a target package +GUTENPRINT_DEPENDENCIES += host-gutenprint + +GUTENPRINT_CONF_OPT = --disable-libgutenprintui2 \ + --disable-samples \ + --without-gimp2 \ + --without-foomatic \ + --without-foomatic3 \ + --disable-escputil \ + --disable-test \ + --disable-testpattern \ + --with-cups="/usr" \ + --with-sysroot="$(STAGING_DIR)" \ + --disable-cups-ppds + +# USE_PREGEN_XMLI18N_TMP_H is added by our patch +GUTENPRINT_MAKE_ENV = BR2_USE_PREGEN_XMLI18N_TMP_H=$(HOST_DIR)/usr/include/xmli18n-tmp.h + +# We have no host dependencies +HOST_GUTENPRINT_DEPENDENCIES = +# The host-gutenprint shall create the required header +HOST_GUTENPRINT_MAKE_ENV = + +HOST_GUTENPRINT_CONF_OPT = --disable-libgutenprintui2 \ + --disable-samples \ + --without-gimp2 \ + --without-doc \ + --disable-nls \ + --disable-nls-macos \ + --without-foomatic \ + --without-foomatic3 \ + --disable-escputil \ + --disable-test \ + --disable-testpattern + +# Needed by autoreconf +define GUTENPRINT_CREATE_M4_DIR + mkdir -p $(@D)/m4local +endef +GUTENPRINT_POST_PATCH_HOOKS += GUTENPRINT_CREATE_M4_DIR + +define HOST_GUTENPRINT_POST_BUILD_INSTAL_TMP_HEADER + cp $(@D)/src/xml/xmli18n-tmp.h $(HOST_DIR)/usr/include +endef +HOST_GUTENPRINT_POST_BUILD_HOOKS += HOST_GUTENPRINT_POST_BUILD_INSTAL_TMP_HEADER + +define GUTENPRINT_POST_INSTALL_TARGET_FIXUP + mkdir -p $(TARGET_DIR)/usr/share/gutenprint/5.2 + cp -rf $(HOST_DIR)/usr/share/gutenprint/5.2/xml $(TARGET_DIR)/usr/share/gutenprint/5.2 +endef +GUTENPRINT_POST_INSTALL_TARGET_HOOKS += GUTENPRINT_POST_INSTALL_TARGET_FIXUP + +$(eval $(autotools-package)) +$(eval $(host-autotools-package))