-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.sh
124 lines (92 loc) · 3.01 KB
/
build.sh
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#!/bin/bash
set -e
readonly EMACS_DIR="$(dirname "$(readlink -f "$0")")"
readonly LOAD_PATH=$EMACS_DIR/etc
readonly BUILD_PATH=$EMACS_DIR/build
PACK_NAME=emacs-x
PACK_SYSTEM=x86_64-linux
export EMACS_CONFIG_MODE=minimal
if [[ ! -z $1 ]] ; then
PACK_NAME=$1
fi
if [[ ! -z $2 ]] ; then
PACK_SYSTEM=$1
fi
PACK_FILENAME="${PACK_NAME}-${EMACS_CONFIG_MODE}-${PACK_SYSTEM}.tar.gz"
INSTALLER_FILENAME="${PACK_NAME}-${EMACS_CONFIG_MODE}-${PACK_SYSTEM}-installer.run"
echo "Emacs dir: $EMACS_DIR"
echo "Pack name: $PACK_FILENAME"
if [ -f guix-binary-nightly.x86_64-linux.tar.xz ]; then
rm -rf guix-binary-nightly.x86_64-linux.tar.xz
fi
echo "Start build emacs-git"
guix build -K -L $LOAD_PATH emacs-git
echo "Start install emacs-git"
guix install -L $LOAD_PATH emacs-git
if [[ ! -d $BUILD_PATH ]] ; then
mkdir $BUILD_PATH
fi
pushd $BUILD_PATH
echo "Start install tree sitter grammers"
guix pack -L $LOAD_PATH -RR -r tree-sitter-grammar.tar.gz -S /opt/tree-sitter/lib=lib \
tree-sitter-bash \
tree-sitter-bibtex \
tree-sitter-c \
tree-sitter-c-sharp \
tree-sitter-clojure \
tree-sitter-cmake \
tree-sitter-cpp \
tree-sitter-css \
tree-sitter-dockerfile \
tree-sitter-elisp \
tree-sitter-elixir \
tree-sitter-elm \
tree-sitter-go \
tree-sitter-gomod \
tree-sitter-haskell \
tree-sitter-heex \
tree-sitter-html \
tree-sitter-java \
tree-sitter-javascript \
tree-sitter-json \
tree-sitter-julia \
tree-sitter-lua \
tree-sitter-markdown \
tree-sitter-markdown-gfm \
tree-sitter-meson \
tree-sitter-ocaml \
tree-sitter-org \
tree-sitter-php \
tree-sitter-plantuml \
tree-sitter-python \
tree-sitter-r \
tree-sitter-racket \
tree-sitter-ruby \
tree-sitter-rust \
tree-sitter-scala \
tree-sitter-scheme \
tree-sitter-typescript
tar xf tree-sitter-grammar.tar.gz
if [[ ! -d $EMACS_DIR/tree-sitter ]] ; then
mkdir $EMACS_DIR/tree-sitter
fi
cp -f opt/tree-sitter/lib/tree-sitter/* $EMACS_DIR/tree-sitter/
popd
echo "Start init emacs-config"
GUIX_PROFILE="${HOME}/.guix-profile"
source "${GUIX_PROFILE}/etc/profile"
emacs --init-directory=$EMACS_DIR -Q --batch -l org --eval "(org-babel-tangle-file \"README.org\")"
emacs --init-directory=$EMACS_DIR -Q --batch -l early-init.el -l init.el
echo "Start build emacs-config"
guix build -K -L $LOAD_PATH emacs-config
echo "Start install emacs-config"
guix install -L $LOAD_PATH emacs-config
echo "Start build glibc-zh-utf8-locales"
guix build -K -L $LOAD_PATH glibc-zh-utf8-locales
echo "Start install glibc-zh-utf8-locales"
guix install -L $LOAD_PATH glibc-zh-utf8-locales
echo "Start pack"
guix pack -L $LOAD_PATH -RR -r $PACK_FILENAME -S /opt/emacs/bin=bin -S /opt/emacs/lib=lib -S /opt/emacs/etc=etc -S /opt/emacs/share=share -S /opt/emacs/include=include \
glibc-zh-utf8-locales emacs-git emacs-config ripgrep fd librime libvterm
echo "Generate installer"
cat install.sh $PACK_FILENAME > $INSTALLER_FILENAME