2 # I, Ian Kelling, follow the GNU license recommendations at
3 # https://www.gnu.org/licenses/license-recommendations.en.html. They
4 # recommend that small programs, < 300 lines, be licensed under the
5 # Apache License 2.0. This file contains or is part of one or more small
6 # programs. If a small program grows beyond 300 lines, I plan to switch
9 # Copyright 2024 Ian Kelling
11 # Licensed under the Apache License, Version 2.0 (the "License");
12 # you may not use this file except in compliance with the License.
13 # You may obtain a copy of the License at
15 # http://www.apache.org/licenses/LICENSE-2.0
17 # Unless required by applicable law or agreed to in writing, software
18 # distributed under the License is distributed on an "AS IS" BASIS,
19 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 # See the License for the specific language governing permissions and
21 # limitations under the License.
24 if [[ -s ~
/.bashrc
]];then . ~
/.bashrc
;fi
32 while [[ $1 == -* ]]; do
36 --no-r) recompile
=false
;;
38 *) echo "$0: error: bad arg: $1" >&2; exit 1 ;;
46 dir
=/a
/opt
/mu-$
(distro-name
)$
(distro-num
)
47 last_build
=$dir/iank-mu-build
49 if [[ -e $dir ]]; then
51 rev=$
(cat $last_build 2>/dev
/null
) ||
:
52 head=$
(git rev-parse HEAD
)
53 if ! $recompile && ! $bootstrap && [[ $rev == "$head" ]]; then
54 echo "already compiled"
55 installed_info
=$
(file $
(readlink
-f $
(type -P mu
)))
56 build_info
=$
(file $dir/build
/mu
/mu
)
57 if [[ $installed_info == "$build_info" ]]; then
58 echo "already installed exiting"
59 # this isn't perfect, because install could partially fail or the
60 # command after it could
64 echo rev=$rev head=$head
65 if [[ $rev != "$head" ]]; then
69 head=$
(git rev-parse HEAD
)
74 e recompile
=$recompile bootstrap
=$bootstrap
79 m rsync
--delete -ra /a
/opt
/mu
/ $dir
85 if [[ $
(debian-codename
) == flidas
]]; then
86 # use the flidas branch, stuck behind because
87 # needs newer crypt libraries that are too troublesome.
90 # libgmime-3.0-dev is a newer version than build-dep installs for buster
91 # note, currently, need newer meson than t10
92 m pi libgmime-3.0
-dev meson
96 m .
/autogen.sh
&& make -j`nproc`
97 # note uninstall is implemented
100 # Workaround for some indecipherable build error
101 # that only happens after syncing the mu dir and not building from
102 # scratch. It seems there is some state somewhere, like ~/.local
103 # that doesn't get copied. Found the workaround by reading the Makefile,
104 # then doing a more verbose build with:
105 # ninja -C $PWD/build -v -d explain
106 sudo
touch -d @$
(($
(stat
-c%Y build
/build.ninja
) - 100)) /usr
/local
/bin
/emacs
109 echo $head >$last_build