shocco
shocco copied to clipboard
shocco fails to install under Homebrew with non-default hb root
Repro steps
- Install Homebrew to something other than
/usr/local
. E.g./opt/brew
-
brew install --HEAD shocco
- 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.
I wouldn't use brew to fish out the location, just use the result of which thing
.
@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.
It looks like this may be fixed in 855b0d79
Clarification: @apeschel is referring to mxcl/homebrew@855b0d79e60ebf2f13d560bfc03aec69386962ac
I'll confirm that the Formula's patch to the configure script works for me.