Diff amule-2.3.3-r8 with a amule-9999

/usr/portage/net-p2p/amule/amule-9999.ebuild 2026-04-29 00:17:39.387285829 +0300
4 4
EAPI=8
5 5
WX_GTK_VER="3.2-gtk3"
6 6

  
7
inherit autotools eapi9-ver flag-o-matic wxwidgets xdg-utils
7
inherit cmake flag-o-matic wxwidgets xdg-utils
8 8

  
9 9
if [[ ${PV} == 9999 ]] ; then
10 10
	EGIT_REPO_URI="https://github.com/amule-project/amule"
......
13 13
	MY_P="${PN/m/M}-${PV}"
14 14
	SRC_URI="https://download.sourceforge.net/${PN}/${MY_P}.tar.xz"
15 15
	S="${WORKDIR}/${MY_P}"
16
	KEYWORDS="~alpha amd64 ~arm ~mips ppc ppc64 ~riscv ~sparc x86"
16
	KEYWORDS="~alpha ~amd64 ~arm ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
17 17
fi
18 18

  
19 19
DESCRIPTION="aMule, the all-platform eMule p2p client"
......
21 21

  
22 22
LICENSE="GPL-2+"
23 23
SLOT="0"
24
IUSE="daemon debug geoip +gui nls remote stats upnp"
24
IUSE="daemon debug geoip +gui nls remote stats test upnp"
25
REQUIRED_USE="|| ( daemon gui remote )"
26

  
27
RESTRICT="!test? ( test )"
25 28

  
26 29
RDEPEND="
27
	dev-libs/boost:=
28 30
	dev-libs/crypto++:=
29 31
	sys-libs/binutils-libs:0=
30 32
	sys-libs/readline:0=
31 33
	virtual/zlib:=
32
	x11-libs/wxGTK:${WX_GTK_VER}=
33
	daemon? ( acct-user/amule )
34
	geoip? ( dev-libs/geoip )
35
	gui? ( x11-libs/wxGTK:${WX_GTK_VER}=[X] )
34
	x11-libs/wxGTK:${WX_GTK_VER}=[curl]
35
	daemon? (
36
		acct-user/amule
37
		dev-libs/boost:=
38
	)
39
	gui? (
40
		dev-libs/boost:=
41
		x11-libs/wxGTK:${WX_GTK_VER}=[X]
42
		geoip? ( dev-libs/geoip )
43
	)
36 44
	nls? ( virtual/libintl )
37 45
	remote? (
38 46
		acct-user/amule
......
41 49
	stats? ( media-libs/gd:=[jpeg,png] )
42 50
	upnp? ( net-libs/libupnp:0= )
43 51
"
44
DEPEND="${RDEPEND}
45
	gui? ( dev-util/desktop-file-utils )
46
"
47 52
BDEPEND="
48 53
	virtual/pkgconfig
49
	>=dev-build/boost-m4-0.4_p20221019
50 54
	nls? ( sys-devel/gettext )
51 55
"
52 56

  
53 57
PATCHES=(
54
	"${FILESDIR}/${PN}-2.3.2-disable-version-check.patch"
55
	"${FILESDIR}/${PN}-2.3.3-fix-exception.patch"
56
	"${FILESDIR}/${P}-autoconf-2.70.patch"
57
	"${FILESDIR}/${PN}-2.3.3-backport-pr368.patch"
58
	"${FILESDIR}/${PN}-2.3.3-wx3.2.patch"
59
	"${FILESDIR}/${PN}-2.3.3-use-xdg-open-as-preview-default.patch"
60
	"${FILESDIR}/${P}-boost-1.87.patch"
61
	"${FILESDIR}/${P}-boost-1.89.patch" # bug 963550
62
	"${FILESDIR}/${P}-libupnp-1.18.patch" # bug 969816
58
	"${FILESDIR}/${PN}-2.4.0-disable-version-check.patch"
59
	"${FILESDIR}/${PN}-2.4.0-use-xdg-open-as-preview-default.patch"
63 60
)
64 61

  
65
src_prepare() {
66
	default
67
	rm m4/boost.m4 || die
68

  
69
	if [[ ${PV} == 9999 ]]; then
70
		./autogen.sh || die
71
	else
72
		eautoreconf
73
	fi
74
}
75

  
76 62
src_configure() {
77 63
	setup-wxwidgets
78 64

  
79 65
	use debug || append-cppflags -DwxDEBUG_LEVEL=0
80
	append-cxxflags -std=gnu++14
81
	# Workaround for gettext-0.11.5
82
	# https://bugs.gentoo.org/945720
83
	append-cflags -std=gnu17
84

  
85
	local myconf=(
86
		--with-denoise-level=0
87
		--with-wx-config="${WX_CONFIG}"
88
		--enable-amulecmd
89
		--with-boost
90
		$(use_enable debug)
91
		$(use_enable daemon amule-daemon)
92
		$(use_enable geoip)
93
		$(use_enable nls)
94
		$(use_enable remote webserver)
95
		$(use_enable stats cas)
96
		$(use_enable stats alcc)
97
		$(use_enable upnp)
66
	CMAKE_BUILD_TYPE=$(usex debug Debug ${CMAKE_BUILD_TYPE})
67

  
68
	local mycmakeargs=(
69
		-DBUILD_ALCC=YES
70
		-DBUILD_ED2K=YES
71
		-DBUILD_ALC="$(usex gui)"
72
		-DBUILD_AMULECMD="$(usex remote)"
73
		-DBUILD_DAEMON="$(usex daemon)"
74
		-DBUILD_CAS="$(usex stats)"
75
		-DBUILD_MONOLITHIC="$(usex gui)"
76
		-DBUILD_TESTING="$(usex test)"
77
		-DBUILD_WEBSERVER="$(usex remote)"
78
		-DENABLE_NLS="$(usex nls)"
79
		-DENABLE_UPNP="$(usex upnp)"
98 80
	)
99 81

  
100 82
	if use gui; then
101
		myconf+=(
102
			$(use_enable remote amule-gui)
103
			$(use_enable stats alc)
104
			$(use_enable stats wxcas)
83
		mycmakeargs+=(
84
			-DBUILD_REMOTEGUI="$(usex remote)"
85
			-DBUILD_WXCAS="$(usex stats)"
86
			-DENABLE_IP2COUNTRY="$(usex geoip)"
105 87
		)
106 88
	else
107
		myconf+=(
108
			--disable-monolithic
109
			--disable-amule-gui
110
			--disable-alc
111
			--disable-wxcas
89
		mycmakeargs+=(
90
			-DBUILD_REMOTEGUI=NO
91
			-DBUILD_WXCAS=NO
92
			-DENABLE_IP2COUNTRY=NO
112 93
		)
113 94
	fi
114 95

  
115
	econf "${myconf[@]}"
116
}
117

  
118
src_test() {
119
	emake check
96
	cmake_src_configure
120 97
}
121 98

  
122 99
src_install() {
123
	default
100
	cmake_src_install
124 101

  
125 102
	if use daemon; then
126 103
		newconfd "${FILESDIR}"/amuled.confd-r1 amuled
......
139 116
}
140 117

  
141 118
pkg_postinst() {
142
	if use daemon || use remote && ver_replacing -lt "2.3.2-r4"; then
143
		elog "Default user under which amuled and amuleweb daemons are started"
144
		elog "have been changed from p2p to amule. Default home directory have been"
145
		elog "changed as well."
146
		echo
147
		elog "If you want to preserve old download/share location, you can create"
148
		elog "symlink /var/lib/amule/.aMule pointing to the old location and adjust"
149
		elog "files ownership *or* restore AMULEUSER and AMULEHOME variables in"
150
		elog "/etc/conf.d/{amuled,amuleweb} to the old values."
119
	if use gui; then
120
		xdg_desktop_database_update
121
		xdg_icon_cache_update
151 122
	fi
152

  
153
	use gui && xdg_desktop_database_update
154 123
}
155 124

  
156 125
pkg_postrm() {
157
	use gui && xdg_desktop_database_update
126
	if use gui; then
127
		xdg_desktop_database_update
128
		xdg_icon_cache_update
129
	fi
158 130
}
Thank you!