aboutsummaryrefslogtreecommitdiff
path: root/compile/tmux.sh
blob: cfe283065779c990065d22d2e00d73d3913410b8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
# on rhel 9: yum install libevent-devel ncurses-devel
if [ "$(id -u)" -eq 0 ] ; then
	echo "Run as a regular user"
	exit 1
fi
nproc=1
case "$(uname)" in
Darwin|OpenBSD) nproc="$(sysctl -n hw.ncpu)" ;;
Linux) nproc="$(nproc)" ;;
esac
set -ex
codedir="${CODEDIR:-$HOME/.local/src}"
src=https://github.com/tmux/tmux
pkgdir="${codedir}/tmux"

if ! [ -d "$pkgdir" ] ; then
	git clone "$src" "$pkgdir"
fi

cd "$pkgdir"
git checkout cc117b5048f77a4842820f8ebbe3a86e5c077224
git reset --hard HEAD
git clean -fdx .
sh autogen.sh
./configure --prefix="$HOME/.local/opt/tmux"
make -j"$nproc"
make install
cd -

echo 'add ~/.local/opt/tmux/bin to your $PATH'