-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
super-productivity: 10.0.11 -> 11.0.0, build from source
- Loading branch information
1 parent
e27aff1
commit 6470a8e
Showing
1 changed file
with
89 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,113 @@ | ||
{ stdenv , lib , fetchurl , appimageTools , makeWrapper , electron }: | ||
{ | ||
buildNpmPackage, | ||
copyDesktopItems, | ||
electron, | ||
fetchFromGitHub, | ||
lib, | ||
makeDesktopItem, | ||
nix-update-script, | ||
npm-lockfile-fix, | ||
}: | ||
|
||
stdenv.mkDerivation rec { | ||
buildNpmPackage rec { | ||
pname = "super-productivity"; | ||
version = "10.0.11"; | ||
version = "11.0.0"; | ||
|
||
src = fetchurl { | ||
url = "https://github.com/johannesjo/super-productivity/releases/download/v${version}/superProductivity-${version}.AppImage"; | ||
sha256 = "sha256-sYHfzqP/Vla0DEReVjaPvo8fe1wNdZnNDhefqPrPFPE="; | ||
name = "${pname}-${version}.AppImage"; | ||
src = fetchFromGitHub { | ||
owner = "johannesjo"; | ||
repo = "super-productivity"; | ||
tag = "v${version}"; | ||
hash = "sha256-vo4S5/F1R/YkANNxthbPKUelmYFMiRuRpVFZ4BlbJsk="; | ||
|
||
postFetch = '' | ||
${lib.getExe npm-lockfile-fix} -r $out/package-lock.json | ||
''; | ||
}; | ||
|
||
appimageContents = appimageTools.extractType2 { | ||
inherit pname version src; | ||
npmDepsHash = "sha256-oHcbLG8pVNmlPvQJgQ+Ou+EPQlItqwwhzR+GlTLa4Mo="; | ||
npmFlags = [ "--legacy-peer-deps" ]; | ||
makeCacheWritable = true; | ||
|
||
env = { | ||
ELECTRON_SKIP_BINARY_DOWNLOAD = "1"; | ||
CHROMEDRIVER_SKIP_DOWNLOAD = "true"; | ||
}; | ||
|
||
dontUnpack = true; | ||
dontConfigure = true; | ||
dontBuild = true; | ||
nativeBuildInputs = [ copyDesktopItems ]; | ||
|
||
# package.json does not include `core-js` and the comment suggests | ||
# it is only needed on some mobile platforms | ||
postPatch = '' | ||
substituteInPlace src/polyfills.ts \ | ||
--replace-fail "import 'core-js/es/object';" "" | ||
''; | ||
|
||
buildPhase = '' | ||
runHook preBuild | ||
nativeBuildInputs = [ makeWrapper ]; | ||
npm run buildFrontend:prod:es6 | ||
npm run electron:build | ||
npm exec electron-builder -- --dir \ | ||
-c.electronDist=${electron}/libexec/electron \ | ||
-c.electronVersion=${electron.version} | ||
runHook postBuild | ||
''; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
mkdir -p $out/bin $out/share/${pname} $out/share/applications | ||
mkdir -p $out/share/super-productivity/{app,defaults,static/plugins,static/resources/plugins} | ||
cp -r app-builds/*-unpacked/{locales,resources{,.pak}} "$out/share/super-productivity/app" | ||
cp -a ${appimageContents}/{locales,resources} $out/share/${pname} | ||
cp -a ${appimageContents}/superproductivity.desktop $out/share/applications/${pname}.desktop | ||
cp -a ${appimageContents}/usr/share/icons $out/share | ||
for size in 16 32 48 64 128 256 512 1024; do | ||
local sizexsize="''${size}x''${size}" | ||
mkdir -p $out/share/icons/hicolor/$sizexsize/apps | ||
cp -v build/icons/$sizexsize.png \ | ||
$out/share/icons/hicolor/$sizexsize/apps/super-productivity.png | ||
done | ||
substituteInPlace $out/share/applications/${pname}.desktop \ | ||
--replace 'Exec=AppRun' 'Exec=${pname}' | ||
makeWrapper '${lib.getExe electron}' "$out/bin/super-productivity" \ | ||
--add-flags "$out/share/super-productivity/app/resources/app.asar" \ | ||
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" \ | ||
--set-default ELECTRON_FORCE_IS_PACKAGED 1 \ | ||
--inherit-argv0 | ||
runHook postInstall | ||
''; | ||
|
||
postFixup = '' | ||
makeWrapper ${electron}/bin/electron $out/bin/${pname} \ | ||
--add-flags $out/share/${pname}/resources/app.asar | ||
''; | ||
# copied from deb file | ||
desktopItems = [ | ||
(makeDesktopItem { | ||
name = "super-productivity"; | ||
desktopName = "superProductivity"; | ||
exec = "super-productivity %u"; | ||
terminal = false; | ||
type = "Application"; | ||
icon = "super-productivity"; | ||
startupWMClass = "superProductivity"; | ||
comment = builtins.replaceStrings [ "\n" ] [ " " ] meta.longDescription; | ||
categories = [ "Utility" ]; | ||
}) | ||
]; | ||
|
||
passthru.updateScript = nix-update-script { }; | ||
|
||
meta = with lib; { | ||
meta = { | ||
description = "To Do List / Time Tracker with Jira Integration"; | ||
longDescription = '' | ||
Experience the best ToDo app for digital professionals and get more done! | ||
Super Productivity comes with integrated time-boxing and time tracking capabilities | ||
and you can load your task from your calendars and from | ||
Jira, Gitlab, GitHub, Open Project and others all into a single ToDo list. | ||
''; | ||
homepage = "https://super-productivity.com"; | ||
license = licenses.mit; | ||
platforms = [ "x86_64-linux" ]; | ||
maintainers = with maintainers; [ offline ]; | ||
license = lib.licenses.mit; | ||
platforms = lib.platforms.linux; | ||
maintainers = with lib.maintainers; [ | ||
offline | ||
pineapplehunter | ||
]; | ||
mainProgram = "super-productivity"; | ||
}; | ||
} |