I've got a project that depends on the regex-pcre package, which in turn depends on the pcre C library. Since Heroku doesn't have that library installed, I have to write a script that downloads and builds the C library and installs regex-pcre with --extra-lib-dirs. This commit allows me to do that by including a script named heroku-pre-install in my Haskell Heroku app that gets executed before cabal install.
call heroku-pre-install script in directory before installing (if it …
can be used to install c dependencies etc.
I wonder if this is the right way to approach it - we're going to hit the same issue for other stuff. maybe the multi-buildpack approach would be cleaner? @luciferous, @pufuwozu, what do you think?
I did hit this regex-pcre problem when trying to deploy a Hakyll website 😞
But multi-buildpack doesn't seem like a bad idea 💡 - willing to give it a try?
Damn, just ran into this now that my important project depends on yesod-markdown. 👎
I don't have time to hack on the multi-buildpack idea, so I'll merge this.
In my opinion the multi-buildpack approach would better, but I just couldn't get it to work. I've tried installing the pcre C library in my heroku-pre-install script without using a separate cabal install with --extra-lib-dirs for the regex packages. This would be the first logical step towards turning my script into a buildpack, since this buildpack can't rely on GHC and cabal since would be executed before the Haskell buildpack. I've fiddled with various options in heroku-buildpack-haskell and my heroku-pre-install script but the cabal install of the main project always failed because cabal couldn't find a particular library. So this seems to be the easiest solution for my case. Thanks for merging the pull request.
@timjb I'm add highlighting-kate with pcre-light preinstalled to my fork because:
If pcre-light doesn't work properly for everyone I'll just update the Buildpack to have the C library preinstalled.