summaryrefslogtreecommitdiffhomepage
path: root/etc/midipix.sh
diff options
context:
space:
mode:
authorLucio Andrés Illanes Albornoz (arab, vxp) <l.illanes@gmx.de>2016-11-14 23:02:47 +0100
committerLucio Andrés Illanes Albornoz (arab, vxp) <l.illanes@gmx.de>2016-11-15 20:40:50 +0100
commit59765f508225998d8a73b1da8380ff06b4a6b79c (patch)
tree9397850a4ab5bac51ec373558722c45be4fe7258 /etc/midipix.sh
parent8739dbe67d82f90d1c3b63a8d07af291c4ace600 (diff)
downloadmidipix_build-59765f508225998d8a73b1da8380ff06b4a6b79c.tar.bz2
midipix_build-59765f508225998d8a73b1da8380ff06b4a6b79c.tar.xz
1) Replaces the SysV-style build script link mechanism w/ build {,meta-}targets,
2) splits build.{subr,sh}} into subr/{build,pkg,rtl}.subr and build.sh, 3) replaces {997.strip,998.midipix_sh,999.tarballs}.build with subr/{strip,tarball}.subr, 4) moves patches to patches/, vars files to vars/, and everything else to etc/, 5) renames `Create `Midipix mintty shell' shortcut.vbs' to midipix_shortcut.vbs, 6) fixes a Weechat configure issue, and 7) updates etc/{build.usage,README}.
Diffstat (limited to 'etc/midipix.sh')
-rwxr-xr-xetc/midipix.sh40
1 files changed, 40 insertions, 0 deletions
diff --git a/etc/midipix.sh b/etc/midipix.sh
new file mode 100755
index 00000000..cc168d18
--- /dev/null
+++ b/etc/midipix.sh
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+set -o noglob;
+if [ -z "${PATH##/bin:*}" \
+-a -z "${PATH##*:/bin:*}" \
+-a -z "${PATH##*:/bin}" ]; then
+ export PATH="/bin${PATH:+:${PATH}}";
+fi;
+while getopts m __; do
+case ${__} in
+m) MIDIPIX_DNAME_DIST=minipix; ;;
+*) echo "usage: $0 [-m] [Cygwin pathname to Midipix root]";
+ echo " -m: use Minipix distribution"; exit 0;
+esac; done;
+if [ -n "${1}" ]; then
+ MIDIPIX_PATH=$(cygpath -am "${1}"); cd ${MIDIPIX_PATH} || exit 1;
+else
+ MIDIPIX_PATH=$(cygpath -am .);
+fi;
+printf "%-35s: %s\n" "Absolute Midipix pathname" "${MIDIPIX_PATH}";
+printf "%-35s: %s\n" "Distribution name" "${MIDIPIX_DNAME_DIST:=native}";
+if [ -f libpsxscl.log ]; then
+ echo Found libpsxscl.log, copying to libpsxscl.last.
+ if ! cp -p -- libpsxscl.log libpsxscl.last; then
+ echo "(cp(1) returned ${?}, ignored.)";
+ fi;
+fi;
+if [ "$(uname -o)" = "Msys" ]; then
+ export MSYS2_ARG_CONV_EXCL="*";
+fi;
+mintty -h always -s 120,80 -e /bin/sh -c "
+ set -o errexit;
+ env PATH=${MIDIPIX_PATH}/${MIDIPIX_DNAME_DIST}/lib \
+ ${MIDIPIX_DNAME_DIST}/bin/ntctty.exe -e \
+ ${MIDIPIX_DNAME_DIST}/bin/chroot ${MIDIPIX_DNAME_DIST} \
+ /bin/env PATH=/bin:/lib bash" &
+sleep ${SLEEP_DELAY:=0.25};
+printf "%-35s: %s\n" "ntctty PID" "$(ps -W | awk '$NF ~ /ntctty\.exe$/{print $1}')";
+
+# vim:filetype=sh