Skip to content

Commit c8baaf5

Browse files
authored
megasync: update, cleanup, move to by-name (#389764)
2 parents f94458a + e6b5a9e commit c8baaf5

File tree

4 files changed

+66
-56
lines changed

4 files changed

+66
-56
lines changed
Lines changed: 66 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,46 @@
11
{
22
lib,
33
stdenv,
4-
c-ares,
4+
fetchFromGitHub,
5+
fetchpatch,
6+
7+
# nativeBuildInputs
58
cmake,
9+
libsForQt5,
10+
libtool,
11+
pkg-config,
12+
unzip,
13+
14+
# buildInputs
15+
c-ares,
616
cryptopp,
717
curl,
8-
fetchFromGitHub,
9-
fetchpatch,
1018
ffmpeg,
1119
hicolor-icon-theme,
1220
icu,
1321
libmediainfo,
1422
libsodium,
15-
libtool,
1623
libuv,
1724
libxcb,
1825
libzen,
19-
mkDerivation,
2026
openssl,
21-
pkg-config,
22-
qtbase,
23-
qtdeclarative,
24-
qtgraphicaleffects,
25-
qttools,
26-
qtquickcontrols,
27-
qtquickcontrols2,
28-
qtsvg,
29-
qtx11extras,
3027
readline,
3128
sqlite,
32-
unzip,
3329
wget,
3430
xorg,
3531
zlib,
36-
qt5,
32+
33+
nix-update-script,
3734
}:
38-
mkDerivation rec {
35+
stdenv.mkDerivation (finalAttrs: {
3936
pname = "megasync";
40-
version = "5.7.1.0";
37+
version = "5.8.0.2";
4138

4239
src = fetchFromGitHub rec {
4340
owner = "meganz";
4441
repo = "MEGAsync";
45-
rev = "v${version}_Linux";
46-
hash = "sha256-lbAI17CyHrppMnxQDV5g0IE+I7Y0DwU+h5MSFZclD2A=";
42+
tag = "v${finalAttrs.version}_Linux";
43+
hash = "sha256-/q7LD1/06+0MepDz3fVrlvGKh+rvNk6d1hm7Ng54Nmk=";
4744
fetchSubmodules = false; # DesignTokensImporter cannot be fetched, see #1010 in github:meganz/megasync
4845
leaveDotGit = true;
4946
postFetch = ''
@@ -52,20 +49,46 @@ mkDerivation rec {
5249
git remote add origin $url
5350
git fetch origin
5451
git clean -fdx
55-
git checkout ${rev}
52+
git checkout ${tag}
5653
git submodule update --init src/MEGASync/mega
5754
5855
rm -rf .git
5956
''; # Why so complicated, I just want a single submodule
6057
};
6158

59+
patches = [
60+
(fetchpatch {
61+
url = "https://aur.archlinux.org/cgit/aur.git/plain/020-megasync-sdk-fix-cmake-dependencies-detection.patch?h=megasync&id=ff59780039697591e7e3a966db058b23bee0451c";
62+
hash = "sha256-hQY6tMwiV3B6M6WiFdOESdhahAtuWjdoj2eI2mst/K8=";
63+
extraPrefix = "src/MEGASync/mega/";
64+
stripLen = true;
65+
})
66+
(fetchpatch {
67+
url = "https://aur.archlinux.org/cgit/aur.git/plain/030-megasync-app-fix-cmake-dependencies-detection.patch?h=megasync&id=ff59780039697591e7e3a966db058b23bee0451c";
68+
hash = "sha256-11XWctv1veUEguc9Xvz2hMYw26CaCwu6M4hyA+5r81U=";
69+
})
70+
./megasync-fix-cmake-install-bindir.patch
71+
./dont-fetch-clang-format.patch
72+
];
73+
74+
postPatch = ''
75+
substituteInPlace cmake/modules/desktopapp_options.cmake \
76+
--replace-fail "ENABLE_ISOLATED_GFX ON" "ENABLE_ISOLATED_GFX OFF"
77+
78+
for file in $(find src/ -type f \( -iname configure -o -iname \*.sh \) ); do
79+
substituteInPlace "$file" --replace-warn "/bin/bash" "${stdenv.shell}"
80+
done
81+
'';
82+
6283
nativeBuildInputs = [
6384
cmake
85+
libsForQt5.qttools
86+
libsForQt5.wrapQtAppsHook
6487
libtool
6588
pkg-config
66-
qttools
6789
unzip
6890
];
91+
6992
buildInputs = [
7093
c-ares
7194
cryptopp
@@ -74,46 +97,24 @@ mkDerivation rec {
7497
hicolor-icon-theme
7598
icu
7699
libmediainfo
100+
libsForQt5.qtbase
101+
libsForQt5.qtdeclarative
102+
libsForQt5.qtgraphicaleffects
103+
libsForQt5.qtquickcontrols
104+
libsForQt5.qtquickcontrols2
105+
libsForQt5.qtsvg
106+
libsForQt5.qtx11extras
77107
libsodium
78108
libuv
79109
libxcb
80110
libzen
81111
openssl
82-
qtbase
83-
qtdeclarative
84-
qtgraphicaleffects
85-
qtquickcontrols
86-
qtquickcontrols2
87-
qtsvg
88-
qtx11extras
89112
readline
90113
sqlite
91114
wget
92115
zlib
93116
];
94117

95-
patches = [
96-
(fetchpatch {
97-
url = "https://aur.archlinux.org/cgit/aur.git/plain/020-megasync-sdk-fix-cmake-dependencies-detection.patch?h=megasync&id=ff59780039697591e7e3a966db058b23bee0451c";
98-
hash = "sha256-hQY6tMwiV3B6M6WiFdOESdhahAtuWjdoj2eI2mst/K8=";
99-
extraPrefix = "src/MEGASync/mega/";
100-
stripLen = true;
101-
})
102-
(fetchpatch {
103-
url = "https://aur.archlinux.org/cgit/aur.git/plain/030-megasync-app-fix-cmake-dependencies-detection.patch?h=megasync&id=ff59780039697591e7e3a966db058b23bee0451c";
104-
hash = "sha256-11XWctv1veUEguc9Xvz2hMYw26CaCwu6M4hyA+5r81U=";
105-
})
106-
./megasync-fix-cmake-install-bindir.patch
107-
./dont-fetch-clang-format.patch
108-
];
109-
110-
postPatch = ''
111-
substituteInPlace cmake/modules/desktopapp_options.cmake --replace-fail "ENABLE_ISOLATED_GFX ON" "ENABLE_ISOLATED_GFX OFF"
112-
for file in $(find src/ -type f \( -iname configure -o -iname \*.sh \) ); do
113-
substituteInPlace "$file" --replace "/bin/bash" "${stdenv.shell}"
114-
done
115-
'';
116-
117118
dontUseQmakeConfigure = true;
118119
enableParallelBuilding = true;
119120

@@ -127,14 +128,25 @@ mkDerivation rec {
127128
qtWrapperArgs+=(--prefix PATH : ${lib.makeBinPath [ xorg.xrdb ]})
128129
'';
129130

130-
meta = with lib; {
131+
passthru = {
132+
updateScript = nix-update-script {
133+
extraArgs = [
134+
"--version-regex=^v(.*)_Linux$"
135+
];
136+
};
137+
};
138+
139+
meta = {
131140
description = "Easy automated syncing between your computers and your MEGA Cloud Drive";
132141
homepage = "https://mega.nz/";
133-
license = licenses.unfree;
142+
downloadPage = "https://github.com/meganz/MEGAsync";
143+
changelog = "https://github.com/meganz/MEGAsync/releases/tag/v${finalAttrs.version}_Linux";
144+
license = lib.licenses.unfree;
134145
platforms = [
135146
"i686-linux"
136147
"x86_64-linux"
137148
];
138149
maintainers = [ ];
150+
mainProgram = "megasync";
139151
};
140-
}
152+
})

pkgs/top-level/all-packages.nix

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2445,8 +2445,6 @@ with pkgs;
24452445

24462446
materialx = with python3Packages; toPythonApplication materialx;
24472447

2448-
megasync = libsForQt5.callPackage ../applications/misc/megasync { };
2449-
24502448
# while building documentation meson may want to run binaries for host
24512449
# which needs an emulator
24522450
# example of an error which this fixes

0 commit comments

Comments
 (0)