diff --git a/.github/workflows/buildLoadup.yml b/.github/workflows/buildLoadup.yml index 3079bbbd..635d0a8a 100644 --- a/.github/workflows/buildLoadup.yml +++ b/.github/workflows/buildLoadup.yml @@ -60,7 +60,7 @@ defaults: jobs: -###################################################################################### +# JOB: inputs ####################################################################### # Regularize the inputs so they can be referenced the same way whether they are # the result of a workflow_dispatch or a workflow_call @@ -85,8 +85,7 @@ jobs: fi - -###################################################################################### +# JOB: sentry ####################################################################### # Use sentry-action to determine if this release has already been built # based on the latest commit to the repo @@ -114,11 +113,11 @@ jobs: with: tag: "loadup" -###################################################################################### +# JOB: loadup ####################################################################### # - # Do the loadup + # Do the loadup and push to release on github # loadup: @@ -129,7 +128,8 @@ jobs: combined_release_tag: ${{ steps.job_outputs.outputs.COMBINED_RELEASE_TAG }} medley_release_tag: ${{ steps.job_outputs.outputs.MEDLEY_RELEASE_TAG }} medley_short_release_tag: ${{ steps.job_outputs.outputs.MEDLEY_SHORT_RELEASE_TAG }} - debs_filename_base: ${{ steps.debs.outputs.DEBS_FILENAME_BASE }} + artifacts_filename_template: ${{ steps.job_outputs.outputs.ARTIFACTS_FILENAME_TEMPLATE }} + release_url: ${{ steps.push.outputs.html_url }} needs: [inputs, sentry] if: | @@ -156,22 +156,35 @@ jobs: # Get Maiko release information, retrieves the name of the latest # release. Used to download the correct Maiko release - - name: Get Maiko Release Information + # Find latest release (draft or normal) + - name: Get maiko release information id: maiko - uses: abatilo/release-info-action@v1.3.2 - with: - owner: ${{ github.repository_owner }} - repo: maiko + run: | + tag="" + if [ "${{ needs.inputs.outputs.draft }}" = "true" ]; + then + gh release list --repo ${{ github.repository_owner }}/maiko | grep Draft >/tmp/releases-$$ + if [ $? -eq 0 ]; + then + tag=$(head -n 1 /tmp/releases-$$ | awk '{ print $3 }') + fi + fi + if [ -z "${tag}" ]; + then + tag=$(gh release list --repo ${{ github.repository_owner }}/maiko | grep Latest | head -n 1 | awk '{ print $3 }') + fi + echo "maiko_tag=${tag}" >> ${GITHUB_OUTPUT} + env: + GITHUB_TOKEN: ${{ secrets.MAIKO_TOKEN }} # Setup environment variables & establish job outputs - name: Setup Environment Variables run: | echo "build_time=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> ${GITHUB_OUTPUT} - echo "TARBALL_DIR=installers/deb/tmp/tarballs" >>${GITHUB_ENV} - echo "DEBS_DIR=installers/deb/debs" >>${GITHUB_ENV} - echo "TARS_DIR=installers/deb/tars" >>${GITHUB_ENV} + echo "TARBALL_DIR=/tmp/tarballs" >>${GITHUB_ENV} echo "MEDLEY_RELEASE_TAG=${RELEASE_TAG}" >>${GITHUB_ENV} - echo "MAIKO_RELEASE_TAG=${{ steps.maiko.outputs.latest_tag }}" >>${GITHUB_ENV} + echo "MAIKO_RELEASE_TAG=${{ steps.maiko.outputs.maiko_tag }}" >>${GITHUB_ENV} + echo "ARTIFACTS_FILENAME_TEMPLATE=medley-full-@@PLATFORM@@-@@ARCH@@-@@MEDLEY.RELEASE@@_@@MAIKO.RELEASE@@" >>${GITHUB_ENV} - name: More Environment Variables run: | echo "MEDLEY_SHORT_RELEASE_TAG=${MEDLEY_RELEASE_TAG#medley-}" >>${GITHUB_ENV} @@ -182,27 +195,25 @@ jobs: - name: Establish job outputs id: job_outputs run: | - echo "COMBINED_RELEASE_TAG=${COMBINED_RELEASE_TAG}" >> $GITHUB_OUTPUT; - echo "MEDLEY_RELEASE_TAG=${MEDLEY_RELEASE_TAG}" >> $GITHUB_OUTPUT; - echo "MEDLEY_SHORT_RELEASE_TAG=${MEDLEY_SHORT_RELEASE_TAG}" >> $GITHUB_OUTPUT; + echo "COMBINED_RELEASE_TAG=${COMBINED_RELEASE_TAG}" >> ${GITHUB_OUTPUT} + echo "MEDLEY_RELEASE_TAG=${MEDLEY_RELEASE_TAG}" >> ${GITHUB_OUTPUT} + echo "MEDLEY_SHORT_RELEASE_TAG=${MEDLEY_SHORT_RELEASE_TAG}" >> ${GITHUB_OUTPUT} + echo "ARTIFACTS_FILENAME_TEMPLATE=${ARTIFACTS_FILENAME_TEMPLATE}" >> ${GITHUB_OUTPUT} # Setup some needed dirs in workspace - name: Create work dirs run: mkdir -p ${TARBALL_DIR} - # Download Maiko Release Assets + # Download Maiko Release Assets and untar it - name: Download Release Assets - uses: robinraju/release-downloader@v1.6 - with: - repository: ${{ github.repository_owner }}/maiko - token: ${{ secrets.GITHUB_TOKEN }} - latest: true - out-file-path: ${{ env.TARBALL_DIR }} - fileName: "${{ env.MAIKO_RELEASE_TAG }}-linux.*.tgz" - - - name: Untar Maiko Release for use in loadup run: | - tar -xzf "${TARBALL_DIR}/${{ env.MAIKO_RELEASE_TAG }}-linux.x86_64.tgz" + gh release download ${MAIKO_RELEASE_TAG} \ + -D ${TARBALL_DIR} \ + --repo ${{ github.repository_owner }}/maiko \ + -p '*.tgz' + tar -xzf "${TARBALL_DIR}/${MAIKO_RELEASE_TAG}-linux.x86_64.tgz" + env: + GITHUB_TOKEN: ${{ secrets.MAIKO_TOKEN }} # Checkout Notecards and tar it in the tarballsdir - name: Checkout Notecards @@ -210,11 +221,11 @@ jobs: with: repository: ${{ github.repository_owner }}/notecards path: ./notecards - - run: mv ./notecards ../notecards - name: Tar notecards into tarball dir run: | - cd .. - tar cfz medley/${TARBALL_DIR}/notecards.tgz notecards + mv ./notecards ../notecards + cd ../notecards + git archive --format=tgz --output="${TARBALL_DIR}/notecards.tgz" --prefix=notecards/ main # Install vnc - name: Install vnc @@ -224,7 +235,6 @@ jobs: run: | Xvnc -geometry 1280x720 :0 & export DISPLAY=":0" - PATH="$PWD/maiko:$PATH" scripts/loadup-all.sh -apps scripts/loadup-db.sh @@ -233,15 +243,6 @@ jobs: scripts/release-make-tars.sh "${MEDLEY_RELEASE_TAG}" mv releases/"${MEDLEY_SHORT_RELEASE_TAG}"/*.tgz "${TARBALL_DIR}" - # Build the deb files as well as the tgz files - - name: Build .deb files for 3 architectures - id: debs - run: | - cd installers/deb - debs_filename_base=$(./build_deb.sh) - echo "DEBS_FILENAME_BASE=${debs_filename_base}" >> $GITHUB_ENV; - echo "DEBS_FILENAME_BASE=${debs_filename_base}" >> $GITHUB_OUTPUT; - # Push the release up to github releases - name: Delete existing release with same tag (if any) uses: cb80/delrel@latest @@ -250,21 +251,166 @@ jobs: continue-on-error: true - name: Push the release - id: push_release + id: push uses: ncipollo/release-action@v1 with: allowUpdates: true artifacts: + # ${{ env.TARBALL_DIR }}/notecards.tgz, ${{ env.TARBALL_DIR }}/${{ env.MEDLEY_RELEASE_TAG }}-loadups.tgz, - ${{ env.TARBALL_DIR }}/${{ env.MEDLEY_RELEASE_TAG }}-runtime.tgz, - ${{ env.DEBS_DIR }}/*.deb, - ${{ env.TARS_DIR }}/*.tgz + ${{ env.TARBALL_DIR }}/${{ env.MEDLEY_RELEASE_TAG }}-runtime.tgz tag: ${{ env.MEDLEY_RELEASE_TAG }} draft: ${{ needs.inputs.outputs.draft }} prerelease: false generateReleaseNotes: true token: ${{ secrets.GITHUB_TOKEN }} + # Save the tarball directory for subsequent jobs + - name: Save tarballs + uses: actions/upload-artifact@v3 + with: + name: tarballs + path: ${{ env.TARBALL_DIR }} + if-no-files-found: error + + +# JOB: linux_installer ############################################################## + + # + # Create the linux installers (.deb and .tgz) and push to release on github + # + linux_installer: + + runs-on: ubuntu-latest + + needs: [inputs, sentry, loadup] + if: | + needs.sentry.outputs.release_not_built == 'true' + || needs.inputs.outputs.force == 'true' + + steps: + + # Checkout latest commit + - name: Checkout Medley + uses: actions/checkout@v3 + + # Environment variables + - name: Environment variables + run: | + echo "DEBS_DIR=installers/deb/debs" >>${GITHUB_ENV} + echo "TARS_DIR=installers/deb/tars" >>${GITHUB_ENV} + echo "TARBALL_DIR=installers/deb/tmp/tarballs" >>${GITHUB_ENV} + echo "MEDLEY_RELEASE_TAG=${{ needs.loadup.outputs.medley_release_tag }}" \ + >>${GITHUB_ENV} + echo "ARTIFACTS_FILENAME_TEMPLATE=${{ needs.loadup.outputs.artifacts_filename_template }}" >>${GITHUB_ENV} + + # Create taball dir + - run: mkdir -p ${TARBALL_DIR} + + # Get the tarballs + - name: Get tarballs + uses: actions/download-artifact@v3 + with: + name: tarballs + path: ${{ env.TARBALL_DIR }} + + # Build the deb files as well as the tgz files + - name: Build .deb files for 3 architectures + id: debs + run: | + cd installers/deb + ./build_deb.sh + + # Push the debs and tgz up to github releases + - name: Push the release + id: push_release + uses: ncipollo/release-action@v1 + with: + allowUpdates: true + artifacts: + ${{ env.DEBS_DIR }}/*.deb, + ${{ env.TARS_DIR }}/*.tgz + tag: ${{ env.MEDLEY_RELEASE_TAG }} + token: ${{ secrets.GITHUB_TOKEN }} + omitBodyDuringUpdate: true + omitDraftDuringUpdate: true + omitNameDuringUpdate: true + omitPrereleaseDuringUpdate: true + + + +# JOB: macos_installer ############################################################## + + # + # Create the macos installers (.dmg and .zip) and push to release on github + # + macos_installer: + + runs-on: macos-12 + + needs: [inputs, sentry, loadup] + if: | + needs.sentry.outputs.release_not_built == 'true' + || needs.inputs.outputs.force == 'true' +# if: false + + defaults: + run: + shell: bash + + steps: + + # Checkout latest commit + - name: Checkout Medley + uses: actions/checkout@v3 + + # Environment variables + - name: Environment variables + run: | + MACOS_DIR=installers/macos + echo "MACOS_DIR=${MACOS_DIR}" >>${GITHUB_ENV} + echo "ARTIFACTS_DIR=${MACOS_DIR}/artifacts" >>${GITHUB_ENV} + echo "TARBALL_DIR=${MACOS_DIR}/tmp/tarballs" >>${GITHUB_ENV} + echo "MEDLEY_RELEASE_TAG=${{ needs.loadup.outputs.medley_release_tag }}" \ + >>${GITHUB_ENV} + echo "ARTIFACTS_FILENAME_TEMPLATE=${{ needs.loadup.outputs.artifacts_filename_template }}" >>${GITHUB_ENV} + + # Create tarball dir + - run: mkdir -p ${TARBALL_DIR} + + # Get the tarballs + - name: Get tarballs + uses: actions/download-artifact@v3 + with: + name: tarballs + path: ${{ env.TARBALL_DIR }} + + # Build the .dmg and .zip files + - name: Build .dmg & .zip files + id: dmg-zip + run: | + cd ${MACOS_DIR} + ./build_artifacts.sh + + # Push the .dmg and .zip up to github releases + - name: Push the release + id: push_release + uses: ncipollo/release-action@v1 + with: + allowUpdates: true + artifacts: + # 2023-07-20 not yet building dmg -- ${{ env.ARTIFACTS_DIR }}/*.dmg, + ${{ env.ARTIFACTS_DIR }}/*.zip + tag: ${{ env.MEDLEY_RELEASE_TAG }} + token: ${{ secrets.GITHUB_TOKEN }} + omitBodyDuringUpdate: true + omitDraftDuringUpdate: true + omitNameDuringUpdate: true + omitPrereleaseDuringUpdate: true + + + +# JOB: windows_installer ############################################################# # # Create the Windows installer, push it up to the release on github and @@ -279,7 +425,11 @@ jobs: needs.sentry.outputs.release_not_built == 'true' || needs.inputs.outputs.force == 'true' + outputs: + windows_installer_filename: ${{ steps.jobout.outputs.INSTALLER_FILENAME }} + steps: + # Checkout latest commit - name: Checkout Medley uses: actions/checkout@v3 @@ -294,8 +444,8 @@ jobs: echo "MEDLEY_RELEASE_TAG=$mrt" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append $msrt="${{ needs.loadup.outputs.medley_short_release_tag }}" echo "MEDLEY_SHORT_RELEASE_TAG=$msrt" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append - $debs="${{ needs.loadup.outputs.debs_filename_base }}" - echo "DEBS_FILENAME_BASE=$debs" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append + $aft="${{ needs.loadup.outputs.artifacts_filename_template }}" + echo "ARTIFACTS_FILENAME_TEMPLATE=$aft" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append # Download vnc viewer - name: Download vncviewer @@ -310,8 +460,7 @@ jobs: shell: powershell run: | iscc installers\win\medley.iss - $filename="medley-install_${env:COMBINED_RELEASE_TAG}_x64.exe" - echo "INSTALLER_FILENAME=$filename" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append + # Upload windows installer to release - name: Upload windows installer to release @@ -319,7 +468,7 @@ jobs: uses: ncipollo/release-action@v1 with: allowUpdates: true - artifacts: installers/win/${{ env.INSTALLER_FILENAME }} + artifacts: installers/win/medley-*.exe tag: ${{ env.MEDLEY_RELEASE_TAG }} token: ${{ secrets.GITHUB_TOKEN }} omitBodyDuringUpdate: true @@ -327,18 +476,63 @@ jobs: omitNameDuringUpdate: true omitPrereleaseDuringUpdate: true - # Install the OpenSSH Client - - name: Install the OpenSSH Client - shell: powershell + +# JOB: downloads_page ################################################################ + + # + # Update the downloads page on OIO + # + + downloads_page: + + runs-on: ubuntu-latest + + needs: [inputs, sentry, loadup, linux_installer, macos_installer, windows_installer] + if: | + needs.sentry.outputs.release_not_built == 'true' + || needs.inputs.outputs.force == 'true' + + steps: + + # Environment variables + - name: Environment Varibales (from other jobs) run: | - Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0 + crt="${{ needs.loadup.outputs.combined_release_tag }}" + echo "COMBINED_RELEASE_TAG=${crt}" >>${GITHUB_ENV} + mrt="${{ needs.loadup.outputs.medley_release_tag }}" + echo "MEDLEY_RELEASE_TAG=${mrt}" >>${GITHUB_ENV} + msrt="${{ needs.loadup.outputs.medley_short_release_tag }}" + echo "MEDLEY_SHORT_RELEASE_TAG=${msrt}" >>${GITHUB_ENV} + + # Checkout latest commit + - name: Checkout Medley + uses: actions/checkout@v3 + + + # Upload a dummy file to release + # Needed since download url of the release changes on every update + # So this will be the final update before creating downloads page + # and we can use its url for the page + - run: echo "placeholder" >placeholder.txt + - name: Upload windows installer to release + id: pushph + uses: ncipollo/release-action@v1 + with: + allowUpdates: true + artifacts: placeholder.txt + tag: ${{ env.MEDLEY_RELEASE_TAG }} + token: ${{ secrets.GITHUB_TOKEN }} + omitBodyDuringUpdate: true + omitDraftDuringUpdate: true + omitNameDuringUpdate: true + omitPrereleaseDuringUpdate: true # Update the downloads page and the man page on OIO - name: Update the downloads page and the man page to the OIO static page host shell: bash run: | # Figure out filenames - download_url="${{ steps.push.outputs.html_url }}" + download_url="${{ steps.pushph.outputs.html_url }}" download_url="${download_url/\/tag\//\/download\/}" local_template="installers/downloads_page/medley_downloads.html" local_filename="medley_downloads.html" @@ -356,9 +550,8 @@ jobs: # Fill in downloads page template sed \ -e "s/@@@MEDLEY.SHORT.RELEASE.TAG@@@/${MEDLEY_SHORT_RELEASE_TAG}/g" \ + -e "s/@@@COMBINED.RELEASE.TAG@@@/${COMBINED_RELEASE_TAG}/g" \ -e "s~@@@DOWNLOAD_URL@@@~${download_url}~g" \ - -e "s/@@@DEBS.FILENAME.BASE@@@/${DEBS_FILENAME_BASE}/g" \ - -e "s/@@@WINDOWS.INSTALLER.FILENAME@@@/${INSTALLER_FILENAME}/g" \ < "${local_template}" > "${local_filename}" # Create sftp instruction file echo "-rm ${remote_filepath}.oldold" > batch @@ -375,7 +568,7 @@ jobs: -###################################################################################### +# JOB: complete ##################################################################### # Use set-sentry-action to determine set the sentry that says this release has # been successfully built @@ -387,9 +580,16 @@ jobs: outputs: build_successful: ${{ steps.output.outputs.build_successful }} - needs: [inputs, sentry, loadup, windows_installer] + needs: [inputs, sentry, loadup, downloads_page] steps: + # Delete the tarballs artifact + - name: Delete tarballs artifact + uses: geekyeggo/delete-artifact@v2 + with: + name: tarballs + failOnError: false + # Checkout the actions for this repo owner - name: Checkout Actions uses: actions/checkout@v3 @@ -411,21 +611,4 @@ jobs: echo "build_successful='true'" >> $GITHUB_OUTPUT ###################################################################################### - - - -# - name: Download the Windows installer created in windows job -# uses: actions/download-artifact@v3 -# with: -# name: windows_installer -# path: installers/win - -# - name: Rename the Windows installer w/ version tag -# run: | -# maiko_release_tag="${{ steps.maiko.outputs.latest_tag }}" -# combined_release_tag="${MEDLEY_RELEASE_TAG#medley-}_${maiko_release_tag#maiko-}" -# windows_installer_filename="medley_install_${combined_release_tag}_x64.exe" -# cd installers/win -# mv medley_install_vXXXVERSIONXXX_x64.exe "${windows_installer_filename}" -# echo "WINDOWS_INSTALLER_FILENAME=${windows_installer_filename}" >>${GITHUB_ENV} - +###################################################################################### diff --git a/.github/workflows/buildReleaseInclDocker.yml b/.github/workflows/buildReleaseInclDocker.yml index cfc9aa42..5049109c 100644 --- a/.github/workflows/buildReleaseInclDocker.yml +++ b/.github/workflows/buildReleaseInclDocker.yml @@ -84,6 +84,7 @@ jobs: echo "force=false" >> $GITHUB_OUTPUT; fi + ###################################################################################### diff --git a/installers/deb/build_deb.sh b/installers/deb/build_deb.sh index 5beb7314..78d45bc9 100755 --- a/installers/deb/build_deb.sh +++ b/installers/deb/build_deb.sh @@ -11,15 +11,6 @@ ############################################################################### # set -x -# mess with file desscriptors so we get only one line on stdout -# so we can communicate only what we want back to any githib runner -# stash fd 1 in fd 3 -exec 3>&1 -# make fd 1 (stdout) be the same as stdout -# so none of the std output from this file will be captured by -# $() but it will still be written out to the tty (via stderr) -exec 1>&2 - tarball_dir=tmp/tarballs # Make sure we are in the right directory @@ -32,6 +23,13 @@ then exit 1 fi +# template for artifacts file names should be passed down in the ENV variable: ARTIFACTS_FILENAME_TEMPLATE +if [ -z "${ARTIFACTS_FILENAME_TEMPLATE}" ]; +then + ARTIFACTS_FILENAME_TEMPLATE="medley-full-@@PLATFORM@@-@@ARCH@@-@@MEDLEY.RELEASE@@_@@MAIKO.RELEASE@@" +fi + + # If running as a github action or -t arg, then skip downloading the tarballs if ! [[ -n "${GITHUB_WORKSPACE}" || "$1" = "-t" ]]; @@ -69,7 +67,6 @@ fi pushd ${tarball_dir} >/dev/null 2>/dev/null medley_release=$(echo medley-*-loadups.tgz | sed "s/medley-\(.*\)-loadups.tgz/\1/") maiko_release=$(echo maiko-*-linux.x86_64.tgz | sed "s/maiko-\(.*\)-linux.x86_64.tgz/\1/") -debs_filename_base="medley-full-${medley_release}_${maiko_release}" popd >/dev/null 2>/dev/null @@ -136,7 +133,7 @@ do # # Create tar file for this arch # - filename="${debs_filename_base}-${wslp}-${arch}" + filename="$(echo ${ARTIFACTS_FILENAME_TEMPLATE} | sed -e "s#@@PLATFORM@@#${wslp}#" -e "s#@@ARCH@@#${arch}#" -e "s#@@MEDLEY.RELEASE@@#${medley_release}#" -e "s#@@MAIKO.RELEASE@@#${maiko_release}#" )" mkdir -p tars echo "Creating tar file tars/${filename}.tgz" tar -C ${il_dir} -czf tars/${filename}.tgz . @@ -151,8 +148,5 @@ do done done -# send just one line back to github $() construct -# do this by restoring fd 1 to what it was orginally -exec 1>&3 -echo "${debs_filename_base}" - +################################################################################################################ +################################################################################################################ diff --git a/installers/downloads_page/medley_downloads.html b/installers/downloads_page/medley_downloads.html index e41529a9..4e81d85d 100644 --- a/installers/downloads_page/medley_downloads.html +++ b/installers/downloads_page/medley_downloads.html @@ -10,36 +10,46 @@
  • Local Installations (for any Linux distro)

  • -
  • WINDOWS 10/11 (Medley runs in a Docker container)

    +
  • macOS 11 (Big Sur) and later - for both Intel and Apple Silicon

    -

    Release @@@MEDLEY.SHORT.RELEASE.TAG@@@ for Windows x64 machines

  • + +
  • WINDOWS 10/11 (Medley running within Cygwin)

    + +

    Not available

  • diff --git a/installers/downloads_page/medley_downloads.md b/installers/downloads_page/medley_downloads.md index 7d251244..cd87f574 100644 --- a/installers/downloads_page/medley_downloads.md +++ b/installers/downloads_page/medley_downloads.md @@ -6,38 +6,47 @@ * #### Standard Linux - [Release @@@MEDLEY.SHORT.RELEASE.TAG@@@ for x86\_64 machines](@@@DOWNLOAD_URL@@@/@@@DEBS.FILENAME.BASE@@@-linux-x86\_64.deb) + [Release @@@MEDLEY.SHORT.RELEASE.TAG@@@ for x86\_64 machines](@@@DOWNLOAD_URL@@@/medley-full-linux-x86\_64-@@@COMBINED.RELEASE.TAG@@@.deb) - [Release @@@MEDLEY.SHORT.RELEASE.TAG@@@ for ARM64 machines](@@@DOWNLOAD_URL@@@/@@@DEBS.FILENAME.BASE@@@-linux-aarch64.deb) + [Release @@@MEDLEY.SHORT.RELEASE.TAG@@@ for ARM64 machines](@@@DOWNLOAD_URL@@@/medley-full-linux-aarch64-@@@COMBINED.RELEASE.TAG@@@.deb) - [Release @@@MEDLEY.SHORT.RELEASE.TAG@@@ for ARMv7 machines](@@@DOWNLOAD_URL@@@/@@@DEBS.FILENAME.BASE@@@-linux-armv7l.deb) + [Release @@@MEDLEY.SHORT.RELEASE.TAG@@@ for ARMv7 machines](@@@DOWNLOAD_URL@@@/medley-full-linux-armv7l-@@@COMBINED.RELEASE.TAG@@@.deb) * #### Windows System for Linux - [Release @@@MEDLEY.SHORT.RELEASE.TAG@@@ for x86\.64 machines](@@@DOWNLOAD_URL@@@/@@@DEBS.FILENAME.BASE@@@-wsl-x86\_64.deb) + [Release @@@MEDLEY.SHORT.RELEASE.TAG@@@ for x86\.64 machines](@@@DOWNLOAD_URL@@@/medley-full-wsl-x86\_64-@@@COMBINED.RELEASE.TAG@@@.deb) - [Release @@@MEDLEY.SHORT.RELEASE.TAG@@@ for ARM64 machines](@@@DOWNLOAD_URL@@@/@@@DEBS.FILENAME.BASE@@@-wsl-aarch64.deb) + [Release @@@MEDLEY.SHORT.RELEASE.TAG@@@ for ARM64 machines](@@@DOWNLOAD_URL@@@/medley-full-wsl-aarch64-@@@COMBINED.RELEASE.TAG@@@.deb) * ### Local Installations (for any Linux distro) * #### Standard Linux - [Release @@@MEDLEY.SHORT.RELEASE.TAG@@@ for x86\_64 machines](@@@DOWNLOAD_URL@@@/@@@DEBS.FILENAME.BASE@@@-linux-x86\_64.tgz) + [Release @@@MEDLEY.SHORT.RELEASE.TAG@@@ for x86\_64 machines](@@@DOWNLOAD_URL@@@/medley-full-linux-x86\_64-@@@COMBINED.RELEASE.TAG@@@.tgz) - [Release @@@MEDLEY.SHORT.RELEASE.TAG@@@ for ARM64 machines](@@@DOWNLOAD_URL@@@/@@@DEBS.FILENAME.BASE@@@-linux-aarch64.tgz) + [Release @@@MEDLEY.SHORT.RELEASE.TAG@@@ for ARM64 machines](@@@DOWNLOAD_URL@@@/medley-full-linux-aarch64-@@@COMBINED.RELEASE.TAG@@@.tgz) - [Release @@@MEDLEY.SHORT.RELEASE.TAG@@@ for ARMv7 machines](@@@DOWNLOAD_URL@@@/@@@DEBS.FILENAME.BASE@@@-linux-armv7l.tgz) + [Release @@@MEDLEY.SHORT.RELEASE.TAG@@@ for ARMv7 machines](@@@DOWNLOAD_URL@@@/medley-full-linux-armv7l-@@@COMBINED.RELEASE.TAG@@@.tgz) * #### Windows System for Linux - [Release @@@MEDLEY.SHORT.RELEASE.TAG@@@ for x86\_64 machines](@@@DOWNLOAD_URL@@@/@@@DEBS.FILENAME.BASE@@@-wsl-x86\_64.tgz) + [Release @@@MEDLEY.SHORT.RELEASE.TAG@@@ for x86\_64 machines](@@@DOWNLOAD_URL@@@/medley-full-wsl-x86\_64-@@@COMBINED.RELEASE.TAG@@@.tgz) - [Release @@@MEDLEY.SHORT.RELEASE.TAG@@@ for ARM64 machines](@@@DOWNLOAD_URL@@@/@@@DEBS.FILENAME.BASE@@@-wsl-aarch64.tgz) + [Release @@@MEDLEY.SHORT.RELEASE.TAG@@@ for ARM64 machines](@@@DOWNLOAD_URL@@@/medley-full-wsl-aarch64-@@@COMBINED.RELEASE.TAG@@@.tgz) - * ## WINDOWS 10/11 (Medley runs in a Docker container) - - [Release @@@MEDLEY.SHORT.RELEASE.TAG@@@ for Windows x64 machines](@@@DOWNLOAD_URL@@@/@@@WINDOWS.INSTALLER.FILENAME@@@) + * ## macOS 11 (Big Sur) and later - for both Intel and Apple Silicon + * ### DMG Installer + + Not available + + * ### ZIP Installer + + [Release @@@MEDLEY.SHORT.RELEASE.TAG@@@](@@@DOWNLOAD_URL@@@/medley-full-macos-universal-@@@COMBINED.RELEASE.TAG@@@.zip) + + * ## WINDOWS 10/11 (Medley running within Cygwin) + + Not available diff --git a/installers/macos/.gitignore b/installers/macos/.gitignore new file mode 100644 index 00000000..14816e60 --- /dev/null +++ b/installers/macos/.gitignore @@ -0,0 +1,7 @@ +tmp +devtmp +pkg/*.pkg +artifacts + + + diff --git a/installers/macos/app/Info.plist b/installers/macos/app/Info.plist new file mode 100644 index 00000000..72d0498d --- /dev/null +++ b/installers/macos/app/Info.plist @@ -0,0 +1,33 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + medley/medley + CFBundleGetInfoString + Medley Interlisp, Copyright 2023 Interlisp.org + CFBundleIconFile + Medley.icns + CFBundleIdentifier + org.interlisp.Medley + CFBundleDocumentTypes + + + CFBundleInfoDictionaryVersion + 3.51 + CFBundlePackageType + APPL + CFBundleShortVersionString + --VERSION_TAG-- + CFBundleSignature + Medley + CFBundleVersion + --VERSION_TAG-- + NSHumanReadableCopyright + Copyright 2023 Interlisp.org + LSMinimumSystemVersion + 11.0 + + diff --git a/installers/macos/app/PkgInfo b/installers/macos/app/PkgInfo new file mode 100644 index 00000000..5c0b3d6d --- /dev/null +++ b/installers/macos/app/PkgInfo @@ -0,0 +1 @@ +APPLMedley diff --git a/installers/macos/build_app.sh b/installers/macos/build_app.sh new file mode 100755 index 00000000..7c66cf96 --- /dev/null +++ b/installers/macos/build_app.sh @@ -0,0 +1,170 @@ +#!/bin/bash +############################################################################### +# +# build_app.sh: build app bundle for installing Medley Interlisp on MacOS +# +# 2023-02-23 Frank Halasz +# +# Copyright 2023 by Interlisp.org +# +############################################################################### + +APPNAME=Medley + +# 2023-07-19 Temorary selector to allow us to create .zip asset before app/dmg work is finished +INCLUDE_APP="no" # "yes" or "no" + +# Make sure we are in the right directory +if [ ! -f ./app/Info.plist ]; +then +echo "Can't find ./app/Info.plist file." +echo "Incorrect cwd?" +echo "Should be in medley/installers/macos" +echo "Exiting" +exit 1 +fi + +# template for artifacts file names should be passed down in the ENV variable: ARTIFACTS_FILENAME_TEMPLATE +if [ -z "${ARTIFACTS_FILENAME_TEMPLATE}" ]; +then + ARTIFACTS_FILENAME_TEMPLATE="medley-full-@@PLATFORM@@-@@ARCH@@-@@MEDLEY.RELEASE@@_@@MAIKO.RELEASE@@" +fi + +# +# Setup directories +# +CWD=$(pwd) +RESULTS_DIR=${CWD}/artifacts +APPBUNDLE=${RESULTS_DIR}/${APPNAME}.app +APPBUNDLECONTENTS=${APPBUNDLE}/Contents +APPBUNDLEEXE=${APPBUNDLECONTENTS}/MacOS +APPBUNDLERESOURCES=${APPBUNDLECONTENTS}/Resources +APPBUNDLEICON=${APPBUNDLECONTENTS}/Resources +tmp_dir=${CWD}/tmp +tarball_dir=${tmp_dir}/tarballs + +# If running as a github action or -t arg, then skip downloading the tarballs +if ! [[ -n "${GITHUB_WORKSPACE}" || "$1" = "-t" ]]; +then + # First, make sure gh is available and we are logged in to github + if [ -z "$(which gh)" ]; + then + echo "Can't find gh" + echo "Exiting." + exit 2 + fi + gh auth status 2>&1 | grep --quiet --no-messages "Logged in to github.com" + if [ $? -ne 0 ]; + then + echo "Not logged into github." + echo "Exiting." + exit 3 + fi + # then clear out the ./tmp directory + rm -rf ${tmp_dir} + mkdir -p ${tmp_dir} + # then download the maiko and medley tarballs + mkdir -p ${tarball_dir} + echo "Fetching maiko and medley release tarballs" + TAG=$(gh release list --repo interlisp/maiko | head -n 1 | awk "{print \$1 }") + gh release download ${TAG} \ + --repo interlisp/maiko \ + --dir ${tarball_dir} \ + --pattern "*darwin*.tgz" + TAG=$(gh release list --repo interlisp/medley | head -n 1 | awk "{print \$1 }") + gh release download ${TAG} \ + --repo interlisp/medley \ + --dir ${tarball_dir} \ + --pattern "*-loadups.tgz" \ + --pattern "*-runtime.tgz" + gh repo clone interlisp/notecards notecards -- --depth 1 + (cd notecards; git archive --format=tgz --output=../notecards.tgz --prefix=notecards/ main) + mv notecards.tgz ${tarball_dir} + rm -rf notecards +fi + +# Figure out release tags from tarball names +pushd ${tarball_dir} >/dev/null 2>/dev/null +medley_release=$(echo medley-*-loadups.tgz | sed "s/medley-\(.*\)-loadups.tgz/\1/") +maiko_release=$(echo maiko-*-darwin.x86_64.tgz | sed "s/maiko-\(.*\)-darwin.x86_64.tgz/\1/") +popd >/dev/null 2>/dev/null + +if [ "${INCLUDE_APP}" = "yes" ]; then + # + # Create bundle dirs + # + rm -rf ${RESULTS_DIR} + mkdir -p ${RESULTS_DIR} + rm -rf ${APPBUNDLE} + mkdir -p ${APPBUNDLE} + mkdir ${APPBUNDLE}/Contents + mkdir ${APPBUNDLE}/Contents/MacOS + mkdir ${APPBUNDLE}/Contents/Resources + # + # Create icons and put in bundle + # + iconset_dir=${tmp_dir}/${APPNAME}.iconset + rm -rf ${iconset_dir} + mkdir -p ${iconset_dir} + image_dir=${CWD}/images + sips -z 16 16 ${image_dir}/App_icon1024.png --out ${iconset_dir}/icon_16x16.png >/dev/null 2>&1 + sips -z 32 32 ${image_dir}/App_icon1024.png --out ${iconset_dir}/icon_16x16@2x.png >/dev/null 2>&1 + sips -z 32 32 ${image_dir}/App_icon1024.png --out ${iconset_dir}/icon_32x32.png >/dev/null 2>&1 + sips -z 64 64 ${image_dir}/App_icon1024.png --out ${iconset_dir}/icon_32x32@2x.png >/dev/null 2>&1 + sips -z 128 128 ${image_dir}/App_icon1024.png --out ${iconset_dir}/icon_128x128.png >/dev/null 2>&1 + sips -z 256 256 ${image_dir}/App_icon1024.png --out ${iconset_dir}/icon_128x128@2x.png >/dev/null 2>&1 + sips -z 256 256 ${image_dir}/App_icon1024.png --out ${iconset_dir}/icon_256x256.png >/dev/null 2>&1 + sips -z 512 512 ${image_dir}/App_icon1024.png --out ${iconset_dir}/icon_256x256@2x.png >/dev/null 2>&1 + sips -z 512 512 ${image_dir}/App_icon1024.png --out ${iconset_dir}/icon_512x512.png >/dev/null 2>&1 + cp ${image_dir}/App_icon1024.png ${iconset_dir}/icon_512x512@2x.png + iconutil -c icns -o ${tmp_dir}/${APPNAME}.icns ${iconset_dir} + cp ${tmp_dir}/${APPNAME}.icns ${APPBUNDLEICON}/ + rm -r ${iconset_dir} + rm ${tmp_dir}/${APPNAME}.icns + # + # Update and copy in "control" files + # + sed -e "s/--VERSION_TAG--/${medley_release}.${maiko_release}.0/g" \ + < app/Info.plist \ + > ${APPBUNDLECONTENTS}/Info.plist + cp app/PkgInfo ${APPBUNDLECONTENTS}/ +fi #INCLUDE_APP + +# +# Untar the maiko and medley releases into the bundle +# +il_dir=${APPBUNDLE}/Contents/MacOS +mkdir -p ${il_dir} +tar -x -z -C ${il_dir} \ + -f "${tarball_dir}/maiko-${maiko_release}-darwin.universal.tgz" +tar -x -z -C ${il_dir} \ + -f "${tarball_dir}/medley-${medley_release}-runtime.tgz" +tar -x -z -C ${il_dir} \ + -f "${tarball_dir}/medley-${medley_release}-loadups.tgz" +tar -x -z -C ${il_dir} \ + -f "${tarball_dir}/notecards.tgz" +# +# Handle run_medley needing separate directories for each arch +# +pushd ${il_dir}/maiko >/dev/null 2>&1 +ln -s darwin.universal darwin.aarch64 +ln -s darwin.universal darwin.x86_64 +popd >/dev/null 2>&1 +# +# Add file icon to medley.command +# +if [ -z "$(which fileicon)" ]; +then + brew install fileicon +fi +fileicon set ${il_dir}/medley/scripts/medley/medley.command ${image_dir}/Command_icon128.png +# +# Also create the zip file of il_dir for distribution +# +pushd ${il_dir} >/dev/null 2>&1 +filename="$(echo ${ARTIFACTS_FILENAME_TEMPLATE} | sed -e "s#@@PLATFORM@@#macos#" -e "s#@@ARCH@@#universal#" -e "s#@@MEDLEY.RELEASE@@#${medley_release}#" -e "s#@@MAIKO.RELEASE@@#${maiko_release}#" )" +zip -r -6 -y -q ${RESULTS_DIR}/${filename}.zip . +popd >/dev/null 2>&1 + +###################################################################################################### +###################################################################################################### diff --git a/installers/macos/build_artifacts.sh b/installers/macos/build_artifacts.sh new file mode 100755 index 00000000..700642e6 --- /dev/null +++ b/installers/macos/build_artifacts.sh @@ -0,0 +1,66 @@ +#!/bin/bash +############################################################################### +# +# build_artifacts.sh: build the artifacts for installing Medley Interlisp on +# MacOS. Basically just calls build_app.sh and build_dmg.sh. +# based on Medley.app built by build_app.sh +# +# 2023-03-03 Frank Halasz +# +# Copyright 2023 by Interlisp.org +# +############################################################################### + +# +# Figure out 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}") + +# +# cd to the dir we are executing from and call +# build_app.sh and the build_dmg.sh +# +cd ${SCRIPTDIR} +t="" +c="" +if [[ "$1" = "-t" || "$2" = "-t" ]]; then t="-t"; fi +if [[ "$1" = "-c" || "$2" = "-c" ]]; then c="-c"; fi +./build_app.sh "${t}" 2>&1 +# 2023-07-20 Not building dmg as yet, just using this to build zip file +# while we finish work around dmg +# ./build_dmg.sh "${c}" + + + +############################################################################### diff --git a/installers/macos/build_dmg.sh b/installers/macos/build_dmg.sh new file mode 100755 index 00000000..531aca0e --- /dev/null +++ b/installers/macos/build_dmg.sh @@ -0,0 +1,185 @@ +#!/bin/bash +############################################################################### +# +# build_dmg.sh: build dmg for installing Medley Interlisp on MacOS +# based on Medley.app built by build_app.sh +# +# 2023-03-03 Frank Halasz +# +# Copyright 2023 by Interlisp.org +# +# Based on code found at: +# http://stackoverflow.com/questions/96882/how-do-i-create-a-nice-looking-dmg-for-mac-os-x-using-command-line-tools +# +############################################################################### + +#set -o verbose #echo onset +o verbose #echo off + +# template for artifacts file names should be passed down in the ENV variable: ARTIFACTS_FILENAME_TEMPLATE +if [ -z "${ARTIFACTS_FILENAME_TEMPLATE}" ]; +then + ARTIFACTS_FILENAME_TEMPLATE="medley-full-@@PLATFORM@@-@@ARCH@@-@@MEDLEY.RELEASE@@_@@MAIKO.RELEASE@@" +fi + +# +# Set Parameters +# +APP_NAME="Medley.app" +VOL_NAME="Medley_Install" +BG_NAME=Install_Message.png +WIN_WIDTH=700 +WIN_HEIGHT=850 + +# +# Set pathnames +# +CWD=$(pwd) +TMP_DIR=${CWD}/tmp +RESULTS_DIR=${CWD}/artifacts +APP_PATH=${RESULTS_DIR}/${APP_NAME} +DMG_PATH=${RESULTS_DIR}/${VOL_NAME} +SRC_DIR=${TMP_DIR}/dmg_src +IMAGES_DIR=${CWD}/images +SCRIPTS_DIR=${CWD}/scripts + +# +# Make sure we are in the right directory +# +if [ ! -e ${APP_PATH} ]; +then + echo "Can't find the app: ${APP_NAME}." + echo "Incorrect cwd? Should be in medley/installers/macos." + echo "Or build_app.sh not yet run?" + echo "Exiting" + exit 1 +fi + +# +# Copy over files from build app etc to dmg proto-directory +# +if [ ! "$1" = "-c" ] +then + # + # Cleanup anything leftover from last run + # + rm -rf ${SRC_DIR} + mkdir -p ${SRC_DIR} + + # + # Assemble source directory for DMG + # + #ditto ${APP_PATH} ${SRC_DIR}/${APP_NAME} + mv ${APP_PATH} ${SRC_DIR}/${APP_NAME} + SetFile -a B ${SRC_DIR}/${APP_NAME} + ditto ${SCRIPTS_DIR}/medley_add2path ${SRC_DIR}/medley_add2path + ditto ${IMAGES_DIR}/${BG_NAME} ${SRC_DIR}/.background/${BG_NAME} +fi + +# +# Create initial dmg image +# +if [ -e "/Volumes/${VOL_NAME}" ]; +then + hdiutil detach /Volumes/${VOL_NAME} +fi +rm -f ${DMG_PATH}.temp.dmg +hdiutil create -srcfolder ${SRC_DIR} -volname ${VOL_NAME} -fs HFS+ \ + -fsargs "-c c=64,a=16,e=16" -format UDRW ${DMG_PATH}.temp.dmg +device=$(\ + hdiutil attach -readwrite -noverify -noautoopen "${DMG_PATH}".temp.dmg \ + | egrep '^/dev/' | sed 1q | awk '{print $1}' \ + ) + +# +# cd to the new dmg +# +pushd /Volumes/${VOL_NAME} >/dev/null 2>&1 + +# +# Add symbolic link for medley script and icon for addpath +# +ln -s Medley.app/Contents/MacOS/medley/scripts/medley/medley.command medley +if [ -z "$(which fileicon)" ]; +then + brew install fileicon +fi +fileicon set medley_add2path ${IMAGES_DIR}/A2P_icon128.png + +# +# Dress up the appearance using Applescript +# +ROW1=375 +ROW2=650 +COL1=139 +COL2=350 +COL3=561 +osascript </dev/null 2>&1 + +# +# Detach the tmp dmg and convert it to final (compressed, ro) dmg +# +hdiutil detach ${device} +sync +rm -f ${DMG_PATH}.dmg +hdiutil convert "${DMG_PATH}".temp.dmg -format UDZO -imagekey zlib-level=6 -o ${DMG_PATH}.dmg +rm -rf "${DMG_PATH}".temp.dmg + +# +# Extract version info from app Info.plist & rename dmg using version +# +sed_script='{/CFBundleVersion/!d;N;s/^.*\(.*\)<\/string>/\1/;s/.0$//;s/\./_/;p;}' +version=$(sed -ne "${sed_script}" ${SRC_DIR}/${APP_NAME}/Contents/Info.plist) +DMG_NAME="$(echo ${ARTIFACTS_FILENAME_TEMPLATE} | sed -e 's#@@PLATFORM@@#macos#' -e 's#@@ARCH@@#$universal#' -e 's#@@MEDLEY.RELEASE@@_@@MAIKO.RELEASE@@#${version}#' )" +mv ${DMG_PATH}.dmg ${RESULTS_DIR}/${DMG_NAME}.dmg + +# +# Done +# +echo "DMG build completed." + +############################################################################### +############################################################################### + diff --git a/installers/macos/images/A2P_icon.svg b/installers/macos/images/A2P_icon.svg new file mode 100644 index 00000000..002a759a --- /dev/null +++ b/installers/macos/images/A2P_icon.svg @@ -0,0 +1,209 @@ + + + + Medley + + + + + + + + + + + + add2path + + + + + + + + + + + + + + diff --git a/installers/macos/images/A2P_icon128.png b/installers/macos/images/A2P_icon128.png new file mode 100644 index 00000000..a82b12ae Binary files /dev/null and b/installers/macos/images/A2P_icon128.png differ diff --git a/installers/macos/images/A2P_icon256.png b/installers/macos/images/A2P_icon256.png new file mode 100644 index 00000000..0ff942f9 Binary files /dev/null and b/installers/macos/images/A2P_icon256.png differ diff --git a/installers/macos/images/App_icon.svg b/installers/macos/images/App_icon.svg new file mode 100644 index 00000000..04f667c7 --- /dev/null +++ b/installers/macos/images/App_icon.svg @@ -0,0 +1,209 @@ + + + + Medley + + + + + + + + + + + + app + + + + + + + + + + + + + + diff --git a/installers/macos/images/App_icon1024.png b/installers/macos/images/App_icon1024.png new file mode 100644 index 00000000..fd3e4dd5 Binary files /dev/null and b/installers/macos/images/App_icon1024.png differ diff --git a/installers/macos/images/App_icon512.png b/installers/macos/images/App_icon512.png new file mode 100644 index 00000000..e8beafa1 Binary files /dev/null and b/installers/macos/images/App_icon512.png differ diff --git a/installers/macos/images/Command_icon.svg b/installers/macos/images/Command_icon.svg new file mode 100644 index 00000000..47359e6c --- /dev/null +++ b/installers/macos/images/Command_icon.svg @@ -0,0 +1,209 @@ + + + + Medley + + + + + + + + + + + + command + + + + + + + + + + + + + + diff --git a/installers/macos/images/Command_icon128.png b/installers/macos/images/Command_icon128.png new file mode 100644 index 00000000..e04486ca Binary files /dev/null and b/installers/macos/images/Command_icon128.png differ diff --git a/installers/macos/images/Command_icon256.png b/installers/macos/images/Command_icon256.png new file mode 100644 index 00000000..727ef694 Binary files /dev/null and b/installers/macos/images/Command_icon256.png differ diff --git a/installers/macos/images/Install_Message.png b/installers/macos/images/Install_Message.png new file mode 100644 index 00000000..c770ca96 Binary files /dev/null and b/installers/macos/images/Install_Message.png differ diff --git a/installers/macos/images/Install_Message.svg b/installers/macos/images/Install_Message.svg new file mode 100644 index 00000000..8c228660 --- /dev/null +++ b/installers/macos/images/Install_Message.svg @@ -0,0 +1,1556 @@ + + + + + + +Install Install Medley Interlisp1. Drag (copy) the three items below into Applications or any folder of your choosing.3. If you want to excute medley without specifying a path,run medley_add2path from a Terminal - one-time.medley command from a Terminal.2. Double-click on the Medley.app to run OR run the + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +andandoror diff --git a/installers/macos/images/Install_icon.svg b/installers/macos/images/Install_icon.svg new file mode 100644 index 00000000..a6f48158 --- /dev/null +++ b/installers/macos/images/Install_icon.svg @@ -0,0 +1,209 @@ + + + + Medley + + + + + + + + + + + + install + + + + + + + + + + + + + + diff --git a/installers/macos/images/Install_icon128.png b/installers/macos/images/Install_icon128.png new file mode 100644 index 00000000..059d1562 Binary files /dev/null and b/installers/macos/images/Install_icon128.png differ diff --git a/installers/macos/images/Install_icon256.png b/installers/macos/images/Install_icon256.png new file mode 100644 index 00000000..059d1562 Binary files /dev/null and b/installers/macos/images/Install_icon256.png differ diff --git a/installers/macos/images/MedleyIcon.png b/installers/macos/images/MedleyIcon.png new file mode 100644 index 00000000..44611728 Binary files /dev/null and b/installers/macos/images/MedleyIcon.png differ diff --git a/installers/macos/images/MedleyIcon.svg b/installers/macos/images/MedleyIcon.svg new file mode 100644 index 00000000..01fabd13 --- /dev/null +++ b/installers/macos/images/MedleyIcon.svg @@ -0,0 +1,199 @@ + + + + Medley + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/installers/macos/images/MedleyIcon128.png b/installers/macos/images/MedleyIcon128.png new file mode 100644 index 00000000..b69cf172 Binary files /dev/null and b/installers/macos/images/MedleyIcon128.png differ diff --git a/installers/macos/images/MedleyIcon256.png b/installers/macos/images/MedleyIcon256.png new file mode 100644 index 00000000..fbf07bbd Binary files /dev/null and b/installers/macos/images/MedleyIcon256.png differ diff --git a/installers/macos/pkg/Distribution.xml b/installers/macos/pkg/Distribution.xml new file mode 100644 index 00000000..17d9a284 --- /dev/null +++ b/installers/macos/pkg/Distribution.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + Medley-base.pkg + + diff --git a/installers/macos/scripts/medley_add2path b/installers/macos/scripts/medley_add2path new file mode 100755 index 00000000..3005330f --- /dev/null +++ b/installers/macos/scripts/medley_add2path @@ -0,0 +1,43 @@ +#!/bin/bash + +# 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}") + +touch ~/.profile +cat >> ~/.profile < '/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 if not under WSL +# or under Darwin? +# +docker=false +wsl=false +darwin=false + +if [ "$(uname)" = "Darwin" ]; +then + darwin=true +elif [ -n "${MEDLEY_DOCKER_BUILD_DATE}" ]; +then + docker='true' +else + 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 + else + wsl='false' + 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 \" 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 + + + diff --git a/scripts/medley/medley.sh b/scripts/medley/medley.sh deleted file mode 100755 index e8f54761..00000000 --- a/scripts/medley/medley.sh +++ /dev/null @@ -1,142 +0,0 @@ -#!/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 if not under WSL? -if [ -n "${MEDLEY_DOCKER_BUILD_DATE}" ]; -then - docker='true' - wsl='false' -else - docker='false' - 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 - else - wsl='false' - 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 \" 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 [[ ( ${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 - - diff --git a/scripts/medley/medley.sh b/scripts/medley/medley.sh new file mode 120000 index 00000000..a64e11ba --- /dev/null +++ b/scripts/medley/medley.sh @@ -0,0 +1 @@ +medley.command \ No newline at end of file diff --git a/scripts/medley/medley_args.sh b/scripts/medley/medley_args.sh index 11a7d868..6687ad7a 100755 --- a/scripts/medley/medley_args.sh +++ b/scripts/medley/medley_args.sh @@ -140,7 +140,12 @@ do shift ;; -z | --man) - /usr/bin/man -l "${MEDLEYDIR}/docs/man-page/medley.1.gz" + if [ ${darwin} = true ]; + then + /usr/bin/man "${MEDLEYDIR}/docs/man-page/medley.1.gz" + else + /usr/bin/man -l "${MEDLEYDIR}/docs/man-page/medley.1.gz" + fi exit 0 ;; --windows) @@ -155,16 +160,20 @@ do usage "${err_msg[@]}" ;; *) - if [[ $# -eq 1 || "$2" = "--" ]]; + # if matched the empty string, just ignore + if [ -n "$1" ]; then - sysout_flag=true - sysout_arg="$1" - else - err_msg=( - "ERROR: sysout argument must be last argument" - "or last argument before the \"--\" flag" - ) - usage "${err_msg[@]}" + if [[ $# -eq 1 || "$2" = "--" ]]; + then + sysout_flag=true + sysout_arg="$1" + else + err_msg=( + "ERROR: sysout argument must be last argument" + "or last argument before the \"--\" flag" + ) + usage "${err_msg[@]}" + fi fi ;; esac