pkgsMusl.firefox: fix build
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
, cargo
|
||||
, dump_syms
|
||||
, makeWrapper
|
||||
, mimalloc
|
||||
, nodejs
|
||||
, perl
|
||||
, pkg-config
|
||||
@@ -88,9 +89,9 @@
|
||||
, ffmpegSupport ? true
|
||||
, gssSupport ? true, libkrb5
|
||||
, jackSupport ? stdenv.isLinux, libjack2
|
||||
, jemallocSupport ? true, jemalloc
|
||||
, jemallocSupport ? !stdenv.hostPlatform.isMusl, jemalloc
|
||||
, ltoSupport ? (stdenv.isLinux && stdenv.is64bit && !stdenv.hostPlatform.isRiscV), overrideCC, buildPackages
|
||||
, pgoSupport ? (stdenv.isLinux && stdenv.hostPlatform == stdenv.buildPlatform), xvfb-run
|
||||
, pgoSupport ? (stdenv.isLinux && stdenv.hostPlatform == stdenv.buildPlatform && !stdenv.hostPlatform.isMusl), xvfb-run
|
||||
, pipewireSupport ? waylandSupport && webrtcSupport
|
||||
, pulseaudioSupport ? stdenv.isLinux, libpulseaudio
|
||||
, sndioSupport ? stdenv.isLinux, sndio
|
||||
@@ -103,7 +104,7 @@
|
||||
# WARNING: NEVER set any of the options below to `true` by default.
|
||||
# Set to `!privacySupport` or `false`.
|
||||
|
||||
, crashreporterSupport ? !privacySupport && !stdenv.hostPlatform.isRiscV, curl
|
||||
, crashreporterSupport ? !privacySupport && !stdenv.hostPlatform.isRiscV && !stdenv.hostPlatform.isMusl, curl
|
||||
, geolocationSupport ? !privacySupport
|
||||
, googleAPISupport ? geolocationSupport
|
||||
, mlsAPISupport ? geolocationSupport
|
||||
@@ -229,6 +230,12 @@ buildStdenv.mkDerivation ({
|
||||
url = "https://hg.mozilla.org/mozilla-central/raw-rev/1068e0955cfb";
|
||||
hash = "sha256-iPqmofsmgvlFNm+mqVPbdgMKmP68ANuzYu+PzfCpoNA=";
|
||||
})
|
||||
] ++ [
|
||||
# https://bugzilla.mozilla.org/show_bug.cgi?id=1830040
|
||||
(fetchpatch {
|
||||
url = "https://git.alpinelinux.org/aports/plain/community/firefox/avoid-redefinition.patch?id=2f620d205ed0f9072bbd7714b5ec1b7bf6911c12";
|
||||
hash = "sha256-fLUYaJwhrC/wF24HkuWn2PHqz7LlAaIZ1HYjRDB2w9A=";
|
||||
})
|
||||
]
|
||||
++ lib.optional (lib.versionOlder version "111") ./env_var_for_system_dir-ff86.patch
|
||||
++ lib.optional (lib.versionAtLeast version "111") ./env_var_for_system_dir-ff111.patch
|
||||
@@ -335,6 +342,9 @@ buildStdenv.mkDerivation ({
|
||||
configureFlagsArray+=("--with-mozilla-api-keyfile=$TMPDIR/mls-api-key")
|
||||
'' + lib.optionalString (enableOfficialBranding && !stdenv.is32bit) ''
|
||||
export MOZILLA_OFFICIAL=1
|
||||
'' + lib.optionalString stdenv.hostPlatform.isMusl ''
|
||||
# linking firefox hits the vm.max_map_count kernel limit with the default musl allocator
|
||||
export LD_PRELOAD=${mimalloc}/lib/libmimalloc.so
|
||||
'';
|
||||
|
||||
# firefox has a different definition of configurePlatforms from nixpkgs, see configureFlags
|
||||
@@ -474,6 +484,12 @@ buildStdenv.mkDerivation ({
|
||||
makeFlags = extraMakeFlags;
|
||||
separateDebugInfo = enableDebugSymbols;
|
||||
enableParallelBuilding = true;
|
||||
env = lib.optionalAttrs stdenv.hostPlatform.isMusl {
|
||||
# Firefox relies on nonstandard behavior of the glibc dynamic linker. It re-uses
|
||||
# previously loaded libraries even though they are not in the rpath of the newly loaded binary.
|
||||
# On musl we have to explicity set the rpath to include these libraries.
|
||||
LDFLAGS = "-Wl,-rpath,${placeholder "out"}/lib/${binaryName}";
|
||||
};
|
||||
|
||||
# tests were disabled in configureFlags
|
||||
doCheck = false;
|
||||
|
||||
Reference in New Issue
Block a user