-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_emacs_debian
More file actions
executable file
·68 lines (54 loc) · 1.64 KB
/
Copy pathinstall_emacs_debian
File metadata and controls
executable file
·68 lines (54 loc) · 1.64 KB
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
#!/bin/sh
set -e
set -u
if [ "$#" -gt 1 ]; then
printf 'usage: %s [branch]\n' "$0" 1>&2
exit 1
fi
readonly branch="${1:-master}"
readonly rootdir="${HOME}"/opt/local/src/emacs
if [ ! -e "${rootdir}" ]; then
printf 'error: %s does not exist.\n' "${rootdir}" 1>&2
exit 1
fi
packages=""
packages="${packages} librsvg2"
packages="${packages} libgnutls30"
packages="${packages} libgccjit-9-dev"
readonly packages
for package in ${packages} ; do
if ! (apt list --installed | grep "${package}" > /dev/null) ; then
printf 'error: %s is not installed.\n' "${package}" 1>&2
exit 1
fi
done
CPPFLAGS=""
CPPFLAGS="${CPPFLAGS} -I${HOME}/opt/local/include"
readonly CPPFLAGS
export CPPFLAGS
LDFLAGS=""
LDFLAGS="${LDFLAGS} -L${HOME}/opt/local/lib"
readonly LDFLAGS
export LDFLAGS
git_clean_excludes=""
git_clean_excludes="${git_clean_excludes} -e GPATH"
git_clean_excludes="${git_clean_excludes} -e GRTAGS"
git_clean_excludes="${git_clean_excludes} -e GTAGS"
readonly git_clean_excludes
git -C "${rootdir}" clean -q -d -x ${git_clean_excludes} -f
git -C "${rootdir}" checkout "${branch}"
git -C "${rootdir}" clean -q -d -x ${git_clean_excludes} -f
git -C "${rootdir}" reset --hard HEAD
git -C "${rootdir}" pull --ff-only origin "${branch}"
options=""
options="${options} --without-x"
options="${options} --with-gnutls"
options="${options} --with-xml2"
options="${options} --with-rsvg"
options="${options} --with-native-compilation"
options="${options} --prefix=${HOME}/opt/local"
readonly options
(cd "${rootdir}" && ./autogen.sh)
(cd "${rootdir}" && ./configure ${options})
(cd "${rootdir}" && make -j 8)
(cd "${rootdir}" && make install)