1 { monolithic ? true # build monolithic amule
2 , enableDaemon ? false # build amule daemon
3 , httpServer ? false # build web interface for the daemon
4 , client ? false # build amule remote gui
15 , boost # Not using boost leads to crashes with gtk3
23 # daemon and client are not build monolithic
24 assert monolithic || (!monolithic && (enableDaemon || client || httpServer));
26 stdenv.mkDerivation rec {
28 + lib.optionalString httpServer "-web"
29 + lib.optionalString enableDaemon "-daemon"
30 + lib.optionalString client "-gui";
33 src = fetchFromGitHub {
34 owner = "amule-project";
37 sha256 = "1nm4vxgmisn1b6l3drmz0q04x067j2i8lw5rnf0acaapwlp8qwvi";
42 url = "https://sources.debian.org/data/main/a/amule/1%3A2.3.3-3/debian/patches/wx3.2.patch";
43 hash = "sha256-OX5Ef80bL+dQqHo2OBLZvzMUrU6aOHfsF7AtoE1r7rs=";
47 nativeBuildInputs = [ cmake gettext makeWrapper pkg-config ];
56 ] ++ lib.optional httpServer libpng
57 ++ lib.optional client libX11;
60 "-DBUILD_MONOLITHIC=${if monolithic then "ON" else "OFF"}"
61 "-DBUILD_DAEMON=${if enableDaemon then "ON" else "OFF"}"
62 "-DBUILD_REMOTEGUI=${if client then "ON" else "OFF"}"
63 "-DBUILD_WEBSERVER=${if httpServer then "ON" else "OFF"}"
64 # building only the daemon fails when these are not set... this is
65 # due to mistakes in the Amule cmake code, but it does not cause
66 # extra code to be built...
73 echo "find_package(Threads)" >> cmake/options.cmake
76 # aMule will try to `dlopen' libupnp and libixml, so help it
78 postInstall = lib.optionalString monolithic ''
79 wrapProgram $out/bin/amule \
80 --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libupnp ]}
84 description = "Peer-to-peer client for the eD2K and Kademlia networks";
86 aMule is an eMule-like client for the eD2k and Kademlia
87 networks, supporting multiple platforms. Currently aMule
88 (officially) supports a wide variety of platforms and operating
89 systems, being compatible with more than 60 different
90 hardware+OS configurations. aMule is entirely free, its
91 sourcecode released under the GPL just like eMule, and includes
92 no adware or spyware as is often found in proprietary P2P
96 homepage = "https://github.com/amule-project/amule";
97 license = licenses.gpl2Plus;
99 platforms = platforms.unix;
100 # Undefined symbols for architecture arm64: "_FSFindFolder"
101 broken = stdenv.hostPlatform.isDarwin;