Skip to content

Instantly share code, notes, and snippets.

@javabrett
Forked from eminence/build-mosh-and-tmux.sh
Created September 7, 2017 01:27
Show Gist options
  • Save javabrett/997e4009b37cbc4ef6d033978e35958f to your computer and use it in GitHub Desktop.
Save javabrett/997e4009b37cbc4ef6d033978e35958f to your computer and use it in GitHub Desktop.
#!/bin/sh
set -e
PWD=`pwd`
TMUX_SRC_DIR=$PWD/tmux-2.3
LIBEVENT_SRC_DIR=$PWD/libevent-2.0.22-stable
NCURSES_SRC_DIR=$PWD/ncurses-6.0
PROTOBUF_SRC_DIR=$PWD/protobuf-2.6.1
MOSH_SRC_DIR=$PWD/mosh-1.2.6
OPENSSL_SRC_DIR=$PWD/openssl-1.0.2c
GPM_SRC_DIR=$PWD/gpm-1.99.7
INSTALL_DIR=/usr/local/bin/prefix
#INSTALL_DIR=/rd/gen/lxd/do_not_delete/$PLATIDENT/prefix
echo "About to build the following packages:"
echo " libevent-2.0.22"
echo " ncurses-6.0"
echo " protobuf-2.6.1"
echo " openssl-1.0.2c"
echo " mosh-1.2.6"
echo " tmux-2.3"
echo ""
echo "Everything will be installed to ${INSTALL_DIR}"
echo "Temporary build dir: ${PWD}"
echo "Press enter to continue"
read c
tar -zxf /rd/gen/lxd/do_not_delete/devel/libevent-2.0.22-stable.tar.gz
tar -zxf /rd/gen/lxd/do_not_delete/devel/ncurses-6.0.tar.gz
tar -zxf /rd/gen/lxd/do_not_delete/devel/tmux-2.3.tar.gz
tar -zxf /rd/gen/lxd/do_not_delete/devel/protobuf-2.6.1.tar.gz
tar -zxf /rd/gen/lxd/do_not_delete/devel/openssl-1.0.2c.tar.gz
tar -zxf /rd/gen/lxd/do_not_delete/devel/mosh-1.2.6.tar.gz
tar -zxf /rd/gen/lxd/do_not_delete/devel/gpm-1.99.7.tar.gz
export CFLAGS="-I${INSTALL_DIR}/include -fPIC"
export CXXFLAGS=$CFLAGS
export PATH="${INSTALL_DIR}/bin:${PATH}"
export LDFLAGS="-L${INSTALL_DIR}/lib -Wl,-rpath,${INSTALL_DIR}/lib"
export PKG_CONFIG_PATH="${INSTALL_DIR}/lib/pkgconfig"
export LD_LIBRARY_PATH="${INSTALL_DIR}/lib"
cd $LIBEVENT_SRC_DIR
make clean || echo
./configure --enable-static=yes --enable-shared=yes --prefix=${INSTALL_DIR} && make && make install
echo "libevent done. Press enter to continue"
read c
cd $OPENSSL_SRC_DIR
make clean || echo
./config no-shared -fPIC --prefix=${INSTALL_DIR} && make && make install
echo "Openssl done. Press enter to continue"
read c
echo "Building protobuf..."
cd $PROTOBUF_SRC_DIR
make clean || echo
./configure --disable-shared --prefix=${INSTALL_DIR}; make; make install
echo "protobuf done. Press enter to continue"
read c
echo "Building ncursesw..."
cd $NCURSES_SRC_DIR
make clean || echo
./configure --enable-pc-files --enable-widec --without-gpm --with-pkg-config-libdir=${PKG_CONFIG_PATH} --prefix=${INSTALL_DIR} && make && make install
echo "Ncursesw done. Press enter to continue"
read c
echo "Building ncurses..."
cd $NCURSES_SRC_DIR
make clean || echo
./configure --enable-pc-files --without-gpm --with-pkg-config-libdir=${PKG_CONFIG_PATH} --prefix=${INSTALL_DIR} && make && make install
echo "Ncurses done. Press enter to continue"
read c
echo "Building tmux..."
cd $TMUX_SRC_DIR
make clean || echo
./configure --prefix=${INSTALL_DIR} && make && make install
echo "tmux done. Press enter to continue"
read c
echo "Building mosh..."
cd $MOSH_SRC_DIR
make clean || echo
./configure --prefix=${INSTALL_DIR} && make && make install
echo "Mosh done"
echo "Everything done"
echo "Installed to ${INSTALL_DIR}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment