1
0
mirror of synced 2026-01-13 15:37:38 +00:00
Frank Halasz de4e5f5ca4
Add cygwin build & install script to buildRealease action; remove old Windows docker build / install (#1337)
* Add cygwin-sdl build to buildLoadup workflow; add installer for cygwin-sdl on windows

* Change how buildLoadup computes latest maiko release to accomodate draft releases

* Fix call to gh release list for maiko

* Debugging call to gh release list for maiko

* Debugging call to gh release list for maiko #2

* Debugging call to gh release list for maiko #3

* Debugging call to gh release list for maiko #4

* Debugging call to gh release list for maiko #5

* Debugging call to gh release list for maiko #6

* Change maiko downloads to accoiunt for draft releases

* Change maiko downloads to account for draft releases #2

* Specify shell (powershell) for Download cygwin installler

* Few cleanup items on cygwin-install

* Update ShellWhich to use command -v instead of which because which returns to much crap on cygwin and command -v is more portable overall

* Switch from using medley-loadup & -runtime tars to medley-full-*.tgz so we get full release incl notecards; delete maiko on install and replace with cygwin maiko

* Make sure Notecards doesn't try to load its HASH fileon PostGreet - for apps.sysout

* Add xdg-utils to cygwin install to support ShellBrowser

* Odds and ends on cygwin build

* Redo medley.iss install script to use tar from Windows rather than cygwin tar because cygwin tar was messing up ACLs in windows.  Needed to change creation of medley.bat accordingly.

* Remove junk lines from buildLoadup.yml

* Restore accidently deleted line to buildLoadup.yml

* Fix multiple issues with cygwin_installer filename; arrange to remove placeholder.txt from the release assets at the end of cygwin installer

* Change name of job from windows_installer to cygwin_installer

* Fix missing GH_TOKEN is removal of placeholder.txt; fix naming of output file in medley.iss

* Fiddling with getting cygwin-installer name right

* Redoing merge of medley.sh/medley.command to handle the Darwin plus Cygwin cases; is medley.iss recreate symbolic links surrounding the medley.sh script

* Fix typos/syntrax errors in medley.sh/medley.command
2023-09-27 10:41:01 -07:00

150 lines
3.8 KiB
Bash
Executable File

#!/bin/bash
###############################################################################
#
# medley.sh - script for running Medley Interlisp on Linux/WSL.
# On Linux and WSL when using X Windows it just sets
# up directories and environment variables and then calls
# run-medley. On WSL, there is an option to run without
# or around X Windows by using the XVnc and a VNC viewer
# on the Windows side. This script will start this VNC viewer
# on the Windows side.
#
# 2023-01-12 Frank Halasz
#
# Copyright 2023 Interlisp.org
#
###############################################################################
#set -x
# functions to discover what directory this script is being executed from
get_abs_filename() {
# $1 : relative filename
echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
}
get_script_dir() {
# call this with ${BASH_SOURCE[0]:-$0} as its (only) parameter
# set -x
local SCRIPT_PATH="$( get_abs_filename "$1" )";
pushd . > '/dev/null';
while [ -h "$SCRIPT_PATH" ];
do
cd "$( dirname -- "$SCRIPT_PATH"; )";
SCRIPT_PATH="$( readlink -f -- "$SCRIPT_PATH"; )";
done
cd "$( dirname -- "$SCRIPT_PATH"; )" > '/dev/null';
SCRIPT_PATH="$( pwd; )";
popd > '/dev/null';
# set +x
echo "${SCRIPT_PATH}"
}
SCRIPTDIR=$(get_script_dir "${BASH_SOURCE[0]:-$0}")
# Define some generally useful functions
source ${SCRIPTDIR}/medley_utils.sh
export MEDLEYDIR=$(cd ${SCRIPTDIR}; cd ../..; pwd)
IL_DIR=$(cd ${MEDLEYDIR}; cd ..; pwd)
export LOGINDIR=${HOME}/il
# Are we running under Docker or WSL or Darwin or Cygwin?
#
docker=false
wsl=false
darwin=false
if [ "$(uname)" = "Darwin" ];
then
darwin=true
elif [ -n "${MEDLEY_DOCKER_BUILD_DATE}" ];
then
docker='true'
elif [ $(uname -s | head --bytes 6) != "CYGWIN" ];
then
wsl_ver=0
# WSL2
grep --ignore-case --quiet wsl /proc/sys/kernel/osrelease
if [ $? -eq 0 ];
then
wsl='true'
wsl_ver=2
else
# WSL1
grep --ignore-case --quiet microsoft /proc/sys/kernel/osrelease
if [ $? -eq 0 ];
then
if [ $(uname -m) = x86_64 ];
then
wsl='true'
wsl_ver=1
else
echo "ERROR: Running Medley on WSL1 requires an x86_64-based PC."
echo "This is not an x86_64-based PC."
echo "Exiting"
exit 23
fi
fi
fi
fi
# process args
source ${SCRIPTDIR}/medley_args.sh
# Make sure that there is not another instance currently running with this same id
ps ax | grep ldex | grep --quiet "\-id ${run_id}"
if [ $? -eq 0 ];
then
echo "Another instance of Medley Interlisp is already running with the id \"${run_id}\"."
echo "Only a single instance with a given id can be run at the same time."
echo "Please retry using the \"--id <name>\" argument to give this new instance a different id."
echo "Exiting"
exit 3
fi
# Set LDEDESTSYSOUT env variable based on id
if [ -z ${LDEDESTSYSOUT} ];
then
if [ "${run_id}" = "default" ];
then
export LDEDESTSYSOUT=${LOGINDIR}/vmem/lisp.virtualmem
else
export LDEDESTSYSOUT=${LOGINDIR}/vmem/lisp_${run_id}.virtualmem
fi
fi
# Create LOGINDIR if necessary
if [ ! -e ${LOGINDIR} ];
then
mkdir -p ${LOGINDIR}
elif [ ! -d ${LOGINDIR} ];
then
echo "ERROR: Medley requires a directory named ${LOGINDIR}."
echo "But ${LOGINDIR} exists appears not be a directory."
echo "Exiting"
exit 2
fi
mkdir -p ${LOGINDIR}/vmem
# Call run-medley with or without vnc
if [[ ( ${darwin} = true ) || (( ${wsl} = false || ${use_vnc} = false ) && ${docker} = false) ]];
then
# If not using vnc, just call run-medley
${MEDLEYDIR}/run-medley -id "${run_id}" ${geometry} ${screensize} ${run_args[@]}
else
# do the vnc thing on wsl or docker
source ${SCRIPTDIR}/medley_vnc.sh
fi