August 2022 Note: This repo will soon be archived. See this comment for more info.
This is a Heroku buildpack for apps requiring ZBAR as a dependency. It is configured to work with the ruby zbar gem but should work with other stacks. This buildpack also applies a patch to Zbar that fixes some jpeg issues, and is required for ruby zbar to work.
heroku config:set ZBAR_LIB=vendor/lib/libzbar.so
heroku buildpacks:add --index 1 https://github.com/sheck/heroku-buildpack-zbar
- The
ZBAR_LIB
config variable must be set tovendor/lib/libzbar.so
. Sharing environment variables between buildpacks is difficult, so it's best to just set it globally. - This buildpack must be loaded before the ruby build pack. Running
heroku buildpacks
should return:
=== [Your App Name] Buildpack URLs
1. https://github.com/sheck/heroku-buildpack-zbar
2. heroku/ruby
if it does not, remove the ruby buildpack and re-add it to move it to the bottom
(Pull requests welcome)
- Cache zbar library so future builds are faster
Setting up the patched version of Zbar on a CI server can be pain. Here's how I got it running on Circle CI: https://gist.github.com/sheck/475e0c8f2d9f618f1eca