Diff wxGTK-3.0.4-r5 with a wxGTK-3.0.5.1-r1

/usr/portage/x11-libs/wxGTK/wxGTK-3.0.5.1-r1.ebuild 2024-12-25 14:59:52.855270185 +0300
1 1
# Copyright 1999-2024 Gentoo Authors
2 2
# Distributed under the terms of the GNU General Public License v2
3 3

  
4
EAPI=8
4
EAPI=7
5 5

  
6 6
inherit multilib-minimal flag-o-matic
7 7

  
8
WXSUBVERSION=${PV}-gtk3				# 3.0.5.1-gtk3
9
WXVERSION=${WXSUBVERSION%.*}			# 3.0.5
10
WXRELEASE=${WXVERSION%.*}-gtk3			# 3.0-gtk3
11
WXRELEASE_NODOT=${WXRELEASE//./}		# 30-gtk3
12

  
8 13
DESCRIPTION="GTK+ version of wxWidgets, a cross-platform C++ GUI toolkit"
9 14
HOMEPAGE="https://wxwidgets.org/"
10 15
SRC_URI="
11 16
	https://github.com/wxWidgets/wxWidgets/releases/download/v${PV}/wxWidgets-${PV}.tar.bz2
12
	https://dev.gentoo.org/~leio/distfiles/wxGTK-3.0.4_p20190713.tar.xz
13
	doc? ( https://github.com/wxWidgets/wxWidgets/releases/download/v${PV}/wxWidgets-${PV}-docs-html.tar.bz2 )"
17
	https://dev.gentoo.org/~leio/distfiles/wxGTK-3.0.5_p20210214.tar.xz
18
	doc? ( https://github.com/wxWidgets/wxWidgets/releases/download/v${WXVERSION}/wxWidgets-${WXVERSION}-docs-html.tar.bz2 )"
14 19
S="${WORKDIR}/wxWidgets-${PV}"
15 20

  
16 21
LICENSE="wxWinLL-3 GPL-2 doc? ( wxWinFDL-3 )"
17
SLOT="3.0"
18
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~mips ppc ppc64 ~riscv sparc x86 ~amd64-linux ~x86-linux"
19
IUSE="+X doc debug gstreamer libnotify opengl pch sdl tiff"
22
SLOT="${WXRELEASE}"
23
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~mips ppc ppc64 ~riscv sparc x86 ~amd64-linux ~x86-linux"
24
IUSE="+X doc debug gstreamer libnotify opengl pch sdl test tiff webkit"
25
REQUIRED_USE="test? ( tiff ) tiff? ( X )"
26
RESTRICT="!test? ( test )"
20 27

  
21 28
RDEPEND="
29
	>=app-eselect/eselect-wxwidgets-20131230
22 30
	dev-libs/expat[${MULTILIB_USEDEP}]
23 31
	sdl? ( media-libs/libsdl2[${MULTILIB_USEDEP}] )
24 32
	X? (
25
		dev-libs/glib:2[${MULTILIB_USEDEP}]
33
		>=dev-libs/glib-2.22:2[${MULTILIB_USEDEP}]
26 34
		media-libs/libjpeg-turbo:=[${MULTILIB_USEDEP}]
27
		media-libs/libpng:=[${MULTILIB_USEDEP}]
35
		media-libs/libpng:0=[${MULTILIB_USEDEP}]
28 36
		sys-libs/zlib[${MULTILIB_USEDEP}]
29
		x11-libs/gtk+:2[${MULTILIB_USEDEP}]
37
		x11-libs/cairo[${MULTILIB_USEDEP}]
38
		x11-libs/gtk+:3[${MULTILIB_USEDEP}]
30 39
		x11-libs/gdk-pixbuf[${MULTILIB_USEDEP}]
31 40
		x11-libs/libSM[${MULTILIB_USEDEP}]
41
		x11-libs/libX11[${MULTILIB_USEDEP}]
32 42
		x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
33 43
		x11-libs/pango[${MULTILIB_USEDEP}]
34 44
		gstreamer? (
......
37 47
		)
38 48
		libnotify? ( x11-libs/libnotify[${MULTILIB_USEDEP}] )
39 49
		opengl? ( virtual/opengl[${MULTILIB_USEDEP}] )
40
		tiff?   ( media-libs/tiff:=[${MULTILIB_USEDEP}] )
50
		tiff? ( media-libs/tiff:=[${MULTILIB_USEDEP}] )
51
		webkit? ( net-libs/webkit-gtk:4 )
41 52
	)"
42
DEPEND="
43
	${RDEPEND}
53
DEPEND="${RDEPEND}
44 54
	opengl? ( virtual/glu[${MULTILIB_USEDEP}] )
45 55
	X? ( x11-base/xorg-proto )"
46
BDEPEND="virtual/pkgconfig"
47
PDEPEND=">=app-eselect/eselect-wxwidgets-20131230"
56
BDEPEND="
57
	test? ( >=dev-util/cppunit-1.8.0 )
58
	>=app-eselect/eselect-wxwidgets-20131230
59
	virtual/pkgconfig"
48 60

  
49 61
PATCHES=(
50
	"${WORKDIR}"/wxGTK-3.0.4_p20190713/
51
	"${FILESDIR}"/${PN}-3.0.5-collision.patch
62
	"${WORKDIR}"/wxGTK-3.0.5_p20210214/
63
	"${FILESDIR}"/wxGTK-${SLOT}-translation-domain.patch
52 64
	"${FILESDIR}"/wxGTK-ignore-c++-abi.patch #676878
65
	"${FILESDIR}"/${PN}-configure-tests.patch
66
	"${FILESDIR}"/${PN}-3.0.5.1-configure-modern-c.patch
53 67
)
54 68

  
69
src_prepare() {
70
	default
71

  
72
	# Versionating
73
	sed -i \
74
		-e "s:\(WX_RELEASE = \).*:\1${WXRELEASE}:"\
75
		-e "s:\(WX_RELEASE_NODOT = \).*:\1${WXRELEASE_NODOT}:"\
76
		-e "s:\(WX_VERSION = \).*:\1${WXVERSION}:"\
77
		-e "s:aclocal):aclocal/wxwin${WXRELEASE_NODOT}.m4):" \
78
		-e "s:wxstd.mo:wxstd${WXRELEASE_NODOT}.mo:" \
79
		-e "s:wxmsw.mo:wxmsw${WXRELEASE_NODOT}.mo:" \
80
		Makefile.in tests/Makefile.in || die
81

  
82
	sed -i \
83
		-e "s:\(WX_RELEASE = \).*:\1${WXRELEASE}:"\
84
		utils/wxrc/Makefile.in || die
85

  
86
	sed -i \
87
		-e "s:\(WX_VERSION=\).*:\1${WXVERSION}:" \
88
		-e "s:\(WX_RELEASE=\).*:\1${WXRELEASE}:" \
89
		-e "s:\(WX_SUBVERSION=\).*:\1${WXSUBVERSION}:" \
90
		-e '/WX_VERSION_TAG=/ s:${WX_RELEASE}:3.0:' \
91
		configure || die
92
}
93

  
55 94
multilib_src_configure() {
56 95
	# Workaround for bug #915154
57 96
	append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
58 97

  
59
	local myconf=(
60
		# X independent options
98
	# X independent options
99
	local myeconfargs=(
61 100
		--with-zlib=sys
62 101
		--with-expat=sys
63 102
		--enable-compat28
......
67 106
		# See bug #504204
68 107
		# Commits 8c4774042b7fdfb08e525d8af4b7912f26a2fdce, fb809aeadee57ffa24591e60cfb41aecd4823090
69 108
		$(use_enable pch precomp-headers)
109

  
110
		# Don't hard-code libdir's prefix for wx-config
111
		--libdir='${prefix}'/$(get_libdir)
70 112
	)
71 113

  
72 114
	# debug in >=2.9
......
76 118
	# apps can disable these features by building w/ -NDEBUG or wxDEBUG_LEVEL_0.
77 119
	# http://docs.wxwidgets.org/3.0/overview_debugging.html
78 120
	# https://groups.google.com/group/wx-dev/browse_thread/thread/c3c7e78d63d7777f/05dee25410052d9c
79
	use debug && myconf+=( --enable-debug=max )
121
	use debug && myeconfargs+=( --enable-debug=max )
80 122

  
81 123
	# wxGTK options
82 124
	#   --enable-graphics_ctx - needed for webkit, editra
83 125
	#   --without-gnomevfs - bug #203389
84
	if use X; then
85
		myconf+=(
86
			--enable-gui
87
			--enable-graphics_ctx
88
			--with-gtkprint
89
			--with-libpng=sys
90
			--with-libxpm=sys
91
			--with-libjpeg=sys
92
			--without-gnomevfs
93
			--disable-webview
94
			$(use_enable gstreamer mediactrl)
95
			$(use_with libnotify)
96
			$(use_with opengl)
97
			$(use_with tiff libtiff sys)
98
		)
99
	else
100
		# wxBase options
101
		myconf+=( --disable-gui )
102
	fi
126
	use X && myeconfargs+=(
127
		--enable-graphics_ctx
128
		--with-gtkprint
129
		--enable-gui
130
		--with-gtk=3
131
		--with-libpng=sys
132
		--with-libjpeg=sys
133
		--without-gnomevfs
134
		$(use_enable gstreamer mediactrl)
135
		$(multilib_native_use_enable webkit webview)
136
		$(use_with libnotify)
137
		$(use_with opengl)
138
		$(use_with tiff libtiff sys)
139
		$(use_enable test tests)
140
	)
141

  
142
	# wxBase options
143
	! use X && myeconfargs+=( --disable-gui )
103 144

  
104
	ECONF_SOURCE="${S}" econf "${myconf[@]}"
145
	ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
146
}
147

  
148
multilib_src_test() {
149
	emake -C tests
150
	(cd tests && ./test) || die
105 151
}
106 152

  
107 153
multilib_src_install_all() {
......
110 156
	newdoc base/readme.txt base_readme.txt
111 157
	newdoc gtk/readme.txt gtk_readme.txt
112 158

  
113
	use doc && HTML_DOCS=( "${WORKDIR}"/wxWidgets-${PV}-docs-html/. )
159
	use doc && HTML_DOCS=( "${WORKDIR}"/wxWidgets-${WXVERSION}-docs-html/. )
114 160
	einstalldocs
115 161

  
116
	# Stray windows locale file, causes collisions
117
	rm -f "${ED}"/usr/share/locale/it/LC_MESSAGES/wxmsw.mo || die
162
	# Stray windows locale file, bug #650118
163
	rm -f "${ED}"/usr/share/locale/it/LC_MESSAGES/wxmsw30-gtk3.mo || die
164

  
165
	# Unversioned links
166
	rm "${ED}"/usr/bin/wx-config || die
167
	use X && { rm "${ED}"/usr/bin/wxrc || die; }
168

  
169
	# version bakefile presets
170
	pushd "${ED}"/usr/share/bakefile/presets >/dev/null || die
171
	local f
172
	for f in wx*; do
173
		mv "${f}" "${f/wx/wx30gtk3}" || die
174
	done
175
	popd >/dev/null || die
118 176
}
119 177

  
120 178
pkg_postinst() {
121
	has_version app-eselect/eselect-wxwidgets &&
122
		eselect wxwidgets update
179
	has_version -b app-eselect/eselect-wxwidgets \
180
		&& eselect wxwidgets update
123 181
}
124 182

  
125 183
pkg_postrm() {
126
	has_version app-eselect/eselect-wxwidgets &&
127
		eselect wxwidgets update
184
	has_version -b app-eselect/eselect-wxwidgets \
185
		&& eselect wxwidgets update
128 186
}
Thank you!