wxGTK-3.2.2.1-r3.ebuild 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. # Copyright 1999-2023 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=8
  4. inherit multilib-minimal
  5. WXSUBVERSION="${PV}-gtk3" # 3.2.1-gtk3
  6. WXVERSION="$(ver_cut 1-3)" # 3.2.1
  7. # Make sure that this matches the number of components in ${PV}
  8. WXRELEASE="$(ver_cut 1-2)-gtk3" # 3.2-gtk3
  9. WXRELEASE_NODOT=${WXRELEASE//./} # 32-gtk3
  10. DESCRIPTION="GTK version of wxWidgets, a cross-platform C++ GUI toolkit"
  11. HOMEPAGE="https://wxwidgets.org/"
  12. SRC_URI="
  13. https://github.com/wxWidgets/wxWidgets/releases/download/v${PV}/wxWidgets-${PV}.tar.bz2
  14. doc? ( https://github.com/wxWidgets/wxWidgets/releases/download/v${PV}/wxWidgets-${PV}-docs-html.tar.bz2 )"
  15. S="${WORKDIR}/wxWidgets-${PV}"
  16. LICENSE="wxWinLL-3 GPL-2 doc? ( wxWinFDL-3 )"
  17. SLOT="${WXRELEASE}"
  18. KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux"
  19. IUSE="+gui curl doc debug gnome-keyring gstreamer libnotify +lzma opengl pch sdl +spell test tiff wayland webkit"
  20. REQUIRED_USE="test? ( tiff ) tiff? ( gui ) spell? ( gui ) gnome-keyring? ( gui )"
  21. RESTRICT="!test? ( test )"
  22. RDEPEND="
  23. >=app-eselect/eselect-wxwidgets-20131230
  24. dev-libs/expat[${MULTILIB_USEDEP}]
  25. dev-libs/libpcre2[pcre16,pcre32,unicode]
  26. sdl? ( media-libs/libsdl2[${MULTILIB_USEDEP}] )
  27. curl? ( net-misc/curl )
  28. lzma? ( app-arch/xz-utils )
  29. gui? (
  30. >=dev-libs/glib-2.22:2[${MULTILIB_USEDEP}]
  31. media-libs/libjpeg-turbo:=[${MULTILIB_USEDEP}]
  32. media-libs/libpng:0=[${MULTILIB_USEDEP}]
  33. sys-libs/zlib[${MULTILIB_USEDEP}]
  34. x11-libs/cairo[${MULTILIB_USEDEP}]
  35. x11-libs/gtk+:3[wayland?,${MULTILIB_USEDEP}]
  36. x11-libs/gdk-pixbuf:2[${MULTILIB_USEDEP}]
  37. media-libs/fontconfig
  38. x11-libs/pango[${MULTILIB_USEDEP}]
  39. gnome-keyring? ( app-crypt/libsecret )
  40. gstreamer? (
  41. media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
  42. media-libs/gst-plugins-base:1.0[${MULTILIB_USEDEP}]
  43. media-libs/gst-plugins-bad:1.0[${MULTILIB_USEDEP}]
  44. )
  45. libnotify? ( x11-libs/libnotify[${MULTILIB_USEDEP}] )
  46. opengl? (
  47. virtual/opengl[${MULTILIB_USEDEP}]
  48. wayland? ( dev-libs/wayland )
  49. )
  50. spell? ( app-text/gspell:= )
  51. tiff? ( media-libs/tiff:=[${MULTILIB_USEDEP}] )
  52. webkit? ( net-libs/webkit-gtk:4= )
  53. )"
  54. DEPEND="${RDEPEND}
  55. opengl? ( virtual/glu[${MULTILIB_USEDEP}] )"
  56. BDEPEND="
  57. test? ( >=dev-util/cppunit-1.8.0 )
  58. >=app-eselect/eselect-wxwidgets-20131230
  59. virtual/pkgconfig"
  60. # Note about the gst-plugin-base dep: The build system queries for it,
  61. # but doesn't link it for some reason? Either way - probably best to
  62. # depend on it anyway.
  63. # Note about the wayland dep: Appears to be only required for the OpenGL
  64. # canvas, and it seems impossible to disable the X dependency, unless
  65. # I'm missing something. This is an automagic header dep, though.
  66. PATCHES=(
  67. #"${WORKDIR}"/wxGTK-3.0.5_p20210214/
  68. "${FILESDIR}/${PN}-3.2.1-gtk3-translation-domain.patch"
  69. #"${FILESDIR}"/wxGTK-ignore-c++-abi.patch #676878
  70. "${FILESDIR}/${PN}-3.2.1-configure-tests.patch"
  71. "${FILESDIR}/${PN}-3.2.1-wayland-control.patch"
  72. "${FILESDIR}/${PN}-3.2.1-prefer-lib64-in-tests.patch"
  73. "${FILESDIR}/${PN}-3.2.2.1-dont-break-flags.patch"
  74. )
  75. src_prepare() {
  76. default
  77. # find . -iname Makefile.in -not -path ./samples'/*' \
  78. # | xargs grep -l WX_RELEASE
  79. local versioned_makefiles=(
  80. ./tests/benchmarks/Makefile.in
  81. ./tests/Makefile.in
  82. ./utils/emulator/src/Makefile.in
  83. ./utils/execmon/Makefile.in
  84. ./utils/wxrc/Makefile.in
  85. ./utils/helpview/src/Makefile.in
  86. ./utils/hhp2cached/Makefile.in
  87. ./utils/screenshotgen/src/Makefile.in
  88. ./utils/ifacecheck/src/Makefile.in
  89. ./Makefile.in
  90. ./demos/life/Makefile.in
  91. ./demos/bombs/Makefile.in
  92. ./demos/fractal/Makefile.in
  93. ./demos/forty/Makefile.in
  94. ./demos/poem/Makefile.in
  95. )
  96. # Versionating
  97. sed -i \
  98. -e "s:\(WX_RELEASE = \).*:\1${WXRELEASE}:"\
  99. -e "s:\(WX_RELEASE_NODOT = \).*:\1${WXRELEASE_NODOT}:"\
  100. -e "s:\(WX_VERSION = \).*:\1${WXVERSION}:"\
  101. -e "s:aclocal):aclocal/wxwin${WXRELEASE_NODOT}.m4):" \
  102. "${versioned_makefiles[@]}" || die
  103. sed -i \
  104. -e "s:\(WX_VERSION=\).*:\1${WXVERSION}:" \
  105. -e "s:\(WX_RELEASE=\).*:\1${WXRELEASE}:" \
  106. -e "s:\(WX_SUBVERSION=\).*:\1${WXSUBVERSION}:" \
  107. -e '/WX_VERSION_TAG=/ s:${WX_RELEASE}:3.0:' \
  108. configure || die
  109. }
  110. multilib_src_configure() {
  111. # X independent options
  112. local myeconfargs=(
  113. --with-zlib=sys
  114. --with-expat=sys
  115. --enable-compat30
  116. --enable-xrc
  117. $(use_with sdl)
  118. $(use_with lzma liblzma)
  119. # Currently defaults to curl, could change. Watch the VDB!
  120. $(use_enable curl webrequest)
  121. # PCHes are unstable and are disabled in-tree where possible
  122. # See bug #504204
  123. # Commits 8c4774042b7fdfb08e525d8af4b7912f26a2fdce, fb809aeadee57ffa24591e60cfb41aecd4823090
  124. $(use_enable pch precomp-headers)
  125. # Don't hard-code libdir's prefix for wx-config
  126. --libdir='${prefix}'/$(get_libdir)
  127. )
  128. # Switch to wxGLCanvas GLX instead of EGL, resolves many OpenGL issues.
  129. myeconfargs+=( "--disable-glcanvasegl" )
  130. # debug in >=2.9
  131. # there is no longer separate debug libraries (gtk2ud)
  132. # wxDEBUG_LEVEL=1 is the default and we will leave it enabled
  133. # wxDEBUG_LEVEL=2 enables assertions that have expensive runtime costs.
  134. # apps can disable these features by building w/ -NDEBUG or wxDEBUG_LEVEL_0.
  135. # http://docs.wxwidgets.org/3.0/overview_debugging.html
  136. # https://groups.google.com/group/wx-dev/browse_thread/thread/c3c7e78d63d7777f/05dee25410052d9c
  137. use debug && myeconfargs+=( --enable-debug=max )
  138. # wxGTK options
  139. # --enable-graphics_ctx - needed for webkit, editra
  140. # --without-gnomevfs - bug #203389
  141. use gui && myeconfargs+=(
  142. --enable-graphics_ctx
  143. --with-gtkprint
  144. --enable-gui
  145. --with-gtk=3
  146. --with-libpng=sys
  147. --with-libjpeg=sys
  148. # Choosing to enable this unconditionally seems fair, pcre2 is
  149. # almost certain to be installed.
  150. --with-regex=sys
  151. --without-gnomevfs
  152. $(use_enable gstreamer mediactrl)
  153. $(multilib_native_use_enable webkit webview)
  154. $(use_with libnotify)
  155. $(use_with opengl)
  156. $(use_with tiff libtiff sys)
  157. $(use_enable gnome-keyring secretstore)
  158. $(use_enable spell spellcheck)
  159. $(use_enable test tests)
  160. $(use_enable wayland)
  161. )
  162. # wxBase options
  163. ! use gui && myeconfargs+=( --disable-gui )
  164. ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
  165. }
  166. multilib_src_test() {
  167. emake -C tests
  168. (cd tests && ./test '~[.]~[net]') || die
  169. }
  170. multilib_src_install_all() {
  171. cd docs || die
  172. dodoc changes.txt readme.txt
  173. newdoc base/readme.txt base_readme.txt
  174. newdoc gtk/readme.txt gtk_readme.txt
  175. use doc && HTML_DOCS=( "${WORKDIR}"/wxWidgets-${PV}-docs-html/. )
  176. einstalldocs
  177. # Unversioned links
  178. rm "${ED}"/usr/bin/wx-config || die
  179. rm "${ED}"/usr/bin/wxrc || die
  180. # version bakefile presets
  181. pushd "${ED}"/usr/share/bakefile/presets >/dev/null || die
  182. local f
  183. for f in wx*; do
  184. mv "${f}" "${f/wx/wx32gtk3}" || die
  185. done
  186. popd >/dev/null || die
  187. }
  188. pkg_postinst() {
  189. has_version -b app-eselect/eselect-wxwidgets \
  190. && eselect wxwidgets update
  191. }
  192. pkg_postrm() {
  193. has_version -b app-eselect/eselect-wxwidgets \
  194. && eselect wxwidgets update
  195. }