Installing a Python wheel (whl) file using a port - Tensorflow

Enrico Maria Crisostomo enrico.m.crisostomo at
Mon Dec 18 22:16:39 UTC 2017

Ah ok, I saw this. If I understand it correctly it's a subset of it. I've
also tried to build it from source but I'm not sure at all I would solve
the primary issue: according to the official documentation, the output of
the build is the whl file:

So, even if we update the port to build from source, we end up exactly with
the same issue: how to install the whl file.

Or perhaps my Python-foo is so weak I'm not seeing something obvious.


On 18 December 2017 at 23:10:01, Cunningham Ken (
ken.cunningham.webuse at wrote:

On 2017-12-18, at 2:09 PM, Enrico Maria Crisostomo wrote:

Thanks Ken.

Actually I checked brew and they haven't got a formula for TensorFlow (at
least at the moment).

On 18 December 2017 at 22:57:42, Cunningham Ken (
ken.cunningham.webuse at wrote:

FYI, I recall homebrew has tensorflow, so you might get some hints looking
at their formula.

Marius was taking this on a few months ago as well, so might have some


On 2017-12-18, at 1:52 PM, Enrico Maria Crisostomo wrote:


I’m trying to create a port for TensorFlow and I have already accumulated
quite a number of doubts in just a couple of hours I've been working on it.

First of all, I realised (late) that TensorFlow (and some of its
dependencies) is built as a wheel package (a .whl file), and as such it
gets uploaded to the Python Package Index: ​  whl files are meant to be
installed with pip, so my current port file does the following:

  if {${name} ne ${subport}} {

    build {

    destroot.cmd        pip-${python.branch}
    destroot.args       \
        install \
        --no-cache-dir \
        --no-dependencies \
        --target ${destroot}${python.pkgd} \

    livecheck.type      none

You can see the PR here:

The port apparently work, but I'd like to submit this port for review for
the following reasons:

  * I'm not sure we should install a whl file this way, invoking `pip`.

  * I had to redefine `master_sites` and `checksums` for each version of

  * I had to redefine the `extract` properties to skip extraction and just
copy the downloaded file into `${worksrcpath}`:

      extract.suffix      .whl
      extract.cmd         cp
      extract.post_args   ${worksrcpath}
      extract.mkdir       yes

  * Is there a better idiom to refer to the currently-installed `pip`?

      destroot.cmd        pip-${python.branch}

  * Is there a better idiom to refer to the Python site packages directory
in the staging area?


Finally, I'm wondering whether this is a good idea at all.  I've grep-ed
the ports and I saw no other whl file installed this way.

If you can have a look at the PR I will appreciate any feedback and insight.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the macports-dev mailing list