amule: cleanup

This commit is contained in:
Peter Hoeg
2019-09-23 11:17:57 +08:00
parent 423eb16913
commit 76dc4b668b
2 changed files with 50 additions and 261 deletions
+50 -31
View File
@@ -2,28 +2,53 @@
, enableDaemon ? false # build amule daemon
, httpServer ? false # build web interface for the daemon
, client ? false # build amule remote gui
, fetchurl, stdenv, zlib, wxGTK, perl, cryptopp, libupnp, gettext, libpng ? null
, pkgconfig, makeWrapper, libX11 ? null }:
, fetchFromGitHub, fetchpatch, stdenv, lib, zlib, wxGTK, perl, cryptopp, libupnp, gettext, libpng ? null
, autoreconfHook, pkgconfig, makeWrapper, libX11 ? null }:
assert httpServer -> libpng != null;
assert client -> libX11 != null;
with stdenv;
mkDerivation rec {
name = "aMule-2.3.2";
stdenv.mkDerivation rec {
pname = "amule";
version = "2.3.2";
src = fetchurl {
url = "mirror://sourceforge/amule/${name}.tar.xz";
sha256 = "0a1rd33hjl30qyzgb5y8m7dxs38asci3kjnlvims1ky6r3yj0izn";
src = fetchFromGitHub {
owner = "amule-project";
repo = "amule";
rev = version;
sha256 = "010wxm6g9f92x6fympj501zbnjka32rzbx0sk3a2y4zpih5d2nsn";
};
buildInputs =
[ zlib wxGTK perl cryptopp libupnp gettext pkgconfig makeWrapper ]
++ lib.optional httpServer libpng
++ lib.optional client libX11;
patches = [
(fetchpatch {
url = "https://patch-diff.githubusercontent.com/raw/amule-project/amule/pull/135.patch";
sha256 = "1n24r1j28083b8ipbnh1nf6i4j6vx59pdkfl1c0g6bb4psx9wvvi";
name = "libupnp_18.patch";
})
];
# See: https://github.com/amule-project/amule/issues/126
patches = [ ./upnp-1.8.patch ];
postPatch = ''
substituteInPlace src/libs/ec/file_generator.pl \
--replace /usr/bin/perl ${perl}/bin/perl
# autotools expects these to be in the root
cp docs/{AUTHORS,README} .
cp docs/Changelog ./ChangeLog
cp docs/Changelog ./NEWS
'';
preAutoreconf = ''
pushd src/pixmaps/flags_xpm >/dev/null
./makeflags.sh
popd >/dev/null
'';
nativeBuildInputs = [ autoreconfHook gettext makeWrapper pkgconfig ];
buildInputs = [
zlib wxGTK perl cryptopp libupnp
] ++ lib.optional httpServer libpng
++ lib.optional client libX11;
enableParallelBuilding = true;
@@ -31,27 +56,21 @@ mkDerivation rec {
"--with-crypto-prefix=${cryptopp}"
"--disable-debug"
"--enable-optimize"
(stdenv.lib.enableFeature monolithic "monolithic")
(stdenv.lib.enableFeature enableDaemon "amule-daemon")
(stdenv.lib.enableFeature client "amule-gui")
(stdenv.lib.enableFeature httpServer "webserver")
(lib.enableFeature monolithic "monolithic")
(lib.enableFeature enableDaemon "amule-daemon")
(lib.enableFeature client "amule-gui")
(lib.enableFeature httpServer "webserver")
];
postConfigure = ''
sed -i "src/libs/ec/file_generator.pl" \
-es'|/usr/bin/perl|${perl}/bin/perl|g'
'';
# aMule will try to `dlopen' libupnp and libixml, so help it
# find them.
postInstall = lib.optionalString monolithic ''
wrapProgram "$out/bin/amule" --prefix LD_LIBRARY_PATH ":" "${libupnp}/lib"
wrapProgram $out/bin/amule \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libupnp ]}
'';
meta = {
homepage = http://amule.org/;
meta = with lib; {
description = "Peer-to-peer client for the eD2K and Kademlia networks";
longDescription = ''
aMule is an eMule-like client for the eD2k and Kademlia
networks, supporting multiple platforms. Currently aMule
@@ -63,9 +82,9 @@ mkDerivation rec {
applications.
'';
license = stdenv.lib.licenses.gpl2Plus;
platforms = stdenv.lib.platforms.gnu ++ stdenv.lib.platforms.linux; # arbitrary choice
maintainers = [ stdenv.lib.maintainers.phreedom ];
homepage = "https://amule.org/";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ phreedom ];
platforms = platforms.unix;
};
}