···464464 be disabled by setting `dontUseCargoParallelTests`.465465* `cargoInstallHook`: install binaries and static/shared libraries466466 that were built using `cargoBuildHook`.467467+* `bindgenHook`: for crates which use `bindgen` as a build dependency, lets468468+ `bindgen` find `libclang` and `libclang` find the libraries in `buildInputs`.467469468470### Examples {#examples}469471
···135135 };136136137137 config = mkOption {138138- type = types.submodule {138138+ type = types.nullOr (types.submodule {139139 freeformType = format.type;140140 options = {141141 # This is a partial selection of the most common options, so new users can quickly···244244 };245245 };246246 };247247- };247247+ });248248 example = literalExpression ''249249 {250250 homeassistant = {···349349 '';350350 description = ''351351 The Home Assistant package to use.352352- Override <literal>extraPackages</literal> or <literal>extraComponents</literal> in order to add additional dependencies.353353- If you specify <option>config</option> and do not set <option>autoExtraComponents</option>354354- to <literal>false</literal>, overriding <literal>extraComponents</literal> will have no effect.355355- Avoid <literal>home-assistant.overridePythonAttrs</literal> if you use <literal>autoExtraComponents</literal>.356352 '';357353 };358354
···1111, hunspell, libevent, libstartup_notification1212, libvpx1313, icu70, libpng, glib, pciutils1414-, autoconf213, which, gnused, rustPackages1414+, autoconf213, which, gnused, rustPackages, rustPlatform1515, rust-cbindgen, nodejs, nasm, fetchpatch1616, gnum41717, gtk3, wrapGAppsHook···196196 which197197 unzip198198 wrapGAppsHook199199+ rustPlatform.bindgenHook199200 ]200201 ++ lib.optionals buildStdenv.isDarwin [ xcbuild rsync ]201202 ++ extraNativeBuildInputs;···211210 rm -f .mozconfig*212211 # this will run autoconf213213212 configureScript="$(realpath ./mach) configure"214214- export MOZCONFIG=$(pwd)/mozconfig215213 export MOZBUILD_STATE_PATH=$(pwd)/mozbuild216214217217- # Set C flags for Rust's bindgen program. Unlike ordinary C218218- # compilation, bindgen does not invoke $CC directly. Instead it219219- # uses LLVM's libclang. To make sure all necessary flags are220220- # included we need to look in a few places.221221- # TODO: generalize this process for other use-cases.222222-223223- BINDGEN_CFLAGS="$(< ${buildStdenv.cc}/nix-support/libc-crt1-cflags) \224224- $(< ${buildStdenv.cc}/nix-support/libc-cflags) \225225- $(< ${buildStdenv.cc}/nix-support/cc-cflags) \226226- $(< ${buildStdenv.cc}/nix-support/libcxx-cxxflags) \227227- ${lib.optionalString buildStdenv.cc.isClang "-idirafter ${buildStdenv.cc.cc.lib}/lib/clang/${lib.getVersion buildStdenv.cc.cc}/include"} \228228- ${lib.optionalString buildStdenv.cc.isGNU "-isystem ${lib.getDev buildStdenv.cc.cc}/include/c++/${lib.getVersion buildStdenv.cc.cc} -isystem ${buildStdenv.cc.cc}/include/c++/${lib.getVersion buildStdenv.cc.cc}/${buildStdenv.hostPlatform.config}"} \229229- $NIX_CFLAGS_COMPILE"230230- ${231231- # Bindgen doesn't like the flag added by `separateDebugInfo`.232232- lib.optionalString enableDebugSymbols ''233233- BINDGEN_CFLAGS="''${BINDGEN_CFLAGS/ -Wa,--compress-debug-sections/}"234234- ''}235235- echo "ac_add_options BINDGEN_CFLAGS='$BINDGEN_CFLAGS'" >> $MOZCONFIG236215 '' + (lib.optionalString googleAPISupport ''237216 # Google API key used by Chromium and Firefox.238217 # Note: These are for NixOS/nixpkgs use ONLY. For your own distribution,
···11+# populates LIBCLANG_PATH and BINDGEN_EXTRA_CLANG_ARGS for rust projects that22+# depend on the bindgen crate33+44+# if you modify this, you probably also need to modify the wrapper for the cli55+# of bindgen in pkgs/development/tools/rust/bindgen/wrapper.sh66+77+populateBindgenEnv () {88+ export LIBCLANG_PATH=@libclang@/lib99+ BINDGEN_EXTRA_CLANG_ARGS="$(< @clang@/nix-support/cc-cflags) $(< @clang@/nix-support/libc-cflags) $(< @clang@/nix-support/libcxx-cxxflags) $NIX_CFLAGS_COMPILE"1010+ export BINDGEN_EXTRA_CLANG_ARGS1111+}1212+1313+postHook="${postHook:-}"$'\n'"populateBindgenEnv"$'\n'
+2-2
pkgs/data/fonts/andika/default.nix
···11{ lib, fetchzip }:2233let44- version = "6.001";44+ version = "6.101";55in66 fetchzip rec {77 name = "andika-${version}";···1414 unzip -j $downloadedFile \*OFL.txt \*OFL-FAQ.txt \*README.txt \*FONTLOG.txt -d "$out/share/doc/${name}"1515 '';16161717- sha256 = "sha256-ukPFBLjHQbOosQ1h0ImVlz8HhNNMp0e41SjzUhQaZtc=";1717+ sha256 = "sha256-J/Ad+fmCMOxLoo+691LE6Bgi/l3ovIfWScwwVWtqACI=";18181919 meta = with lib; {2020 homepage = "https://software.sil.org/andika";
+2-2
pkgs/data/fonts/charis-sil/default.nix
···11{ lib, fetchzip }:2233let44- version = "6.001";44+ version = "6.101";55in66 fetchzip rec {77 name = "charis-sil-${version}";···1414 unzip -j $downloadedFile \*OFL.txt \*OFL-FAQ.txt \*README.txt \*FONTLOG.txt -d "$out/share/doc/${name}"1515 '';16161717- sha256 = "sha256-eKSOvYuTMpAnTk4sRiWFUDJrTsF+K5716ALCepaUU08=";1717+ sha256 = "sha256-b1ms9hJ6IPe7W6O9KgzHZvwT4/nAoLOhdydcUrwNfnU=";18181919 meta = with lib; {2020 homepage = "https://software.sil.org/charis";
+2-2
pkgs/data/fonts/doulos-sil/default.nix
···11{ lib, fetchzip }:2233let44- version = "6.001";44+ version = "6.101";55in66 fetchzip rec {77 name = "doulos-sil-${version}";···1414 unzip -j $downloadedFile \*OFL.txt \*OFL-FAQ.txt \*README.txt \*FONTLOG.txt -d "$out/share/doc/${name}"1515 '';16161717- sha256 = "sha256-MkeLLT7EAeSuCMxVVxVfajHufxr+xMLIz2hf3wF3U4o=";1717+ sha256 = "sha256-vYdnudMkkWz6r8pwq98fyO0zcfFBRPmrqlmWxHCOIcc=";18181919 meta = with lib; {2020 homepage = "https://software.sil.org/doulos";
···3434 touch $out3535 '';3636 };3737- } ''3737+ }3838+ # if you modify the logic to find the right clang flags, also modify rustPlatform.bindgenHook3939+ ''3840 mkdir -p $out/bin3941 export cincludes="$(< ${clang}/nix-support/cc-cflags) $(< ${clang}/nix-support/libc-cflags)"4042 export cxxincludes="$(< ${clang}/nix-support/libcxx-cxxflags)"