about summary refs log tree commit diff
path: root/pkgs/applications/networking/freefilesync
diff options
context:
space:
mode:
authorWeijia Wang <9713184+wegank@users.noreply.github.com>2023-03-24 16:11:02 +0200
committerWeijia Wang <9713184+wegank@users.noreply.github.com>2023-03-24 16:11:02 +0200
commit00efb050080402560259e208bf4fd5c7ffb63024 (patch)
tree3ac99b1cca1d2e3abadd8775fe623dad0f15e861 /pkgs/applications/networking/freefilesync
parentf06b91b301c16aef906e4e6fe7379d801aad99c3 (diff)
freefilesync: add desktop items
Diffstat (limited to 'pkgs/applications/networking/freefilesync')
-rw-r--r--pkgs/applications/networking/freefilesync/default.nix51
1 files changed, 36 insertions, 15 deletions
diff --git a/pkgs/applications/networking/freefilesync/default.nix b/pkgs/applications/networking/freefilesync/default.nix
index 4d1310335ecc7..82cecfb91f981 100644
--- a/pkgs/applications/networking/freefilesync/default.nix
+++ b/pkgs/applications/networking/freefilesync/default.nix
@@ -1,8 +1,11 @@
 { lib
-, gcc12Stdenv
+, stdenv
 , fetchFromGitHub
 , fetchpatch
+, copyDesktopItems
 , pkg-config
+, wrapGAppsHook
+, unzip
 , curl
 , glib
 , gtk3
@@ -10,10 +13,10 @@
 , openssl
 , wxGTK32
 , gitUpdater
-, wrapGAppsHook
+, makeDesktopItem
 }:
 
-gcc12Stdenv.mkDerivation rec {
+stdenv.mkDerivation rec {
   pname = "freefilesync";
   version = "12.1";
 
@@ -24,30 +27,26 @@ gcc12Stdenv.mkDerivation rec {
     hash = "sha256-KA3Bn8skJ2gMmihmwlUmN6jXZmfoYY/f4vqbKwvxwgw=";
   };
 
-  # Patches from ROSA Linux
+  # Patches from Debian
   patches = [
     # Disable loading of the missing Animal.dat
     (fetchpatch {
-      url = "https://abf.io/import/freefilesync/raw/rosa2021.1-11.25-1/ffs_devuan.patch";
-      sha256 = "sha256-o8T/tBinlhM1I82yXxm0ogZcZf+uri95vTJrca5mcqs=";
+      url = "https://sources.debian.org/data/main/f/freefilesync/12.0-2/debian/patches/ffs_devuan.patch";
       excludes = [ "FreeFileSync/Source/ffs_paths.cpp" ];
-      postFetch = ''
-        substituteInPlace $out --replace " for Rosa" ""
-      '';
+      hash = "sha256-6pHr5txabMTpGMKP7I5oe1lGAmgb0cPW8ZkPv/WXN74=";
     })
     # Fix build with GTK 3
     (fetchpatch {
-      url = "https://abf.io/import/freefilesync/raw/rosa2021.1-11.25-1/ffs_devuan_gtk3.patch";
-      sha256 = "sha256-NXt/+BRTcMk8bnjR9Hipv1NzV9YqRJqy0e3RMInoWsA=";
-      postFetch = ''
-        substituteInPlace $out --replace "-isystem/usr/include/gtk-3.0" ""
-      '';
+      url = "https://sources.debian.org/data/main/f/freefilesync/12.0-2/debian/patches/ffs_devuan_gtk3.patch";
+      hash = "sha256-0n58Np4JI3hYK/CRBytkPHl9Jp4xK+IRjgUvoYti/f4=";
     })
   ];
 
   nativeBuildInputs = [
-    wrapGAppsHook
+    copyDesktopItems
     pkg-config
+    wrapGAppsHook
+    unzip
   ];
 
   buildInputs = [
@@ -88,9 +87,31 @@ gcc12Stdenv.mkDerivation rec {
     cp -R FreeFileSync/Build/* $out
     mv $out/{Bin,bin}
 
+    mkdir -p $out/share/pixmaps
+    unzip -j $out/Resources/Icons.zip '*Sync.png' -d $out/share/pixmaps
+
     runHook postInstall
   '';
 
+  desktopItems = [
+    (makeDesktopItem rec {
+      name = "FreeFileSync";
+      desktopName = name;
+      genericName = "Folder Comparison and Synchronization";
+      icon = name;
+      exec = name;
+      categories = [ "Utility" "FileTools" ];
+    })
+    (makeDesktopItem rec {
+      name = "RealTimeSync";
+      desktopName = name;
+      genericName = "Automated Synchronization";
+      icon = name;
+      exec = name;
+      categories = [ "Utility" "FileTools" ];
+    })
+  ];
+
   passthru.updateScript = gitUpdater {
     rev-prefix = "v";
   };