2019-11-28 10:46:33 +00:00
|
|
|
{ atomEnv
|
|
|
|
, autoPatchelfHook
|
|
|
|
, dpkg
|
|
|
|
, fetchurl
|
|
|
|
, makeDesktopItem
|
|
|
|
, makeWrapper
|
|
|
|
, stdenv
|
|
|
|
, udev
|
|
|
|
, wrapGAppsHook
|
|
|
|
}:
|
2016-11-08 20:39:52 +00:00
|
|
|
|
2019-09-22 22:02:48 +01:00
|
|
|
let
|
|
|
|
inherit (stdenv.hostPlatform) system;
|
2016-11-08 20:39:52 +00:00
|
|
|
|
2019-11-28 10:46:33 +00:00
|
|
|
throwSystem = throw "Unsupported system: ${system}";
|
|
|
|
|
2019-09-22 22:02:48 +01:00
|
|
|
pname = "simplenote";
|
2016-11-08 20:39:52 +00:00
|
|
|
|
2020-05-07 03:21:42 +01:00
|
|
|
version = "1.16.0";
|
2016-11-08 20:39:52 +00:00
|
|
|
|
2019-09-22 22:02:48 +01:00
|
|
|
sha256 = {
|
2020-05-07 03:21:42 +01:00
|
|
|
x86_64-linux = "01nk3dbyhs0p7f6b4bkrng95i29g0x7vxj0rx1qb7sm3n11yi091";
|
2019-11-28 10:46:33 +00:00
|
|
|
}.${system} or throwSystem;
|
2016-11-08 20:39:52 +00:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "The simplest way to keep notes";
|
2019-09-22 22:02:48 +01: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"
|
|
|
|
];
|
2016-11-08 20:39:52 +00:00
|
|
|
};
|
2019-09-22 22:02:48 +01: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 22:02:48 +01:00
|
|
|
comment = "Simplenote for Linux";
|
2019-11-28 10:46:33 +00:00
|
|
|
desktopName = "Simplenote";
|
2019-09-22 22:02:48 +01:00
|
|
|
exec = "simplenote %U";
|
|
|
|
icon = "simplenote";
|
2019-11-28 10:46:33 +00:00
|
|
|
name = "simplenote";
|
2019-09-22 22:02:48 +01:00
|
|
|
startupNotify = "true";
|
2019-11-28 10:46:33 +00:00
|
|
|
type = "Application";
|
2019-09-22 22:02:48 +01: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 22:02:48 +01:00
|
|
|
|
2019-11-28 10:46:33 +00:00
|
|
|
buildInputs = atomEnv.packages;
|
2019-09-22 22:02:48 +01: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 = [
|
|
|
|
udev.lib
|
|
|
|
];
|
2019-09-22 22:02:48 +01:00
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
makeWrapper $out/opt/Simplenote/simplenote $out/bin/simplenote \
|
2019-12-26 22:01:36 +00:00
|
|
|
--prefix LD_LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [ stdenv.cc.cc ] }" \
|
2019-11-28 10:46:33 +00:00
|
|
|
"''${gappsWrapperArgs[@]}"
|
2019-09-22 22:02:48 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
2019-11-28 10:46:33 +00:00
|
|
|
linux
|