host-libgtk2-2.20.1-reduce-dependencies.patch 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. Hack the configure.in file to add a "none" gdktarget which removes
  2. dependencies on graphic backends such as X.org or DirectFB. Gtk does
  3. not fully build in this mode, but it builds sufficiently to build the
  4. host tools that are needed to build the target Gtk.
  5. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  6. ---
  7. configure.in | 101 ++---------------------------------------------------------
  8. 1 file changed, 4 insertions(+), 97 deletions(-)
  9. Index: gtk+-2.22.0/configure.in
  10. ===================================================================
  11. --- gtk+-2.22.0.orig/configure.in
  12. +++ gtk+-2.22.0/configure.in
  13. @@ -258,12 +258,12 @@
  14. gdktarget=x11
  15. fi
  16. -AC_ARG_WITH(gdktarget, [ --with-gdktarget=[[x11/win32/quartz/directfb]] select non-default GDK target],
  17. +AC_ARG_WITH(gdktarget, [ --with-gdktarget=[[x11/win32/quartz/directfb/none]] select non-default GDK target],
  18. gdktarget=$with_gdktarget)
  19. AC_SUBST(gdktarget)
  20. case $gdktarget in
  21. - x11|win32|quartz|directfb) ;;
  22. + x11|win32|quartz|directfb|none) ;;
  23. *) AC_MSG_ERROR([Invalid target for GDK: use x11, quartz, directfb or win32.]);;
  24. esac
  25. @@ -373,9 +373,6 @@
  26. ## annoying to construct
  27. PKG_CHECK_MODULES(BASE_DEPENDENCIES,
  28. [glib-2.0 >= glib_required_version dnl
  29. - atk >= atk_required_version dnl
  30. - pango >= pango_required_version dnl
  31. - cairo >= cairo_required_version dnl
  32. gdk-pixbuf-2.0 >= gdk_pixbuf_required_version])
  33. ## In addition to checking that cairo is present, we also need to
  34. @@ -388,8 +385,6 @@
  35. if test "x$cairo_backend" = "xx11"; then
  36. cairo_backend=xlib
  37. fi
  38. -PKG_CHECK_MODULES(CAIRO_BACKEND,
  39. - [cairo-$cairo_backend >= cairo_required_version])
  40. if test "$os_win32" != yes; then
  41. # libtool option to control which symbols are exported
  42. @@ -1270,50 +1265,6 @@
  43. fi
  44. -# Check for Pango flags
  45. -
  46. -if test "x$gdktarget" = "xwin32"; then
  47. - PANGO_PACKAGES="pangowin32 pangocairo"
  48. -else
  49. - PANGO_PACKAGES="pango pangocairo"
  50. -fi
  51. -
  52. -AC_MSG_CHECKING(Pango flags)
  53. -if $PKG_CONFIG --exists $PANGO_PACKAGES ; then
  54. - PANGO_CFLAGS=`$PKG_CONFIG --cflags $PANGO_PACKAGES`
  55. - PANGO_LIBS=`$PKG_CONFIG --libs $PANGO_PACKAGES`
  56. -
  57. - AC_MSG_RESULT($PANGO_CFLAGS $PANGO_LIBS)
  58. -else
  59. - AC_MSG_ERROR([
  60. -*** Pango not found. Pango built with Cairo support is required
  61. -*** to build GTK+. See http://www.pango.org for Pango information.
  62. -])
  63. -fi
  64. -
  65. -CFLAGS="$CFLAGS $PANGO_CFLAGS"
  66. -
  67. -if $PKG_CONFIG --uninstalled $PANGO_PACKAGES; then
  68. - :
  69. -else
  70. - gtk_save_LIBS="$LIBS"
  71. - LIBS="$PANGO_LIBS $LIBS"
  72. - AC_TRY_LINK_FUNC(pango_context_new, :, AC_MSG_ERROR([
  73. -*** Can't link to Pango. Pango is required to build
  74. -*** GTK+. For more information see http://www.pango.org]))
  75. - LIBS="$gtk_save_LIBS"
  76. -fi
  77. -
  78. -CFLAGS="$saved_cflags"
  79. -LDFLAGS="$saved_ldflags"
  80. -
  81. -# Pull in gio-unix for GDesktopAppInfo usage, see at least gdkapplaunchcontext-x11.c
  82. -if test "x$gdktarget" = "xx11"; then
  83. - GDK_PACKAGES="$PANGO_PACKAGES gio-unix-2.0 $X_PACKAGES gdk-pixbuf-2.0 cairo-$cairo_backend"
  84. -else
  85. - GDK_PACKAGES="$PANGO_PACKAGES gio-2.0 gdk-pixbuf-2.0 cairo-$cairo_backend"
  86. -fi
  87. -
  88. GDK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GDK_PACKAGES`"
  89. GDK_DEP_CFLAGS="`$PKG_CONFIG --cflags gthread-2.0 $GDK_PACKAGES` $GDK_EXTRA_CFLAGS"
  90. #
  91. @@ -1321,7 +1272,7 @@
  92. # into the pkg-config files
  93. #
  94. if test $enable_explicit_deps != yes ; then
  95. - GDK_PACKAGES="$PANGO_PACKAGES gdk-pixbuf-2.0"
  96. + GDK_PACKAGES="gdk-pixbuf-2.0"
  97. GDK_EXTRA_LIBS=
  98. fi
  99. @@ -1331,37 +1282,7 @@
  100. AC_SUBST(GDK_DEP_LIBS)
  101. AC_SUBST(GDK_DEP_CFLAGS)
  102. -
  103. -########################################
  104. -# Check for Accessibility Toolkit flags
  105. -########################################
  106. -
  107. -ATK_PACKAGES=atk
  108. -AC_MSG_CHECKING(ATK flags)
  109. -if $PKG_CONFIG --exists $ATK_PACKAGES ; then
  110. - ATK_CFLAGS=`$PKG_CONFIG --cflags $ATK_PACKAGES`
  111. - ATK_LIBS=`$PKG_CONFIG --libs $ATK_PACKAGES`
  112. -
  113. - AC_MSG_RESULT($ATK_CFLAGS $ATK_LIBS)
  114. -else
  115. - AC_MSG_ERROR([
  116. -*** Accessibility Toolkit not found. Accessibility Toolkit is required
  117. -*** to build GTK+.
  118. -])
  119. -fi
  120. -
  121. -if $PKG_CONFIG --uninstalled $ATK_PACKAGES; then
  122. - :
  123. -else
  124. - gtk_save_LIBS="$LIBS"
  125. - LIBS="$ATK_LIBS $LIBS"
  126. - AC_TRY_LINK_FUNC(atk_object_get_type, : , AC_MSG_ERROR([
  127. - *** Cannot link to Accessibility Toolkit. Accessibility Toolkit is required
  128. - *** to build GTK+]))
  129. - LIBS="$gtk_save_LIBS"
  130. -fi
  131. -
  132. -GTK_PACKAGES="atk cairo gdk-pixbuf-2.0 gio-2.0"
  133. +GTK_PACKAGES="gdk-pixbuf-2.0"
  134. if test "x$gdktarget" = "xx11"; then
  135. GTK_PACKAGES="$GTK_PACKAGES pangoft2"
  136. fi
  137. @@ -1517,20 +1438,6 @@
  138. gtk_save_cppflags="$CPPFLAGS"
  139. CPPFLAGS="$CPPFLAGS $GTK_DEP_CFLAGS $GDK_DEP_CFLAGS"
  140. -AC_CHECK_HEADER(cairo-pdf.h,,AC_MSG_ERROR([
  141. -*** Can't find cairo-pdf.h. You must build Cairo with the pdf
  142. -*** backend enabled.]))
  143. -
  144. -if test "$os_win32" != "yes"; then
  145. - AC_CHECK_HEADER(cairo-ps.h,,AC_MSG_ERROR([
  146. -*** Can't find cairo-ps.h. You must build Cairo with the
  147. -*** postscript backend enabled.]))
  148. -
  149. - AC_CHECK_HEADER(cairo-svg.h,,AC_MSG_ERROR([
  150. -*** Can't find cairo-svg.h. You must build Cairo with the
  151. -*** svg backend enabled.]))
  152. -fi
  153. -
  154. CPPFLAGS="$gtk_save_cppflags"