nixpkgs/pkgs/applications/misc/simplenote/default.nix

98 lines
2 KiB
Nix
Raw Normal View History

2019-11-28 10:46:33 +00:00
{ atomEnv
, autoPatchelfHook
, dpkg
, fetchurl
, makeDesktopItem
, makeWrapper
, lib
2019-11-28 10:46:33 +00:00
, stdenv
, udev
, wrapGAppsHook
}:
2019-09-22 21:02:48 +00:00
let
inherit (stdenv.hostPlatform) system;
2019-11-28 10:46:33 +00:00
throwSystem = throw "Unsupported system: ${system}";
2019-09-22 21:02:48 +00:00
pname = "simplenote";
2021-04-11 15:50:12 +00:00
version = "2.9.0";
2019-09-22 21:02:48 +00:00
sha256 = {
2021-04-11 15:50:12 +00:00
x86_64-linux = "sha256-uwd9fYqZepJ/BBttprqkJhswqMepGsHDTd5Md9gjI68=";
2019-11-28 10:46:33 +00:00
}.${system} or throwSystem;
meta = with lib; {
description = "The simplest way to keep notes";
2019-09-22 21:02:48 +00:00
homepage = "https://github.com/Automattic/simplenote-electron";
license = licenses.gpl2;
2019-11-28 10:46:33 +00:00
maintainers = with maintainers; [
kiwi
];
platforms = [
"x86_64-linux"
];
};
2019-09-22 21:02:48 +00:00
linux = stdenv.mkDerivation rec {
inherit pname version meta;
src = fetchurl {
url =
"https://github.com/Automattic/simplenote-electron/releases/download/"
+ "v${version}/Simplenote-linux-${version}-amd64.deb";
inherit sha256;
};
desktopItem = makeDesktopItem {
2019-11-28 10:46:33 +00:00
categories = "Development";
2019-09-22 21:02:48 +00:00
comment = "Simplenote for Linux";
2019-11-28 10:46:33 +00:00
desktopName = "Simplenote";
2019-09-22 21:02:48 +00:00
exec = "simplenote %U";
icon = "simplenote";
2019-11-28 10:46:33 +00:00
name = "simplenote";
2019-09-22 21:02:48 +00:00
startupNotify = "true";
2019-11-28 10:46:33 +00:00
type = "Application";
2019-09-22 21:02:48 +00:00
};
dontBuild = true;
dontConfigure = true;
dontPatchELF = true;
dontWrapGApps = true;
2019-11-28 10:46:33 +00:00
nativeBuildInputs = [
autoPatchelfHook
dpkg
makeWrapper
wrapGAppsHook
];
2019-09-22 21:02:48 +00:00
2019-11-28 10:46:33 +00:00
buildInputs = atomEnv.packages;
2019-09-22 21:02:48 +00:00
unpackPhase = "dpkg-deb -x $src .";
installPhase = ''
mkdir -p "$out/bin"
cp -R "opt" "$out"
cp -R "usr/share" "$out/share"
chmod -R g-w "$out"
mkdir -p "$out/share/applications"
cp "${desktopItem}/share/applications/"* "$out/share/applications"
'';
2019-11-28 10:46:33 +00:00
runtimeDependencies = [
(lib.getLib udev)
2019-11-28 10:46:33 +00:00
];
2019-09-22 21:02:48 +00:00
postFixup = ''
makeWrapper $out/opt/Simplenote/simplenote $out/bin/simplenote \
2021-01-15 05:42:41 +00:00
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ stdenv.cc.cc ] }" \
2019-11-28 10:46:33 +00:00
"''${gappsWrapperArgs[@]}"
2019-09-22 21:02:48 +00:00
'';
};
in
2019-11-28 10:46:33 +00:00
linux