|
|
|
@ -1,7 +1,10 @@ |
|
|
|
|
{ stdenv, appimage-run, fetchurl, runtimeShell }: |
|
|
|
|
{ stdenv, appimageTools, autoPatchelfHook, desktop-file-utils |
|
|
|
|
, fetchurl, runtimeShell }: |
|
|
|
|
|
|
|
|
|
let |
|
|
|
|
version = "3.3.3"; |
|
|
|
|
pname = "standardnotes"; |
|
|
|
|
name = "${pname}-${version}"; |
|
|
|
|
|
|
|
|
|
plat = { |
|
|
|
|
i386-linux = "-i386"; |
|
|
|
@ -12,27 +15,33 @@ let |
|
|
|
|
i386-linux = "2ccdf23588b09d645811e562d4fd7e02ac0e367bf2b34e373d8470d48544036d"; |
|
|
|
|
x86_64-linux = "6366d0a37cbf2cf51008a666e40bada763dd1539173de01e093bcbe4146a6bd8"; |
|
|
|
|
}.${stdenv.hostPlatform.system}; |
|
|
|
|
in |
|
|
|
|
|
|
|
|
|
stdenv.mkDerivation { |
|
|
|
|
pname = "standardnotes"; |
|
|
|
|
inherit version; |
|
|
|
|
|
|
|
|
|
src = fetchurl { |
|
|
|
|
url = "https://github.com/standardnotes/desktop/releases/download/v${version}/standard-notes-${version}${plat}.AppImage"; |
|
|
|
|
inherit sha256; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
buildInputs = [ appimage-run ]; |
|
|
|
|
appimageContents = appimageTools.extract { |
|
|
|
|
inherit name src; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
nativeBuildInputs = [ autoPatchelfHook desktop-file-utils ]; |
|
|
|
|
|
|
|
|
|
in appimageTools.wrapType2 rec { |
|
|
|
|
inherit name src; |
|
|
|
|
|
|
|
|
|
extraInstallCommands = '' |
|
|
|
|
# directory in /nix/store so readonly |
|
|
|
|
cp -r ${appimageContents}/* $out |
|
|
|
|
cd $out |
|
|
|
|
chmod -R +w $out |
|
|
|
|
mv $out/bin/${name} $out/bin/${pname} |
|
|
|
|
|
|
|
|
|
dontUnpack = true; |
|
|
|
|
# fixup and install desktop file |
|
|
|
|
${desktop-file-utils}/bin/desktop-file-install --dir $out/share/applications \ |
|
|
|
|
--set-key Exec --set-value ${pname} standard-notes.desktop |
|
|
|
|
|
|
|
|
|
installPhase = '' |
|
|
|
|
mkdir -p $out/{bin,share} |
|
|
|
|
cp $src $out/share/standardNotes.AppImage |
|
|
|
|
echo "#!${runtimeShell}" > $out/bin/standardnotes |
|
|
|
|
echo "${appimage-run}/bin/appimage-run $out/share/standardNotes.AppImage" >> $out/bin/standardnotes |
|
|
|
|
chmod +x $out/bin/standardnotes $out/share/standardNotes.AppImage |
|
|
|
|
rm usr/lib/* AppRun standard-notes.desktop .so* |
|
|
|
|
''; |
|
|
|
|
|
|
|
|
|
meta = with stdenv.lib; { |
|
|
|
|