commit:     b840ec865ffc41c408909b0fa586b7652c72af30
Author:     NHOrus <jy6x2b32pie9 <AT> yahoo <DOT> com>
AuthorDate: Thu Mar 28 20:00:03 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed May  8 11:06:46 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b840ec86

x11-libs/wxGTK: remove auto_ptr in 3.0.5.1

Backports fixes from 3.2.2, using existing wxScopedPtr

[sam: Keep -r1 in stable and add -r2 in ~arch.]

Closes: https://bugs.gentoo.org/910441
Signed-off-by: NHOrus <jy6x2b32pie9 <AT> yahoo.com>
Closes: https://github.com/gentoo/gentoo/pull/35971
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../wxGTK/files/wxGTK-3.0.5.1-excise-autoptr.patch | 322 +++++++++++++++++++++
 x11-libs/wxGTK/wxGTK-3.0.5.1-r2.ebuild             | 188 ++++++++++++
 2 files changed, 510 insertions(+)

diff --git a/x11-libs/wxGTK/files/wxGTK-3.0.5.1-excise-autoptr.patch 
b/x11-libs/wxGTK/files/wxGTK-3.0.5.1-excise-autoptr.patch
new file mode 100644
index 000000000000..e03f64632f2b
--- /dev/null
+++ b/x11-libs/wxGTK/files/wxGTK-3.0.5.1-excise-autoptr.patch
@@ -0,0 +1,322 @@
+Direct replacement of auto_ptr, equivalent to parts of upstream commits:
+https://github.com/wxWidgets/wxWidgets/commit/b8c9cd35288a5c94f88ea83bf8c9ee644f99ece1
+https://github.com/wxWidgets/wxWidgets/commit/11a5728b327d5f16ef284d737f6329d38ae4d4b1
+made by diffing new-er upstream version with fixes included and current file
+diff --git a/tests/archive/archivetest.cpp b/tests/archive/archivetest.cpp
+index fa122d1..845ee0b 100644
+--- a/tests/archive/archivetest.cpp
++++ b/tests/archive/archivetest.cpp
+@@ -32,7 +32,6 @@
+ #include <sys/stat.h>
+ 
+ using std::string;
+-using std::auto_ptr;
+ 
+ 
+ // Check whether member templates can be used
+@@ -559,7 +558,7 @@ TestEntry& ArchiveTestCase<ClassFactoryT>::Add(const char 
*name,
+ template <class ClassFactoryT>
+ void ArchiveTestCase<ClassFactoryT>::CreateArchive(wxOutputStream& out)
+ {
+-    auto_ptr<OutputStreamT> arc(m_factory->NewStream(out));
++    wxScopedPtr<OutputStreamT> arc(m_factory->NewStream(out));
+     TestEntries::iterator it;
+ 
+     OnCreateArchive(*arc);
+@@ -587,7 +586,7 @@ void 
ArchiveTestCase<ClassFactoryT>::CreateArchive(wxOutputStream& out)
+ 
+         if ((choices & 2) || testEntry.IsText()) {
+             // try PutNextEntry(EntryT *pEntry)
+-            auto_ptr<EntryT> entry(m_factory->NewEntry());
++            wxScopedPtr<EntryT> entry(m_factory->NewEntry());
+             entry->SetName(name, wxPATH_UNIX);
+             if (setIsDir)
+                 entry->SetIsDir();
+@@ -701,8 +700,8 @@ template <class ClassFactoryT>
+ void ArchiveTestCase<ClassFactoryT>::ModifyArchive(wxInputStream& in,
+                                                    wxOutputStream& out)
+ {
+-    auto_ptr<InputStreamT> arcIn(m_factory->NewStream(in));
+-    auto_ptr<OutputStreamT> arcOut(m_factory->NewStream(out));
++    wxScopedPtr<InputStreamT> arcIn(m_factory->NewStream(in));
++    wxScopedPtr<OutputStreamT> arcOut(m_factory->NewStream(out));
+     EntryT *pEntry;
+ 
+     const wxString deleteName = wxT("bin/bin1000");
+@@ -714,7 +713,7 @@ void 
ArchiveTestCase<ClassFactoryT>::ModifyArchive(wxInputStream& in,
+     arcOut->CopyArchiveMetaData(*arcIn);
+ 
+     while ((pEntry = arcIn->GetNextEntry()) != NULL) {
+-        auto_ptr<EntryT> entry(pEntry);
++        wxScopedPtr<EntryT> entry(pEntry);
+         OnSetNotifier(*entry);
+         wxString name = entry->GetName(wxPATH_UNIX);
+ 
+@@ -759,7 +758,7 @@ void 
ArchiveTestCase<ClassFactoryT>::ModifyArchive(wxInputStream& in,
+ 
+     // try adding a new entry
+     TestEntry& testEntry = Add(newName.mb_str(), newData);
+-    auto_ptr<EntryT> newentry(m_factory->NewEntry());
++    wxScopedPtr<EntryT> newentry(m_factory->NewEntry());
+     newentry->SetName(newName);
+     newentry->SetDateTime(testEntry.GetDateTime());
+     newentry->SetSize(testEntry.GetLength());
+@@ -782,7 +781,7 @@ void 
ArchiveTestCase<ClassFactoryT>::ExtractArchive(wxInputStream& in)
+     typedef std::list<EntryPtr> Entries;
+     typedef typename Entries::iterator EntryIter;
+ 
+-    auto_ptr<InputStreamT> arc(m_factory->NewStream(in));
++    wxScopedPtr<InputStreamT> arc(m_factory->NewStream(in));
+     int expectedTotal = m_testEntries.size();
+     EntryPtr entry;
+     Entries entries;
+@@ -991,7 +990,7 @@ void 
ArchiveTestCase<ClassFactoryT>::TestIterator(wxInputStream& in)
+     typedef std::list<EntryT*> ArchiveCatalog;
+     typedef typename ArchiveCatalog::iterator CatalogIter;
+ 
+-    auto_ptr<InputStreamT> arc(m_factory->NewStream(in));
++    wxScopedPtr<InputStreamT> arc(m_factory->NewStream(in));
+     size_t count = 0;
+ 
+ #ifdef WXARC_MEMBER_TEMPLATES
+@@ -1003,7 +1002,7 @@ void 
ArchiveTestCase<ClassFactoryT>::TestIterator(wxInputStream& in)
+ #endif
+ 
+     for (CatalogIter it = cat.begin(); it != cat.end(); ++it) {
+-        auto_ptr<EntryT> entry(*it);
++        wxScopedPtr<EntryT> entry(*it);
+         count += m_testEntries.count(entry->GetName(wxPATH_UNIX));
+     }
+ 
+@@ -1020,7 +1019,7 @@ void 
ArchiveTestCase<ClassFactoryT>::TestPairIterator(wxInputStream& in)
+     typedef std::map<wxString, EntryT*> ArchiveCatalog;
+     typedef typename ArchiveCatalog::iterator CatalogIter;
+ 
+-    auto_ptr<InputStreamT> arc(m_factory->NewStream(in));
++    wxScopedPtr<InputStreamT> arc(m_factory->NewStream(in));
+     size_t count = 0;
+ 
+ #ifdef WXARC_MEMBER_TEMPLATES
+@@ -1032,7 +1031,7 @@ void 
ArchiveTestCase<ClassFactoryT>::TestPairIterator(wxInputStream& in)
+ #endif
+ 
+     for (CatalogIter it = cat.begin(); it != cat.end(); ++it) {
+-        auto_ptr<EntryT> entry(it->second);
++        wxScopedPtr<EntryT> entry(it->second);
+         count += m_testEntries.count(entry->GetName(wxPATH_UNIX));
+     }
+ 
+@@ -1049,7 +1048,7 @@ void 
ArchiveTestCase<ClassFactoryT>::TestSmartIterator(wxInputStream& in)
+     typedef typename ArchiveCatalog::iterator CatalogIter;
+     typedef wxArchiveIterator<InputStreamT, Ptr<EntryT> > Iter;
+ 
+-    auto_ptr<InputStreamT> arc(m_factory->NewStream(in));
++    wxScopedPtr<InputStreamT> arc(m_factory->NewStream(in));
+ 
+ #ifdef WXARC_MEMBER_TEMPLATES
+     ArchiveCatalog cat((Iter)*arc, Iter());
+@@ -1080,7 +1079,7 @@ void 
ArchiveTestCase<ClassFactoryT>::TestSmartPairIterator(wxInputStream& in)
+     typedef wxArchiveIterator<InputStreamT,
+                 std::pair<wxString, Ptr<EntryT> > > PairIter;
+ 
+-    auto_ptr<InputStreamT> arc(m_factory->NewStream(in));
++    wxScopedPtr<InputStreamT> arc(m_factory->NewStream(in));
+ 
+ #ifdef WXARC_MEMBER_TEMPLATES
+     ArchiveCatalog cat((PairIter)*arc, PairIter());
+@@ -1108,8 +1107,8 @@ void 
ArchiveTestCase<ClassFactoryT>::ReadSimultaneous(TestInputStream& in)
+ 
+     // create two archive input streams
+     TestInputStream in2(in);
+-    auto_ptr<InputStreamT> arc(m_factory->NewStream(in));
+-    auto_ptr<InputStreamT> arc2(m_factory->NewStream(in2));
++    wxScopedPtr<InputStreamT> arc(m_factory->NewStream(in));
++    wxScopedPtr<InputStreamT> arc2(m_factory->NewStream(in2));
+ 
+     // load the catalog
+ #ifdef WXARC_MEMBER_TEMPLATES
+@@ -1201,7 +1200,7 @@ protected:
+     void CreateArchive(wxOutputStream& out);
+     void ExtractArchive(wxInputStream& in);
+ 
+-    auto_ptr<wxArchiveClassFactory> m_factory;  // factory to make classes
++    wxScopedPtr<wxArchiveClassFactory> m_factory;  // factory to make classes
+     int m_options;                              // test options
+ };
+ 
+@@ -1241,7 +1240,7 @@ void CorruptionTestCase::runTest()
+ 
+ void CorruptionTestCase::CreateArchive(wxOutputStream& out)
+ {
+-    auto_ptr<wxArchiveOutputStream> arc(m_factory->NewStream(out));
++    wxScopedPtr<wxArchiveOutputStream> arc(m_factory->NewStream(out));
+ 
+     arc->PutNextDirEntry(wxT("dir"));
+     arc->PutNextEntry(wxT("file"));
+@@ -1250,8 +1249,8 @@ void CorruptionTestCase::CreateArchive(wxOutputStream& 
out)
+ 
+ void CorruptionTestCase::ExtractArchive(wxInputStream& in)
+ {
+-    auto_ptr<wxArchiveInputStream> arc(m_factory->NewStream(in));
+-    auto_ptr<wxArchiveEntry> entry(arc->GetNextEntry());
++    wxScopedPtr<wxArchiveInputStream> arc(m_factory->NewStream(in));
++    wxScopedPtr<wxArchiveEntry> entry(arc->GetNextEntry());
+ 
+     while (entry.get() != NULL) {
+         char buf[1024];
+@@ -1259,7 +1258,6 @@ void CorruptionTestCase::ExtractArchive(wxInputStream& 
in)
+         while (arc->IsOk())
+             arc->Read(buf, sizeof(buf));
+ 
+-        auto_ptr<wxArchiveEntry> next(arc->GetNextEntry());
+-        entry = next;
++        entry.reset(arc->GetNextEntry());
+     }
+ }
+diff --git a/tests/archive/archivetest.h b/tests/archive/archivetest.h
+index 7a1a306..37a083c 100644
+--- a/tests/archive/archivetest.h
++++ b/tests/archive/archivetest.h
+@@ -13,7 +13,7 @@
+ 
+ #include "wx/archive.h"
+ #include "wx/wfstream.h"
+-
++#include "wx/scopedptr.h"
+ 
+ 
///////////////////////////////////////////////////////////////////////////////
+ // Bit flags for options for the tests
+@@ -213,7 +213,7 @@ protected:
+ 
+     typedef std::map<wxString, TestEntry*> TestEntries;
+     TestEntries m_testEntries;              // test data
+-    std::auto_ptr<ClassFactoryT> m_factory; // factory to make classes
++    wxScopedPtr<ClassFactoryT> m_factory; // factory to make classes
+     int m_options;                          // test options
+     wxDateTime m_timeStamp;                 // timestamp to give test entries
+     int m_id;                               // select between the possibilites
+diff --git a/tests/archive/ziptest.cpp b/tests/archive/ziptest.cpp
+index 3e9cff3..dc3fef5 100644
+--- a/tests/archive/ziptest.cpp
++++ b/tests/archive/ziptest.cpp
+@@ -22,7 +22,6 @@
+ #include "wx/zipstrm.h"
+ 
+ using std::string;
+-using std::auto_ptr;
+ 
+ 
+ 
///////////////////////////////////////////////////////////////////////////////
+@@ -186,7 +185,7 @@ void ZipPipeTestCase::runTest()
+     TestInputStream in(out, m_id % ((m_options & PipeIn) ? 4 : 3));
+     wxZipInputStream zip(in);
+ 
+-    auto_ptr<wxZipEntry> entry(zip.GetNextEntry());
++    wxScopedPtr<wxZipEntry> entry(zip.GetNextEntry());
+     CPPUNIT_ASSERT(entry.get() != NULL);
+ 
+     if ((m_options & PipeIn) == 0)
+diff --git a/tests/net/socket.cpp b/tests/net/socket.cpp
+index acd91ae..7e27fc4 100644
+--- a/tests/net/socket.cpp
++++ b/tests/net/socket.cpp
+@@ -28,10 +28,11 @@
+ #include "wx/url.h"
+ #include "wx/sstream.h"
+ #include "wx/evtloop.h"
++#include "wx/scopedptr.h"
+ #include <memory>
+ 
+-typedef std::auto_ptr<wxSockAddress> wxSockAddressPtr;
+-typedef std::auto_ptr<wxSocketClient> wxSocketClientPtr;
++typedef wxScopedPtr<wxSockAddress> wxSockAddressPtr;
++typedef wxScopedPtr<wxSocketClient> wxSocketClientPtr;
+ 
+ static wxString gs_serverHost(wxGetenv("WX_TEST_SERVER"));
+ 
+@@ -257,7 +258,7 @@ void SocketTestCase::UrlTest()
+ 
+     wxURL url("http://"; + gs_serverHost);
+ 
+-    const std::auto_ptr<wxInputStream> in(url.GetInputStream());
++    const wxScopedPtr<wxInputStream> in(url.GetInputStream());
+     CPPUNIT_ASSERT( in.get() );
+ 
+     wxStringOutputStream out;
+diff --git a/tests/streams/largefile.cpp b/tests/streams/largefile.cpp
+index 9c6c481..59fca24 100644
+--- a/tests/streams/largefile.cpp
++++ b/tests/streams/largefile.cpp
+@@ -33,6 +33,7 @@
+ 
+ #include "wx/filename.h"
+ #include "wx/wfstream.h"
++#include "wx/scopedptr.h"
+ 
+ #ifdef __WINDOWS__
+     #include "wx/msw/wrapwin.h"
+@@ -51,7 +52,6 @@
+     #define fileno _fileno
+ #endif
+ 
+-using std::auto_ptr;
+ 
+ 
+ 
///////////////////////////////////////////////////////////////////////////////
+@@ -120,7 +120,7 @@ void LargeFileTest::runTest()
+ 
+     // write a large file
+     {
+-        auto_ptr<wxOutputStream> out(MakeOutStream(tmpfile.m_name));
++        wxScopedPtr<wxOutputStream> out(MakeOutStream(tmpfile.m_name));
+ 
+         // write 'A's at [ 0x7fffffbf, 0x7fffffff [
+         pos = 0x7fffffff - size;
+@@ -154,7 +154,7 @@ void LargeFileTest::runTest()
+ 
+     // read the large file back
+     {
+-        auto_ptr<wxInputStream> in(MakeInStream(tmpfile.m_name));
++        wxScopedPtr<wxInputStream> in(MakeInStream(tmpfile.m_name));
+         char buf[size];
+ 
+         if (haveLFS) {
+@@ -218,7 +218,7 @@ protected:
+ 
+ wxInputStream *LargeFileTest_wxFile::MakeInStream(const wxString& name) const
+ {
+-    auto_ptr<wxFileInputStream> in(new wxFileInputStream(name));
++    wxScopedPtr<wxFileInputStream> in(new wxFileInputStream(name));
+     CPPUNIT_ASSERT(in->IsOk());
+     return in.release();
+ }
+@@ -250,7 +250,7 @@ protected:
+ 
+ wxInputStream *LargeFileTest_wxFFile::MakeInStream(const wxString& name) const
+ {
+-    auto_ptr<wxFFileInputStream> in(new wxFFileInputStream(name));
++    wxScopedPtr<wxFFileInputStream> in(new wxFFileInputStream(name));
+     CPPUNIT_ASSERT(in->IsOk());
+     return in.release();
+ }
+diff --git a/wxWidgets-3.0.5.1/src/stc/scintilla/src/Editor.cxx.old 
b/wxWidgets-3.0.5.1/src/stc/scintilla/src/Editor.cxx
+index 2081df2..a8c8572 100644
+--- a/src/stc/scintilla/src/Editor.cxx
++++ b/src/stc/scintilla/src/Editor.cxx
+@@ -41,6 +41,7 @@
+ #include "Selection.h"
+ #include "PositionCache.h"
+ #include "Editor.h"
++#include "wx/scopedptr.h"
+ 
+ #ifdef SCI_NAMESPACE
+ using namespace Scintilla;
+@@ -5706,7 +5707,7 @@ long Editor::FindText(
+ 
+       Sci_TextToFind *ft = reinterpret_cast<Sci_TextToFind *>(lParam);
+       int lengthFound = istrlen(ft->lpstrText);
+-      std::auto_ptr<CaseFolder> pcf(CaseFolderForEncoding());
++      wxScopedPtr<CaseFolder> pcf(CaseFolderForEncoding());
+       int pos = pdoc->FindText(ft->chrg.cpMin, ft->chrg.cpMax, ft->lpstrText,
+               (wParam & SCFIND_MATCHCASE) != 0,
+               (wParam & SCFIND_WHOLEWORD) != 0,

diff --git a/x11-libs/wxGTK/wxGTK-3.0.5.1-r2.ebuild 
b/x11-libs/wxGTK/wxGTK-3.0.5.1-r2.ebuild
new file mode 100644
index 000000000000..832b85ae5e18
--- /dev/null
+++ b/x11-libs/wxGTK/wxGTK-3.0.5.1-r2.ebuild
@@ -0,0 +1,188 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit multilib-minimal flag-o-matic
+
+WXSUBVERSION=${PV}-gtk3                                # 3.0.5.1-gtk3
+WXVERSION=${WXSUBVERSION%.*}                   # 3.0.5
+WXRELEASE=${WXVERSION%.*}-gtk3                 # 3.0-gtk3
+WXRELEASE_NODOT=${WXRELEASE//./}               # 30-gtk3
+
+DESCRIPTION="GTK+ version of wxWidgets, a cross-platform C++ GUI toolkit"
+HOMEPAGE="https://wxwidgets.org/";
+SRC_URI="
+       
https://github.com/wxWidgets/wxWidgets/releases/download/v${PV}/wxWidgets-${PV}.tar.bz2
+       
https://dev.gentoo.org/~leio/distfiles/wxGTK-${WXVERSION}_p20210214.tar.xz
+       doc? ( 
https://github.com/wxWidgets/wxWidgets/releases/download/v${WXVERSION}/wxWidgets-${WXVERSION}-docs-html.tar.bz2
 )"
+S="${WORKDIR}/wxWidgets-${PV}"
+
+LICENSE="wxWinLL-3 GPL-2 doc? ( wxWinFDL-3 )"
+SLOT="${WXRELEASE}"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 
~riscv ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="+X doc debug gstreamer libnotify opengl pch sdl test tiff webkit"
+REQUIRED_USE="test? ( tiff ) tiff? ( X )"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+       >=app-eselect/eselect-wxwidgets-20131230
+       dev-libs/expat[${MULTILIB_USEDEP}]
+       sdl? ( media-libs/libsdl2[${MULTILIB_USEDEP}] )
+       X? (
+               >=dev-libs/glib-2.22:2[${MULTILIB_USEDEP}]
+               media-libs/libjpeg-turbo:=[${MULTILIB_USEDEP}]
+               media-libs/libpng:0=[${MULTILIB_USEDEP}]
+               sys-libs/zlib[${MULTILIB_USEDEP}]
+               x11-libs/cairo[${MULTILIB_USEDEP}]
+               x11-libs/gtk+:3[${MULTILIB_USEDEP}]
+               x11-libs/gdk-pixbuf[${MULTILIB_USEDEP}]
+               x11-libs/libSM[${MULTILIB_USEDEP}]
+               x11-libs/libX11[${MULTILIB_USEDEP}]
+               x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+               x11-libs/pango[${MULTILIB_USEDEP}]
+               gstreamer? (
+                       media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
+                       media-libs/gst-plugins-base:1.0[${MULTILIB_USEDEP}]
+               )
+               libnotify? ( x11-libs/libnotify[${MULTILIB_USEDEP}] )
+               opengl? ( virtual/opengl[${MULTILIB_USEDEP}] )
+               tiff? ( media-libs/tiff:=[${MULTILIB_USEDEP}] )
+               webkit? ( net-libs/webkit-gtk:4 )
+       )"
+DEPEND="${RDEPEND}
+       opengl? ( virtual/glu[${MULTILIB_USEDEP}] )
+       X? ( x11-base/xorg-proto )"
+BDEPEND="
+       test? ( >=dev-util/cppunit-1.8.0 )
+       >=app-eselect/eselect-wxwidgets-20131230
+       virtual/pkgconfig"
+
+PATCHES=(
+       "${WORKDIR}"/wxGTK-3.0.5_p20210214/
+       "${FILESDIR}"/wxGTK-${SLOT}-translation-domain.patch
+       "${FILESDIR}"/wxGTK-ignore-c++-abi.patch #676878
+       "${FILESDIR}"/${PN}-configure-tests.patch
+       "${FILESDIR}"/${PN}-3.0.5.1-configure-modern-c.patch
+       "${FILESDIR}"/${PN}-3.0.5.1-excise-autoptr.patch
+
+)
+
+src_prepare() {
+       default
+
+       # Versionating
+       sed -i \
+               -e "s:\(WX_RELEASE = \).*:\1${WXRELEASE}:"\
+               -e "s:\(WX_RELEASE_NODOT = \).*:\1${WXRELEASE_NODOT}:"\
+               -e "s:\(WX_VERSION = \).*:\1${WXVERSION}:"\
+               -e "s:aclocal):aclocal/wxwin${WXRELEASE_NODOT}.m4):" \
+               -e "s:wxstd.mo:wxstd${WXRELEASE_NODOT}.mo:" \
+               -e "s:wxmsw.mo:wxmsw${WXRELEASE_NODOT}.mo:" \
+               Makefile.in tests/Makefile.in || die
+
+       sed -i \
+               -e "s:\(WX_RELEASE = \).*:\1${WXRELEASE}:"\
+               utils/wxrc/Makefile.in || die
+
+       sed -i \
+               -e "s:\(WX_VERSION=\).*:\1${WXVERSION}:" \
+               -e "s:\(WX_RELEASE=\).*:\1${WXRELEASE}:" \
+               -e "s:\(WX_SUBVERSION=\).*:\1${WXSUBVERSION}:" \
+               -e '/WX_VERSION_TAG=/ s:${WX_RELEASE}:3.0:' \
+               configure || die
+}
+
+multilib_src_configure() {
+       # Workaround for bug #915154
+       append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
+
+       # X independent options
+       local myeconfargs=(
+               --with-zlib=sys
+               --with-expat=sys
+               --enable-compat28
+               $(use_with sdl)
+
+               # PCHes are unstable and are disabled in-tree where possible
+               # See bug #504204
+               # Commits 8c4774042b7fdfb08e525d8af4b7912f26a2fdce, 
fb809aeadee57ffa24591e60cfb41aecd4823090
+               $(use_enable pch precomp-headers)
+
+               # Don't hard-code libdir's prefix for wx-config
+               --libdir='${prefix}'/$(get_libdir)
+       )
+
+       # debug in >=2.9
+       # there is no longer separate debug libraries (gtk2ud)
+       # wxDEBUG_LEVEL=1 is the default and we will leave it enabled
+       # wxDEBUG_LEVEL=2 enables assertions that have expensive runtime costs.
+       # apps can disable these features by building w/ -NDEBUG or 
wxDEBUG_LEVEL_0.
+       # http://docs.wxwidgets.org/3.0/overview_debugging.html
+       # 
https://groups.google.com/group/wx-dev/browse_thread/thread/c3c7e78d63d7777f/05dee25410052d9c
+       use debug && myeconfargs+=( --enable-debug=max )
+
+       # wxGTK options
+       #   --enable-graphics_ctx - needed for webkit, editra
+       #   --without-gnomevfs - bug #203389
+       use X && myeconfargs+=(
+               --enable-graphics_ctx
+               --with-gtkprint
+               --enable-gui
+               --with-gtk=3
+               --with-libpng=sys
+               --with-libjpeg=sys
+               --without-gnomevfs
+               $(use_enable gstreamer mediactrl)
+               $(multilib_native_use_enable webkit webview)
+               $(use_with libnotify)
+               $(use_with opengl)
+               $(use_with tiff libtiff sys)
+               $(use_enable test tests)
+       )
+
+       # wxBase options
+       ! use X && myeconfargs+=( --disable-gui )
+
+       ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
+}
+
+multilib_src_test() {
+       emake -C tests
+       (cd tests && ./test) || die
+}
+
+multilib_src_install_all() {
+       cd docs || die
+       dodoc changes.txt readme.txt
+       newdoc base/readme.txt base_readme.txt
+       newdoc gtk/readme.txt gtk_readme.txt
+
+       use doc && HTML_DOCS=( "${WORKDIR}"/wxWidgets-${WXVERSION}-docs-html/. )
+       einstalldocs
+
+       # Stray windows locale file, bug #650118
+       rm -f "${ED}"/usr/share/locale/it/LC_MESSAGES/wxmsw30-gtk3.mo || die
+
+       # Unversioned links
+       rm "${ED}"/usr/bin/wx-config || die
+       use X && { rm "${ED}"/usr/bin/wxrc || die; }
+
+       # version bakefile presets
+       pushd "${ED}"/usr/share/bakefile/presets >/dev/null || die
+       local f
+       for f in wx*; do
+               mv "${f}" "${f/wx/wx30gtk3}" || die
+       done
+       popd >/dev/null || die
+}
+
+pkg_postinst() {
+       has_version -b app-eselect/eselect-wxwidgets \
+               && eselect wxwidgets update
+}
+
+pkg_postrm() {
+       has_version -b app-eselect/eselect-wxwidgets \
+               && eselect wxwidgets update
+}

Reply via email to