2 # Copyright (C) 2016 Ian Kelling
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
17 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
20 # arg = git commit to check out
21 # -r = don't recompile from scratch
24 # stop if any the command fails
28 while [[ $1 == -* ]]; do
30 -r) recompile
=false
; shift ;;
31 -u) update
=true
; shift ;;
36 export CFLAGS
="-Og -g3"
38 logq pi texlive hunspell git
39 case $
(distro-name
) in
41 # before i learned the builddep command, i identified these
42 # dependencies. Not sure if the builddep took care of them all
43 # gtk3-devel libXpm-devel libjpeg-turbo-devel libtiff-devel giflib-devel ncurses-devel gnutls-devel libxml2-devel libotf-devel GConf2-devel gpm-devel librsvg2-devel ImageMagick-devel m17n-lib-devel libselinux-devel
45 logq s yum-builddep
-y emacs
46 logq pi texlive-dvipng
49 # oddly, on ubuntu 14.04 this installs postfix, but I dun care
50 # ubuntu 14.04 gave this error message
51 # Unable to satisfy the build-depends: Build-Depends: libpng-dev
52 # this is satisfied by dvipng. the build-dep is just wrong
53 # minor bug I'm not going to bother reporting
54 logq p
-y build-dep emacs
55 # fyi libmagick is broken right now because it uses a fork which is waiting for emacs to support it
56 # not sure how many of these are satisfied by the prev command,
57 # but from the log, it looks like none of them
58 logq pi libacl1-dev libselinux-dev libm17n-dev libgtk-3-dev \
59 librsvg2-dev libgpm-dev libgconf2-dev libotf-dev libxml2-dev \
60 automake1.11 libgnutls28-dev libncurses-dev libxpm-dev libjpeg-dev \
61 libgif-dev libtiff-dev texinfo dvipng
64 # included in dependencies on other distros, todo, check on ubuntu
65 logq pi suckless-tools
71 #building emacs, INSTALL.BZR
74 dir
=/a
/opt
/emacs-
`distro-name``debian-archive`
76 if [[ ! -e $dir ]]; then
77 cp -r /a
/opt
/emacs
$dir
83 # todo, consider when this should be uncommented
84 #logq s make uninstall
85 find ~
/.emacs.d
/ -name '*.elc' -delete
93 i
reset --hard origin
/master
97 # autogen is usually only for the first build, assume it works
99 # I tried changing O2 to O3, don't know if it made it faster or slower so I went back to 02.
100 # Also, link-time-optimization based on ./INSTALL
102 # for debugging, use -Og, or -O0 to make debug really correspond to sources
103 # dunno why I have had -std=gnu99 in the past
104 #CFLAGS='-std=gnu99 -g3 -Og'
105 export CFLAGS
='-g3 -Og'
106 #CFLAGS='-std=gnu99 -g3 -O2' logq ./configure --enable-link-time-optimization
107 # on ubuntu 12.04, the above fails, says my c compiler won't work, so intead, just use defaults
109 logq
make -j `nproc` bootstrap
112 # temporarily for testing multiple versions
114 logq sudo
make install
116 # make emacs always work for root
117 s lnf
/usr
/local
/bin
/emacs
/usr
/bin
121 logq emacs
--batch -l ~
/.emacs.d
/init.el
-l ~
/.emacs.d
/compile-init-dir.el
123 # not keeping up with the latest org-mode development
124 #~/bin/buildscripts/org-mode
128 cd ~
/.emacs.d
/src
/mediawiki-el
133 # not keeping up with the latest gnus development.
134 # # instructions from the README
135 # # the byte-recompile-directory seems to compile gnus,
136 # # but gnus complains that it should be compiled when it starts
137 # cd ~/.emacs.d/src/gnus
138 # if [[ $1 == *u* ]]; then