summary refs log tree commit diff
diff options
context:
space:
mode:
authorMax Hausch <github@hausch.xyz>2021-04-14 13:33:17 +0200
committerJörg Thalheim <joerg@thalheim.io>2021-04-14 14:53:48 +0200
commit92ec5c8583f7f710816100433d21b12d0db8e6c8 (patch)
tree2cd0984ae350198faa61898715a2e3dfd1ef2427
parent37a8a32777945454d58b59e1edb3270f49ecb41c (diff)
downloadnixpkgs-92ec5c8583f7f710816100433d21b12d0db8e6c8.tar
nixpkgs-92ec5c8583f7f710816100433d21b12d0db8e6c8.tar.gz
nixpkgs-92ec5c8583f7f710816100433d21b12d0db8e6c8.tar.bz2
nixpkgs-92ec5c8583f7f710816100433d21b12d0db8e6c8.tar.lz
nixpkgs-92ec5c8583f7f710816100433d21b12d0db8e6c8.tar.xz
nixpkgs-92ec5c8583f7f710816100433d21b12d0db8e6c8.tar.zst
nixpkgs-92ec5c8583f7f710816100433d21b12d0db8e6c8.zip
super-productivity: 1.10.45 -> 6.5.2
Version 1.10.45 segfaults, this commit fixes the package
-rw-r--r--pkgs/applications/networking/super-productivity/default.nix106
-rw-r--r--pkgs/applications/office/super-productivity/default.nix55
-rw-r--r--pkgs/top-level/all-packages.nix2
3 files changed, 56 insertions, 107 deletions
diff --git a/pkgs/applications/networking/super-productivity/default.nix b/pkgs/applications/networking/super-productivity/default.nix
deleted file mode 100644
index 38d12710cca..00000000000
--- a/pkgs/applications/networking/super-productivity/default.nix
+++ /dev/null
@@ -1,106 +0,0 @@
-{ lib, stdenv, fetchurl, dpkg, makeWrapper
-, alsaLib, atk, cairo, cups, curl, dbus, expat, fontconfig, freetype, glib
-, gnome2, gtk3, gdk-pixbuf, libnotify, libxcb, nspr, nss, pango
-, systemd, xorg, xprintidle-ng }:
-
-let
-
-  version = "1.10.45";
-
-  rpath = lib.makeLibraryPath [
-    alsaLib
-    atk
-    cairo
-    cups
-    curl
-    dbus
-    expat
-    fontconfig
-    freetype
-    glib
-    gnome2.GConf
-    gdk-pixbuf
-    gtk3
-    pango
-    libnotify
-    libxcb
-    nspr
-    nss
-    stdenv.cc.cc
-    systemd
-
-    xorg.libxkbfile
-    xorg.libX11
-    xorg.libXcomposite
-    xorg.libXcursor
-    xorg.libXdamage
-    xorg.libXext
-    xorg.libXfixes
-    xorg.libXi
-    xorg.libXrandr
-    xorg.libXrender
-    xorg.libXtst
-    xorg.libXScrnSaver
-  ] + ":${stdenv.cc.cc.lib}/lib64";
-
-  src =
-    if stdenv.hostPlatform.system == "x86_64-linux" then
-      fetchurl {
-        url = "https://github.com/johannesjo/super-productivity/releases/download/v${version}/superProductivity_${version}_amd64.deb";
-        sha256 = "0jfi0lfijnhij9jvkhxgyvq8m1jzaym8n1c7707fv3hjh1h0vxn1";
-      }
-    else
-      throw "super-productivity is not supported on ${stdenv.hostPlatform.system}";
-
-in stdenv.mkDerivation {
-  pname = "super-productivity";
-  inherit version;
-
-  inherit src;
-
-  buildInputs = [
-    dpkg
-    gtk3  # needed for GSETTINGS_SCHEMAS_PATH
-  ];
-
-  nativeBuildInputs = [ makeWrapper ];
-
-  unpackPhase = "dpkg -x $src .";
-
-  installPhase = ''
-    runHook preInstall
-
-    mkdir -p $out
-
-    cp -R usr/share $out/share
-    cp -R opt $out/libexec
-
-    # Otherwise it looks "suspicious"
-    chmod -R g-w $out
-
-    # set linker and rpath
-    patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$out/libexec/superProductivity/superproductivity"
-    patchelf --set-rpath ${rpath}:$out/libexec/superProductivity "$out/libexec/superProductivity/superproductivity"
-
-    # wrapper for xdg_data_dirs and xprintidle path
-    makeWrapper $out/libexec/superProductivity/superproductivity $out/bin/superproductivity \
-      --prefix XDG_DATA_DIRS : $GSETTINGS_SCHEMAS_PATH \
-      --prefix PATH : "${xprintidle-ng}/bin"
-
-    # Fix the desktop link
-    substituteInPlace $out/share/applications/superproductivity.desktop \
-      --replace /opt/superProductivity/ $out/bin/
-
-    runHook postInstall
-  '';
-
-  dontStrip = true;
-
-  meta = with lib; {
-    description = "To Do List / Time Tracker with Jira Integration";
-    homepage = "https://super-productivity.com";
-    license = licenses.mit;
-    platforms = [ "x86_64-linux" ];
-    maintainers = with maintainers; [ offline ];
-  };
-}
diff --git a/pkgs/applications/office/super-productivity/default.nix b/pkgs/applications/office/super-productivity/default.nix
new file mode 100644
index 00000000000..7793db2138c
--- /dev/null
+++ b/pkgs/applications/office/super-productivity/default.nix
@@ -0,0 +1,55 @@
+{ stdenv , lib , fetchurl , appimageTools , makeWrapper , electron_11 }:
+
+let
+  electron = electron_11;
+in
+stdenv.mkDerivation rec {
+  pname = "super-productivity";
+  version = "6.5.2";
+
+  src = fetchurl {
+    url = "https://github.com/johannesjo/super-productivity/releases/download/v${version}/superProductivity-${version}.AppImage";
+    sha256 = "1ivl7chsv9axgk6nqkf580pav651hchi3di0mrp0pylpsqgk6f1f";
+    name = "${pname}-${version}.AppImage";
+  };
+
+  appimageContents = appimageTools.extractType2 {
+    name = "${pname}-${version}";
+    inherit src;
+  };
+
+  dontUnpack = true;
+  dontConfigure = true;
+  dontBuild = true;
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/bin $out/share/${pname} $out/share/applications
+
+    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
+
+    substituteInPlace $out/share/applications/${pname}.desktop \
+      --replace 'Exec=AppRun' 'Exec=${pname}'
+
+    runHook postInstall
+  '';
+
+  postFixup = ''
+    makeWrapper ${electron}/bin/electron $out/bin/${pname} \
+      --add-flags $out/share/${pname}/resources/app.asar \
+      --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ stdenv.cc.cc ]}"
+  '';
+
+  meta = with lib; {
+    description = "To Do List / Time Tracker with Jira Integration";
+    homepage = "https://super-productivity.com";
+    license = licenses.mit;
+    platforms = [ "x86_64-linux" ];
+    maintainers = with maintainers; [ offline ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index c438e63ebdd..4d009d82b15 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -23555,7 +23555,7 @@ in
     withPortAudio = stdenv.isDarwin;
   };
 
-  super-productivity = callPackage ../applications/networking/super-productivity { };
+  super-productivity = callPackage ../applications/office/super-productivity { };
 
   wlroots = callPackage ../development/libraries/wlroots {
     inherit (xorg) xcbutilrenderutil;