Skip to content

Instantly share code, notes, and snippets.

@bobziuchkovski
Last active October 20, 2018 03:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bobziuchkovski/a150f065dca2bbfb7ade56b3e11d8e50 to your computer and use it in GitHub Desktop.
Save bobziuchkovski/a150f065dca2bbfb7ade56b3e11d8e50 to your computer and use it in GitHub Desktop.
Convert portable Mac OS wine tarballs to wineskin engines
#!/bin/bash
command -v 7z >/dev/null 2>&1 || ( echo "Error: '7z' binary is missing." >&2; exit 1 )
set -ex
VERSION=3.18
PACKAGE="https://dl.winehq.org/wine-builds/macosx/pool/portable-winehq-staging-${VERSION}-osx.tar.gz"
ENGINE_DIR="${HOME}/Library/Application Support/Wineskin/Engines"
ENGINE_FILE="${ENGINE_DIR}/WS9Wine${VERSION}.tar.7z"
if [ -e "${ENGINE_FILE}" ]; then
echo "Error: File '$ENGINE_FILE' already exists. Aborting" >&2
exit 1
fi
TMPDIR=$(mktemp -d)
(
cd ${TMPDIR}
curl -SL "${PACKAGE}" | tar -zxf -
mv usr wswine.bundle
echo "wine${VERSION}" > wswine.bundle/VERSION
mkdir -p "${ENGINE_DIR}"
tar cf - wswine.bundle | 7z a -si "${ENGINE_FILE}"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment