Writing portfiles: How to depend on a certain variant of a port?

Lars Sonchocky-Helldorf lars.sonchocky-helldorf at hamburg.de
Sun Sep 6 11:09:27 PDT 2015

Hi 'porters

I am trying to write a portfile for torch7 (see http://torch.ch/docs/getting-started.html ). Since I am not very experienced with that task I might ask some possibly stupid questions for a while …

At the moment I am trying to figure out the right depends_lib. My guideline for this is https://raw.githubusercontent.com/torch/ezinstall/master/install-deps which is normally used to install torch. This script hat the shortcoming that it unasked for installs brew:

if [[ `uname` == 'Darwin' ]]; then
    # GCC?
    if [[ `which gcc` == '' ]]; then
        echo "MacOS doesn't come with GCC: please install XCode and the command line tools."
        exit 1

    # Install Homebrew (pkg manager):
    if [[ `which brew` == '' ]]; then
        ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

    # Install dependencies:
    brew update
    brew install git readline cmake wget qt
    brew install libjpeg imagemagick zeromq graphicsmagick openssl
    brew link readline --force
    brew install caskroom/cask/brew-cask
    brew cask install xquartz
    brew remove gnuplot
    brew install gnuplot --with-wxmac --with-cairo --with-pdflib-lite --with-x11 --without-lua

Since I am a macports fellow I don't like the fact of having brew on my maschine. Despite the little funny beermug …

So I am trying to determine the dependencies from this. At the moment it looks like this:

depends_lib         port:git \
                    port:readline \
                    port:cmake \
                    port:wget \
                    port:qt4-mac \
                    port:jpeg \
                    port:ImageMagick \
                    port:zmq \
                    port:openssl \
                    port:quartz-wm \

now for gnuplot the default variants are +aquaterm +luaterm +pangocairo +wxwidgets +x11 but according to the above brew stuff I guess I would need the variants +wxwidgets +pangocairo +pdflib +x11

So how would I specify the variants I want in depends_lib? 

I searched https://guide.macports.org/chunked/development.variants.html and https://guide.macports.org/chunked/development.creating-portfile.html but found no answer on my question there.



More information about the macports-users mailing list