soulseekqt : refactoring appimage manipulation to be more generic.
This commit is contained in:
parent
1258e6dd3a
commit
ae7cc3eb5c
@ -5,7 +5,7 @@
|
|||||||
, qtbase, qtmultimedia
|
, qtbase, qtmultimedia
|
||||||
, libjson, libgpgerror
|
, libjson, libgpgerror
|
||||||
, libX11, libxcb, libXau, libXdmcp, freetype, libbsd
|
, libX11, libxcb, libXau, libXdmcp, freetype, libbsd
|
||||||
, pythonPackages, squashfsTools, makeDesktopItem
|
, pythonPackages, squashfsTools, desktop_file_utils
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with stdenv.lib;
|
with stdenv.lib;
|
||||||
@ -23,16 +23,6 @@ let
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
desktopItem = makeDesktopItem {
|
|
||||||
name = "SoulseekQt";
|
|
||||||
exec = "soulseekqt";
|
|
||||||
icon = "$out/share/soulseekqt/";
|
|
||||||
comment = "Official Qt SoulSeek client";
|
|
||||||
desktopName = "SoulseekQt";
|
|
||||||
genericName = "SoulseekQt";
|
|
||||||
categories = "Network;";
|
|
||||||
};
|
|
||||||
|
|
||||||
in stdenv.mkDerivation rec {
|
in stdenv.mkDerivation rec {
|
||||||
|
|
||||||
name = "soulseekqt-${version}";
|
name = "soulseekqt-${version}";
|
||||||
@ -41,26 +31,36 @@ in stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
dontBuild = true;
|
dontBuild = true;
|
||||||
|
|
||||||
buildInputs = [ pythonPackages.binwalk squashfsTools ];
|
buildInputs = [ pythonPackages.binwalk squashfsTools desktop_file_utils ];
|
||||||
|
|
||||||
# avoid usage of appimagetool
|
# avoid usage of appimage's runner option --appimage-extract
|
||||||
unpackCmd = ''
|
unpackCmd = ''
|
||||||
export HOME=$(pwd) # workaround for binwalk
|
export HOME=$(pwd) # workaround for binwalk
|
||||||
tar xvf $curSrc && binwalk --quiet \
|
appimage=$(tar xvf $curSrc) && binwalk --quiet \
|
||||||
${mainbin}.AppImage -D 'squashfs:.squashfs:unsquashfs %e'
|
$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
|
||||||
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out/{bin,share/soulseekqt}
|
mkdir -p $out/{bin,share/applications,share/icons/}
|
||||||
cd squashfs-root/
|
cp default.desktop $out/share/applications/$binary.desktop
|
||||||
cp -R soulseek.png translations $out/share/soulseekqt
|
cp soulseek.png $out/share/icons/
|
||||||
cp SoulseekQt $out/bin/soulseekqt
|
cp $binary $out/bin/
|
||||||
'';
|
'';
|
||||||
|
|
||||||
fixupPhase = ''
|
fixupPhase = ''
|
||||||
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
||||||
--set-rpath ${libPath} \
|
--set-rpath ${libPath} \
|
||||||
$out/bin/soulseekqt
|
$out/bin/$binary
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user