Skip to content

Commit

Permalink
firefox-bin: remove workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
K900 committed Sep 30, 2023
1 parent 10cb2bd commit 2893902
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions pkgs/applications/networking/browsers/firefox-bin/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
, runtimeShell
, systemLocale ? config.i18n.defaultLocale or "en_US"
, patchelfUnstable # have to use patchelfUnstable to support --no-clobber-old-sections
, makeWrapper
}:

let
Expand Down Expand Up @@ -58,28 +57,14 @@ let
source = lib.findFirst (sourceMatches mozLocale) defaultSource sources;

pname = "firefox-${channel}-bin-unwrapped";

# FIXME: workaround for not being able to pass flags to patchelf
# Remove after https://github.com/NixOS/nixpkgs/pull/256525
wrappedPatchelf = stdenv.mkDerivation {
pname = "patchelf-wrapped";
inherit (patchelfUnstable) version;

nativeBuildInputs = [ makeWrapper ];

buildCommand = ''
mkdir -p $out/bin
makeWrapper ${patchelfUnstable}/bin/patchelf $out/bin/patchelf --append-flags "--no-clobber-old-sections"
'';
};
in

stdenv.mkDerivation {
inherit pname version;

src = fetchurl { inherit (source) url sha256; };

nativeBuildInputs = [ wrapGAppsHook autoPatchelfHook wrappedPatchelf ];
nativeBuildInputs = [ wrapGAppsHook autoPatchelfHook patchelfUnstable ];
buildInputs = [
gtk3
adwaita-icon-theme
Expand All @@ -95,6 +80,8 @@ stdenv.mkDerivation {
appendRunpaths = [
"${pipewire.lib}/lib"
];
# Firefox uses "relrhack" to manually process relocations from a fixed offset
patchelfFlags = [ "--no-clobber-old-sections" ];

installPhase =
''
Expand Down

0 comments on commit 2893902

Please sign in to comment.