3

I have an issue with a package, dmtx-utils, that was moved to the homebrew/boneyard. It is actually expecting, what I believe is to be an older version of ImageMagick; something predating 7.0.4-8 (which is the current version).

In the process of installing the various other needed packages for our workflow, we also install zbar - which is also dependent on ImageMagick.

When installing zbar via brew install zbar it will also install the dependent ImageMagick, but in doing so, the latest version of ImageMagick.

In this case: When installing zbar, how can I make brew install a specific version of its dependencies, like ImageMagick?

Or more generally: When installing package X, how can I make brew install a specific version of its dependencies, like package Y?

Thanks and best,

Sander

  • 1
    Install the dependency first, and [pick the version](http://stackoverflow.com/a/4158763/238978) in doing so. – Emil Vikström Feb 15 '17 at 09:53
  • 2
    So even though I do this (first install `ImageMagick` via `brew install imagemagick@6` - indeed I need a specific version), `brew install zbar` will install the dependencies. In this case `ImageMagick` version 7. How can I make it not do that? Also: `zbar` hasn't changed between version 6 and 7 of ImageMagick - as far as I can tell at least... – Sander W. van der Laan Feb 21 '17 at 22:20
  • Had the same issue -- installing a previous version doesn't satisfy the dependency check. Really frustrating. I don't think homebrew's concept of versions is fined grained enough – Mike Hornblade Jul 06 '17 at 22:23

1 Answers1

1

The only way I know to do this at the moment is this:

  1. Install the dependencies, packages Y, first, and pin all the of them whose versions you care about.

  2. Install the final package X, and brew will attempt to install the latest it can (given what brew is hosting currently and the versions of the previous dependencies).

However, this supposedly simple two-step process is fraught with issues due to how Brew works, which transforms the real problem you want to answer into how do you install any arbitrary version of a package?

Doing this is answered in Emil's shared link here, which is another Stack Overflow question.

Coolio2654
  • 1,589
  • 3
  • 21
  • 46