nixpkgs/pkgs/applications/networking/p2p/soulseekqt/default.nix

62 lines
1.7 KiB
Nix
Raw Normal View History

{ stdenv, lib, fetchurl, mkDerivation
, autoPatchelfHook
2018-03-05 14:13:15 +00:00
, dbus
, desktop-file-utils
, fontconfig
, libjson
, pythonPackages
, qtmultimedia
, squashfsTools
, zlib
2018-03-05 14:13:15 +00:00
}:
mkDerivation rec {
pname = "soulseekqt";
version = "2018-1-30";
2018-03-05 14:13:15 +00:00
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";
2018-03-05 14:13:15 +00:00
};
dontBuild = true;
nativeBuildInputs = [ autoPatchelfHook pythonPackages.binwalk squashfsTools desktop-file-utils ];
buildInputs = [ qtmultimedia stdenv.cc.cc ];
# 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
'';
2018-03-05 14:13:15 +00:00
installPhase = ''
mkdir -p $out/{bin,share/applications,share/icons/}
cp default.desktop $out/share/applications/$binary.desktop
cp soulseek.png $out/share/icons/
cp $binary $out/bin/
2018-03-05 14:13:15 +00:00
'';
meta = with lib; {
2018-03-05 14:13:15 +00:00
description = "Official Qt SoulSeek client";
homepage = http://www.soulseekqt.net;
license = licenses.unfree;
maintainers = [ maintainers.genesis ];
platforms = [ "x86_64-linux" ];
2018-03-05 14:13:15 +00:00
};
}