nixpkgs/pkgs/by-name/fr/freefilesync/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

147 lines
3.4 KiB
Nix
Raw Normal View History

2022-10-07 11:04:55 +00:00
{ lib
2023-03-24 14:11:02 +00:00
, stdenv
2023-05-17 21:10:07 +00:00
, fetchurl
2022-10-07 11:04:55 +00:00
, fetchpatch
2024-01-10 21:44:50 +00:00
, fetchDebianPatch
2023-03-24 14:11:02 +00:00
, copyDesktopItems
2022-10-07 11:04:55 +00:00
, pkg-config
, wrapGAppsHook3
2023-03-24 14:11:02 +00:00
, unzip
2022-10-07 11:04:55 +00:00
, curl
, glib
, gtk3
, libssh2
, openssl
, wxGTK32
2023-03-24 14:11:02 +00:00
, makeDesktopItem
2022-10-07 11:04:55 +00:00
}:
2023-09-16 22:14:51 +00:00
stdenv.mkDerivation (finalAttrs: {
2022-10-07 11:04:55 +00:00
pname = "freefilesync";
2024-04-03 13:32:38 +00:00
version = "13.5";
2022-10-07 11:04:55 +00:00
2023-05-17 21:10:07 +00:00
src = fetchurl {
2023-09-16 22:14:51 +00:00
url = "https://freefilesync.org/download/FreeFileSync_${finalAttrs.version}_Source.zip";
2023-08-01 17:50:48 +00:00
# The URL only redirects to the file on the second attempt
postFetch = ''
rm -f $out
tryDownload "$url"
'';
2024-04-03 13:32:38 +00:00
hash = "sha256-8At8QobAQR2mQnFjFSPTkEuxmP9M8gINP0qH28J3ynY=";
2022-10-07 11:04:55 +00:00
};
2023-05-17 21:10:07 +00:00
sourceRoot = ".";
2023-03-24 14:11:02 +00:00
# Patches from Debian
2022-10-07 11:04:55 +00:00
patches = [
# Disable loading of the missing Animal.dat
(fetchpatch {
2024-01-10 21:44:50 +00:00
url = "https://sources.debian.org/data/main/f/freefilesync/13.3-1/debian/patches/ffs_devuan.patch";
2022-10-07 11:04:55 +00:00
excludes = [ "FreeFileSync/Source/ffs_paths.cpp" ];
2024-01-10 21:44:50 +00:00
hash = "sha256-cW0Y9+ByQWGzMU4NFRSkW46KkxQB4jRZotHlCFniv5o=";
2022-10-07 11:04:55 +00:00
})
# Fix build with GTK 3
2024-01-10 21:44:50 +00:00
(fetchDebianPatch {
pname = "freefilesync";
version = "13.3";
debianRevision = "1";
patch = "ffs_devuan_gtk3.patch";
2023-03-24 14:11:02 +00:00
hash = "sha256-0n58Np4JI3hYK/CRBytkPHl9Jp4xK+IRjgUvoYti/f4=";
2022-10-07 11:04:55 +00:00
})
2024-01-10 21:44:50 +00:00
# Fix build with vanilla wxWidgets
(fetchDebianPatch {
pname = "freefilesync";
version = "13.3";
debianRevision = "1";
patch = "Disable_wxWidgets_uncaught_exception_handling.patch";
hash = "sha256-Fem7eDDKSqPFU/t12Jco8OmYC8FM9JgB4/QVy/ouvbI=";
})
2024-02-05 11:05:12 +00:00
# Disable update patch
(fetchDebianPatch {
pname = "freefilesync";
version = "13.3";
debianRevision = "1";
patch = "ffs_no_check_updates.patch";
hash = "sha256-lPyHpxhZz8BSnDI8QfAzKpKwVkp2jiF49RWjKNuZGII=";
})
2022-10-07 11:04:55 +00:00
];
nativeBuildInputs = [
2023-03-24 14:11:02 +00:00
copyDesktopItems
2022-10-07 11:04:55 +00:00
pkg-config
wrapGAppsHook3
2023-03-24 14:11:02 +00:00
unzip
2022-10-07 11:04:55 +00:00
];
buildInputs = [
curl
glib
gtk3
libssh2
openssl
2024-01-10 21:44:50 +00:00
wxGTK32
2022-10-07 11:04:55 +00:00
];
env.NIX_CFLAGS_COMPILE = toString [
2022-10-07 11:04:55 +00:00
# Undef g_object_ref on GLib 2.56+
"-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_54"
"-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_54"
# Define libssh2 constants
"-DMAX_SFTP_READ_SIZE=30000"
"-DMAX_SFTP_OUTGOING_SIZE=30000"
];
buildPhase = ''
runHook preBuild
chmod +w FreeFileSync/Build
cd FreeFileSync/Source
make -j$NIX_BUILD_CORES
cd RealTimeSync
make -j$NIX_BUILD_CORES
cd ../../..
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out
cp -R FreeFileSync/Build/* $out
mv $out/{Bin,bin}
2023-03-24 14:11:02 +00:00
mkdir -p $out/share/pixmaps
unzip -j $out/Resources/Icons.zip '*Sync.png' -d $out/share/pixmaps
2022-10-07 11:04:55 +00:00
runHook postInstall
'';
2023-03-24 14:11:02 +00:00
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" ];
})
];
2022-10-07 11:04:55 +00:00
meta = with lib; {
description = "Open Source File Synchronization & Backup Software";
homepage = "https://freefilesync.org";
2022-10-09 10:33:17 +00:00
license = [ licenses.gpl3Only licenses.openssl licenses.curl licenses.libssh2 ];
2022-10-07 11:04:55 +00:00
maintainers = with maintainers; [ wegank ];
platforms = platforms.linux;
};
2023-09-16 22:14:51 +00:00
})