Merge pull request #268033 from K900/firefox-bin-hacks-again

Revert "firefox-bin: remove workaround"

authored by K900 and committed by GitHub 3b7c461d b1cc48b9

+16 -3
+16 -3
pkgs/applications/networking/browsers/firefox-bin/default.nix
··· 20 , runtimeShell 21 , systemLocale ? config.i18n.defaultLocale or "en_US" 22 , patchelfUnstable # have to use patchelfUnstable to support --no-clobber-old-sections 23 }: 24 25 let ··· 57 source = lib.findFirst (sourceMatches mozLocale) defaultSource sources; 58 59 pname = "firefox-${channel}-bin-unwrapped"; 60 in 61 62 stdenv.mkDerivation { ··· 64 65 src = fetchurl { inherit (source) url sha256; }; 66 67 - nativeBuildInputs = [ wrapGAppsHook autoPatchelfHook patchelfUnstable ]; 68 buildInputs = [ 69 gtk3 70 adwaita-icon-theme ··· 80 appendRunpaths = [ 81 "${pipewire}/lib" 82 ]; 83 - # Firefox uses "relrhack" to manually process relocations from a fixed offset 84 - patchelfFlags = [ "--no-clobber-old-sections" ]; 85 86 installPhase = 87 ''
··· 20 , runtimeShell 21 , systemLocale ? config.i18n.defaultLocale or "en_US" 22 , patchelfUnstable # have to use patchelfUnstable to support --no-clobber-old-sections 23 + , makeWrapper 24 }: 25 26 let ··· 58 source = lib.findFirst (sourceMatches mozLocale) defaultSource sources; 59 60 pname = "firefox-${channel}-bin-unwrapped"; 61 + 62 + # FIXME: workaround for not being able to pass flags to patchelf 63 + # Remove after https://github.com/NixOS/nixpkgs/pull/256525 64 + wrappedPatchelf = stdenv.mkDerivation { 65 + pname = "patchelf-wrapped"; 66 + inherit (patchelfUnstable) version; 67 + 68 + nativeBuildInputs = [ makeWrapper ]; 69 + 70 + buildCommand = '' 71 + mkdir -p $out/bin 72 + makeWrapper ${patchelfUnstable}/bin/patchelf $out/bin/patchelf --append-flags "--no-clobber-old-sections" 73 + ''; 74 + }; 75 in 76 77 stdenv.mkDerivation { ··· 79 80 src = fetchurl { inherit (source) url sha256; }; 81 82 + nativeBuildInputs = [ wrapGAppsHook autoPatchelfHook wrappedPatchelf ]; 83 buildInputs = [ 84 gtk3 85 adwaita-icon-theme ··· 95 appendRunpaths = [ 96 "${pipewire}/lib" 97 ]; 98 99 installPhase = 100 ''