0001-reduce-dependencies.patch 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. Changes:
  6. Ported to 2.24.18
  7. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  8. Signed-off-by: Spenser Gilliland <spenser@gillilanding.com>
  9. ---
  10. Index: libgtk2-2.24.18/configure.ac
  11. ===================================================================
  12. --- libgtk2-2.24.18.orig/configure.ac 2013-05-13 07:02:44.000000000 -0500
  13. +++ libgtk2-2.24.18/configure.ac 2013-05-27 02:12:09.947030335 -0500
  14. @@ -258,12 +258,12 @@
  15. gdktarget=x11
  16. fi
  17. -AC_ARG_WITH(gdktarget, [ --with-gdktarget=[[x11/win32/quartz/directfb]] select non-default GDK target],
  18. +AC_ARG_WITH(gdktarget, [ --with-gdktarget=[[x11/win32/quartz/directfb/none]] select non-default GDK target],
  19. gdktarget=$with_gdktarget)
  20. AC_SUBST(gdktarget)
  21. case $gdktarget in
  22. - x11|win32|quartz|directfb) ;;
  23. + x11|win32|quartz|directfb|none) ;;
  24. *) AC_MSG_ERROR([Invalid target for GDK: use x11, quartz, directfb or win32.]);;
  25. esac
  26. @@ -372,11 +373,15 @@
  27. ## annoying to construct
  28. PKG_CHECK_MODULES(BASE_DEPENDENCIES,
  29. [glib-2.0 >= glib_required_version dnl
  30. - atk >= atk_required_version dnl
  31. - pango >= pango_required_version dnl
  32. - cairo >= cairo_required_version dnl
  33. gdk-pixbuf-2.0 >= gdk_pixbuf_required_version])
  34. +if test "x$gdktarget" != "xnone"; then
  35. + PKG_CHECK_MODULES(BASE_DEPENDENCIES,
  36. + [atk >= atk_required_version dnl
  37. + pango >= pango_required_version dnl
  38. + cairo >= cairo_required_version])
  39. +fi
  40. +
  41. ## In addition to checking that cairo is present, we also need to
  42. ## check that the correct cairo backend is there. E.g. if the GDK
  43. ## target is win32 we need the cairo-win32 backend and so on.
  44. @@ -387,8 +392,11 @@
  45. if test "x$cairo_backend" = "xx11"; then
  46. cairo_backend=xlib
  47. fi
  48. -PKG_CHECK_MODULES(CAIRO_BACKEND,
  49. - [cairo-$cairo_backend >= cairo_required_version])
  50. +
  51. +if test "x$gdktarget" != "xnone"; then
  52. + PKG_CHECK_MODULES(CAIRO_BACKEND,
  53. + [cairo-$cairo_backend >= cairo_required_version])
  54. +fi
  55. PKG_CHECK_MODULES(GMODULE, [gmodule-2.0])
  56. @@ -1279,6 +1287,7 @@
  57. AM_CONDITIONAL(USE_DIRECTFB, false)
  58. fi
  59. +if test "x$gdktarget" != "xnone"; then
  60. # Check for Pango flags
  61. @@ -1324,6 +1333,8 @@
  62. GDK_PACKAGES="$PANGO_PACKAGES gio-2.0 gdk-pixbuf-2.0 cairo-$cairo_backend"
  63. fi
  64. +fi # gdktarget != none
  65. +
  66. GDK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GDK_PACKAGES` $MATH_LIB"
  67. GDK_DEP_CFLAGS="`$PKG_CONFIG --cflags gthread-2.0 $GDK_PACKAGES` $GDK_EXTRA_CFLAGS"
  68. #
  69. @@ -1341,6 +1352,7 @@
  70. AC_SUBST(GDK_DEP_LIBS)
  71. AC_SUBST(GDK_DEP_CFLAGS)
  72. +if test "x$gdktarget" != "xnone"; then
  73. ########################################
  74. # Check for Accessibility Toolkit flags
  75. @@ -1372,6 +1384,10 @@
  76. fi
  77. GTK_PACKAGES="atk cairo gdk-pixbuf-2.0 gio-2.0"
  78. +else # gdktarget != none
  79. +GTK_PACKAGES="gdk-pixbuf-2.0"
  80. +fi # gdktarget != none
  81. +
  82. if test "x$gdktarget" = "xx11"; then
  83. GTK_PACKAGES="$GTK_PACKAGES pangoft2"
  84. fi
  85. @@ -1533,6 +1549,8 @@
  86. gtk_save_cppflags="$CPPFLAGS"
  87. CPPFLAGS="$CPPFLAGS $GTK_DEP_CFLAGS $GDK_DEP_CFLAGS"
  88. +if test "x$gdktarget" != "xnone"; then
  89. +
  90. AC_CHECK_HEADER(cairo-pdf.h,,AC_MSG_ERROR([
  91. *** Can't find cairo-pdf.h. You must build Cairo with the pdf
  92. *** backend enabled.]))
  93. @@ -1547,6 +1565,8 @@
  94. *** svg backend enabled.]))
  95. fi
  96. +fi # gdktarget != none
  97. +
  98. CPPFLAGS="$gtk_save_cppflags"