logo

overlay

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

wxGTK-3.1.5.ebuild (3631B)


  1. # Copyright 1999-2021 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=7
  4. inherit multilib-minimal
  5. DESCRIPTION="GTK+ version of wxWidgets, a cross-platform C++ GUI toolkit"
  6. HOMEPAGE="https://wxwidgets.org/"
  7. SRC_URI="
  8. https://github.com/wxWidgets/wxWidgets/releases/download/v${PV}/wxWidgets-${PV}.tar.bz2
  9. doc? ( https://github.com/wxWidgets/wxWidgets/releases/download/v${PV}/wxWidgets-${PV}-docs-html.tar.bz2 )"
  10. S="${WORKDIR}/wxWidgets-${PV}"
  11. LICENSE="wxWinLL-3 GPL-2 doc? ( wxWinFDL-3 )"
  12. SLOT="3.1"
  13. KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux"
  14. IUSE="+X doc debug gstreamer libnotify opengl sdl tiff webkit"
  15. RDEPEND="
  16. >=app-eselect/eselect-wxwidgets-20131230
  17. dev-libs/expat[${MULTILIB_USEDEP}]
  18. sdl? ( media-libs/libsdl2[${MULTILIB_USEDEP}] )
  19. >=dev-libs/glib-2.22:2[${MULTILIB_USEDEP}]
  20. media-libs/libpng:0=[${MULTILIB_USEDEP}]
  21. sys-libs/zlib[${MULTILIB_USEDEP}]
  22. virtual/jpeg:0=[${MULTILIB_USEDEP}]
  23. x11-libs/cairo[${MULTILIB_USEDEP}]
  24. x11-libs/gtk+:3[${MULTILIB_USEDEP}]
  25. x11-libs/gdk-pixbuf[${MULTILIB_USEDEP}]
  26. x11-libs/pango[${MULTILIB_USEDEP}]
  27. X? (
  28. x11-libs/libSM[${MULTILIB_USEDEP}]
  29. x11-libs/libX11[${MULTILIB_USEDEP}]
  30. x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
  31. )
  32. gstreamer? (
  33. media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
  34. media-libs/gst-plugins-base:1.0[${MULTILIB_USEDEP}]
  35. )
  36. libnotify? ( x11-libs/libnotify[${MULTILIB_USEDEP}] )
  37. opengl? ( virtual/opengl[${MULTILIB_USEDEP}] )
  38. tiff? ( media-libs/tiff:0[${MULTILIB_USEDEP}] )
  39. webkit? ( net-libs/webkit-gtk:4 )
  40. "
  41. DEPEND="${RDEPEND}
  42. opengl? ( virtual/glu[${MULTILIB_USEDEP}] )
  43. X? ( x11-base/xorg-proto )"
  44. BDEPEND="
  45. >=app-eselect/eselect-wxwidgets-20131230
  46. virtual/pkgconfig"
  47. src_prepare() {
  48. default
  49. use X || sed -i \
  50. -e 's;-lGL\b;-lOpenGL;' \
  51. -e 's;-lX11;;g' \
  52. configure || die
  53. }
  54. multilib_src_configure() {
  55. local myeconfargs=(
  56. --with-zlib=sys
  57. --with-expat=sys
  58. --enable-compat30
  59. $(use_with sdl)
  60. --enable-graphics_ctx
  61. --with-gtkprint
  62. --enable-gui
  63. --with-gtk=3
  64. --with-libpng=sys
  65. --with-libjpeg=sys
  66. --without-gnomevfs
  67. $(use_enable gstreamer mediactrl)
  68. $(multilib_native_use_enable webkit webview)
  69. $(use_with libnotify)
  70. $(use_with opengl)
  71. $(use_with tiff libtiff sys)
  72. # Don't hard-code libdir's prefix for wx-config
  73. --libdir='${prefix}'/$(get_libdir)
  74. )
  75. # debug in >=2.9
  76. # there is no longer separate debug libraries (gtk2ud)
  77. # wxDEBUG_LEVEL=1 is the default and we will leave it enabled
  78. # wxDEBUG_LEVEL=2 enables assertions that have expensive runtime costs.
  79. # apps can disable these features by building w/ -NDEBUG or wxDEBUG_LEVEL_0.
  80. # http://docs.wxwidgets.org/3.0/overview_debugging.html
  81. # https://groups.google.com/group/wx-dev/browse_thread/thread/c3c7e78d63d7777f/05dee25410052d9c
  82. use debug && myeconfargs+=( --enable-debug=max )
  83. ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
  84. }
  85. multilib_src_install_all() {
  86. cd docs || die
  87. dodoc changes.txt readme.txt
  88. newdoc base/readme.txt base_readme.txt
  89. newdoc gtk/readme.txt gtk_readme.txt
  90. use doc && HTML_DOCS=( "${WORKDIR}"/wxWidgets-${PV}-docs-html/. )
  91. einstalldocs
  92. # Unversioned links
  93. rm "${ED}"/usr/bin/wx-config || die
  94. rm "${ED}"/usr/bin/wxrc || die
  95. # version bakefile presets
  96. pushd "${ED}"/usr/share/bakefile/presets >/dev/null || die
  97. local f
  98. for f in wx*; do
  99. mv "${f}" "${f/wx/wx31}" || die
  100. done
  101. popd >/dev/null || die
  102. }
  103. pkg_postinst() {
  104. has_version -b app-eselect/eselect-wxwidgets \
  105. && eselect wxwidgets update
  106. }
  107. pkg_postrm() {
  108. has_version -b app-eselect/eselect-wxwidgets \
  109. && eselect wxwidgets update
  110. }