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, exiting"
57 echo rev=$rev head=$head
58 if [[ $rev != "$head" ]]; then
62 head=$
(git rev-parse HEAD
)
67 e recompile
=$recompile bootstrap
=$bootstrap
72 m rsync
--delete -ra /a
/opt
/mu
/ $dir
78 if [[ $
(debian-codename
) == flidas
]]; then
79 # use the flidas branch, stuck behind because
80 # needs newer crypt libraries that are too troublesome.
83 # libgmime-3.0-dev is a newer version than build-dep installs for buster
84 # note, currently, need newer meson than t10
85 m pi libgmime-3.0
-dev meson
89 m .
/autogen.sh
&& make -j`nproc`
90 # note uninstall is implemented
93 # Workaround for some indecipherable build error
94 # that only happens after syncing the mu dir and not building from
95 # scratch. It seems there is some state somewhere, like ~/.local
96 # that doesn't get copied. Found the workaround by reading the Makefile,
97 # then doing a more verbose build with:
98 # ninja -C $PWD/build -v -d explain
99 sudo
touch -d @$
(($
(stat
-c%Y build
/build.ninja
) - 100)) /usr
/local
/bin
/emacs
102 echo $head >$last_build