summary refs log tree commit diff
path: root/pkgs/tools/networking/p2p/amule/default.nix
blob: eafa51fb4f25d78058cddea0df2b93bd04a86513 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{ monolithic ? true # build monolithic amule
, daemon ? 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 }:

assert httpServer -> libpng != null;
with stdenv;
let
  # Enable/Disable Feature
  edf = enabled: flag: if enabled then "--enable-" + flag else "--disable-" + flag;
in 
mkDerivation rec {
  name = "aMule-2.2.6";

  src = fetchurl {
    url = "mirror://sourceforge/amule/${name}.tar.bz2";
    sha256 = "08l1931hcg1ia8yvhgx70hx64mknjnfn6l78m0ja44w13mgjpqvc";
  };

  buildInputs =
    [ zlib wxGTK perl cryptopp libupnp gettext pkgconfig makeWrapper ]
    ++ lib.optional httpServer libpng;

  configureFlags = ''
    --with-crypto-prefix=${cryptopp}
    --disable-debug
    --enable-optimize
    ${edf monolithic "monolithic"}
    ${edf daemon "amule-daemon"}
    ${edf client "amule-gui"}
    ${edf 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"
  '';

  meta = {
    homepage = http://amule.org/;
    description = "aMule, a 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
      (officially) supports a wide variety of platforms and operating
      systems, being compatible with more than 60 different
      hardware+OS configurations.  aMule is entirely free, its
      sourcecode released under the GPL just like eMule, and includes
      no adware or spyware as is often found in proprietary P2P
      applications.
    '';

    license = "GPLv2+";

    platforms = stdenv.lib.platforms.gnu;  # arbitrary choice
    maintainers = [ stdenv.lib.maintainers.ludo stdenv.lib.maintainers.phreedom ];
  };
}