Skip to content

Instantly share code, notes, and snippets.

@nickovs
Last active December 27, 2023 19:02
Show Gist options
  • Save nickovs/f097c577df90bdeb98ea0127c60e3462 to your computer and use it in GitHub Desktop.
Save nickovs/f097c577df90bdeb98ea0127c60e3462 to your computer and use it in GitHub Desktop.
A script for building a version of the Zbar library suitable for running in an AWS Lambda instance
#!/bin/bash
# Clear out old images
[ -d "lib" ] && rm -r lib
cat <<EOF > tmp_recipe.sh
# This is the actual container-side recipe
yum groupinstall -y "Development Tools"
cd /root
git clone https://github.com/mchehab/zbar.git
cd zbar
autoreconf -vfi
./configure --prefix=/usr --without-xshm --without-xv --without-jpeg --without-imagemagick --without-gtk --without-python --without-qt --disable-video
make
mkdir -p /build/lib
cp -a zbar/.libs/libzbar.so* /build/lib
EOF
# Run the recipe in an Amazon Linux 2 container
docker run --rm -it -v $(pwd):/build amazonlinux:2 bash /build/tmp_recipe.sh
rm tmp_recipe.sh
@yopicon2
Copy link

yopicon2 commented Aug 1, 2022

Thanks very much!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment