2020-02-26 12:54:00 +00:00
|
|
|
{ stdenv, autoconf, automake, c-ares, cryptopp, curl, doxygen, fetchFromGitHub
|
2020-06-07 12:39:09 +00:00
|
|
|
, fetchpatch, ffmpeg_3, libmediainfo, libraw, libsodium, libtool, libuv, libzen
|
2020-02-26 12:57:29 +00:00
|
|
|
, lsb-release, mkDerivation, pkgconfig, qtbase, qttools, sqlite, swig, unzip
|
|
|
|
, wget }:
|
2019-06-23 14:08:52 +00:00
|
|
|
|
2019-08-24 19:15:40 +00:00
|
|
|
mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "megasync";
|
2020-03-31 01:31:29 +00:00
|
|
|
version = "4.3.1.0";
|
2019-06-23 14:08:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "meganz";
|
|
|
|
repo = "MEGAsync";
|
|
|
|
rev = "v${version}_Linux";
|
2020-03-31 01:31:29 +00:00
|
|
|
sha256 = "0b68wpif8a0wf1vfn1nr19dmz8f31dprb27jpldxrxhyfslc43yj";
|
2019-06-23 14:08:52 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2020-02-26 12:54:00 +00:00
|
|
|
nativeBuildInputs =
|
|
|
|
[ autoconf automake doxygen lsb-release pkgconfig qttools swig ];
|
2019-06-23 14:08:52 +00:00
|
|
|
buildInputs = [
|
|
|
|
c-ares
|
|
|
|
cryptopp
|
|
|
|
curl
|
2020-06-07 12:39:09 +00:00
|
|
|
ffmpeg_3
|
2019-06-23 14:08:52 +00:00
|
|
|
libmediainfo
|
|
|
|
libraw
|
|
|
|
libsodium
|
|
|
|
libtool
|
|
|
|
libuv
|
|
|
|
libzen
|
2019-08-24 19:15:40 +00:00
|
|
|
qtbase
|
2019-06-23 14:08:52 +00:00
|
|
|
sqlite
|
|
|
|
unzip
|
|
|
|
wget
|
2019-06-24 14:19:48 +00:00
|
|
|
];
|
2019-06-23 14:08:52 +00:00
|
|
|
|
2019-06-25 02:23:47 +00:00
|
|
|
patches = [
|
2019-06-24 14:19:48 +00: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 02:23:47 +00:00
|
|
|
./noinstall-distro-version.patch
|
2019-06-24 14:19:48 +00:00
|
|
|
# megasync target is not part of the install rule thanks to a commented block
|
2019-06-25 02:23:47 +00:00
|
|
|
./install-megasync.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
for file in $(find src/ -type f \( -iname configure -o -iname \*.sh \) ); do
|
|
|
|
substituteInPlace "$file" --replace "/bin/bash" "${stdenv.shell}"
|
|
|
|
done
|
2019-06-23 14:08:52 +00:00
|
|
|
'';
|
|
|
|
|
2019-06-24 14:19:48 +00:00
|
|
|
dontUseQmakeConfigure = true;
|
2019-06-25 02:23:47 +00:00
|
|
|
enableParallelBuilding = true;
|
2019-06-24 14:19:48 +00:00
|
|
|
|
2019-06-23 14:08:52 +00:00
|
|
|
preConfigure = ''
|
|
|
|
cd src/MEGASync/mega
|
|
|
|
./autogen.sh
|
|
|
|
'';
|
|
|
|
|
|
|
|
configureFlags = [
|
2020-02-26 12:54:00 +00:00
|
|
|
"--disable-examples"
|
|
|
|
"--disable-java"
|
|
|
|
"--disable-php"
|
|
|
|
"--enable-chat"
|
|
|
|
"--with-cares"
|
|
|
|
"--with-cryptopp"
|
|
|
|
"--with-curl"
|
|
|
|
"--with-ffmpeg"
|
|
|
|
"--without-freeimage" # unreferenced even when found
|
|
|
|
"--without-readline"
|
|
|
|
"--without-termcap"
|
|
|
|
"--with-sodium"
|
|
|
|
"--with-sqlite"
|
|
|
|
"--with-zlib"
|
|
|
|
];
|
2019-06-23 14:08:52 +00:00
|
|
|
|
2019-06-24 14:19:48 +00:00
|
|
|
postConfigure = ''
|
|
|
|
cd ../..
|
2019-06-23 14:08:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
qmake CONFIG+="release" MEGA.pro
|
2019-06-24 14:19:48 +00:00
|
|
|
pushd MEGASync
|
|
|
|
lrelease MEGASync.pro
|
|
|
|
DESKTOP_DESTDIR="$out" qmake PREFIX="$out" -o Makefile MEGASync.pro CONFIG+=release
|
|
|
|
popd
|
2019-06-23 14:08:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2020-02-26 12:54:00 +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" ];
|
2019-06-23 14:08:52 +00:00
|
|
|
maintainers = [ maintainers.michojel ];
|
|
|
|
};
|
|
|
|
}
|