Skip to content

Package request: python*Packages.tensorflow-bin for aarch64-darwin #308125

@dbaynard

Description

@dbaynard

Project description

I've been able to get this to build. Here's a sample override for cfd6b5f

{ lib
, fetchurl
, hostPlatform
, python3
}:

# Python packages
let

  tensorflow-aarch64-sources = {
    "2.15.0" = {
      "3.10" = {
        prefix = "98/35/844093df99983773f2c33be2f332047e1a531998f67da712358250cbf5e8";
        hash = "sha256-zftM2A3f3xiSEvTjdHpEBHAtWMxqNGq4iHvVZ8oyhPg=";
      };
    };
  };

  tensorflow-bin = python3.pkgs.tensorflow-bin.overridePythonAttrs (old:
    {
      meta = old.meta or { } // {
        platforms = old.meta.platforms or [ ] ++ [
          "aarch64-darwin"
        ];
      };
    } // lib.optionalAttrs (hostPlatform.isDarwin && hostPlatform.isAarch64) {
      src =
        let
          inherit (python3) pythonVersion;
          pyVerNoDot = lib.replaceStrings [ "." ] [ "" ] pythonVersion;
          name = "tensorflow_macos-${old.version}-cp${pyVerNoDot}-cp${pyVerNoDot}-macosx_12_0_arm64.whl";
          details = tensorflow-aarch64-sources.${old.version}.${pythonVersion};
        in
        fetchurl {
          inherit name;
          url = "https://files.pythonhosted.org/packages/${details.prefix}/${name}";
          hash = details.hash or lib.fakeHash;
        };
      preConfigure = lib.replaceStrings
        [ "mv *.whl $orig_name" ]
        [ "[[ -f $orig_name ]] || mv *.whl $orig_name" ]
        old.preConfigure;
    });

in
tensorflow-bin

I'm happy to make the PR, if maintainers are willing to review? @jyp @abbradar

(I was unable to access old wheels from the googleapis URLs, hence using pypi.)

Metadata

  • homepage URL: http://tensorflow.org
  • source URL: (binary: see above)
  • license: asl20
  • platforms: this issue is for darwin

This is already supported for x86_64 (linux and darwin) in https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/development/python-modules/tensorflow/bin.nix


Add a 👍 reaction to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions