2019-12-09 20:28:44 +00:00
|
|
|
{ stdenv, lib, fetchzip, mkDerivation
|
2020-03-04 17:22:38 +00:00
|
|
|
, appimageTools
|
2019-10-03 03:38:23 +01:00
|
|
|
, autoPatchelfHook
|
|
|
|
, desktop-file-utils
|
2019-12-09 20:28:44 +00:00
|
|
|
, imagemagick
|
2019-10-03 03:38:23 +01:00
|
|
|
, qtmultimedia
|
2018-03-05 14:13:15 +00:00
|
|
|
}:
|
|
|
|
|
2019-10-03 03:38:23 +01:00
|
|
|
mkDerivation rec {
|
|
|
|
pname = "soulseekqt";
|
2018-08-04 16:24:52 +01:00
|
|
|
version = "2018-1-30";
|
2020-03-04 17:22:38 +00:00
|
|
|
name="${pname}-${version}";
|
2018-03-05 14:13:15 +00:00
|
|
|
|
2019-12-09 20:28:44 +00:00
|
|
|
src = fetchzip {
|
|
|
|
url = "https://www.slsknet.org/SoulseekQt/Linux/SoulseekQt-${version}-64bit-appimage.tgz";
|
|
|
|
sha256 = "16ncnvv8h33f161mgy7qc0wjvvqahsbwvby65qhgfh9pbbgb4xgg";
|
2020-03-04 17:22:38 +00:00
|
|
|
};
|
2018-03-05 14:13:15 +00:00
|
|
|
|
2020-03-04 17:22:38 +00:00
|
|
|
appextracted = appimageTools.extractType2 {
|
|
|
|
inherit name;
|
|
|
|
src="${src}/SoulseekQt-2018-1-30-64bit.AppImage";
|
|
|
|
};
|
2018-08-04 16:24:52 +01:00
|
|
|
|
2020-03-04 17:22:38 +00:00
|
|
|
dontBuild = true;
|
|
|
|
dontConfigure = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ imagemagick autoPatchelfHook desktop-file-utils ];
|
2019-10-03 03:38:23 +01:00
|
|
|
buildInputs = [ qtmultimedia stdenv.cc.cc ];
|
2018-08-04 16:24:52 +01:00
|
|
|
|
2018-03-05 14:13:15 +00:00
|
|
|
installPhase = ''
|
2020-03-04 17:22:38 +00:00
|
|
|
# directory in /nix/store so readonly
|
|
|
|
cd $appextracted
|
2019-12-09 20:28:44 +00:00
|
|
|
|
|
|
|
binary="$(readlink AppRun)"
|
|
|
|
install -Dm755 $binary -t $out/bin
|
|
|
|
|
|
|
|
# fixup and install desktop file
|
|
|
|
desktop-file-install --dir $out/share/applications \
|
|
|
|
--set-key Exec --set-value $binary \
|
|
|
|
--set-key Comment --set-value "${meta.description}" \
|
2020-03-04 17:22:38 +00:00
|
|
|
--set-key Categories --set-value Network default.desktop
|
|
|
|
mv $out/share/applications/default.desktop $out/share/applications/SoulseekQt.desktop
|
2019-12-09 20:28:44 +00:00
|
|
|
|
|
|
|
#TODO: write generic code to read icon path from $binary.desktop
|
2020-03-04 17:22:38 +00:00
|
|
|
icon="$(readlink .DirIcon)"
|
2019-12-09 20:28:44 +00:00
|
|
|
for size in 16 32 48 64 72 96 128 192 256 512 1024; do
|
|
|
|
mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps
|
2020-03-04 17:22:38 +00:00
|
|
|
convert -resize "$size"x"$size" $icon $out/share/icons/hicolor/"$size"x"$size"/apps/$icon
|
2019-12-09 20:28:44 +00:00
|
|
|
done
|
|
|
|
'';
|
2018-03-05 14:13:15 +00:00
|
|
|
|
2019-10-03 03:38:23 +01:00
|
|
|
meta = with lib; {
|
2018-03-05 14:13:15 +00:00
|
|
|
description = "Official Qt SoulSeek client";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://www.slsknet.org";
|
2018-03-05 14:13:15 +00:00
|
|
|
license = licenses.unfree;
|
|
|
|
maintainers = [ maintainers.genesis ];
|
2018-08-04 16:24:52 +01:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2018-03-05 14:13:15 +00:00
|
|
|
};
|
|
|
|
}
|