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 20 , runtimeShell 21 21 , systemLocale ? config.i18n.defaultLocale or "en_US" 22 22 , patchelfUnstable # have to use patchelfUnstable to support --no-clobber-old-sections 23 + , makeWrapper 23 24 }: 24 25 25 26 let ··· 57 58 source = lib.findFirst (sourceMatches mozLocale) defaultSource sources; 58 59 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 + }; 60 75 in 61 76 62 77 stdenv.mkDerivation { ··· 64 79 65 80 src = fetchurl { inherit (source) url sha256; }; 66 81 67 - nativeBuildInputs = [ wrapGAppsHook autoPatchelfHook patchelfUnstable ]; 82 + nativeBuildInputs = [ wrapGAppsHook autoPatchelfHook wrappedPatchelf ]; 68 83 buildInputs = [ 69 84 gtk3 70 85 adwaita-icon-theme ··· 80 95 appendRunpaths = [ 81 96 "${pipewire}/lib" 82 97 ]; 83 - # Firefox uses "relrhack" to manually process relocations from a fixed offset 84 - patchelfFlags = [ "--no-clobber-old-sections" ]; 85 98 86 99 installPhase = 87 100 ''