2019-12-09 20:28:44 +00:00
|
|
|
{ stdenv, lib, fetchzip, mkDerivation
|
2019-10-03 03:38:23 +01:00
|
|
|
, autoPatchelfHook
|
2018-03-05 14:13:15 +00:00
|
|
|
, dbus
|
2019-10-03 03:38:23 +01:00
|
|
|
, desktop-file-utils
|
|
|
|
, fontconfig
|
2019-12-09 20:28:44 +00:00
|
|
|
, imagemagick
|
2019-10-03 03:38:23 +01:00
|
|
|
, libjson
|
|
|
|
, qtmultimedia
|
2019-12-09 20:28:44 +00:00
|
|
|
, radare2
|
|
|
|
, jq
|
2019-10-03 03:38:23 +01:00
|
|
|
, squashfsTools
|
|
|
|
, zlib
|
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";
|
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";
|
2018-03-05 14:13:15 +00:00
|
|
|
};
|
|
|
|
|
2018-08-04 16:24:52 +01:00
|
|
|
dontBuild = true;
|
|
|
|
|
2019-12-09 20:28:44 +00:00
|
|
|
nativeBuildInputs = [ imagemagick radare2 jq autoPatchelfHook squashfsTools
|
|
|
|
desktop-file-utils ];
|
2019-10-03 03:38:23 +01:00
|
|
|
buildInputs = [ qtmultimedia stdenv.cc.cc ];
|
2018-08-04 16:24:52 +01:00
|
|
|
|
2019-10-03 03:38:23 +01:00
|
|
|
# avoid usage of appimage's runner option --appimage-extract
|
2019-12-09 20:28:44 +00:00
|
|
|
postUnpack = ''
|
|
|
|
cd $sourceRoot
|
2019-10-03 03:38:23 +01:00
|
|
|
|
2019-12-09 20:28:44 +00:00
|
|
|
# multiarch offset one-liner using same method as AppImage
|
|
|
|
offset=$(r2 *.AppImage -nn -Nqc "pfj.elf_header @ 0" |\
|
|
|
|
jq 'map({(.name): .value}) | add | .shoff + (.shnum * .shentsize)')
|
2019-10-03 03:38:23 +01:00
|
|
|
|
2019-12-09 20:28:44 +00:00
|
|
|
unsquashfs -o $offset *.AppImage
|
|
|
|
sourceRoot=squashfs-root
|
2018-08-05 12:05:23 +01:00
|
|
|
'';
|
2018-03-05 14:13:15 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2019-12-09 20:28:44 +00:00
|
|
|
|
|
|
|
binary="$(readlink AppRun)"
|
|
|
|
mv default.desktop $binary.desktop
|
|
|
|
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}" \
|
|
|
|
--set-key Categories --set-value Network $binary.desktop
|
|
|
|
|
|
|
|
#TODO: write generic code to read icon path from $binary.desktop
|
|
|
|
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
|
|
|
|
convert -resize "$size"x"$size" ./soulseek.png $out/share/icons/hicolor/"$size"x"$size"/apps/soulseek.png
|
|
|
|
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";
|
2019-12-09 20:28:44 +00: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
|
|
|
};
|
|
|
|
}
|