-
-
Save mbreese/b0630195e57874c87ef3611d059d1bc2 to your computer and use it in GitHub Desktop.
#!/bin/bash | |
TARGETDIR=$1 | |
if [ "$TARGETDIR" = "" ]; then | |
TARGETDIR=$(python -c 'import os; print os.path.realpath("local")') | |
fi | |
mkdir -p $TARGETDIR | |
libevent() { | |
curl -LO https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz | |
tar -zxvf libevent-2.0.22-stable.tar.gz | |
cd libevent-2.0.22-stable | |
./configure --prefix=$TARGETDIR && make && make install | |
cd .. | |
} | |
ncurses() { | |
curl -LO https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.0.tar.gz | |
tar zxvf ncurses-6.0.tar.gz | |
cd ncurses-6.0 | |
./configure --prefix $TARGETDIR \ | |
--with-default-terminfo-dir=/usr/share/terminfo \ | |
--with-terminfo-dirs="/etc/terminfo:/lib/terminfo:/usr/share/terminfo" \ | |
--enable-pc-files \ | |
--with-pkg-config-libdir=$HOME/local/lib/pkgconfig \ | |
&& make && make install | |
cd .. | |
} | |
tmux() { | |
curl -LO https://github.com/tmux/tmux/releases/download/2.3/tmux-2.3.tar.gz | |
tar zxvf tmux-2.3.tar.gz | |
cd tmux-2.3 | |
PKG_CONFIG_PATH=$TARGETDIR/lib/pkgconfig ./configure --enable-static --prefix=$TARGETDIR && make && make install | |
cd .. | |
cp $TARGETDIR/bin/tmux . | |
} | |
libevent | |
ncurses | |
tmux |
Line 25 has a mistake, no? why refer to $HOME when elsewhere it uses $TARGETDIR ?
--with-pkg-config-libdir=$HOME/local/lib/pkgconfig \
Maybe should be:
--with-pkg-config-libdir=$TARGETDIR/lib/pkgconfig \
Line 25 has a mistake, no? why refer to $HOME when elsewhere it uses $TARGETDIR ?
--with-pkg-config-libdir=$HOME/local/lib/pkgconfig \
Maybe should be:
--with-pkg-config-libdir=$TARGETDIR/lib/pkgconfig \
Yes, line 25 should probably read $TARGETDIR
instead of $HOME/local
...
Thanks!
Thanks! Do you need a Python call though? Couldn't you just
TARGETDIR="$PWD/local"
?
The call to python is to make sure we get an absolute path. $PWD
should work in most (if not all) cases, but to avoid cases where this isn't set correctly, I just default to using the python call.
I'm getting an error during make on RHEL 7.7
mv -f $depbase.Tpo $depbase.Po
In file included from /usr/include/string.h:633:0,
from arguments.c:22:
compat.h:211:8: error: expected identifier or ‘(’ before ‘__extension__’
char *strsep(char **, const char *);
^
compat.h:211:8: error: expected identifier or ‘(’ before ‘)’ token
char *strsep(char **, const char *);
^
make: *** [arguments.o] Error 1
The make in tmux() Everything else works fine.
Fixes that worked for me (Centos7) for future reference.
strsep
(The same from @markfaine above)
In file included from /usr/include/string.h:633:0,
from arguments.c:22:
compat.h:211:8: error: expected identifier or ‘(’ before ‘__extension__’
char *strsep(char **, const char *);
^
compat.h:211:8: error: expected identifier or ‘(’ before ‘)’ token
char *strsep(char **, const char *);
^
Caused by configure
falsely assume strsep
is not available, since attempt to use it failed to compile. But the reason it does not compile is not strsep
, it is cannot find -lc
.
From https://stackoverflow.com/a/16025272, simply yum install glibc-static
forkpty
(Same from https://github.com/tmux/tmux/issues/1729)
In file included from tmux.h:36,
from cmd-copy-mode.c:21:
compat.h:301:9: error: conflicting types for ‘forkpty’
pid_t forkpty(int *, char *, struct termios *, struct winsize *);
^~~~~~~
In file included from compat.h:109,
from tmux.h:36,
from cmd-copy-mode.c:21:
/usr/include/pty.h:39:12: note: previous declaration of ‘forkpty’ was here
extern int forkpty (int *__amaster, char *__name,
Add --with-termlib
to ncurses configure step.
i had a libevent compile error (something having to do with dereffing incomplete types) on SUSE 15.1. changing to libevent 2.1.12 solved it
An updated version for tmux 3.2 using musl libc: https://gist.github.com/zenofile/d2acef1a0423e5081e74162cd5a0ae2d.
This is excellent, and has saved me much trouble. Thank you.
Thanks! Do you need a Python call though? Couldn't you just
TARGETDIR="$PWD/local"
?