2022-02-10 20:34:41 +00:00
|
|
|
{ lib, stdenv, fetchurl, dpkg, autoPatchelfHook, makeWrapper, electron
|
|
|
|
, nodePackages, alsa-lib, gtk3, libxshmfence, mesa, nss }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "morgen";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "2.7.0";
|
2022-02-10 20:34:41 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://download.todesktop.com/210203cqcj00tw1/morgen-${version}.deb";
|
2023-05-24 13:37:59 +00:00
|
|
|
sha256 = "sha256-v01mytnyJA1GQ/9/+7/HDIbwW1Jl4dpgf+84k0sRf4o=";
|
2022-02-10 20:34:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
dpkg
|
|
|
|
autoPatchelfHook
|
|
|
|
makeWrapper
|
|
|
|
nodePackages.asar
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [ alsa-lib gtk3 libxshmfence mesa nss ];
|
|
|
|
|
|
|
|
unpackCmd = ''
|
|
|
|
dpkg-deb -x ${src} ./morgen-${pname}
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mv usr $out
|
|
|
|
mv opt $out
|
|
|
|
|
|
|
|
asar extract $out/opt/Morgen/resources/app.asar "$TMP/work"
|
|
|
|
# 1. Fixes path for todesktop-runtime-config.json
|
|
|
|
# 2. Fixes startup script
|
|
|
|
substituteInPlace $TMP/work/dist/main.js \
|
|
|
|
--replace "process.resourcesPath,\"todesktop-runtime-config.json" "\"$out/opt/Morgen/resources/todesktop-runtime-config.json" \
|
2023-02-02 18:25:31 +00:00
|
|
|
--replace "Exec=\".concat(process.execPath," "Exec=\".concat(\"$out/bin/morgen\","
|
2022-02-10 20:34:41 +00:00
|
|
|
asar pack --unpack='{*.node,*.ftz,rect-overlay}' "$TMP/work" $out/opt/Morgen/resources/app.asar
|
|
|
|
|
|
|
|
substituteInPlace $out/share/applications/morgen.desktop \
|
|
|
|
--replace '/opt/Morgen' $out/bin
|
|
|
|
|
|
|
|
makeWrapper ${electron}/bin/electron $out/bin/morgen \
|
|
|
|
--add-flags $out/opt/Morgen/resources/app.asar
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "All-in-one Calendars, Tasks and Scheduler";
|
|
|
|
homepage = "https://morgen.so/download";
|
2022-06-26 10:26:21 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2022-02-10 20:34:41 +00:00
|
|
|
license = licenses.unfree;
|
|
|
|
maintainers = with maintainers; [ wolfangaukang ];
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|