1 |
|
# Copyright 1999-2022 Gentoo Authors
|
|
1 |
# Copyright 1999-2023 Gentoo Authors
|
2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
4 |
EAPI="7"
|
5 |
5 |
|
6 |
|
inherit autotools desktop flag-o-matic systemd toolchain-funcs
|
|
6 |
inherit autotools flag-o-matic systemd toolchain-funcs
|
7 |
7 |
|
8 |
8 |
DESCRIPTION="Multi-network P2P application written in Ocaml, with Gtk, web & telnet interface"
|
9 |
9 |
HOMEPAGE="http://mldonkey.sourceforge.net/ https://github.com/ygrek/mldonkey"
|
... | ... | |
13 |
13 |
SLOT="0"
|
14 |
14 |
KEYWORDS="~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~x86"
|
15 |
15 |
|
16 |
|
IUSE="bittorrent doc fasttrack gd gnutella gtk guionly magic +ocamlopt upnp"
|
17 |
|
|
18 |
|
REQUIRED_USE="guionly? ( gtk )"
|
|
16 |
IUSE="bittorrent doc fasttrack gd gnutella magic +ocamlopt upnp"
|
19 |
17 |
|
20 |
18 |
RDEPEND="dev-lang/perl
|
21 |
19 |
dev-ml/camlp4:=
|
22 |
20 |
gd? ( media-libs/gd:2=[truetype] )
|
23 |
|
gtk? (
|
24 |
|
dev-libs/glib:2
|
25 |
|
dev-ml/lablgtk:2=[svg]
|
26 |
|
gnome-base/librsvg:2
|
27 |
|
media-libs/libpng:=
|
28 |
|
x11-libs/gdk-pixbuf:2
|
29 |
|
x11-libs/gtk+:2
|
30 |
|
x11-libs/libX11
|
31 |
|
x11-libs/pango
|
32 |
|
)
|
33 |
|
guionly? (
|
34 |
|
dev-libs/glib:2
|
35 |
|
dev-ml/lablgtk:2=[svg]
|
36 |
|
gnome-base/librsvg:2
|
37 |
|
media-libs/libpng:=
|
38 |
|
x11-libs/gdk-pixbuf:2
|
39 |
|
x11-libs/gtk+:2
|
40 |
|
x11-libs/libX11
|
41 |
|
x11-libs/pango
|
42 |
|
)
|
43 |
21 |
magic? ( sys-apps/file )
|
44 |
22 |
upnp? (
|
45 |
23 |
net-libs/libnatpmp
|
46 |
24 |
net-libs/miniupnpc:=
|
47 |
25 |
)
|
48 |
|
!guionly? ( acct-user/p2p )
|
|
26 |
acct-user/p2p
|
49 |
27 |
app-arch/bzip2
|
50 |
28 |
sys-libs/zlib
|
51 |
29 |
"
|
... | ... | |
68 |
46 |
S="${WORKDIR}/${P}-2"
|
69 |
47 |
|
70 |
48 |
pkg_setup() {
|
71 |
|
if use gtk; then
|
72 |
|
echo ""
|
73 |
|
einfo "If the compile with gui fails, and you have updated Ocaml"
|
74 |
|
einfo "recently, you may have forgotten that you need to run"
|
75 |
|
einfo "/usr/portage/dev-lang/ocaml/files/ocaml-rebuild.sh"
|
76 |
|
einfo "to learn which ebuilds you need to recompile"
|
77 |
|
einfo "each time you update Ocaml to a different version"
|
78 |
|
einfo "see the Ocaml ebuild for details"
|
79 |
|
echo ""
|
80 |
|
fi
|
81 |
|
|
82 |
49 |
# dev-lang/ocaml creates its own objects but calls gcc for linking, which will
|
83 |
50 |
# results in relocations if gcc wants to create a PIE executable
|
84 |
51 |
if gcc-specs-pie ; then
|
... | ... | |
103 |
70 |
src_configure() {
|
104 |
71 |
local myconf=()
|
105 |
72 |
|
106 |
|
if use gtk; then
|
107 |
|
myconf+=( --enable-gui=newgui2 )
|
108 |
|
else
|
109 |
|
myconf+=( --disable-gui )
|
110 |
|
fi
|
111 |
|
|
112 |
|
if use guionly; then
|
113 |
|
myconf+=( --disable-multinet --disable-donkey )
|
114 |
|
fi
|
115 |
|
|
116 |
73 |
local my_extra_libs
|
117 |
74 |
if use gd; then
|
118 |
75 |
my_extra_libs="-lpng"
|
... | ... | |
132 |
89 |
$(use_enable magic) \
|
133 |
90 |
$(use_enable upnp upnp-natpmp) \
|
134 |
91 |
--disable-force-upnp-natpmp \
|
|
92 |
--disable-gui
|
135 |
93 |
${myconf[@]}
|
136 |
94 |
}
|
137 |
95 |
|
138 |
96 |
src_compile() {
|
139 |
97 |
export OCAMLRUNPARAM="l=256M"
|
140 |
98 |
emake -j1 # Upstream bug #48
|
141 |
|
|
142 |
|
if ! use guionly; then
|
143 |
|
emake utils
|
144 |
|
fi
|
|
99 |
emake utils
|
145 |
100 |
}
|
146 |
101 |
|
147 |
102 |
src_install() {
|
148 |
103 |
local myext i
|
149 |
104 |
use ocamlopt || myext=".byte"
|
150 |
|
if ! use guionly; then
|
151 |
|
for i in mlnet mld_hash get_range copysources subconv; do
|
152 |
|
newbin "${i}${myext}" "${i}"
|
153 |
|
done
|
154 |
|
use bittorrent && newbin "make_torrent${myext}" make_torrent
|
155 |
|
|
156 |
|
systemd_dounit "${FILESDIR}/${PN}.service"
|
157 |
|
newconfd "${FILESDIR}/mldonkey.confd" mldonkey
|
158 |
|
newinitd "${FILESDIR}/mldonkey.initd" mldonkey
|
159 |
|
fi
|
160 |
|
|
161 |
|
if use gtk; then
|
162 |
|
for i in mlgui mlguistarter; do
|
163 |
|
newbin "${i}${myext}" "${i}"
|
164 |
|
done
|
165 |
|
make_desktop_entry mlgui "MLDonkey GUI" mldonkey "Network;P2P"
|
166 |
|
newicon "${S}"/packages/rpm/mldonkey-icon-48.png "${PN}.png"
|
167 |
|
fi
|
|
105 |
for i in mlnet mld_hash get_range copysources subconv; do
|
|
106 |
newbin "${i}${myext}" "${i}"
|
|
107 |
done
|
|
108 |
use bittorrent && newbin "make_torrent${myext}" make_torrent
|
|
109 |
|
|
110 |
systemd_dounit "${FILESDIR}/${PN}.service"
|
|
111 |
newconfd "${FILESDIR}/mldonkey.confd" mldonkey
|
|
112 |
newinitd "${FILESDIR}/mldonkey.initd" mldonkey
|
168 |
113 |
|
169 |
114 |
if use doc ; then
|
170 |
115 |
docompress -x "/usr/share/doc/${PF}/scripts" "/usr/share/doc/${PF}/html"
|