nixpkgs/pkgs/applications/misc/megasync/default.nix

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

130 lines
2.3 KiB
Nix
Raw Normal View History

{ lib
, stdenv
, autoconf
, automake
, c-ares
, cryptopp
, curl
, doxygen
, fetchFromGitHub
, ffmpeg
, freeimage
, libmediainfo
, libraw
, libsodium
, libtool
, libuv
, libzen
, lsb-release
, mkDerivation
, pkg-config
, qtbase
, qttools
, qtx11extras
, sqlite
, swig
, unzip
, wget
}:
mkDerivation rec {
pname = "megasync";
2022-03-30 10:42:04 +00:00
version = "4.6.5.0";
src = fetchFromGitHub {
owner = "meganz";
repo = "MEGAsync";
rev = "v${version}_Linux";
2022-03-30 10:42:04 +00:00
sha256 = "sha256-2gsJmMnt0+4vknd2HgOtCYCjVWT7eD0WBimmtsFEhvY=";
fetchSubmodules = true;
};
nativeBuildInputs = [
autoconf
automake
doxygen
libtool
lsb-release
pkg-config
qttools
swig
unzip
];
buildInputs = [
c-ares
cryptopp
curl
ffmpeg
freeimage
libmediainfo
libraw
libsodium
libuv
libzen
qtbase
qtx11extras
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
./ffmpeg_44.patch
];
postPatch = ''
for file in $(find src/ -type f \( -iname configure -o -iname \*.sh \) ); do
substituteInPlace "$file" --replace "/bin/bash" "${stdenv.shell}"
done
'';
dontUseQmakeConfigure = true;
enableParallelBuilding = true;
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"
"--with-freeimage"
2020-02-26 12:54:00 +00:00
"--without-readline"
"--without-termcap"
"--with-sodium"
"--with-sqlite"
"--with-zlib"
];
postConfigure = ''
cd ../..
'';
preBuild = ''
qmake CONFIG+="release" MEGA.pro
pushd MEGASync
lrelease MEGASync.pro
DESKTOP_DESTDIR="$out" qmake PREFIX="$out" -o Makefile MEGASync.pro CONFIG+=release
popd
'';
meta = with 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" ];
maintainers = [ maintainers.michojel ];
};
}