mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-26 07:34:11 +00:00
dadc7eb329
Whenever we create scripts that are installed to $out, we must use runtimeShell in order to get the shell that can be executed on the machine we create the package for. This is relevant for cross-compiling. The only use case for stdenv.shell are scripts that are executed as part of the build system. Usages in checkPhase are borderline however to decrease the likelyhood of people copying the wrong examples, I decided to use runtimeShell as well.
49 lines
1.4 KiB
Nix
49 lines
1.4 KiB
Nix
{ stdenv, appimage-run, fetchurl, runtimeShell }:
|
|
|
|
let
|
|
version = "3.0.6";
|
|
|
|
plat = {
|
|
"i386-linux" = "i386";
|
|
"x86_64-linux" = "x86_64";
|
|
}.${stdenv.hostPlatform.system};
|
|
|
|
sha256 = {
|
|
"i386-linux" = "0czhlbacjks9x8y2w46nzlvk595psqhqw0vl0bvsq7sz768dk0ni";
|
|
"x86_64-linux" = "0haji9h8rrm9yvqdv6i2y6xdd0yhsssjjj83hmf6cb868lwyigsf";
|
|
}.${stdenv.hostPlatform.system};
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
name = "standardnotes-${version}";
|
|
|
|
src = fetchurl {
|
|
url = "https://github.com/standardnotes/desktop/releases/download/v${version}/standard-notes-${version}-${plat}.AppImage";
|
|
inherit sha256;
|
|
};
|
|
|
|
buildInputs = [ appimage-run ];
|
|
|
|
unpackPhase = ":";
|
|
|
|
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
|
|
'';
|
|
|
|
meta = with stdenv.lib; {
|
|
description = "A simple and private notes app";
|
|
longDescription = ''
|
|
Standard Notes is a private notes app that features unmatched simplicity,
|
|
end-to-end encryption, powerful extensions, and open-source applications.
|
|
'';
|
|
homepage = https://standardnotes.org;
|
|
license = licenses.agpl3;
|
|
maintainers = with maintainers; [ mgregoire ];
|
|
platforms = [ "i386-linux" "x86_64-linux" ];
|
|
};
|
|
}
|