-
-
Notifications
You must be signed in to change notification settings - Fork 645
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use /usr/local/bin/ape on Apple Silicon
- Loading branch information
Showing
6 changed files
with
24 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
PROG=${0##*/} | ||
MODE=${MODE:-$m} | ||
TMPDIR=${TMPDIR:-/tmp} | ||
COSMO=${COSMO:-/opt/cosmo} | ||
COSMOS=${COSMOS:-/opt/cosmos} | ||
|
||
|
@@ -18,6 +19,19 @@ fi | |
echo "Actually Portable Executable (APE) Installer" >&2 | ||
echo "Author: Justine Tunney <[email protected]>" >&2 | ||
|
||
# special installation process for apple silicon | ||
if [ "$(uname -s)" = "Darwin" ] && [ "$(uname -m)" = "arm64" ]; then | ||
echo "cc -O -o $TMPDIR/ape.$$ ape/ape-m1.c" >&2 | ||
cc -O -o "$TMPDIR/ape.$$" ape/ape-m1.c || exit | ||
if [ ! -d /usr/local/bin ]; then | ||
echo "$SUDO mkdir -p /usr/local/bin" >&2 | ||
$SUDO mkdir -p /usr/local/bin || exit | ||
fi | ||
echo "$SUDO mv -f $TMPDIR/ape.$$ /usr/local/bin/ape" >&2 | ||
$SUDO mv -f "$TMPDIR/ape.$$" /usr/local/bin/ape || exit | ||
exit | ||
fi | ||
|
||
################################################################################ | ||
# INSTALL APE LOADER SYSTEMWIDE | ||
|
||
|
@@ -50,8 +64,8 @@ fi | |
if [ "$(uname -s)" = "Darwin" ]; then | ||
if ! [ /usr/bin/ape -nt o//ape/ape.macho ]; then | ||
echo >&2 | ||
echo "installing o//ape/ape.elf to /usr/bin/ape" >&2 | ||
echo "$SUDO mv -f o//ape/ape.elf /usr/bin/ape" >&2 | ||
echo "installing o//ape/ape.macho to /usr/bin/ape" >&2 | ||
echo "$SUDO cp -f o//ape/ape.macho /usr/bin/ape" >&2 | ||
$SUDO cp -f o//ape/ape.macho /usr/bin/ape || exit | ||
echo "done" >&2 | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters