about summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2019-06-20 23:56:06 +0200
committerFlorian Klink <flokli@flokli.de>2019-06-21 01:53:40 +0200
commit2bfec5238869d33e1f9b54f7eb5cbd94b59aa443 (patch)
tree2b79c867292592d409fe374d9f4859219300ba27 /pkgs/applications
parent32a992af8bd3f838114427d3ec0b3035193d88c7 (diff)
downloadnixlib-2bfec5238869d33e1f9b54f7eb5cbd94b59aa443.tar
nixlib-2bfec5238869d33e1f9b54f7eb5cbd94b59aa443.tar.gz
nixlib-2bfec5238869d33e1f9b54f7eb5cbd94b59aa443.tar.bz2
nixlib-2bfec5238869d33e1f9b54f7eb5cbd94b59aa443.tar.lz
nixlib-2bfec5238869d33e1f9b54f7eb5cbd94b59aa443.tar.xz
nixlib-2bfec5238869d33e1f9b54f7eb5cbd94b59aa443.tar.zst
nixlib-2bfec5238869d33e1f9b54f7eb5cbd94b59aa443.zip
patchwork: 3.11.4 -> 3.14.1
This updates patchwork from 3.11.4 to 3.14.1, and uses the appimageTools
machinery to extract the AppImage instead of the wrapper used before.

On top of that, we install a .desktop file, so its available from the
application menu.
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/networking/ssb/patchwork/default.nix65
1 files changed, 36 insertions, 29 deletions
diff --git a/pkgs/applications/networking/ssb/patchwork/default.nix b/pkgs/applications/networking/ssb/patchwork/default.nix
index c8b8b5ef333c..40026275a1e3 100644
--- a/pkgs/applications/networking/ssb/patchwork/default.nix
+++ b/pkgs/applications/networking/ssb/patchwork/default.nix
@@ -1,46 +1,53 @@
-{
- stdenv,
- appimage-run,
- fetchurl,
- runtimeShell,
- gsettings-desktop-schemas,
- gtk3,
- gobject-introspection,
- wrapGAppsHook,
-}:
+{ appimageTools, symlinkJoin, lib, fetchurl, makeDesktopItem }:
 
-stdenv.mkDerivation rec {
-  # latest version that runs without errors
-  # https://github.com/ssbc/patchwork/issues/972
-  version = "3.11.4";
+let
   pname = "patchwork";
+  version = "3.14.1";
+  name = "${pname}-${version}";
 
   src = fetchurl {
-    url = "https://github.com/ssbc/patchwork/releases/download/v${version}/Patchwork-${version}-linux-x86_64.AppImage";
-    sha256 = "1blsprpkvm0ws9b96gb36f0rbf8f5jgmw4x6dsb1kswr4ysf591s";
+    url = "https://github.com/ssbc/patchwork/releases/download/v${version}/ssb-${pname}-${version}-x86_64.AppImage";
+    sha256 = "01vsldabv9nmbx8kzlgw275zykm72s1dxglnaq4jz5vbysbyn0qd";
   };
 
-  nativeBuildInputs = [ wrapGAppsHook ];
-  buildInputs = [ appimage-run gtk3 gsettings-desktop-schemas gobject-introspection ];
+  binary = appimageTools.wrapType2 {
+    name = "${pname}";
+    inherit src;
+  };
+  # we only use this to extract the icon
+  appimage-contents = appimageTools.extractType2 {
+    inherit name src;
+  };
 
-  unpackPhase = ":";
+  desktopItem = makeDesktopItem {
+    name = "patchwork";
+    exec = "${binary}/bin/patchwork";
+    icon = "ssb-patchwork.png";
+    comment = "Decentralized messaging and sharing app";
+    desktopName = "Patchwork";
+    genericName = "Patchwork";
+    categories = "Network;";
+  };
 
-  installPhase = ''
-    mkdir -p $out/{bin,share}
-    cp $src $out/share/${pname}
-    echo "#!${runtimeShell}" > $out/bin/${pname}
-    echo "${appimage-run}/bin/appimage-run $out/share/${pname}" >> $out/bin/${pname}
-    chmod +x $out/bin/${pname} $out/share/${pname}
-  '';
+in
+  symlinkJoin {
+    inherit name;
+    paths = [ binary ];
+
+    postBuild = ''
+      mkdir -p $out/share/pixmaps/ $out/share/applications
+      cp ${appimage-contents}/ssb-patchwork.png $out/share/pixmaps
+      cp ${desktopItem}/share/applications/* $out/share/applications/
+    '';
 
-  meta = with stdenv.lib; {
-    description = "A decentralized messaging and sharing app built on top of Secure Scuttlebutt (SSB).";
+  meta = with lib; {
+    description = "A decentralized messaging and sharing app built on top of Secure Scuttlebutt (SSB)";
     longDescription = ''
       sea-slang for gossip - a scuttlebutt is basically a watercooler on a ship.
     '';
     homepage = https://www.scuttlebutt.nz/;
     license = licenses.agpl3;
-    maintainers = with maintainers; [ thedavidmeister ];
+    maintainers = with maintainers; [ thedavidmeister ninjatrappeur flokli ];
     platforms = [ "x86_64-linux" ];
   };
 }