anchor.diff:    inherit version;
     format = "wheel";
   
  -  # At the time of writing (2022-03-03), there are releases for <=3.10.
  -  # Supporting all of them is a pain, so we focus on 3.9, the current nixpkgs
  -  # python3 version, and 3.10.
  -  disabled = !(pythonVersion == "3.9" || pythonVersion == "3.10");
  +  # At the time of writing (2022-10-19), there are releases for <=3.10.
  +  # Supporting all of them is a pain, so we focus on 3.10, the current nixpkgs
  +  # python version.
  +  disabled = !(pythonVersion == "3.10");
   
  -  src =
  -    if !cudaSupport then cpuSrcs."${pythonVersion}" else
  -    let
  -      # jaxlib wheels are currently provided for cudnn versions at least 8.0.5 and
  -      # 8.2. Try to use 8.2 whenever possible.
  -      cudnnVersion = if (lib.versionAtLeast cudnn.version "8.2") then "82" else "805";
  -    in
  -    gpuSrcs."${pythonVersion}-${cudnnVersion}";
  +  src = if !cudaSupport then cpuSrcs."${stdenv.hostPlatform.system}" else gpuSrc;
   
     # Prebuilt wheels are dynamically linked against things that nix can't find.
     # Run `autoPatchelfHook` to automagically fix them.
  -  nativeBuildInputs = [ autoPatchelfHook ] ++ lib.optional cudaSupport addOpenGLRunpath;
  +  nativeBuildInputs = lib.optionals cudaSupport [ autoPatchelfHook addOpenGLRunpath ];
     # Dynamic link dependencies
     buildInputs = [ stdenv.cc.cc ];
   
  
positive.code:     sourceProvenance = with sourceTypes; [ binaryNativeCode ];
      license = licenses.asl20;
      maintainers = with maintainers; [ samuela ];
      platforms = [ "x86_64-linux" ];
    };
  }
  
negative.code: # https://storage.googleapis.com/jax-releases/libtpu_releases.html.
  
  # For future reference, the easiest way to test the GPU backend is to run
  #   NIX_PATH=.. nix-shell -p python3 python3Packages.jax "python3Packages.jaxlib-bin.override { cudaSupport = true; }"
  #   export XLA_FLAGS=--xla_gpu_force_compilation_parallelism=1
  #   python -c "from jax.lib import xla_bridge; assert xla_bridge.get_backend().platform == 'gpu'"
  #   python -c "from jax import random; random.PRNGKey(0)"
  