[Nix-dev] [patch] Amule improvements

Evgeny Egorochkin phreedom.stdin at gmail.com
Tue Jun 15 15:09:13 CEST 2010


Hi

This nixpkgs patch lets you compile Amule daemon and remote GUIs instead of 
monolithic Amule. I don't yet have a nixos module for the daemon ready because 
it's not very *nixy but it's nevertheless already useful if you want to 
control a daemon running on another machine.

-- 
Evgeny
-------------- next part --------------
diff --git a/pkgs/tools/networking/p2p/amule/default.nix b/pkgs/tools/networking/p2p/amule/default.nix
index 68bf5ba..d70041f 100644
--- a/pkgs/tools/networking/p2p/amule/default.nix
+++ b/pkgs/tools/networking/p2p/amule/default.nix
@@ -1,6 +1,12 @@
-{ 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 }:
 
+assert httpServer -> libpng != null;
+
 stdenv.mkDerivation rec {
   name = "aMule-2.2.6";
 
@@ -10,9 +16,16 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs =
-    [ zlib wxGTK perl cryptopp libupnp gettext pkgconfig makeWrapper ];
-
-  configureFlags = "--with-crypto-prefix=${cryptopp}";
+    [ zlib wxGTK perl cryptopp libupnp gettext pkgconfig makeWrapper ]
+    ++ stdenv.lib.optional httpServer libpng;
+
+  configureFlags = ''
+    --with-crypto-prefix=${cryptopp}
+    ${if monolithic then "--enable-monolithic" else "--disable-monolithic"}
+    ${if daemon then "--enable-amule-daemon" else "--disable-amule-daemon"}
+    ${if client then "--enable-amule-gui" else "--disable-amule-gui"}
+    ${if httpServer then "--enable-webserver" else "--disable-webserver"}
+  '';
 
   postConfigure = ''
     sed -i "src/libs/ec/file_generator.pl"     \
@@ -22,8 +35,7 @@ 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"
+    ${if monolithic then "wrapProgram \"$out/bin/amule\" --prefix LD_LIBRARY_PATH \":\" \"${libupnp}/lib\"" else ""}
   '';
 
   meta = {
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 4a046c8..2d52651 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -365,7 +365,11 @@ let
 
   amule = import ../tools/networking/p2p/amule {
     inherit fetchurl stdenv zlib perl cryptopp gettext libupnp makeWrapper
-      wxGTK pkgconfig;
+      wxGTK pkgconfig libpng;
+    monolithic = getConfig ["amule" "monolithic"] true;
+    daemon = getConfig ["amule" "daemon"] false;
+    httpServer = getConfig ["amule" "httpServer"] false;
+    client = getConfig ["amule" "client"] false;
   };
 
   aria = builderDefsPackage (import ../tools/networking/aria) {


More information about the nix-dev mailing list