X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=kitty;h=2fa8372163dc956f72d02b84404833b3b1e9e484;hb=HEAD;hp=07a5e514281eea8e680f2270fda9d1328494673e;hpb=f898fa23c5a5f455bf300fb48e57641e290334fb;p=buildscripts 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