Skip to content

Instantly share code, notes, and snippets.

@appleshan
Created February 5, 2018 16:20
Show Gist options
  • Select an option

  • Save appleshan/f2a18eb79a299f3628160e05b5ae259e to your computer and use it in GitHub Desktop.

Select an option

Save appleshan/f2a18eb79a299f3628160e05b5ae259e to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
readonly version="25.3" # "25.2" # "25.1"
#version_postfix="-rc2" # ".90"
#patch_version=25.2-rc1-mac-6.2
#source_url=ftp://alpha.gnu.org/gnu/emacs/pretest
source_url=https://mirrors.tuna.tsinghua.edu.cn/gnu/emacs
echo "=================================================="
echo "Build latest version of Emacs, version management with stow"
echo "OS: Manjaro Linux 17.1.3"
echo "version: $version"
echo "Toolkit: "
install_prefix=/opt/stow/emacs-"$version"
if [ -d $install_prefix ]; then
echo "target directory $install_prefix exists, exit."
#exit
fi
#sudo mkdir -p $install_prefix
# install dependencies
# sudo pacman -S autoconf automake stow webkitgtk
# download source package
echo "=================================================="
echo "= Download source package :"
cd /usr/local/src
if [[ ! -d emacs-"$version" ]]; then
echo "download emacs-$version:"
wget $source_url/emacs-"$version".tar.xz
tar xvf emacs-"$version".tar.xz
read -p "Press enter to continue"
fi
# build and install
echo "=================================================="
echo "= Build :"
cd emacs-"$version"
sudo mkdir -vp $install_prefix/{bin/,libexec/,share/,var/}
./autogen.sh
./configure \
--prefix=$install_prefix \
--bindir=$install_prefix/bin \
--libexecdir=$install_prefix/libexec \
--localstatedir=$install_prefix/var \
--datarootdir=$install_prefix/share \
--with-imagemagick \
--with-modules
# --with-xwidgets
read -p "Press enter to continue"
make -j4
read -p "Press enter to continue"
echo "=================================================="
echo "= Install :"
sudo make install
# strip $install_prefix/bin/emacs-"$version"
read -p "Press enter to continue"
echo "=================================================="
echo "= Version management with stow :"
echo "stow emacs..."
cd /opt/stow/emacs-"$version"
sudo stow -d /opt/stow/emacs-"$version" -t /usr/local/bin bin
cd /usr/local/src
sudo rm -rf emacs-"$version"
echo "=================================================="
echo "= Done! Find your Emacs at "$installprefix"."
echo "=================================================="
#!/usr/bin/env bash
##########################################################################
# install emacs config automatically.
# by Apple Shan (apple.shan@gmail.com)
##########################################################################
# sudo pacman -S emacs
cd ~/private-projects/
# clone syl20bnr/spacemacs repo
git clone -b develop https://github.com/syl20bnr/spacemacs.git spacemacs-develop
# clone appleshan/my-spacemacs-config and submodule
git clone --recursive https://github.com/appleshan/my-spacemacs-config.git spacemacs-private
# git submodule
# 如果已經抓下來才發現 submodule 是空的,可以用以下指令去抓
cd spacemacs-private
git submodule update --init --recursive
rm ~/.emacs.d
rm ~/.spacemacs.d
# 建立软链接
# ln -s <源文件> <目标> 创建一个符号链接
ln -s ~/private-projects/spacemacs-develop ~/.emacs.d
ln -s ~/private-projects/spacemacs-private ~/.spacemacs.d
# 验证软链接建立成功
la ~/ |grep emacs
################################################################################
# 按照其他 package
# all-the-icons
# Installing Fonts
M-x all-the-icons-install-fonts
# dired-k
cd ~/.spacemacs.d/local/
git clone https://github.com/appleshan/emacs-dired-k dired-k
# terminal-here
cd ~/.spacemacs.d/local/
git clone https://github.com/appleshan/terminal-here terminal-here
# pyim-bigdict.pyim
wget http://tumashu.github.io/pyim-bigdict/pyim-bigdict.pyim.gz
################################################################################
# 安装外部程序
# ditaa
mkdir -p /opt/java/ditaa0_9
cd /opt/java/ditaa0_9
wget https://downloads.sourceforge.net/project/ditaa/ditaa/0.9/ditaa0_9.zip
# or
wget http://sourceforge.mirrorservice.org/d/di/ditaa/ditaa/0.9/ditaa0_9.zip
unzip ditaa0_9.zip
# graphviz
# for python
pip install python-language-server
pip install rope # a python refactoring library
pip install jedi # Python 自动补全库
pip install flake8 # flake8 用来检查语法错误
pip install importmagic # importmagic 用来自动引入需要的包
pip install autopep8 # autopep8 用来检查 PEP8 规范
pip install yapf # yapf 用来格式化代码
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment