Skip to content

Commit

Permalink
huge workaround, bison-epita and no more Critetion (for now)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wes974 committed Feb 16, 2021
1 parent 866be36 commit 8932b34
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 34 deletions.
52 changes: 30 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,39 @@ FROM archlinux:latest
# Work-around the issue with glibc 2.33 on old Docker engines
# Extract files directly as pacman is also affected by the issue
RUN patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst && \
curl -LO https://repo.archlinuxcn.org/x86_64/$patched_glibc && \
bsdtar -C / -xvf $patched_glibc
curl -LO "https://repo.archlinuxcn.org/x86_64/$patched_glibc" && \
bsdtar -C / -xvf "$patched_glibc" && rm "$patched_glibc"

# Import dotfiles folder.
COPY ./dotfiles dotfiles

# Install what's needed.
RUN sed -i '93d' /etc/pacman.conf && sed -i '98d' /etc/pacman.conf; yes | pacman -Syuu; pacman -S --needed --noconfirm - < dotfiles/pkglist.txt && \
# Manual install of Criterion.
# Can be replace with commented code below, which will install yay if you want to install AUR packages.
# (A bit of an overkill for just Criterion).
wget https://github.com/Snaipe/Criterion/releases/download/v2.3.3/criterion-v2.3.3-linux-x86_64.tar.bz2 -O - | tar -xj && \
cp -r criterion-v2.3.3/include/criterion /usr/include/ && cp criterion-v2.3.3/lib/* /usr/lib/ && \
cp criterion-v2.3.3/share/pkgconfig/* /usr/share/pkgconfig && \
rm -rf criterion-v2.3.3 rm -rf criterion-v2.3.3-linux-x86_64.tar.bz2 && \
ln -s /usr/bin/gpg /usr/local/bin/gpg && \
# Add non root user for running makepkg to install yay for installing some AUR packages.
# useradd non_root && mkdir /home/non_root && chown -R non_root:non_root /home/non_root && \
# echo 'non_root ALL=NOPASSWD: ALL' >> /etc/sudoers && \
# sudo -u non_root bash -c 'cd ~ && git clone https://aur.archlinux.org/yay.git && cd yay && makepkg -si --noconfirm && \
# yay -S --noconfirm criterion && cd ~ && rm -rf yay && yes | yay -Scc' && \
# Clear the cache to reduce size.
yes | pacman -Scc && \
# Install oh-my-zsh and some plugins + powerlevel10k and build gitstatus.
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" && \
RUN sed -i '93d' /etc/pacman.conf && sed -i '98d' /etc/pacman.conf; \
# yes | pacman -Syuu; \
pacman -Sy --needed --noconfirm - < dotfiles/pkglist.txt

# Manual install of Criterion.
# Can be replace with commented code below, which will install yay if you want to install AUR packages.
# (A bit of an overkill for just Criterion).
# RUN wget https://github.com/Snaipe/Criterion/releases/download/v2.3.3/criterion-v2.3.3-linux-x86_64.tar.bz2 -O - | tar -xj && \
# cp -r criterion-v2.3.3/include/criterion /usr/include/ && cp criterion-v2.3.3/lib/* /usr/lib/ && \
# cp criterion-v2.3.3/share/pkgconfig/* /usr/share/pkgconfig && \
# rm -rf criterion-v2.3.3 rm -rf criterion-v2.3.3-linux-x86_64.tar.bz2 && \
# ln -s /usr/bin/gpg /usr/local/bin/gpg

# Add non root user for running makepkg to install yay for installing some AUR packages.
# useradd non_root && mkdir /home/non_root && chown -R non_root:non_root /home/non_root && \
# echo 'non_root ALL=NOPASSWD: ALL' >> /etc/sudoers && \
# sudo -u non_root bash -c 'cd ~ && git clone https://aur.archlinux.org/yay.git && cd yay && makepkg -si --noconfirm && \
# yay -S --noconfirm criterion && cd ~ && rm -rf yay && yes | yay -Scc' && \

# Install bison-epita
RUN git clone https://aur.archlinux.org/bison-epita.git && cd bison-epita && env EUID=1 makepkg -sirc --noconfirm && cd .. && rm -r bison-epita && \
# git clone https://aur.archlinux.org/criterion.git && cd criterion && env EUID=1 makepkg -sirc --noconfirm && cd .. && rm -r criterion && \
yes | pacman -Scc

# Install oh-my-zsh and some plugins + powerlevel10k and build gitstatus.
RUN sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" && \
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting && \
git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:=~/.oh-my-zsh/custom}/plugins/zsh-completions && \
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k && \
Expand All @@ -41,7 +49,7 @@ RUN sed -i '93d' /etc/pacman.conf && sed -i '98d' /etc/pacman.conf; yes | pacman
cp -r /dotfiles/nvim $HOME/.config/nvim && cp /dotfiles/zshrc $HOME/.zshrc && \
cp /dotfiles/p10k.zsh $HOME/.p10k.zsh && cp /dotfiles/clang-format /.clang-format && \
# Install vim plugins via workaround.
nvim --headless +PlugInstall +qall && timeout 5m nvim --headless +CocUpdateSync; exit 0 && \
nvim -c 'CocInstall -sync |q' && nvim -c 'CocUpdateSync|q' && timeout 5m nvim --headless +CocUpdateSync; exit 0
nvim --headless +PlugInstall +qall && \
timeout 5min "nvim -c 'CocInstall -sync coc-snippets coc-pairs coc-actions coc-lists coc-highlight coc-python coc-clangd coc-sh|q'"; exit 0

WORKDIR /home
20 changes: 10 additions & 10 deletions dotfiles/nvim/init.vim
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
" "
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

let g:coc_global_extensions = [
\ 'coc-snippets',
\ 'coc-pairs',
\ 'coc-actions',
\ 'coc-lists',
\ 'coc-highlight',
\ 'coc-python',
\ 'coc-clangd',
\ 'coc-sh'
\ ]
" let g:coc_global_extensions = [
" \ 'coc-snippets',
" \ 'coc-pairs',
" \ 'coc-actions',
" \ 'coc-lists',
" \ 'coc-highlight',
" \ 'coc-python',
" \ 'coc-clangd',
" \ 'coc-sh'
" \ ]

" vim-plug ----------------------------------------------------------------

Expand Down
3 changes: 1 addition & 2 deletions dotfiles/pkglist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ base-devel
bat
bison
boost
boost-libs
clang
cmake
coreutils
Expand All @@ -15,7 +16,6 @@ gcc
gcc-libs
gdb
git
glibc
gnupg
go
grep
Expand Down Expand Up @@ -53,7 +53,6 @@ tree
unzip
valgrind
wget
wget
which
zip
zsh

0 comments on commit 8932b34

Please sign in to comment.