I use MegaSync as my cloud sync, and the current version (4.9.0.0) is over a year old now, so I am trying to upgrade it to 4.12.2.0, and hoping that it’s mostly a case of updating the version number and file hash.
I have forked the nixpkgs repo, created a branch on my fork, and now I’m trying to build the existing package to test my environment before I make any changes. I am following this guide, so I added this to my config:
nixpkgs.overlays = [
(final: prev: {
mymegasync = prev.megasync.overrideAttrs (previousAttrs: {
src = ../../nixpkgs/pkgs/applications/misc/megasync;
});
})
];
… and then imported mymegasync instead of megasync. Trying to build it with nixos-rebuild build
I get the following errors:
building Nix...
building the system configuration...
these 16 derivations will be built:
/nix/store/95cg6gka0d2smyfpqzb0hs3g30j4nsby-megasync-4.9.0.0.drv
/nix/store/qc3rc8g5ypq5xfgb000xg6rsc8lfxrkv-system-path.drv
/nix/store/zdfl1crq7fh0gsmk221iayfja6fpkhjp-dbus-1.drv
/nix/store/r2f10bd282cnfs63rbba6hwcsiqiiyq7-X-Restart-Triggers-dbus.drv
/nix/store/13vjkm9xircmc8q6zgnkzvj6kvy49p32-unit-dbus.service.drv
/nix/store/3zfw99szkra4hffa3dxg5czsb6wkmyxk-etc-pam-environment.drv
/nix/store/4vnm6m3q3gskligk6rc77ymb5n1d9isj-set-environment.drv
/nix/store/1p5wcalhan8k8xzcyixifynrmhchbc25-X-Restart-Triggers-polkit.drv
/nix/store/ls2l62dxajx3vsc6hdbazcnm59lglxj4-unit-polkit.service.drv
/nix/store/v1sxa5j3x1rkn3z1zb1nkx2icw706zc8-unit-accounts-daemon.service.drv
/nix/store/xz7dk8dhx12pb6h9294vhcr5rsr7mj7v-unit-dbus.service.drv
/nix/store/axvlmwrzav46q2p4znnv3phkg6h6dmsj-system-units.drv
/nix/store/knbvvpxp6qdszdwk60piybr4wm8x22j2-etc-profile.drv
/nix/store/p0337lxkmsnxh0y46imc1l2qxj8vnfcy-user-units.drv
/nix/store/zsj8sa7zyhm39sxfffmn5d9f3xs8qahc-etc.drv
/nix/store/193g6cmlfarzczdgx37p8xn6sypbgqcx-nixos-system-atrius-23.11.4703.c5101e457206.drv
building '/nix/store/95cg6gka0d2smyfpqzb0hs3g30j4nsby-megasync-4.9.0.0.drv'...
Running phase: qtPreHook
Running phase: unpackPhase
unpacking source archive /nix/store/3nmy7nmdj2ql9hfi4yg3yzxn1fk057j2-megasync
source root is megasync
Running phase: patchPhase
applying patch /nix/store/qscc11iqhxsqqfs4yvwn2mw0i0s9fn2z-noinstall-distro-version.patch
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: source/src/MEGASync/platform/platform.pri
|===================================================================
|--- source.orig/src/MEGASync/platform/platform.pri
|+++ source/src/MEGASync/platform/platform.pri
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored
error: builder for '/nix/store/95cg6gka0d2smyfpqzb0hs3g30j4nsby-megasync-4.9.0.0.drv' failed with exit code 1
error: 1 dependencies of derivation '/nix/store/qc3rc8g5ypq5xfgb000xg6rsc8lfxrkv-system-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/1p5wcalhan8k8xzcyixifynrmhchbc25-X-Restart-Triggers-polkit.drv' failed to build
error: 1 dependencies of derivation '/nix/store/zdfl1crq7fh0gsmk221iayfja6fpkhjp-dbus-1.drv' failed to build
error: 1 dependencies of derivation '/nix/store/3zfw99szkra4hffa3dxg5czsb6wkmyxk-etc-pam-environment.drv' failed to build
error: 1 dependencies of derivation '/nix/store/4vnm6m3q3gskligk6rc77ymb5n1d9isj-set-environment.drv' failed to build
error: 1 dependencies of derivation '/nix/store/v1sxa5j3x1rkn3z1zb1nkx2icw706zc8-unit-accounts-daemon.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/r2f10bd282cnfs63rbba6hwcsiqiiyq7-X-Restart-Triggers-dbus.drv' failed to build
error: 1 dependencies of derivation '/nix/store/knbvvpxp6qdszdwk60piybr4wm8x22j2-etc-profile.drv' failed to build
error: 1 dependencies of derivation '/nix/store/ls2l62dxajx3vsc6hdbazcnm59lglxj4-unit-polkit.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/13vjkm9xircmc8q6zgnkzvj6kvy49p32-unit-dbus.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/xz7dk8dhx12pb6h9294vhcr5rsr7mj7v-unit-dbus.service.drv' failed to build
error: 3 dependencies of derivation '/nix/store/axvlmwrzav46q2p4znnv3phkg6h6dmsj-system-units.drv' failed to build
error: 1 dependencies of derivation '/nix/store/p0337lxkmsnxh0y46imc1l2qxj8vnfcy-user-units.drv' failed to build
error: 7 dependencies of derivation '/nix/store/zsj8sa7zyhm39sxfffmn5d9f3xs8qahc-etc.drv' failed to build
error: 2 dependencies of derivation '/nix/store/193g6cmlfarzczdgx37p8xn6sypbgqcx-nixos-system-atrius-23.11.4703.c5101e457206.drv' failed to build
There’s no more information about why the dependencies failed to build, but since this is based on my existing configuration, I can’t understand why it doesn’t work. I also tried starting a nix-shell with some of the dependencies, but all of the QT ones cause errors, so although this command works it still results in exactly the same error log above.
nix-shell -p autoconf automake c-ares cryptopp curl doxygen ffmpeg freeimage libmediainfo libraw libsodium libtool libuv libzen lsb-release sqlite swig unzip wget
So now I’m a bit lost. Am I following the right approach? I’d love to figure out how to help out and upgrade this package for myself and others.
Edit: I managed to get the nix-shell starting up with all of the buildInputs. The QT package paths had changed to have “libsForQt5.qt5” in front of them, so this worked to start the shell:
nix-shell -p autoconf automake doxygen libtool lsb-release pkg-config libsForQt5.qt5.qttools swig unzip c-ares cryptopp curl ffmpeg freeimage libmediainfo libraw libsodium libuv libzen libsForQt5.qt5.qtbase libsForQt5.qt5.qtx11extras sqlite wget
But the build still failed with the same error:
1 out of 1 hunk ignored
error: builder for '/nix/store/95cg6gka0d2smyfpqzb0hs3g30j4nsby-megasync-4.9.0.0.drv' failed with exit code 1
error: 1 dependencies of derivation '/nix/store/qc3rc8g5ypq5xfgb000xg6rsc8lfxrkv-system-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/1p5wcalhan8k8xzcyixifynrmhchbc25-X-Restart-Triggers-polkit.drv' failed to build
error: 1 dependencies of derivation '/nix/store/zdfl1crq7fh0gsmk221iayfja6fpkhjp-dbus-1.drv' failed to build
error: 1 dependencies of derivation '/nix/store/3zfw99szkra4hffa3dxg5czsb6wkmyxk-etc-pam-environment.drv' failed to build
error: 1 dependencies of derivation '/nix/store/4vnm6m3q3gskligk6rc77ymb5n1d9isj-set-environment.drv' failed to build
error: 1 dependencies of derivation '/nix/store/v1sxa5j3x1rkn3z1zb1nkx2icw706zc8-unit-accounts-daemon.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/r2f10bd282cnfs63rbba6hwcsiqiiyq7-X-Restart-Triggers-dbus.drv' failed to build
error: 1 dependencies of derivation '/nix/store/knbvvpxp6qdszdwk60piybr4wm8x22j2-etc-profile.drv' failed to build
error: 1 dependencies of derivation '/nix/store/ls2l62dxajx3vsc6hdbazcnm59lglxj4-unit-polkit.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/13vjkm9xircmc8q6zgnkzvj6kvy49p32-unit-dbus.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/xz7dk8dhx12pb6h9294vhcr5rsr7mj7v-unit-dbus.service.drv' failed to build
error: 3 dependencies of derivation '/nix/store/axvlmwrzav46q2p4znnv3phkg6h6dmsj-system-units.drv' failed to build
error: 1 dependencies of derivation '/nix/store/p0337lxkmsnxh0y46imc1l2qxj8vnfcy-user-units.drv' failed to build
error: 7 dependencies of derivation '/nix/store/zsj8sa7zyhm39sxfffmn5d9f3xs8qahc-etc.drv' failed to build
error: 2 dependencies of derivation '/nix/store/193g6cmlfarzczdgx37p8xn6sypbgqcx-nixos-system-atrius-23.11.4703.c5101e457206.drv' failed to build