Skip to content

Instantly share code, notes, and snippets.

@crissupb
Created March 12, 2018 22:03
Show Gist options
  • Save crissupb/939d43aff42f6108a5b7f21f3d1a37da to your computer and use it in GitHub Desktop.
Save crissupb/939d43aff42f6108a5b7f21f3d1a37da to your computer and use it in GitHub Desktop.
Script to rebuild Git2S3 Lambda zip file
yum update
yum upgrade
yum install -y gcc make cmake git zip
yum install -y python27-devel python27-pip make cmake
yum install -y libcurl-devel wget zlib-devel openssl-static libffi-devel
wget https://www.libssh2.org/download/libssh2-1.8.0.tar.gz
tar xvf libssh2-1.8.0.tar.gz
cd libssh2-1.8.0
mkdir bin
cd bin
cmake .. -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_C_FLAGS=-fPIC
cmake --build .
cmake --build . --target install
cd /working
wget https://github.com/libgit2/libgit2/archive/v0.26.0.tar.gz
tar xvf v0.26.0.tar.gz
cd libgit2-0.26.0
mkdir build
cd build
cmake .. -DTHREADSAFE=ON \
-DBUILD_CLAR=OFF \
-DCMAKE_INSTALL_PREFIX=/usr
cmake --build .
cmake --build . --target install
cd /working
ldconfig
pip install -t . pygit2
python -c 'import pygit2'
cp /usr/lib/libgit2.so.26 .
zip GitPullS3.zip *.py
zip GitPullS3.zip *.pyc
zip GitPullS3.zip *.so
zip GitPullS3.zip *.md
zip GitPullS3.zip libgit2.so.26
zip -r GitPullS3.zip .libs_cffi_backend
zip -r GitPullS3.zip cffi
zip -r GitPullS3.zip pygit2
zip -r GitPullS3.zip pycparser
@cfbarbero
Copy link

this was super helpful

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