Created
November 13, 2016 22:44
-
-
Save mneumann/2c86078a8c99d6e325fd70d26608dfa8 to your computer and use it in GitHub Desktop.
Build static linked cargo (rust's package manager) snapshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Run from cargo git directory | |
CARGO_BIN=`pwd`/mycargo # an existing cargo binary | |
OPENSSL_VERSION=1.0.2j | |
export OPENSSL_ROOT_DIR=`pwd`/openssl | |
export OPENSSL_LIB_DIR=${OPENSSL_ROOT_DIR}/lib | |
export OPENSSL_INCLUDE_DIR=${OPENSSL_ROOT_DIR}/include | |
export OPENSSL_STATIC=1 | |
export LIBSSH2_NO_PKG_CONFIG=1 | |
export LIBCURL_NO_PKG_CONFIG=1 | |
export LIBZ_SYS_STATIC=1 | |
export PROFILE=release | |
export VERBOSE=1 | |
export NUM_JOBS=8 | |
# Build OpenSSL | |
rm -rf openssl | |
fetch https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz | |
tar xf openssl-${OPENSSL_VERSION}.tar.gz | |
cd openssl-${OPENSSL_VERSION} | |
./Configure --prefix=${OPENSSL_ROOT_DIR} BSD-x86_64 -fPIC | |
make -j${NUM_JOBS} | |
make install | |
cd .. | |
# build cargo | |
rm -rf target | |
./configure --cargo=${CARGO_BIN} --enable-nightly --prefix=`pwd`/build-dst --local-rust-root=/usr/local --target=x86_64-unknown-dragonfly | |
gmake | |
gmake dist |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment