2021-04-12 18:23:04 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-11-06 00:33:48 +00:00
|
|
|
, autoconf
|
|
|
|
, automake
|
|
|
|
, c-ares
|
|
|
|
, cryptopp
|
|
|
|
, curl
|
|
|
|
, doxygen
|
|
|
|
, fetchFromGitHub
|
2021-12-06 16:07:01 +00:00
|
|
|
, ffmpeg
|
2020-11-06 00:33:48 +00:00
|
|
|
, libmediainfo
|
|
|
|
, libraw
|
|
|
|
, libsodium
|
|
|
|
, libtool
|
|
|
|
, libuv
|
|
|
|
, libzen
|
|
|
|
, lsb-release
|
|
|
|
, mkDerivation
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config
|
2020-11-06 00:33:48 +00:00
|
|
|
, qtbase
|
|
|
|
, qttools
|
|
|
|
, qtx11extras
|
|
|
|
, sqlite
|
|
|
|
, swig
|
|
|
|
, unzip
|
|
|
|
, wget
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
mkDerivation rec {
|
|
|
|
pname = "megasync";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "4.9.1.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "meganz";
|
|
|
|
repo = "MEGAsync";
|
|
|
|
rev = "v${version}_Linux";
|
2024-04-21 15:54:59 +00:00
|
|
|
sha256 = "sha256-Y1nfY5iP64iSCYwzqxbjZAQNHyj4yVbSudSInm+yJzY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2021-04-12 18:23:04 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
autoconf
|
|
|
|
automake
|
|
|
|
doxygen
|
|
|
|
libtool
|
|
|
|
lsb-release
|
|
|
|
pkg-config
|
|
|
|
qttools
|
|
|
|
swig
|
|
|
|
unzip
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
|
|
|
c-ares
|
|
|
|
cryptopp
|
|
|
|
curl
|
2021-12-06 16:07:01 +00:00
|
|
|
ffmpeg
|
2020-04-24 23:36:52 +00:00
|
|
|
libmediainfo
|
|
|
|
libraw
|
|
|
|
libsodium
|
|
|
|
libuv
|
|
|
|
libzen
|
|
|
|
qtbase
|
2020-11-06 00:33:48 +00:00
|
|
|
qtx11extras
|
2020-04-24 23:36:52 +00:00
|
|
|
sqlite
|
|
|
|
wget
|
|
|
|
];
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# Distro and version targets attempt to use lsb_release which is broken
|
|
|
|
# (see issue: https://github.com/NixOS/nixpkgs/issues/22729)
|
|
|
|
./noinstall-distro-version.patch
|
|
|
|
# megasync target is not part of the install rule thanks to a commented block
|
|
|
|
./install-megasync.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
2021-04-12 18:23:04 +00:00
|
|
|
for file in $(find src/ -type f \( -iname configure -o -iname \*.sh \) ); do
|
2020-04-24 23:36:52 +00:00
|
|
|
substituteInPlace "$file" --replace "/bin/bash" "${stdenv.shell}"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
dontUseQmakeConfigure = true;
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
cd src/MEGASync/mega
|
|
|
|
./autogen.sh
|
|
|
|
'';
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--disable-examples"
|
|
|
|
"--disable-java"
|
|
|
|
"--disable-php"
|
|
|
|
"--enable-chat"
|
|
|
|
"--with-cares"
|
|
|
|
"--with-cryptopp"
|
|
|
|
"--with-curl"
|
2021-12-06 16:07:01 +00:00
|
|
|
"--with-ffmpeg"
|
2024-04-21 15:54:59 +00:00
|
|
|
"--without-freeimage"
|
2020-04-24 23:36:52 +00:00
|
|
|
"--without-readline"
|
|
|
|
"--without-termcap"
|
|
|
|
"--with-sodium"
|
|
|
|
"--with-sqlite"
|
|
|
|
"--with-zlib"
|
|
|
|
];
|
|
|
|
|
|
|
|
postConfigure = ''
|
|
|
|
cd ../..
|
|
|
|
'';
|
|
|
|
|
|
|
|
preBuild = ''
|
2024-04-21 15:54:59 +00:00
|
|
|
qmake CONFIG+="nofreeimage release" MEGA.pro
|
2020-04-24 23:36:52 +00:00
|
|
|
pushd MEGASync
|
|
|
|
lrelease MEGASync.pro
|
2024-04-21 15:54:59 +00:00
|
|
|
DESKTOP_DESTDIR="$out" qmake PREFIX="$out" -o Makefile MEGASync.pro CONFIG+="nofreeimage release"
|
2020-04-24 23:36:52 +00:00
|
|
|
popd
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description =
|
|
|
|
"Easy automated syncing between your computers and your MEGA Cloud Drive";
|
|
|
|
homepage = "https://mega.nz/";
|
|
|
|
license = licenses.unfree;
|
|
|
|
platforms = [ "i686-linux" "x86_64-linux" ];
|
2024-04-21 15:54:59 +00:00
|
|
|
maintainers = [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|