diff options
author | Alyssa Ross <hi@alyssa.is> | 2019-07-14 15:50:11 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2019-08-14 00:01:17 +0000 |
commit | 69a15dd2dc85051ba1436613805f9286850e0596 (patch) | |
tree | d53cec2bb5b8d07df1d1919b212cb2deb3628cd6 /nixpkgs/pkgs/applications/misc/megasync | |
parent | 6941276da135c3eb3b50e0be33d92e7d01ccba9a (diff) | |
parent | beff2f8d75ef2c65017fb25e251337c6bb2e950d (diff) | |
download | nixlib-69a15dd2dc85051ba1436613805f9286850e0596.tar nixlib-69a15dd2dc85051ba1436613805f9286850e0596.tar.gz nixlib-69a15dd2dc85051ba1436613805f9286850e0596.tar.bz2 nixlib-69a15dd2dc85051ba1436613805f9286850e0596.tar.lz nixlib-69a15dd2dc85051ba1436613805f9286850e0596.tar.xz nixlib-69a15dd2dc85051ba1436613805f9286850e0596.tar.zst nixlib-69a15dd2dc85051ba1436613805f9286850e0596.zip |
Merge commit 'beff2f8d75ef2c65017fb25e251337c6bb2e950d'
v# modified: nixpkgs/pkgs/tools/networking/dhcpcd/default.nix
Diffstat (limited to 'nixpkgs/pkgs/applications/misc/megasync')
3 files changed, 159 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/misc/megasync/default.nix b/nixpkgs/pkgs/applications/misc/megasync/default.nix new file mode 100644 index 000000000000..b3e739864171 --- /dev/null +++ b/nixpkgs/pkgs/applications/misc/megasync/default.nix @@ -0,0 +1,125 @@ +{ stdenv +, autoconf +, automake +, c-ares +, cryptopp +, curl +, doxygen +, fetchFromGitHub +, ffmpeg +, hicolor-icon-theme +, libmediainfo +, libraw +, libsodium +, libtool +, libuv +, libzen +, lsb-release +, pkgconfig +, qt5 +, sqlite +, swig +, unzip +, wget +}: + +stdenv.mkDerivation rec { + name = "megasync-${version}"; + version = "4.1.1.0"; + + src = fetchFromGitHub { + owner = "meganz"; + repo = "MEGAsync"; + rev = "v${version}_Linux"; + sha256 = "0lc228q3s9xp78dxjn22g6anqlsy1hi7a6yfs4q3l6gyfc3qcxl2"; + fetchSubmodules = true; + }; + + nativeBuildInputs = [ + autoconf + automake + doxygen + lsb-release + pkgconfig + qt5.qmake + qt5.qttools + swig + ]; + buildInputs = [ + c-ares + cryptopp + curl + ffmpeg + hicolor-icon-theme + libmediainfo + libraw + libsodium + libtool + libuv + libzen + qt5.qtbase + qt5.qtsvg + sqlite + unzip + 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 = '' + 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 = [ + "--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" + ]; + + 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 stdenv.lib; { + 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 ]; + }; +} diff --git a/nixpkgs/pkgs/applications/misc/megasync/install-megasync.patch b/nixpkgs/pkgs/applications/misc/megasync/install-megasync.patch new file mode 100644 index 000000000000..7d8748528e7f --- /dev/null +++ b/nixpkgs/pkgs/applications/misc/megasync/install-megasync.patch @@ -0,0 +1,21 @@ +Index: source/src/MEGASync/MEGASync.pro +=================================================================== +--- source.orig/src/MEGASync/MEGASync.pro ++++ source/src/MEGASync/MEGASync.pro +@@ -28,11 +28,11 @@ unix:!macx { + TARGET = megasync + + # Uncomment the following if "make install" doesn't copy megasync in /usr/bin directory +-# isEmpty(PREFIX) { +-# PREFIX = /usr +-# } +-# target.path = $$PREFIX/bin +-# INSTALLS += target ++ isEmpty(PREFIX) { ++ PREFIX = /usr ++ } ++ target.path = $$PREFIX/bin ++ INSTALLS += target + } + else { + TARGET = MEGAsync diff --git a/nixpkgs/pkgs/applications/misc/megasync/noinstall-distro-version.patch b/nixpkgs/pkgs/applications/misc/megasync/noinstall-distro-version.patch new file mode 100644 index 000000000000..bbf100737bc4 --- /dev/null +++ b/nixpkgs/pkgs/applications/misc/megasync/noinstall-distro-version.patch @@ -0,0 +1,13 @@ +Index: source/src/MEGASync/platform/platform.pri +=================================================================== +--- source.orig/src/MEGASync/platform/platform.pri ++++ source/src/MEGASync/platform/platform.pri +@@ -37,7 +37,7 @@ unix:!macx { + system(command -v lsb_release): version.commands = lsb_release -rs > $$version.target + version.files = $$version.target + +- INSTALLS += distro version ++ # INSTALLS += distro version + + QT += dbus + SOURCES += $$PWD/linux/LinuxPlatform.cpp \ |