lbrycrd/reproducible_build_osx.sh

72 lines
2.3 KiB
Bash
Raw Normal View History

2016-06-22 21:08:45 +02:00
brew update
brew install autoconf
brew install automake
brew install libtool
brew install pkg-config
brew install protobuf
brew install gmp
2016-06-13 20:38:35 +02:00
mkdir dependencies
cd dependencies
2016-06-22 21:08:45 +02:00
export LBRYCRD_DEPENDENCIES="`pwd`"
2016-06-08 03:25:24 +02:00
2016-06-22 21:08:45 +02:00
#download, patch, and build bdb
wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz
tar xf db-4.8.30.NC.tar.gz
export BDB_PREFIX="`pwd`/bdb"
2016-06-22 21:08:45 +02:00
curl -OL https://raw.github.com/narkoleptik/os-x-berkeleydb-patch/master/atomic.patch
patch db-4.8.30.NC/dbinc/atomic.h < atomic.patch
cd db-4.8.30.NC/build_unix
../dist/configure --prefix=$BDB_PREFIX --enable-cxx --disable-shared --with-pic
make
make install
2016-06-08 03:25:24 +02:00
2016-06-22 21:08:45 +02:00
#download and build openssl
cd $LBRYCRD_DEPENDENCIES
wget https://www.openssl.org/source/openssl-1.0.1p.tar.gz
tar xf openssl-1.0.1p.tar.gz
export OPENSSL_PREFIX="`pwd`/openssl_build"
mkdir $OPENSSL_PREFIX
2016-06-22 21:08:45 +02:00
mkdir $OPENSSL_PREFIX/ssl
cd openssl-1.0.1p
2016-06-22 21:08:45 +02:00
./Configure --prefix=$OPENSSL_PREFIX --openssldir=$OPENSSL_PREFIX/ssl -fPIC darwin64-x86_64-cc no-shared no-dso no-engines
make
make install
2016-06-08 03:25:24 +02:00
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:${OPENSSL_PREFIX}/lib/pkgconfig/"
2016-06-22 21:08:45 +02:00
#download and build boost
cd $LBRYCRD_DEPENDENCIES
wget http://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.bz2/download -O boost_1_59_0.tar.bz2
tar xf boost_1_59_0.tar.bz2
2016-06-13 20:38:35 +02:00
export BOOST_ROOT="`pwd`/boost_1_59_0"
cd boost_1_59_0
./bootstrap.sh
./b2 link=static cxxflags=-fPIC stage
2016-06-08 03:25:24 +02:00
2016-06-22 21:08:45 +02:00
#download and build libevent
cd $LBRYCRD_DEPENDENCIES
2016-06-08 03:25:24 +02:00
mkdir libevent_build
git clone https://github.com/libevent/libevent.git
export LIBEVENT_PREFIX="`pwd`/libevent_build"
cd libevent
./autogen.sh
./configure --prefix=$LIBEVENT_PREFIX --enable-static --disable-shared --with-pic LDFLAGS="-L${OPENSSL_PREFIX}/lib/" CPPFLAGS="-I${OPENSSL_PREFIX}/include"
make
make install
2016-06-22 21:08:45 +02:00
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:${LIBEVENT_PREFIX}/lib/pkgconfig/"
2016-06-08 03:25:24 +02:00
2016-06-22 21:08:45 +02:00
#download and build lbrycrd
cd $LBRYCRD_DEPENDENCIES
git clone https://github.com/lbryio/lbrycrd
cd lbrycrd
2016-06-22 21:08:45 +02:00
git checkout real2
./autogen.sh
2016-06-22 21:08:45 +02:00
./configure --without-gui --enable-cxx --enable-static --disable-shared --with-pic \
LDFLAGS="-L${OPENSSL_PREFIX}/lib/ -L${BDB_PREFIX}/lib/ -L${LIBEVENT_PREFIX}/lib/ -static-libstdc++" \
CPPFLAGS="-I${OPENSSL_PREFIX}/include -I${BDB_PREFIX}/include -I${LIBEVENT_PREFIX}/include/"
make
strip src/lbrycrdd
strip src/lbrycrd-cli
strip src/lbrycrd-tx
2016-06-22 21:08:45 +02:00
strip src/test/test-lbrycrd