Skip to content

Commit

Permalink
firefox{-esr,}: fix failing build due to the google-api-key
Browse files Browse the repository at this point in the history
Since firefox 58.0.1 the google api key is now stored at an absolute
path ($TMPDIR/ga). Since variable expansion in `configureFlags` does not
really work (as expected) the build started failing when using the
legacy firefox build system. With the newer `./mach` based builds
firefox reads the configure flags from `.mozconfig` instead.

This commit moves the `with-google-api-keyfile=` setting into the
`preConfigure` phase where we can properly expand `$TMPDIR` into
whatever the path is.
  • Loading branch information
andir committed Feb 1, 2018
1 parent f92fd95 commit 42b9b8f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkgs/applications/networking/browsers/firefox/common.nix
Expand Up @@ -104,12 +104,14 @@ stdenv.mkDerivation (rec {
'' + lib.optionalString (stdenv.lib.versionAtLeast version "58.0.0") ''
cat >.mozconfig <<END_MOZCONFIG
${lib.concatStringsSep "\n" (map (flag: "ac_add_options ${flag}") configureFlags)}
${lib.optionalString googleAPISupport "ac_add_options --with-google-api-keyfile=$TMPDIR/ga"}
END_MOZCONFIG
'' + lib.optionalString googleAPISupport ''
# Google API key used by Chromium and Firefox.
# Note: These are for NixOS/nixpkgs use ONLY. For your own distribution,
# please get your own set of keys.
echo "AIzaSyDGi15Zwl11UNe6Y-5XW_upsfyw31qwZPI" > $TMPDIR/ga
configureFlagsArray+=("--with-google-api-keyfile=$TMPDIR/ga")
'' + ''
# this will run autoconf213
${if (stdenv.lib.versionAtLeast version "58.0.0") then "./mach configure" else "make -f client.mk configure-files"}
Expand Down Expand Up @@ -184,7 +186,6 @@ stdenv.mkDerivation (rec {
++ flag gssSupport "negotiateauth"
++ lib.optional (!ffmpegSupport) "--disable-gstreamer"
++ flag webrtcSupport "webrtc"
++ lib.optional googleAPISupport "--with-google-api-keyfile=$TMPDIR/ga"
++ flag crashreporterSupport "crashreporter"
++ lib.optional drmSupport "--enable-eme=widevine"

Expand Down

0 comments on commit 42b9b8f

Please sign in to comment.