logo

overlay

My own overlay for experimentations, use with caution, no support is provided git clone https://hacktivis.me/git/overlay.git

gtk+-3.24.27.ebuild (7312B)


  1. # Copyright 1999-2021 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=7
  4. GNOME2_EAUTORECONF="yes"
  5. inherit gnome2 multilib multilib-minimal virtualx
  6. DESCRIPTION="Gimp ToolKit +"
  7. HOMEPAGE="https://www.gtk.org/"
  8. LICENSE="LGPL-2+"
  9. SLOT="3"
  10. IUSE="aqua accessibility broadway cloudprint colord cups examples gtk-doc +introspection sysprof test vim-syntax wayland +X xinerama"
  11. REQUIRED_USE="
  12. || ( aqua wayland X )
  13. xinerama? ( X )
  14. "
  15. KEYWORDS="~amd64 ~x86"
  16. # Upstream wants us to do their job:
  17. # https://bugzilla.gnome.org/show_bug.cgi?id=768662#c1
  18. RESTRICT="test"
  19. # FIXME: introspection data is built against system installation of gtk+:3,
  20. # bug #????
  21. COMMON_DEPEND="
  22. >=dev-libs/atk-2.32.0[introspection?,${MULTILIB_USEDEP}]
  23. >=dev-libs/fribidi-0.19.7[${MULTILIB_USEDEP}]
  24. >=dev-libs/glib-2.57.2:2[${MULTILIB_USEDEP}]
  25. media-libs/fontconfig[${MULTILIB_USEDEP}]
  26. >=media-libs/harfbuzz-0.9:=
  27. >=media-libs/libepoxy-1.4[X(+)?,${MULTILIB_USEDEP}]
  28. virtual/libintl[${MULTILIB_USEDEP}]
  29. >=x11-libs/cairo-1.14[aqua?,glib,svg,X?,${MULTILIB_USEDEP}]
  30. >=x11-libs/gdk-pixbuf-2.30:2[introspection?,${MULTILIB_USEDEP}]
  31. >=x11-libs/pango-1.41.0[introspection?,${MULTILIB_USEDEP}]
  32. x11-misc/shared-mime-info
  33. cloudprint? (
  34. >=dev-libs/json-glib-1.0[${MULTILIB_USEDEP}]
  35. >=net-libs/rest-0.7[${MULTILIB_USEDEP}]
  36. )
  37. colord? ( >=x11-misc/colord-0.1.9:0=[${MULTILIB_USEDEP}] )
  38. cups? ( >=net-print/cups-2.0[${MULTILIB_USEDEP}] )
  39. introspection? ( >=dev-libs/gobject-introspection-1.39:= )
  40. sysprof? ( >=dev-util/sysprof-capture-3.33.2:3[${MULTILIB_USEDEP}] )
  41. wayland? (
  42. >=dev-libs/wayland-1.14.91[${MULTILIB_USEDEP}]
  43. >=dev-libs/wayland-protocols-1.17
  44. media-libs/mesa[wayland,${MULTILIB_USEDEP}]
  45. >=x11-libs/libxkbcommon-0.2[${MULTILIB_USEDEP}]
  46. )
  47. X? (
  48. accessibility? ( >=app-accessibility/at-spi2-atk-2.15.1[${MULTILIB_USEDEP}] )
  49. media-libs/mesa[X(+),${MULTILIB_USEDEP}]
  50. x11-libs/libX11[${MULTILIB_USEDEP}]
  51. x11-libs/libXcomposite[${MULTILIB_USEDEP}]
  52. x11-libs/libXcursor[${MULTILIB_USEDEP}]
  53. x11-libs/libXdamage[${MULTILIB_USEDEP}]
  54. x11-libs/libXext[${MULTILIB_USEDEP}]
  55. x11-libs/libXfixes[${MULTILIB_USEDEP}]
  56. >=x11-libs/libXi-1.3[${MULTILIB_USEDEP}]
  57. >=x11-libs/libXrandr-1.5[${MULTILIB_USEDEP}]
  58. xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
  59. )
  60. "
  61. DEPEND="${COMMON_DEPEND}
  62. test? (
  63. media-fonts/font-cursor-misc
  64. media-fonts/font-misc-misc
  65. )
  66. X? ( x11-base/xorg-proto )
  67. "
  68. # gtk+-3.2.2 breaks Alt key handling in <=x11-libs/vte-0.30.1:2.90
  69. # gtk+-3.3.18 breaks scrolling in <=x11-libs/vte-0.31.0:2.90
  70. RDEPEND="${COMMON_DEPEND}
  71. >=dev-util/gtk-update-icon-cache-3
  72. !<gnome-base/gail-1000
  73. !<x11-libs/vte-0.31.0:2.90
  74. "
  75. # librsvg for svg icons (PDEPEND to avoid circular dep), bug #547710
  76. PDEPEND="
  77. gnome-base/librsvg[${MULTILIB_USEDEP}]
  78. >=x11-themes/adwaita-icon-theme-3.14
  79. vim-syntax? ( app-vim/gtk-syntax )
  80. "
  81. BDEPEND="
  82. app-text/docbook-xml-dtd:4.1.2
  83. app-text/docbook-xsl-stylesheets
  84. dev-libs/gobject-introspection-common
  85. dev-libs/libxslt
  86. >=dev-util/gdbus-codegen-2.48
  87. dev-util/glib-utils
  88. >=dev-util/gtk-doc-am-1.20
  89. >=sys-devel/gettext-0.19.7
  90. virtual/pkgconfig
  91. gtk-doc? (
  92. app-text/docbook-xml-dtd:4.3
  93. >=dev-util/gtk-doc-1.20
  94. )
  95. "
  96. MULTILIB_CHOST_TOOLS=(
  97. /usr/bin/gtk-query-immodules-3.0"$(get_exeext)"
  98. )
  99. PATCHES=(
  100. # gtk-update-icon-cache is installed by dev-util/gtk-update-icon-cache
  101. "${FILESDIR}/${PN}"-3.24.25-update-icon-cache.patch
  102. # Fix broken autotools logic
  103. "${FILESDIR}/${PN}"-3.22.20-libcloudproviders-automagic.patch
  104. # get rid of gtk3-atk-bridge crap
  105. "${FILESDIR}/${PN}"-3.22.19.atk-bridge.patch
  106. )
  107. strip_builddir() {
  108. local rule=$1
  109. shift
  110. local directory=$1
  111. shift
  112. sed -e "s/^\(${rule} =.*\)${directory}\(.*\)$/\1\2/" -i $@ \
  113. || die "Could not strip director ${directory} from build."
  114. }
  115. src_prepare() {
  116. if ! use test ; then
  117. # don't waste time building tests
  118. strip_builddir SRC_SUBDIRS testsuite Makefile.{am,in}
  119. # the tests dir needs to be build now because since commit
  120. # 7ff3c6df80185e165e3bf6aa31bd014d1f8bf224 tests/gtkgears.o needs to be there
  121. # strip_builddir SRC_SUBDIRS tests Makefile.{am,in}
  122. fi
  123. if ! use examples; then
  124. # don't waste time building demos
  125. strip_builddir SRC_SUBDIRS demos Makefile.{am,in}
  126. strip_builddir SRC_SUBDIRS examples Makefile.{am,in}
  127. fi
  128. gnome2_src_prepare
  129. }
  130. multilib_src_configure() {
  131. local myconf=(
  132. $(use_enable aqua quartz-backend)
  133. $(use_enable broadway broadway-backend)
  134. $(use_enable cloudprint)
  135. $(use_enable colord)
  136. $(use_enable cups cups auto)
  137. $(multilib_native_use_enable gtk-doc)
  138. $(multilib_native_use_enable introspection)
  139. $(use_enable sysprof profiler)
  140. $(use_enable wayland wayland-backend)
  141. $(use_enable X x11-backend)
  142. $(use_enable X xcomposite)
  143. $(use_enable X xdamage)
  144. $(use_enable X xfixes)
  145. $(use_enable X xkb)
  146. $(use_enable X xrandr)
  147. $(use_enable xinerama)
  148. $(use_with accessibility atk-bridge)
  149. # cloudprovider is not packaged in Gentoo yet
  150. --disable-cloudproviders
  151. --disable-papi
  152. --enable-man
  153. --with-xml-catalog="${EPREFIX}"/etc/xml/catalog
  154. # need libdir here to avoid a double slash in a path that libtool doesn't
  155. # grok so well during install (// between $EPREFIX and usr ...)
  156. # TODO: Is this still the case?
  157. --libdir="${EPREFIX}"/usr/$(get_libdir)
  158. CUPS_CONFIG="${EPREFIX}/usr/bin/${CHOST}-cups-config"
  159. )
  160. if use wayland; then
  161. myconf+=(
  162. # Include wayland immodule into gtk itself, to avoid problems like
  163. # https://gitlab.gnome.org/GNOME/gnome-shell/issues/109 from a
  164. # user overridden GTK_IM_MODULE envvar
  165. --with-included-immodules=wayland
  166. )
  167. fi;
  168. ECONF_SOURCE=${S} gnome2_src_configure "${myconf[@]}"
  169. # work-around gtk-doc out-of-source brokedness
  170. if multilib_is_native_abi; then
  171. local d
  172. for d in gdk gtk libgail-util; do
  173. ln -s "${S}"/docs/reference/${d}/html docs/reference/${d}/html || die
  174. done
  175. fi
  176. }
  177. multilib_src_test() {
  178. "${EROOT}${GLIB_COMPILE_SCHEMAS}" --allow-any-name "${S}/gtk" || die
  179. GSETTINGS_SCHEMA_DIR="${S}/gtk" virtx emake check
  180. }
  181. multilib_src_install() {
  182. gnome2_src_install
  183. }
  184. multilib_src_install_all() {
  185. insinto /etc/gtk-3.0
  186. doins "${FILESDIR}"/settings.ini
  187. # Skip README.{in,commits,win32} that would get installed by default
  188. DOCS=( AUTHORS ChangeLog NEWS README )
  189. einstalldocs
  190. }
  191. pkg_preinst() {
  192. gnome2_pkg_preinst
  193. multilib_pkg_preinst() {
  194. # Make immodules.cache belongs to gtk+ alone
  195. local cache="/usr/$(get_libdir)/gtk-3.0/3.0.0/immodules.cache"
  196. if [[ -e "${EROOT}${cache}" ]]; then
  197. cp "${EROOT}${cache}" "${ED}${cache}" || die
  198. else
  199. touch "${ED}${cache}" || die
  200. fi
  201. }
  202. multilib_parallel_foreach_abi multilib_pkg_preinst
  203. }
  204. pkg_postinst() {
  205. gnome2_pkg_postinst
  206. multilib_pkg_postinst() {
  207. gnome2_query_immodules_gtk3 \
  208. || die "Update immodules cache failed (for ${ABI})"
  209. }
  210. multilib_parallel_foreach_abi multilib_pkg_postinst
  211. if ! has_version "app-text/evince"; then
  212. elog "Please install app-text/evince for print preview functionality."
  213. elog "Alternatively, check \"gtk-print-preview-command\" documentation and"
  214. elog "add it to your settings.ini file."
  215. fi
  216. }
  217. pkg_postrm() {
  218. gnome2_pkg_postrm
  219. if [[ -z ${REPLACED_BY_VERSION} ]]; then
  220. multilib_pkg_postrm() {
  221. rm -f "${EROOT}/usr/$(get_libdir)/gtk-3.0/3.0.0/immodules.cache"
  222. }
  223. multilib_foreach_abi multilib_pkg_postrm
  224. fi
  225. }