From a86a935b69053defdd71104689d14b75e5365cac Mon Sep 17 00:00:00 2001 From: Alison Watson Date: Sun, 15 Nov 2020 14:03:33 -0700 Subject: [PATCH] add development chroot environment --- applications/fish | 3 +++ computers/cain/void-conf | 9 +++++++++ fish/chroot | 31 +++++++++++++++++++++++++++++++ fish/prompt | 18 ++++++++++++------ 4 files changed, 55 insertions(+), 6 deletions(-) create mode 100644 fish/chroot diff --git a/applications/fish b/applications/fish index dc04f4a..b4547da 100644 --- a/applications/fish +++ b/applications/fish @@ -10,15 +10,18 @@ end # - _agw_dir_bin = volatile binary storage # - _agw_dir_rc = the directory holding this repository # - _agw_dir_src = non-volatile source code storage +# - _agw_dir_dev = volatile chroot development environment switch (uname) case Linux NetBSD set -Ux _agw_dir_bin ~/bin set -Ux _agw_dir_rc ~/rc set -Ux _agw_dir_src ~/src + set -Ux _agw_dir_dev ~/dev case Darwin set -Ux _agw_dir_bin ~/Binaries set -Ux _agw_dir_rc ~/Sources/scripts set -Ux _agw_dir_src ~/Sources + set -Ux _agw_dir_dev ~/Development case \* echo (set_color red)"This platform is not configured!" end diff --git a/computers/cain/void-conf b/computers/cain/void-conf index 9dcf188..41642f0 100644 --- a/computers/cain/void-conf +++ b/computers/cain/void-conf @@ -1,2 +1,11 @@ +# -*-Conf-*- +XBPS_CHROOT_CMD=uunshare +XBPS_ALLOW_CHROOT_BREAKOUT=no + +XBPS_CFLAGS="-O3 -pipe -march=native" +XBPS_CXXFLAGS="${XBPS_CFLAGS}" XBPS_MAKEJOBS=12 + XBPS_ALLOW_RESTRICTED=yes + +## EOF diff --git a/fish/chroot b/fish/chroot new file mode 100644 index 0000000..b81aff5 --- /dev/null +++ b/fish/chroot @@ -0,0 +1,31 @@ +#!/usr/bin/env fish + +function devrt-recreate + echo "Ensure that you have committed any changes to the devrt that you need to before recreating." + echo "Type 'ok' to continue, or anything else to exit." + if test (read) != "ok" + exit 1 + end + rm -rf $_agw_dir_dev + tar -xJf $_agw_dir_bin/dev-base.latest.tar.xz + xbps-uunshare -- $_agw_dir_dev /setup.sh +end + +function devrt-commit + pushd ~ + set lf $_agw_dir_bin/dev-base.latest.tar.xz + set nf $_agw_dir_bin/dev-base.(stat -c %Y $lf).tar.xz + mv $lf $nf + tar -Ipixz -cf $lf (string replace ~/ "" -- $_agw_dir_dev) + popd +end + +function devrt + xbps-uunshare \ + -b $_agw_dir_rc:/home/marrub/rc \ + -b $_agw_dir_src:/home/marrub/src \ + -b $_agw_dir_bin:/home/marrub/bin \ + -- $_agw_dir_dev /usr/bin/env _agw_chroot=1 /usr/bin/fish -l -i -C cd +end + +## EOF diff --git a/fish/prompt b/fish/prompt index 3b84d24..091d445 100644 --- a/fish/prompt +++ b/fish/prompt @@ -4,12 +4,18 @@ function fish_prompt set _stat $status echo -n (set_color 70a9ff)(date +%H:%M:%S) echo -n (set_color normal)( - if test $_stat -eq 0 - echo '@' - else - echo '!' - end) - echo -n (set_color c792ea)$hostname + if test $_stat -eq 0 + echo '@' + else + echo '!' + end) + + echo -n ( + if test $_agw_chroot + set_color f54f4c + else + set_color c792ea + end)$hostname echo (set_color normal)"% " end