shocco icon indicating copy to clipboard operation
shocco copied to clipboard

shocco fails to install under Homebrew with non-default hb root

Open jwhitley opened this issue 12 years ago • 4 comments

Repro steps

  1. Install Homebrew to something other than /usr/local. E.g. /opt/brew
  2. brew install --HEAD shocco
  3. shocco which shocco

Actual result

>> shocco `which shocco`
shocco: markdown command not found.

NOTE: markdown was correctly installed as a dependency by the brew formula and exists on PATH.

Expected result

Works


The first-order failure cause is due to this line in the built shocco script:

MARKDOWN='/opt/hb/Cellar/shocco/HEAD/libexec/bin/markdown'

This is wrong. Markdown exists on PATH and was never installed to this location. ./configure made this up because it couldn't find markdown.

The root cause is shocco's ./configure script, which is why I'm filing this here vs. against the brew formula. It explicitly overrides the user's PATH and reconstructs it from scratch, guessing at likely install locations of dependent tools such as pygments and markdown, including the default homebrew install prefix. It's not clear why the script reconstructs PATH, but this seems like a brittle policy for the reason illustrated in this issue.

Proposed fix

If brew is available, use brew --prefix to figure this out.

jwhitley avatar May 23 '12 17:05 jwhitley

I wouldn't use brew to fish out the location, just use the result of which thing.

adamv avatar May 23 '12 17:05 adamv

@adamv Yes, I'd prefer leaving PATH alone and using which as well. I was mostly going with the (unspoken) assumption that there was some reason to reconstruct PATH in the first place that I wasn't aware of.

jwhitley avatar May 23 '12 18:05 jwhitley

It looks like this may be fixed in 855b0d79

apeschel avatar May 28 '13 18:05 apeschel

Clarification: @apeschel is referring to mxcl/homebrew@855b0d79e60ebf2f13d560bfc03aec69386962ac

I'll confirm that the Formula's patch to the configure script works for me.

jwhitley avatar May 29 '13 18:05 jwhitley