firefox: cleanup expression

- Add a few more macOS frameworks needed
- Fix RUST_BINDGEN handling. We need to pass all of NIX_CFLAGS_COMPILE
  to rust bindgen
wip/yesman
Matthew Bauer 6 years ago
parent 72a1bc9a28
commit 4b71fe6d86
  1. 32
      pkgs/applications/networking/browsers/firefox/common.nix
  2. 4
      pkgs/top-level/all-packages.nix

@ -40,7 +40,8 @@
, drmSupport ? false
# macOS dependencies
, xcbuild, CoreMedia
, xcbuild, CoreMedia, ExceptionHandling, Kerberos, AVFoundation, MediaToolbox
, CoreLocation, Foundation, libobjc
## other
@ -97,9 +98,20 @@ stdenv.mkDerivation (rec {
++ lib.optionals ffmpegSupport [ gstreamer gst-plugins-base ]
++ lib.optional gtk3Support gtk3
++ lib.optional gssSupport kerberos
++ lib.optionals stdenv.isDarwin [ CoreMedia ];
NIX_CFLAGS_COMPILE = "-I${nspr.dev}/include/nspr -I${nss.dev}/include/nss -I${glib.dev}/include/gio-unix-2.0";
++ lib.optionals stdenv.isDarwin [ CoreMedia ExceptionHandling Kerberos
AVFoundation MediaToolbox CoreLocation
Foundation libobjc ];
NIX_CFLAGS_COMPILE = [ "-I${nspr.dev}/include/nspr"
"-I${nss.dev}/include/nss"
"-I${glib.dev}/include/gio-unix-2.0" ]
++ lib.optional stdenv.isDarwin [
"-isystem ${llvmPackages.libcxx}/include/c++/v1"
"-DMAC_OS_X_VERSION_MAX_ALLOWED=MAC_OS_X_VERSION_10_10" ];
postPatch = lib.optionalString stdenv.isDarwin ''
substituteInPlace js/src/jsmath.cpp --replace 'defined(HAVE___SINCOS)' 0
'';
nativeBuildInputs =
[ autoconf213 which gnused pkgconfig perl python2 cargo rustc ]
@ -120,10 +132,14 @@ stdenv.mkDerivation (rec {
make -f client.mk configure-files
configureScript="$(realpath ./configure)"
'') + ''
cxxLib=$( echo -n ${gcc}/include/c++/* )
archLib=$cxxLib/$( ${gcc}/bin/gcc -dumpmachine )
test -f layout/style/ServoBindings.toml && sed -i -e '/"-DRUST_BINDGEN"/ a , "-cxx-isystem", "'$cxxLib'", "-isystem", "'$archLib'"' layout/style/ServoBindings.toml
export MOZCONFIG=$(pwd)/mozconfig
# Set C flags for Rust's bindgen program. Unlike ordinary C
# compilation, bindgen does not invoke $CC directly. Instead it
# uses LLVM's libclang. To make sure all necessary flags are
# included we need to look in a few places.
# TODO: generalize this process for other use-cases.
echo "ac_add_options BINDGEN_CFLAGS='$(< ${stdenv.cc}/nix-support/libc-cflags) $(< ${stdenv.cc}/nix-support/cc-cflags) ${stdenv.cc.default_cxx_stdlib_compile} -idirafter ${llvmPackages.clang.cc}/lib/clang/${lib.getVersion llvmPackages.clang}/include $NIX_CFLAGS_COMPILE'" >> $MOZCONFIG
'' + lib.optionalString googleAPISupport ''
# Google API key used by Chromium and Firefox.
# Note: These are for NixOS/nixpkgs use ONLY. For your own distribution,

@ -16306,6 +16306,10 @@ with pkgs;
python = python2;
gnused = gnused_422;
icu = icu59;
inherit (darwin.apple_sdk.frameworks) CoreMedia ExceptionHandling
Kerberos AVFoundation MediaToolbox
CoreLocation Foundation;
inherit (darwin) libobjc;
};
});

Loading…
Cancel
Save