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
This commit is contained in:
parent
72a1bc9a28
commit
4b71fe6d86
@ -40,7 +40,8 @@
|
|||||||
, drmSupport ? false
|
, drmSupport ? false
|
||||||
|
|
||||||
# macOS dependencies
|
# macOS dependencies
|
||||||
, xcbuild, CoreMedia
|
, xcbuild, CoreMedia, ExceptionHandling, Kerberos, AVFoundation, MediaToolbox
|
||||||
|
, CoreLocation, Foundation, libobjc
|
||||||
|
|
||||||
## other
|
## other
|
||||||
|
|
||||||
@ -97,9 +98,20 @@ stdenv.mkDerivation (rec {
|
|||||||
++ lib.optionals ffmpegSupport [ gstreamer gst-plugins-base ]
|
++ lib.optionals ffmpegSupport [ gstreamer gst-plugins-base ]
|
||||||
++ lib.optional gtk3Support gtk3
|
++ lib.optional gtk3Support gtk3
|
||||||
++ lib.optional gssSupport kerberos
|
++ lib.optional gssSupport kerberos
|
||||||
++ lib.optionals stdenv.isDarwin [ CoreMedia ];
|
++ 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";
|
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 =
|
nativeBuildInputs =
|
||||||
[ autoconf213 which gnused pkgconfig perl python2 cargo rustc ]
|
[ autoconf213 which gnused pkgconfig perl python2 cargo rustc ]
|
||||||
@ -120,10 +132,14 @@ stdenv.mkDerivation (rec {
|
|||||||
make -f client.mk configure-files
|
make -f client.mk configure-files
|
||||||
configureScript="$(realpath ./configure)"
|
configureScript="$(realpath ./configure)"
|
||||||
'') + ''
|
'') + ''
|
||||||
cxxLib=$( echo -n ${gcc}/include/c++/* )
|
export MOZCONFIG=$(pwd)/mozconfig
|
||||||
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
|
# 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 ''
|
'' + lib.optionalString googleAPISupport ''
|
||||||
# Google API key used by Chromium and Firefox.
|
# Google API key used by Chromium and Firefox.
|
||||||
# Note: These are for NixOS/nixpkgs use ONLY. For your own distribution,
|
# Note: These are for NixOS/nixpkgs use ONLY. For your own distribution,
|
||||||
|
@ -16306,6 +16306,10 @@ with pkgs;
|
|||||||
python = python2;
|
python = python2;
|
||||||
gnused = gnused_422;
|
gnused = gnused_422;
|
||||||
icu = icu59;
|
icu = icu59;
|
||||||
|
inherit (darwin.apple_sdk.frameworks) CoreMedia ExceptionHandling
|
||||||
|
Kerberos AVFoundation MediaToolbox
|
||||||
|
CoreLocation Foundation;
|
||||||
|
inherit (darwin) libobjc;
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user