summary refs log tree commit diff
diff options
context:
space:
mode:
authorJuanpe BolĂ­var <juanpe@sinusoid.es>2022-09-04 14:39:18 +0200
committerGitHub <noreply@github.com>2022-09-04 14:39:18 +0200
commit8c35bc9e14c01f40890aff62178fb683f7a02d22 (patch)
tree78cde81946d2811dabe0e33ee2de78f43d772d4b
parenta5255451c5576d2a8b30bca8d8848e3a77f463d8 (diff)
downloadnixpkgs-8c35bc9e14c01f40890aff62178fb683f7a02d22.tar
nixpkgs-8c35bc9e14c01f40890aff62178fb683f7a02d22.tar.gz
nixpkgs-8c35bc9e14c01f40890aff62178fb683f7a02d22.tar.bz2
nixpkgs-8c35bc9e14c01f40890aff62178fb683f7a02d22.tar.lz
nixpkgs-8c35bc9e14c01f40890aff62178fb683f7a02d22.tar.xz
nixpkgs-8c35bc9e14c01f40890aff62178fb683f7a02d22.tar.zst
nixpkgs-8c35bc9e14c01f40890aff62178fb683f7a02d22.zip
amuled: add option to only build web, add top-level amule-web (#176775)
-rw-r--r--pkgs/tools/networking/p2p/amule/default.nix16
-rw-r--r--pkgs/top-level/all-packages.nix5
2 files changed, 18 insertions, 3 deletions
diff --git a/pkgs/tools/networking/p2p/amule/default.nix b/pkgs/tools/networking/p2p/amule/default.nix
index 9431da7cf46..7538bb94126 100644
--- a/pkgs/tools/networking/p2p/amule/default.nix
+++ b/pkgs/tools/networking/p2p/amule/default.nix
@@ -21,10 +21,11 @@
 }:
 
 # daemon and client are not build monolithic
-assert monolithic || (!monolithic && (enableDaemon || client));
+assert monolithic || (!monolithic && (enableDaemon || client || httpServer));
 
 stdenv.mkDerivation rec {
   pname = "amule"
+    + lib.optionalString httpServer "-web"
     + lib.optionalString enableDaemon "-daemon"
     + lib.optionalString client "-gui";
   version = "2.3.3";
@@ -53,8 +54,18 @@ stdenv.mkDerivation rec {
     "-DBUILD_DAEMON=${if enableDaemon then "ON" else "OFF"}"
     "-DBUILD_REMOTEGUI=${if client then "ON" else "OFF"}"
     "-DBUILD_WEBSERVER=${if httpServer then "ON" else "OFF"}"
+    # building only the daemon fails when these are not set... this is
+    # due to mistakes in the Amule cmake code, but it does not cause
+    # extra code to be built...
+    "-Dwx_NEED_GUI=ON"
+    "-Dwx_NEED_ADV=ON"
+    "-Dwx_NEED_NET=ON"
   ];
 
+  postPatch = ''
+    echo "find_package(Threads)" >> cmake/options.cmake
+  '';
+
   # aMule will try to `dlopen' libupnp and libixml, so help it
   # find them.
   postInstall = lib.optionalString monolithic ''
@@ -79,7 +90,6 @@ stdenv.mkDerivation rec {
     license = licenses.gpl2Plus;
     maintainers = with maintainers; [ ];
     platforms = platforms.unix;
-    # cmake fails: Cannot specify link libraries for target "wxWidgets::ADV" which is not built by this project.
-    broken = enableDaemon || stdenv.isDarwin;
+    broken = stdenv.isDarwin;
   };
 }
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 25f4acb9b6c..54bc4eb21a8 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -2211,6 +2211,11 @@ with pkgs;
     client = true;
   };
 
+  amule-web = amule.override {
+    monolithic = false;
+    httpServer = true;
+  };
+
   antennas = nodePackages.antennas;
 
   apg = callPackage ../tools/security/apg { };