How can I compile and install Emacs in the home directory?

Viewed 782

I want to install Emacs without using APT/YUM, because I am not a super user.

I downloaded the source code from https://www.gnu.org/software/emacs/manual/html_node/efaq/Installing-Emacs.html. Then, I commanded

./configure --prefix=$HOME/.local/emacs/27_1

Standard output said

configure: error: The following required libraries were not found:
     gnutls
Maybe some development libraries/packages are missing?
To build anyway, give:
     --with-gnutls=ifavailable
as options to configure.

So I commanded

./configure --with-gnutls=ifavailable --prefix=$HOME/.local/emacs/27_1

Standard output said

configure: error: The required function 'tputs' was not found in any library.
The following libraries were tried (in order):
  libtinfo, libncurses, libterminfo, libcurses, libtermcap
Please try installing whichever of these libraries is most appropriate
for your system, together with its header files.
For example, a libncurses-dev(el) or similar package.

So I downloaded ncurses and installed it by:

wget https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.2.tar.gz
tar xvfz ncurses-6.2.tar.gz
cd ncurses-6.2
./configure --prefix=$HOME/.local/ncurses/6_2 --with-shared --with-pkg-config-libdir=$HOME/ncurses/6_2/lib/pkgconfig --enable-pc-files
make
make install

And I made symbolic links and PATH

cd ~/.local/bin
ls ../ncurses/6_2/bin/ | xargs -I {} ln -s ../ncurses/6_2/bin/{} {}
cd ~/.local/include
ls ../ncurses/6_2/include/ | xargs -I {} ln -s ../ncurses/6_2/include/{} {}
cd ~/.local/lib
ls ../ncurses/6_2/lib/ | xargs -I {} ln -s ../ncurses/6_2/lib/{} {}
cd ~/.local/lib/pkgconfig
ls ../../ncurses/6_2/lib/pkgconfig/ | xargs -I {} ln -s ../../ncurses/6_2/lib/pkgconfig/{} {}
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/.local/lib
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$HOME/.local/lib/pkgconfig

I did configure again, but the same error occurred. What should I do?

0 Answers
Related