firefox{-esr,}: fix failing build due to the google-api-key

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.
This commit is contained in:
Andreas Rammhold 2018-02-01 13:38:16 +01:00
parent f92fd9554e
commit 42b9b8f7c8
No known key found for this signature in database
GPG Key ID: E432E410B5E48C86

@ -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"}
@ -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"