summary refs log tree commit diff
path: root/pkgs/applications/networking/p2p
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/networking/p2p')
-rw-r--r--pkgs/applications/networking/p2p/ktorrent/default.nix6
-rw-r--r--pkgs/applications/networking/p2p/soulseekqt/default.nix58
2 files changed, 26 insertions, 38 deletions
diff --git a/pkgs/applications/networking/p2p/ktorrent/default.nix b/pkgs/applications/networking/p2p/ktorrent/default.nix
index 535991312f1..e38378d09b3 100644
--- a/pkgs/applications/networking/p2p/ktorrent/default.nix
+++ b/pkgs/applications/networking/p2p/ktorrent/default.nix
@@ -1,11 +1,11 @@
-{ stdenv, fetchurl, fetchpatch, cmake
+{ mkDerivation, lib, fetchurl, fetchpatch, cmake
 , extra-cmake-modules, qtbase, qtscript
 , karchive, kcrash, kdnssd, ki18n, kio, knotifications, knotifyconfig
 , kdoctools, kross, kcmutils, kwindowsystem
 , libktorrent, taglib, libgcrypt, kplotting
 }:
 
-stdenv.mkDerivation rec {
+mkDerivation rec {
   pname = "ktorrent";
   version = "${libktorrent.mainVersion}";
 
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "KDE integrated BtTorrent client";
     homepage    = https://www.kde.org/applications/internet/ktorrent/;
     license = licenses.gpl2;
diff --git a/pkgs/applications/networking/p2p/soulseekqt/default.nix b/pkgs/applications/networking/p2p/soulseekqt/default.nix
index 704c439bb27..b52320c9681 100644
--- a/pkgs/applications/networking/p2p/soulseekqt/default.nix
+++ b/pkgs/applications/networking/p2p/soulseekqt/default.nix
@@ -1,53 +1,47 @@
-{ stdenv
-, fetchurl
+{ stdenv, lib, fetchurl, mkDerivation
+, autoPatchelfHook
 , dbus
-, zlib, fontconfig
-, qtbase, qtmultimedia
-, libjson, libgpgerror
-, libX11, libxcb, libXau, libXdmcp, freetype, libbsd
-, pythonPackages, squashfsTools, desktop-file-utils
+, desktop-file-utils
+, fontconfig
+, libjson
+, pythonPackages
+, qtmultimedia
+, squashfsTools
+, zlib
 }:
 
-with stdenv.lib;
-let
-  libPath = makeLibraryPath
-    [ stdenv.cc.cc qtbase qtmultimedia dbus libX11 zlib libX11 libxcb libXau libXdmcp freetype fontconfig libbsd libjson libgpgerror];
-
+mkDerivation rec {
+  pname = "soulseekqt";
   version = "2018-1-30";
 
-  mainbin = "SoulseekQt-" + (version) +"-"+ (if stdenv.is64bit then "64bit" else "32bit");
-  srcs = {
-    x86_64-linux = fetchurl {
-      url = "https://www.dropbox.com/s/0vi87eef3ooh7iy/${mainbin}.tgz";
+  src = fetchurl {
+      urls = [
+        "https://www.dropbox.com/s/0vi87eef3ooh7iy/SoulseekQt-${version}.tgz"
+        "https://www.slsknet.org/SoulseekQt/Linux/SoulseekQt-${version}-64bit-appimage.tgz"
+      ];
       sha256 = "0d1cayxr1a4j19bc5a3qp9pg22ggzmd55b6f5av3lc6lvwqqg4w6";
     };
-  };
-
-in stdenv.mkDerivation rec {
-
-  pname = "soulseekqt";
-  inherit version;
-  src = srcs.${stdenv.hostPlatform.system} or (throw "unsupported system: ${stdenv.hostPlatform.system}");
 
   dontBuild = true;
 
-  buildInputs = [ pythonPackages.binwalk squashfsTools desktop-file-utils ];
+  nativeBuildInputs = [ autoPatchelfHook pythonPackages.binwalk squashfsTools desktop-file-utils ];
+  buildInputs = [ qtmultimedia stdenv.cc.cc ];
 
-  # avoid usage of appimage's runner option --appimage-extract 
+  # avoid usage of appimage's runner option --appimage-extract
   unpackCmd = ''
     export HOME=$(pwd) # workaround for binwalk
     appimage=$(tar xvf $curSrc) && binwalk --quiet \
        $appimage -D 'squashfs:squashfs:unsquashfs %e'
     '';
-  
+
   patchPhase = ''
     cd squashfs-root/
     binary="$(readlink AppRun)"
-  
+
     # fixup desktop file
     desktop-file-edit --set-key Exec --set-value $binary default.desktop
     desktop-file-edit --set-key Comment --set-value "${meta.description}" default.desktop
-    desktop-file-edit --set-key Categories --set-value Network default.desktop   
+    desktop-file-edit --set-key Categories --set-value Network default.desktop
   '';
 
   installPhase = ''
@@ -57,13 +51,7 @@ in stdenv.mkDerivation rec {
     cp $binary $out/bin/
   '';
 
-  fixupPhase = ''
-    patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
-             --set-rpath ${libPath} \
-             $out/bin/$binary
-  '';
-
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Official Qt SoulSeek client";
     homepage = http://www.soulseekqt.net;
     license = licenses.unfree;