From: Ian Kelling Date: Sat, 27 Apr 2024 23:19:18 +0000 (-0400) Subject: overdue commit lots of changes X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=ab99d27ca3f4bc8053fe2ae8684966896e0a1186;p=buildscripts overdue commit lots of changes --- diff --git a/alacritty b/alacritty deleted file mode 100755 index ca175c7..0000000 --- a/alacritty +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -# I, Ian Kelling, follow the GNU license recommendations at -# https://www.gnu.org/licenses/license-recommendations.en.html. They -# recommend that small programs, < 300 lines, be licensed under the -# Apache License 2.0. This file contains or is part of one or more small -# programs. If a small program grows beyond 300 lines, I plan to switch -# its license to GPL. - -# Copyright 2024 Ian Kelling - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -source /a/bin/bash-bear-trap/bash-bear -source /a/bin/distro-functions/src/package-manager-abstractions - - -pi cmake pkg-config libfreetype6-dev libfontconfig1-dev libxcb-xfixes0-dev libxkbcommon-dev python3 -cd /a/opt/alacritty -cargo build --release -sudo mkdir -p /usr/local/share/man/man1 -gzip -c extra/alacritty.man | sudo tee /usr/local/share/man/man1/alacritty.1.gz > /dev/null -sudo rsync -at /a/opt/alacritty/target/release/alacritty /usr/local/bin diff --git a/bbb b/bbb index e0dc87e..3ca9eb3 100755 --- a/bbb +++ b/bbb @@ -34,7 +34,7 @@ ln -s $PWD ~ s virsh dumpxml ubuntu20.04-clone-bbb | gr mac # use mac -virsh net-update default add ip-dhcp-host "" --live --config +virsh net-update default add ip-dhcp-host "" --live --config virsh start ubuntu20.04-clone-bbb @@ -67,7 +67,7 @@ option proto udp EOF -wget -qO- https://ubuntu.bigbluebutton.org/bbb-install-2.5.sh | bash -sxe -- -v focal-250 -s i.b8.nz -e letsencrypt@b8.nz -a -g +wget -qO- https://ubuntu.bigbluebutton.org/bbb-install-2.5.sh | bash -sxe -- -v focal-250 -s b8.nz -e letsencrypt@b8.nz -a -g diff --git a/emacs b/emacs index 01a6600..5fe4e2f 100755 --- a/emacs +++ b/emacs @@ -112,8 +112,15 @@ if [[ -e $dir ]]; then rev=$(cat $last_build 2>/dev/null) ||: head=$(git rev-parse HEAD) if ! $recompile && ! $bootstrap && [[ $rev == "$head" ]]; then - echo "already compiled, exiting" - exit 0 + echo "already compiled" + installed_info=$(file $(readlink -f $(type -P emacs))) + build_info=$(file $dir/src/emacs) + if [[ $installed_info == "$build_info" ]]; then + echo "already installed exiting" + # this isn't perfect, because install could partially fail or the + # command after it could + exit 0 + fi fi if [[ $rev != "$head" ]]; then bootstrap=true diff --git a/go b/go index d58bca7..354b92e 100755 --- a/go +++ b/go @@ -51,8 +51,13 @@ install=false if ! $force; then yesterday=$(( $(date +%s) - 60*60*24 )) + fetch_mtime=$(stat -c %Y FETCH_HEAD) + if [[ ! $fetch_mtime ]]; then + err failed to get output from stat -c %Y FETCH_HEAD + exit 1 + fi # no need to check for updates on go more than once a day - if (( $(stat -c %Y FETCH_HEAD) > yesterday )); then + if (( fetch_mtime > yesterday )); then up=false fi diff --git a/kitty b/kitty deleted file mode 100755 index 07a5e51..0000000 --- a/kitty +++ /dev/null @@ -1,98 +0,0 @@ -#!/bin/bash -# I, Ian Kelling, follow the GNU license recommendations at -# https://www.gnu.org/licenses/license-recommendations.en.html. They -# recommend that small programs, < 300 lines, be licensed under the -# Apache License 2.0. This file contains or is part of one or more small -# programs. If a small program grows beyond 300 lines, I plan to switch -# its license to GPL. - -# Copyright 2024 Ian Kelling - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -source /a/bin/bash-bear-trap/bash-bear - -if [[ -s ~/.bashrc ]]; then . ~/.bashrc; fi - -rebuild=false -case $1 in - -r) rebuild=true ;; -esac - -# https://sw.kovidgoyal.net/kitty/build/ -deps=( - libdbus-1-dev - libxcursor-dev - libxrandr-dev - libxi-dev - libxinerama-dev - libgl1-mesa-dev - libxkbcommon-x11-dev - libfontconfig-dev - libx11-xcb-dev - liblcms2-dev - libpython3-dev - librsync-dev -) - -pi ${deps[@]} - -last_build=/a/opt/kitty-build-info/last-build -cd /a/opt/kitty -rev=$(cat $last_build 2>/dev/null) ||: -head=$(sudo -u zu git rev-parse HEAD) -if ! $recompile && ! $bootstrap && [[ $rev == "$head" ]]; then - : -fi - - -# built it on one machine, the others it dies with the error illegal -# instruction. building is pretty quick, so just detect if our version -# works, and if not, rebuild and install. -# I had an idea to test the failure like so: -# timeout 5 kitty /bin/true, but that doesn't work over ssh -if ! $rebuild && ! /bin/true; then - rebuild=true -fi - -err-cleanup() { - if mountpoint -q /usr/local/src/kitty; then - s umount /usr/local/src/kitty - fi -} - -if $rebuild; then - s mkdir -p /usr/local/src/kitty - s mount -o bind /a/opt/kitty /usr/local/src/kitty - - s install -o zu -g zu -d /usr/local/src/kitty - s chown -hR zu.zu /usr/local/src/kitty - cd /usr/local/src/kitty - # default plus go - p=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/usr/local/go/bin - gp=/usr/local/src/kitty/go - m sudo -u zu bash -c 'PATH=$PATH:/usr/local/go/bin; export GOPATH=/usr/local/src/kitty/go; go mod download -x' - m sudo -u zu firejail --read-write=/usr/local/src/kitty --profile=makekitty env PATH=$p make clean - m sudo -u zu firejail --read-write=/usr/local/src/kitty --profile=makekitty env PATH=$p GOPATH=$gp make - cd / - s umount /usr/local/src/kitty - s chown -hR iank.iank /a/opt/kitty -fi - -cd /a/opt/kitty -s rsync -ar --chown root:root --delete __main__.py kitty logo kittens /usr/local/src/kitty -s rsync -ar --chown root:root ./terminfo/x/xterm-kitty /usr/share/terminfo/x/xterm-kitty -s ln -sf -T /usr/local/src/kitty/kitty/launcher/kitty /usr/local/bin/kitty - -echo $head >$last_build diff --git a/mu4e b/mu4e index 5673bb5..d70e6ed 100755 --- a/mu4e +++ b/mu4e @@ -51,8 +51,15 @@ if [[ -e $dir ]]; then rev=$(cat $last_build 2>/dev/null) ||: head=$(git rev-parse HEAD) if ! $recompile && ! $bootstrap && [[ $rev == "$head" ]]; then - echo "already compiled, exiting" - exit 0 + echo "already compiled" + installed_info=$(file $(readlink -f $(type -P mu))) + build_info=$(file $dir/build/mu/mu) + if [[ $installed_info == "$build_info" ]]; then + echo "already installed exiting" + # this isn't perfect, because install could partially fail or the + # command after it could + exit 0 + fi fi echo rev=$rev head=$head if [[ $rev != "$head" ]]; then