bin: dependencies not working at all?

Ken Cunningham ken.cunningham.webuse at gmail.com
Fri Jan 31 00:32:51 UTC 2020


Either I’m having a problem understanding bin: deps, or something is not working correctly with them.

I’ve tried the same thing on several different machines, and always seem to get the same result.



Specifically, I’m trying to trim down unrequired dependencies on some of the bootstrap ports to minimize headaches and heartburn maintaining them.

llvm-3.4 for example does not need any special perl.

In the portfile, it has

    depends_run         bin:perl:perl5 port:llvm_select

This means (to me) look for a binary named perl somewhere in the path, and install perl5 if there isn’t one. 

Of course, there always is a binary named “perl” in the path, so the depends itself is a bit redundant, but at any rate, with all ports uninstalled, the system perl is active:

$ port -v installed | grep active
$ which perl
/usr/bin/perl

$ printenv
PATH=/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

however, port still wants to install perl5 and all it’s supporting deps:

$ port info llvm-3.4
llvm-3.4 @3.4.2_12 (lang)
Sub-ports:            clang-3.4
Variants:             assertions, ocaml, universal

Description:          The LLVM Core libraries provide a modern source- and target-independent optimizer, along with code generation support for many popular CPUs (as well as some less common ones!) These
                      libraries are built around a well specified code representation known as the LLVM intermediate representation ("LLVM IR").
Homepage:             https://llvm.org/

Library Dependencies: libffi, ncurses-bootstrap, zlib
Runtime Dependencies: perl5, llvm_select
Platforms:            darwin
License:              NCSA
Maintainers:          Email: jeremyhu at macports.org, GitHub: jeremyhu
                      Email: larryv at macports.org, GitHub: larryv
                      Email: kencu at macports.org, GitHub: kencu

$ port rdeps llvm-3.4
The following ports are dependencies of llvm-3.4 @3.4.2_12:
  libffi
  ncurses-bootstrap
  zlib
    xz-bootstrap
      libiconv-bootstrap
        gperf-bootstrap
      gettext-bootstrap
  perl5
    perl5.28
      xz
        clang-3.4
          cctools
            libunwind-headers
            llvm-3.4
              llvm_select
          python27-bootstrap
            pkgconfig-bootstrap
            bzip2
            expat
            openssl
          clang_select
          ld64
            ld64-127
              libmacho-headers
        libiconv
          gperf
            libcxx
        gettext
          ncurses
      db48
      gdbm
        readline


changing it to a path dependency doesn’t help:

depends_run         path:bin/perl:perl5

$ port info llvm-3.4
llvm-3.4 @3.4.2_12 (lang)
...
Runtime Dependencies: perl5, llvm_select


Even sticking a symlink in ${prefix}/bin doesn’t work:

$ sudo ln -s /usr/bin/perl /opt/local/bin/perl

$ which perl
/opt/local/bin/perl

$ port info llvm-3.4
llvm-3.4 @3.4.2_12 (lang)
…
Runtime Dependencies: perl5, llvm_select


What stupid assumption am I making, or what am I doing wrong?

Ken




More information about the macports-dev mailing list