Merge pull request #222884 from wegank/freefilesync-icons

freefilesync: add desktop items
This commit is contained in:
Weijia Wang 2023-03-24 18:55:23 +02:00 committed by GitHub
commit b7496f96eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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";
};