From 5d3da0395d4e6d8592073a31313aef23f54cff43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Schr=C3=B6ter?= Date: Thu, 24 Oct 2024 19:04:29 +0200 Subject: [PATCH] mullvad-browser: 13.5.9 -> 14.0 https://github.com/mullvad/mullvad-browser/releases/tag/14.0 Add --no-clobber-old-sections to patchelf to fix segfault. Also switches from manual patchelf usage to autoPatchelf to make this fix work for all binaries. (cherry picked from commit 841ff222ddc13768fda78205474df3bf13878c7f) --- pkgs/by-name/mu/mullvad-browser/package.nix | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/mu/mullvad-browser/package.nix b/pkgs/by-name/mu/mullvad-browser/package.nix index 84b63cc542ce..9f46d11f6a43 100644 --- a/pkgs/by-name/mu/mullvad-browser/package.nix +++ b/pkgs/by-name/mu/mullvad-browser/package.nix @@ -7,6 +7,7 @@ , writeText , wrapGAppsHook3 , autoPatchelfHook +, patchelfUnstable # have to use patchelfUnstable to support --no-clobber-old-sections , callPackage , atk @@ -90,7 +91,7 @@ let ++ lib.optionals mediaSupport [ ffmpeg ] ); - version = "13.5.9"; + version = "14.0"; sources = { x86_64-linux = fetchurl { @@ -102,7 +103,7 @@ let "https://tor.eff.org/dist/mullvadbrowser/${version}/mullvad-browser-linux-x86_64-${version}.tar.xz" "https://tor.calyxinstitute.org/dist/mullvadbrowser/${version}/mullvad-browser-linux-x86_64-${version}.tar.xz" ]; - hash = "sha256-hyFYI42IfFY0vqkqInkLQAWSY8flsmWGN8CaXBwXbGA="; + hash = "sha256-D5r1VsbjaswGm5ncgdSIOJFfDMXBZX2JDGcTTRVkoVs="; }; }; @@ -125,7 +126,13 @@ stdenv.mkDerivation rec { src = sources.${stdenv.hostPlatform.system} or (throw "unsupported system: ${stdenv.hostPlatform.system}"); - nativeBuildInputs = [ copyDesktopItems makeWrapper wrapGAppsHook3 autoPatchelfHook ]; + nativeBuildInputs = [ + autoPatchelfHook + patchelfUnstable + copyDesktopItems + makeWrapper + wrapGAppsHook3 + ]; buildInputs = [ gtk3 alsa-lib @@ -133,6 +140,9 @@ stdenv.mkDerivation rec { libXtst ]; + # Firefox uses "relrhack" to manually process relocations from a fixed offset + patchelfFlags = [ "--no-clobber-old-sections" ]; + preferLocalBuild = true; allowSubstitutes = false; @@ -165,7 +175,8 @@ stdenv.mkDerivation rec { tar xf "$src" -C "$MB_IN_STORE" --strip-components=2 pushd "$MB_IN_STORE" - patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "mullvadbrowser.real" + # Set ELF interpreter + autoPatchelf mullvadbrowser.real # mullvadbrowser is a wrapper that checks for a more recent libstdc++ & appends it to the ld path mv mullvadbrowser.real mullvadbrowser