2022-10-21 18:38:19 +00:00
|
|
|
{ lib
|
2023-03-27 19:17:25 +00:00
|
|
|
, stdenv
|
2023-05-24 13:37:59 +00:00
|
|
|
, fetchurl
|
2022-10-21 18:38:19 +00:00
|
|
|
, fetchpatch
|
2023-03-27 19:17:25 +00:00
|
|
|
, copyDesktopItems
|
2022-10-21 18:38:19 +00:00
|
|
|
, pkg-config
|
2023-03-27 19:17:25 +00:00
|
|
|
, wrapGAppsHook
|
|
|
|
, unzip
|
2022-10-21 18:38:19 +00:00
|
|
|
, curl
|
|
|
|
, glib
|
|
|
|
, gtk3
|
|
|
|
, libssh2
|
|
|
|
, openssl
|
|
|
|
, wxGTK32
|
2023-03-27 19:17:25 +00:00
|
|
|
, makeDesktopItem
|
2022-10-21 18:38:19 +00:00
|
|
|
}:
|
|
|
|
|
2023-03-27 19:17:25 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2022-10-21 18:38:19 +00:00
|
|
|
pname = "freefilesync";
|
2023-08-04 22:07:22 +00:00
|
|
|
version = "12.5";
|
2022-10-21 18:38:19 +00:00
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://freefilesync.org/download/FreeFileSync_${version}_Source.zip";
|
2023-08-04 22:07:22 +00:00
|
|
|
# The URL only redirects to the file on the second attempt
|
|
|
|
postFetch = ''
|
|
|
|
rm -f $out
|
|
|
|
tryDownload "$url"
|
|
|
|
'';
|
|
|
|
hash = "sha256-KTN/HbNLP/+z5rryp3wDRo6c7l03vi6tUxCXZPMGUoM=";
|
2022-10-21 18:38:19 +00:00
|
|
|
};
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
sourceRoot = ".";
|
|
|
|
|
2023-03-27 19:17:25 +00:00
|
|
|
# Patches from Debian
|
2022-10-21 18:38:19 +00:00
|
|
|
patches = [
|
|
|
|
# Disable loading of the missing Animal.dat
|
|
|
|
(fetchpatch {
|
2023-03-27 19:17:25 +00:00
|
|
|
url = "https://sources.debian.org/data/main/f/freefilesync/12.0-2/debian/patches/ffs_devuan.patch";
|
2023-08-04 22:07:22 +00:00
|
|
|
postFetch = ''
|
|
|
|
substituteInPlace $out \
|
|
|
|
--replace "-std=c++2b" "-std=c++23"
|
|
|
|
'';
|
2022-10-21 18:38:19 +00:00
|
|
|
excludes = [ "FreeFileSync/Source/ffs_paths.cpp" ];
|
2023-08-04 22:07:22 +00:00
|
|
|
hash = "sha256-CtUC94AoYTxoqSMWZrzuO3jTD46rj11JnbNyXtWckCo=";
|
2022-10-21 18:38:19 +00:00
|
|
|
})
|
|
|
|
# Fix build with GTK 3
|
|
|
|
(fetchpatch {
|
2023-03-27 19:17:25 +00:00
|
|
|
url = "https://sources.debian.org/data/main/f/freefilesync/12.0-2/debian/patches/ffs_devuan_gtk3.patch";
|
|
|
|
hash = "sha256-0n58Np4JI3hYK/CRBytkPHl9Jp4xK+IRjgUvoYti/f4=";
|
2022-10-21 18:38:19 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2023-03-27 19:17:25 +00:00
|
|
|
copyDesktopItems
|
2022-10-21 18:38:19 +00:00
|
|
|
pkg-config
|
2023-03-27 19:17:25 +00:00
|
|
|
wrapGAppsHook
|
|
|
|
unzip
|
2022-10-21 18:38:19 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
curl
|
|
|
|
glib
|
|
|
|
gtk3
|
|
|
|
libssh2
|
|
|
|
openssl
|
|
|
|
wxGTK32
|
|
|
|
];
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = toString [
|
2022-10-21 18:38:19 +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-27 19:17:25 +00:00
|
|
|
mkdir -p $out/share/pixmaps
|
|
|
|
unzip -j $out/Resources/Icons.zip '*Sync.png' -d $out/share/pixmaps
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2023-03-27 19:17:25 +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-21 18:38:19 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Open Source File Synchronization & Backup Software";
|
|
|
|
homepage = "https://freefilesync.org";
|
|
|
|
license = [ licenses.gpl3Only licenses.openssl licenses.curl licenses.libssh2 ];
|
|
|
|
maintainers = with maintainers; [ wegank ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|