Any way to cross compile a port?

Ryan Schmidt ryandesign at macports.org
Sat Mar 26 00:01:21 PDT 2016


On Mar 26, 2016, at 1:52 AM, Carlo Tambuatco <oraclmaster at gmail.com> wrote:
> 
> Well, I was asking for anything huge like say pypy or ffmpeg or anything that takes hours to build. Is there some kind of preferences you can set for certain ports to request pre-built binaries only? Does macports automatically detect your build environment and just know which binaries to download and install?

We build different binaries for each version of OS X. MacPorts knows what version of OS X you run so it can request the correct binary from our server.

There is no per-port setting for whether you want a binary or not. MacPorts defaults to assuming you want to use our binaries if they are available. You can override this on a port-by-port basis using the -s or -b flag. "-s" means build from source. "-b" means use a binary only; print an error message and exit if no binary exists on our server.

You can also set this globally. In macports.conf, look for the setting "buildfromsource". Its default value is "ifneeded". This means MacPorts will first try to download a binary from our server, and if none exists for your OS and arch(s) and the variant(s) you selected, it will be built on your computer. Other values you can change "buildfromsource" to are "always" (which means always build from source; do not attempt to use a binary from our server) or "never" (which means never try to build from source; print an error message and exit if no binary exists on our server).

Binary packages exist for pypy:

http://packages.macports.org/pypy/?C=M;O=D

Current binaries do not exist for ffmpeg because we are not allowed to distribute such binaries due to the license, so you must build it from source:

$ ~/macports/base/portmgr/jobs/port_binary_distributable.tcl -v ffmpeg
"ffmpeg" is not distributable because its license "gpl" conflicts with license "OpenSSL" of dependency "openssl"




More information about the macports-users mailing list