summaryrefslogtreecommitdiff
path: root/setup.sh
blob: 665882d2cfac9c9141336f813f415dd01f5f2db6 (plain)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash

set -e

if [ ${PWD} != "/home/tmu/dotfiles" ]; then
    echo "Not in ~/dotfiles, proceed manually"
    exit 1
fi

git submodule update --init --recursive

# handle files and symlinks
if [[ "$(read -e -p 'Check and install symlinks? [y/N]> '; echo $REPLY)" == [Yy]* ]]; then
    awk -f install.awk ensureddirs.csv symlinks.csv
fi

# build various tools
if [[ "$(read -e -p 'Build dwm/st/slstatus? [y/N]> '; echo $REPLY)" == [Yy]* ]]; then
    cd dwm
    ./setup.sh
    cd ..

    cd st
    ./setup.sh
    cd ..

    cd slstatus
    ./setup.sh
    cd ..
fi

EMACSFULL="--with-x-toolkit=gtk3 --disable-build-details --with-cairo \
           --with-harfbuzz --with-libsystemd=no --with-modules \
           --with-tree-sitter"

EMACSMIN="--without-all \
          --with-x-toolkit=no  --without-xwidgets --without-x --without-ns --disable-ns-self-contained \
          --with-xpm=no --with-jpeg=no --with-png=no --with-gif=no --with-tiff=no \
          --without-internationalization --without-tree-sitter --without-mailutils"

EMACSALWAYS="--with-gnutls --with-file-notification=yes --with-native-compilation=yes --with-zlib=yes"

if [[ "$(read -e -p 'Build emacs? [y/N]> '; echo $REPLY)" == [Yy]* ]]; then
    if [[ "$(read -e -p 'Build minimal emacs? [y/N]> '; echo $REPLY)" == [Yy]* ]]; then
        EMACSOPT="${EMACSMIN}  ${EMACSALWAYS}"
    else
        EMACSOPT="${EMACSFULL} ${EMACSALWAYS}"
    fi
    cd emacs-source
    ./autogen.sh
    ./configure --prefix="${HOME}/.local" \
                ${EMACSOPT} \
                CFLAGS='-O2 -pipe'
    make
    make install
    cd ..
fi

echo "All set up, remember to source ~/.bash_profile and symlink tmubrowse and tmuterm."