/
emacs.sh
executable file
·69 lines (57 loc) · 2.27 KB
/
emacs.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
#!/bin/bash
readonly TAG=emacs-26.1
readonly REPOSITORY=git://git.savannah.gnu.org/emacs.git
readonly CONFIGURE_OPTIONS=(--without-jpeg
--without-tiff
--without-gif
--without-png
--without-rsvg
--without-imagemagick
--without-sound
--without-makeinfo
--without-gconf
--without-dbus
--without-xml2
--without-makeinfo
--with-x-toolkit=gtk2)
###
readonly PROGRAM=emacs
source common.sh
function prepare() {
cd "$SOURCE_DIR"
./autogen.sh \
|| eexit "Failed to generate configure. Maybe some dependencies are missing?"
case "$PLATFORM" in
mac) ./configure --prefix="$INSTALL_DIR" --with-ns --disable-ns-self-contained "${CONFIGURE_OPTIONS[@]}" \
|| eexit "Configure failed. Maybe some dependencies are missing?" ;;
*) ./configure --prefix="$INSTALL_DIR" "${CONFIGURE_OPTIONS[@]}" \
|| eexit "Configure failed. Maybe some dependencies are missing?" ;;
esac
}
function build() {
cd "$SOURCE_DIR"
make -j $MAXCPUS \
|| eexit "The build failed. Please check the output for error messages."
}
function install() {
cd "$SOURCE_DIR"
# Ensure we clear out previous install
rm -R "$INSTALL_DIR/"
make install datadir="$INSTALL_DIR/share/" \
|| eexit "The install failed. Please check the output for error messages."
status 2 "Copying dependencies"
ensure-dependencies $(find-binaries "$INSTALL_DIR/")
cp "$SCRIPT_DIR/config/site-start.el" "$INSTALL_DIR/share/emacs/site-lisp/site-start.el" \
|| eexit "Couldn't copy site file to correct site-lisp dir"
case "$PLATFORM" in
lin) cp "/usr/bin/xsel" "$SHARED_BIN_DIR/" \
|| eexit "Could not find xsel."
ensure-dependencies "$SHARED_BIN_DIR/xsel"
;;
mac) mac-fixup-dependencies "$INSTALL_DIR/bin/emacs"
mac-fixup-dependencies "$INSTALL_DIR/bin/$TAG"
mac-fixup-lib-dependencies
;;
esac
}
main