xref: /OK3568_Linux_fs/buildroot/package/gutenprint/gutenprint.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun################################################################################
2*4882a593Smuzhiyun#
3*4882a593Smuzhiyun# gutenprint
4*4882a593Smuzhiyun#
5*4882a593Smuzhiyun################################################################################
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunGUTENPRINT_VERSION_MAJOR = 5.2
8*4882a593SmuzhiyunGUTENPRINT_VERSION = $(GUTENPRINT_VERSION_MAJOR).14
9*4882a593SmuzhiyunGUTENPRINT_SITE = http://downloads.sourceforge.net/project/gimp-print/gutenprint-$(GUTENPRINT_VERSION_MAJOR)/$(GUTENPRINT_VERSION)
10*4882a593SmuzhiyunGUTENPRINT_SOURCE = gutenprint-$(GUTENPRINT_VERSION).tar.bz2
11*4882a593SmuzhiyunGUTENPRINT_LICENSE = GPL-2.0+
12*4882a593SmuzhiyunGUTENPRINT_LICENSE_FILES = COPYING
13*4882a593SmuzhiyunGUTENPRINT_CPE_ID_VENDOR = gutenprint_project
14*4882a593Smuzhiyun
15*4882a593Smuzhiyun# Needed, as we touch Makefile.am
16*4882a593SmuzhiyunGUTENPRINT_AUTORECONF = YES
17*4882a593Smuzhiyun
18*4882a593Smuzhiyun# Needed by autoreconf
19*4882a593Smuzhiyundefine GUTENPRINT_CREATE_M4_DIR
20*4882a593Smuzhiyun	mkdir -p $(@D)/m4local
21*4882a593Smuzhiyunendef
22*4882a593SmuzhiyunGUTENPRINT_POST_PATCH_HOOKS += GUTENPRINT_CREATE_M4_DIR
23*4882a593SmuzhiyunHOST_GUTENPRINT_POST_PATCH_HOOKS += GUTENPRINT_CREATE_M4_DIR
24*4882a593Smuzhiyun
25*4882a593SmuzhiyunGUTENPRINT_DEPENDENCIES = \
26*4882a593Smuzhiyun	cups host-pkgconf \
27*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_LIBICONV),libiconv) \
28*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_LIBUSB),libusb)
29*4882a593Smuzhiyun
30*4882a593Smuzhiyun# host-gutenprint is needed to generate XML as part of compilation
31*4882a593Smuzhiyun# the program that generates the xml also links against libgutenprint
32*4882a593Smuzhiyun# so we need to build both a host package and a target package
33*4882a593SmuzhiyunGUTENPRINT_DEPENDENCIES += host-gutenprint
34*4882a593Smuzhiyun
35*4882a593SmuzhiyunGUTENPRINT_CONF_ENV = \
36*4882a593Smuzhiyun	ac_cv_path_CUPS_CONFIG=$(STAGING_DIR)/usr/bin/cups-config \
37*4882a593Smuzhiyun	ac_cv_path_IJS_CONFIG=""
38*4882a593Smuzhiyun
39*4882a593SmuzhiyunGUTENPRINT_CONF_OPTS = \
40*4882a593Smuzhiyun	--disable-libgutenprintui2 \
41*4882a593Smuzhiyun	--disable-samples \
42*4882a593Smuzhiyun	--without-doc \
43*4882a593Smuzhiyun	--without-gimp2 \
44*4882a593Smuzhiyun	--disable-escputil \
45*4882a593Smuzhiyun	--disable-test \
46*4882a593Smuzhiyun	--disable-testpattern \
47*4882a593Smuzhiyun	--with-cups="/usr" \
48*4882a593Smuzhiyun	--with-sysroot="$(STAGING_DIR)" \
49*4882a593Smuzhiyun	--disable-cups-ppds
50*4882a593Smuzhiyun
51*4882a593Smuzhiyun# USE_PREGEN_XMLI18N_TMP_H is added by our patch
52*4882a593SmuzhiyunGUTENPRINT_MAKE_ENV = BR2_USE_PREGEN_XMLI18N_TMP_H=$(HOST_DIR)/include/xmli18n-tmp.h
53*4882a593Smuzhiyun
54*4882a593SmuzhiyunHOST_GUTENPRINT_DEPENDENCIES = host-pkgconf
55*4882a593Smuzhiyun# The host-gutenprint shall create the required header
56*4882a593SmuzhiyunHOST_GUTENPRINT_MAKE_ENV =
57*4882a593Smuzhiyun
58*4882a593Smuzhiyun# Even with --without-cups, gutenprint will still add the output of
59*4882a593Smuzhiyun# cups-config --cflags / --ldflags to it's compiler/linker flags if
60*4882a593Smuzhiyun# available on host.
61*4882a593Smuzhiyun# Notice: Because of the configure logic, it needs to be set to the
62*4882a593Smuzhiyun# empty string to to disable this, not just to /bin/false like elsewhere.
63*4882a593SmuzhiyunHOST_GUTENPRINT_CONF_ENV = ac_cv_path_CUPS_CONFIG=''
64*4882a593Smuzhiyun
65*4882a593SmuzhiyunHOST_GUTENPRINT_CONF_OPTS = \
66*4882a593Smuzhiyun	--disable-libgutenprintui2 \
67*4882a593Smuzhiyun	--disable-samples \
68*4882a593Smuzhiyun	--without-gimp2 \
69*4882a593Smuzhiyun	--without-doc \
70*4882a593Smuzhiyun	--without-foomatic \
71*4882a593Smuzhiyun	--without-foomatic3 \
72*4882a593Smuzhiyun	--disable-escputil \
73*4882a593Smuzhiyun	--disable-test \
74*4882a593Smuzhiyun	--disable-testpattern \
75*4882a593Smuzhiyun	--without-cups
76*4882a593Smuzhiyun
77*4882a593Smuzhiyundefine HOST_GUTENPRINT_POST_BUILD_INSTAL_TMP_HEADER
78*4882a593Smuzhiyun	cp $(@D)/src/xml/xmli18n-tmp.h $(HOST_DIR)/include
79*4882a593Smuzhiyunendef
80*4882a593SmuzhiyunHOST_GUTENPRINT_POST_BUILD_HOOKS += HOST_GUTENPRINT_POST_BUILD_INSTAL_TMP_HEADER
81*4882a593Smuzhiyun
82*4882a593Smuzhiyundefine GUTENPRINT_POST_INSTALL_TARGET_FIXUP
83*4882a593Smuzhiyun	mkdir -p $(TARGET_DIR)/usr/share/gutenprint/5.2
84*4882a593Smuzhiyun	cp -rf $(HOST_DIR)/share/gutenprint/5.2/xml $(TARGET_DIR)/usr/share/gutenprint/5.2
85*4882a593Smuzhiyunendef
86*4882a593SmuzhiyunGUTENPRINT_POST_INSTALL_TARGET_HOOKS += GUTENPRINT_POST_INSTALL_TARGET_FIXUP
87*4882a593Smuzhiyun
88*4882a593Smuzhiyun$(eval $(autotools-package))
89*4882a593Smuzhiyun$(eval $(host-autotools-package))
90