summary refs log tree commit diff
diff options
context:
space:
mode:
authorEvgeny Egorochkin2010-06-19 02:19:39 +0000
committerEvgeny Egorochkin2010-06-19 02:19:39 +0000
commit4719a2ed3cfe2eada459b251554fdc3a4d5ea574 (patch)
treece0959836d22be9cc49bcc5e2b40a8692cf6ab4c
parent0f7761548307142dcf49561c5f0a7025314588dc (diff)
Added flags to compile amule daemon and remote gui backups/multitask-builds@34175
svn path=/nixpkgs/trunk/; revision=22334
-rw-r--r--pkgs/tools/networking/p2p/amule/default.nix34
-rw-r--r--pkgs/top-level/all-packages.nix2
2 files changed, 27 insertions, 9 deletions
diff --git a/pkgs/tools/networking/p2p/amule/default.nix b/pkgs/tools/networking/p2p/amule/default.nix
index 68bf5baa3332..eafa51fb4f25 100644
--- a/pkgs/tools/networking/p2p/amule/default.nix
+++ b/pkgs/tools/networking/p2p/amule/default.nix
@@ -1,7 +1,17 @@
-{ fetchurl, stdenv, zlib, wxGTK, perl, cryptopp, libupnp, gettext
+{ 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 }:
 
-stdenv.mkDerivation rec {
+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 {
@@ -10,9 +20,18 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs =
-    [ zlib wxGTK perl cryptopp libupnp gettext pkgconfig makeWrapper ];
+    [ zlib wxGTK perl cryptopp libupnp gettext pkgconfig makeWrapper ]
+    ++ lib.optional httpServer libpng;
 
-  configureFlags = "--with-crypto-prefix=${cryptopp}";
+  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"     \
@@ -21,9 +40,8 @@ stdenv.mkDerivation rec {
 
   # aMule will try to `dlopen' libupnp and libixml, so help it
   # find them.
-  postInstall = ''
-    wrapProgram "$out/bin/amule" \
-      --prefix LD_LIBRARY_PATH ":" "${libupnp}/lib"
+  postInstall = lib.optionalString monolithic ''
+    wrapProgram "$out/bin/amule" --prefix LD_LIBRARY_PATH ":" "${libupnp}/lib"
   '';
 
   meta = {
@@ -44,6 +62,6 @@ stdenv.mkDerivation rec {
     license = "GPLv2+";
 
     platforms = stdenv.lib.platforms.gnu;  # arbitrary choice
-    maintainers = [ stdenv.lib.maintainers.ludo ];
+    maintainers = [ stdenv.lib.maintainers.ludo stdenv.lib.maintainers.phreedom ];
   };
 }
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 9b9d2c82fa60..42f434b8abe4 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -375,7 +375,7 @@ let
 
   amule = import ../tools/networking/p2p/amule {
     inherit fetchurl stdenv zlib perl cryptopp gettext libupnp makeWrapper
-      wxGTK pkgconfig;
+      wxGTK pkgconfig libpng;
   };
 
   aria = builderDefsPackage (import ../tools/networking/aria) {