2021-02-17 05:52:49 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-11-06 05:02:09 +01:00
|
|
|
, autoconf
|
|
|
|
, automake
|
|
|
|
, c-ares
|
|
|
|
, cryptopp
|
|
|
|
, curl
|
|
|
|
, doxygen
|
|
|
|
, fetchFromGitHub
|
2021-11-25 11:32:45 +01:00
|
|
|
, ffmpeg
|
|
|
|
, freeimage
|
2020-11-06 05:02:09 +01:00
|
|
|
, libmediainfo
|
|
|
|
, libraw
|
|
|
|
, libsodium
|
|
|
|
, libtool
|
|
|
|
, libuv
|
|
|
|
, libzen
|
|
|
|
, lsb-release
|
|
|
|
, mkDerivation
|
2021-01-17 03:09:27 +01:00
|
|
|
, pkg-config
|
2020-11-06 05:02:09 +01:00
|
|
|
, qtbase
|
|
|
|
, qttools
|
|
|
|
, qtx11extras
|
|
|
|
, sqlite
|
|
|
|
, swig
|
|
|
|
, unzip
|
|
|
|
, wget
|
|
|
|
}:
|
2019-08-24 21:15:40 +02:00
|
|
|
mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "megasync";
|
2021-11-25 11:32:45 +01:00
|
|
|
version = "4.6.1.0";
|
2019-06-23 16:08:52 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "meganz";
|
|
|
|
repo = "MEGAsync";
|
|
|
|
rev = "v${version}_Linux";
|
2021-11-25 11:32:45 +01:00
|
|
|
sha256 = "0v2fvji9hs7valya0wx5qjx01c7yjld6nnp6m9gpxfkr30h5s5wb";
|
2019-06-23 16:08:52 +02:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2021-02-17 05:52:49 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
autoconf
|
|
|
|
automake
|
|
|
|
doxygen
|
|
|
|
libtool
|
|
|
|
lsb-release
|
|
|
|
pkg-config
|
|
|
|
qttools
|
|
|
|
swig
|
|
|
|
unzip
|
|
|
|
];
|
2019-06-23 16:08:52 +02:00
|
|
|
buildInputs = [
|
|
|
|
c-ares
|
|
|
|
cryptopp
|
|
|
|
curl
|
2021-11-25 11:32:45 +01:00
|
|
|
ffmpeg
|
|
|
|
freeimage
|
2019-06-23 16:08:52 +02:00
|
|
|
libmediainfo
|
|
|
|
libraw
|
|
|
|
libsodium
|
|
|
|
libuv
|
|
|
|
libzen
|
2019-08-24 21:15:40 +02:00
|
|
|
qtbase
|
2020-11-06 05:02:09 +01:00
|
|
|
qtx11extras
|
2019-06-23 16:08:52 +02:00
|
|
|
sqlite
|
|
|
|
wget
|
2019-06-24 16:19:48 +02:00
|
|
|
];
|
2019-06-23 16:08:52 +02:00
|
|
|
|
2019-06-25 04:23:47 +02:00
|
|
|
patches = [
|
2019-06-24 16:19:48 +02:00
|
|
|
# Distro and version targets attempt to use lsb_release which is broken
|
|
|
|
# (see issue: https://github.com/NixOS/nixpkgs/issues/22729)
|
2019-06-25 04:23:47 +02:00
|
|
|
./noinstall-distro-version.patch
|
2019-06-24 16:19:48 +02:00
|
|
|
# megasync target is not part of the install rule thanks to a commented block
|
2019-06-25 04:23:47 +02:00
|
|
|
./install-megasync.patch
|
2021-11-25 11:32:45 +01:00
|
|
|
./ffmpeg_44.patch
|
2019-06-25 04:23:47 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
2021-02-17 05:52:49 +01:00
|
|
|
for file in $(find src/ -type f \( -iname configure -o -iname \*.sh \) ); do
|
2019-06-25 04:23:47 +02:00
|
|
|
substituteInPlace "$file" --replace "/bin/bash" "${stdenv.shell}"
|
|
|
|
done
|
2019-06-23 16:08:52 +02:00
|
|
|
'';
|
|
|
|
|
2019-06-24 16:19:48 +02:00
|
|
|
dontUseQmakeConfigure = true;
|
2019-06-25 04:23:47 +02:00
|
|
|
enableParallelBuilding = true;
|
2019-06-24 16:19:48 +02:00
|
|
|
|
2019-06-23 16:08:52 +02:00
|
|
|
preConfigure = ''
|
|
|
|
cd src/MEGASync/mega
|
|
|
|
./autogen.sh
|
|
|
|
'';
|
|
|
|
|
|
|
|
configureFlags = [
|
2020-02-26 13:54:00 +01:00
|
|
|
"--disable-examples"
|
|
|
|
"--disable-java"
|
|
|
|
"--disable-php"
|
|
|
|
"--enable-chat"
|
|
|
|
"--with-cares"
|
|
|
|
"--with-cryptopp"
|
|
|
|
"--with-curl"
|
2021-11-25 11:32:45 +01:00
|
|
|
"--with-ffmpeg"
|
|
|
|
"--with-freeimage"
|
2020-02-26 13:54:00 +01:00
|
|
|
"--without-readline"
|
|
|
|
"--without-termcap"
|
|
|
|
"--with-sodium"
|
|
|
|
"--with-sqlite"
|
|
|
|
"--with-zlib"
|
|
|
|
];
|
2019-06-23 16:08:52 +02:00
|
|
|
|
2019-06-24 16:19:48 +02:00
|
|
|
postConfigure = ''
|
|
|
|
cd ../..
|
2019-06-23 16:08:52 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
qmake CONFIG+="release" MEGA.pro
|
2019-06-24 16:19:48 +02:00
|
|
|
pushd MEGASync
|
|
|
|
lrelease MEGASync.pro
|
|
|
|
DESKTOP_DESTDIR="$out" qmake PREFIX="$out" -o Makefile MEGASync.pro CONFIG+=release
|
|
|
|
popd
|
2019-06-23 16:08:52 +02:00
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-02-26 13:54:00 +01: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" ];
|
2019-06-23 16:08:52 +02:00
|
|
|
maintainers = [ maintainers.michojel ];
|
|
|
|
};
|
|
|
|
}
|