Skip to content

Instantly share code, notes, and snippets.

@allangarcia
Last active May 30, 2025 07:01
Show Gist options
  • Save allangarcia/938b052a7d55d1652052e4259364260b to your computer and use it in GitHub Desktop.
Save allangarcia/938b052a7d55d1652052e4259364260b to your computer and use it in GitHub Desktop.
#!/bin/bash
# README: A more updated version is on the comments by (ashmna)[https://gist.github.com/ashmna]
# See at: https://gist.github.com/allangarcia/938b052a7d55d1652052e4259364260b?permalink_comment_id=4265898#gistcomment-4265898
# this is for tools required
brew update
brew install ninja
brew install cmake
# crete the default root directory
cd $HOME/Developer
mkdir Aseprite
cd Aseprite
# download skia m81
curl -O -L "https://github.com/aseprite/skia/releases/download/m81-b607b32047/Skia-macOS-Release-x64.zip"
unzip Skia-macOS-Release-x64.zip -d skia-m81
# this is the project itselft
git clone --recursive https://github.com/aseprite/aseprite.git
# compiling aseprite
cd aseprite
mkdir build
cd build
cmake \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_OSX_ARCHITECTURES=x86_64 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 \
-DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk \
-DLAF_BACKEND=skia \
-DSKIA_DIR=../../skia-m81 \
-DSKIA_LIBRARY_DIR=../../skia-m81/out/Release-x64 \
-G Ninja \
..
ninja aseprite
cd ../..
# bundle app from trial
mkdir bundle
cd bundle
curl -O -J "https://www.aseprite.org/downloads/trial/Aseprite-v1.2.27-trial-macOS.dmg"
mkdir mount
yes qy | hdiutil attach -quiet -nobrowse -noverify -noautoopen -mountpoint mount Aseprite-v1.2.27-trial-macOS.dmg
cp -rf mount/Aseprite.app .
hdiutil detach mount
rm -rf Aseprite.app/Contents/MacOS/aseprite
cp -rf ../aseprite/build/bin/aseprite Aseprite.app/Contents/MacOS/aseprite
rm -rf Aseprite.app/Contents/Resources/data
cp -rf ../aseprite/build/bin/data Aseprite.app/Contents/Resources/data
cd ..
# Install on /Applications
sudo cp bundle/Aseprite.app /Applications/
@matenboi
Copy link

matenboi commented Feb 24, 2024

This was also my first time making a macOS bundle, and I tried following both directions above but neither of them worked for me. This is what ended up working for me:

mkdir bundle
cd bundle
curl -O -J https://www.aseprite.org/downloads/trial/Aseprite-v1.3.4-trial-macOS.dmg
mkdir mount
yes qy | hdiutil attach -quiet -nobrowse -noverify -noautoopen -mountpoint mount Aseprite-v1.3.4-trial-macOS.dmg
cp -r mount/Aseprite.app .
rm -rf Aseprite.app/Contents/MacOS/aseprite
cp -R ~/Developer/aseprite/build/bin/aseprite Aseprite.app/Contents/MacOS/
rm -rf Aseprite.app/Contents/Resources/data
cp -R ~/Developer/aseprite/build/bin/data Aseprite.app/Contents/Resources/
sudo cp -R Aseprite.app /Applications/

It's basically the same as the main post, but I changed 1 or 2 things that ended up throwing errors at me. I am using a M2 MacBook Pro (on version 14.0 Sonoma).

@kobi666
Copy link

kobi666 commented Feb 29, 2024

for silicon users with new version:

mkdir bundle
cd bundle
curl -O -J "https://www.aseprite.org/downloads/trial/Aseprite-v1.3.4-trial-macOS.dmg"
mkdir mount
yes qy | hdiutil attach -quiet -nobrowse -noverify -noautoopen -mountpoint mount Aseprite-v1.3.4-trial-macOS.dmg
cp -rf mount/Aseprite.app .
hdiutil detach mount
rm -rf Aseprite.app/Contents/MacOS/aseprite
cp -rf ../aseprite/build/bin/aseprite Aseprite.app/Contents/MacOS/aseprite
rm -rf Aseprite.app/Contents/Resources/data
cp -rf ../aseprite/build/bin/data Aseprite.app/Contents/Resources/data
cd ..

@allangarcia
Copy link
Author

for silicon users with new version:

mkdir bundle cd bundle curl -O -J "https://www.aseprite.org/downloads/trial/Aseprite-v1.3.4-trial-macOS.dmg" mkdir mount yes qy | hdiutil attach -quiet -nobrowse -noverify -noautoopen -mountpoint mount Aseprite-v1.3.4-trial-macOS.dmg cp -rf mount/Aseprite.app . hdiutil detach mount rm -rf Aseprite.app/Contents/MacOS/aseprite cp -rf ../aseprite/build/bin/aseprite Aseprite.app/Contents/MacOS/aseprite rm -rf Aseprite.app/Contents/Resources/data cp -rf ../aseprite/build/bin/data Aseprite.app/Contents/Resources/data cd ..

Thank you for the update. I'll incorporate this into a new gist and share here, because we don't know everyone already adopted ARM and don't know if the ARM version will work on Intel's based compiling.

@furashcka
Copy link

furashcka commented Apr 11, 2024

This .sh script has a problem: it doesn't catch errors, such as a 404 error for Aseprite-v1.3.4-trial-macOS.dmg among others. This might not seem like a big issue, but for beginners (like myself), it can be very time-consuming to understand WHY IT'S NOT WORKING!

I couldn't build Aseprite without encountering errors until I divided the code into steps. Working with the code in separated steps is easier than debugging a .sh script.

I discovered some alternative solutions and wrote a simple tutorial for my reference, which might be helpful for others - https://f-cka.notion.site/Build-Run-Aseprite-on-Apple-Silicon-f88527ab38c44bc3997ef1e7e5447851, and I achieved the desired result.

Untitled

@andreypeshko
Copy link

andreypeshko commented Jun 2, 2024

This .sh script has a problem: it doesn't catch errors, such as a 404 error for Aseprite-v1.3.4-trial-macOS.dmg among others. This might not seem like a big issue, but for beginners (like myself), it can be very time-consuming to understand WHY IT'S NOT WORKING!

I couldn't build Aseprite without encountering errors until I divided the code into steps. Working with the code in separated steps is easier than debugging a .sh script.

I discovered some alternative solutions and wrote a simple tutorial for my reference, which might be helpful for others - https://f-cka.notion.site/Build-Run-Aseprite-on-Apple-Silicon-f88527ab38c44bc3997ef1e7e5447851, and I achieved the desired result.

Untitled

Thanks @furashcka, I think you have a little mistake in your bash script

cp -rf mount/Aseprite.app .
hdiutil detach mount

rm -rf Aseprite.app/Contents/MacOS/aseprite
cp -rf ../aseprite/build/bin/aseprite Aseprite.app/Contents/MacOS/aseprite
rm -rf Aseprite.app/Contents/Resources/data
cp -rf ../aseprite/build/bin/data Aseprite.app/Contents/Resources/data
cd ..

should be

cp -rf mount/Aseprite.app .
hdiutil detach mount

rm -rf Aseprite.app/Contents/MacOS/aseprite
cp -rf ../build/bin/aseprite Aseprite.app/Contents/MacOS/aseprite
rm -rf Aseprite.app/Contents/Resources/data
cp -rf ../build/bin/data Aseprite.app/Contents/Resources/data
cd ..

@allangarcia
Copy link
Author

Thank you so much for all contributions. I’ll be soon updating the script.

@allangarcia
Copy link
Author

Anyone have experience into making this a project to compile into a docker container? I would love this contribution.

@willisplummer
Copy link

I had to run xattr -cr Aseprite.app at the end otherwise I was getting an error "the application is damaged and should be moved to the trash" https://community.aseprite.org/t/macos-ventura-13-0/16105

@p10tr3k
Copy link

p10tr3k commented Nov 25, 2024

On macOS you may need to set this before running the script:
git config --global core.autocrlf input
It helped me with this error:
FAILED: third_party/libpng/pnglibconf.c ...

@hidde-vb
Copy link

hidde-vb commented Feb 3, 2025

I had to update the trial version to v1.3.9.1, the version listed in the Gist is removed from the downloads list.

Had no other issues, thanks!

@jwc20
Copy link

jwc20 commented May 30, 2025

update for mac m1 with Aseprite v1.3.9.1 and skia m124

#!/bin/bash

# this is for tools required 
brew update
brew install ninja
brew install cmake

# create the default root directory
cd $HOME/Developer
mkdir -p Aseprite
cd Aseprite

# download skia m124
curl -O -L "https://github.com/aseprite/skia/releases/download/m124-08a5439a6b/Skia-macOS-Release-arm64.zip"
unzip Skia-macOS-Release-arm64.zip -d skia-m124

# this is the project itself
git clone --recursive https://github.com/aseprite/aseprite.git

# compiling aseprite
cd aseprite
rm -rf build  # Clean any existing build
mkdir build
cd build

# Get absolute path to skia
SKIA_DIR="$(cd ../../skia-m124 && pwd)"

cmake \
  -DCMAKE_BUILD_TYPE=RelWithDebInfo \
  -DCMAKE_OSX_ARCHITECTURES=arm64 \
  -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
  -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk \
  -DLAF_BACKEND=skia \
  -DSKIA_DIR="${SKIA_DIR}" \
  -DSKIA_LIBRARY_DIR="${SKIA_DIR}/out/Release-arm64" \
  -DSKIA_LIBRARY="${SKIA_DIR}/out/Release-arm64/libskia.a" \
  -DCMAKE_POLICY_DEFAULT_CMP0076=OLD \
  -G Ninja \
  ..

ninja aseprite
cd ../..

# bundle app from trial
mkdir -p bundle
cd bundle

# download trial version
curl -O -J "https://www.aseprite.org/downloads/trial/Aseprite-v1.3.9.1-trial-macOS.dmg"

mkdir -p mount

# mount the dmg
hdiutil attach -quiet -nobrowse -noverify -noautoopen -mountpoint mount Aseprite-v1.3.9.1-trial-macOS.dmg

cp -rf mount/Aseprite.app .
hdiutil detach mount

# replace the trial binary with our compiled version
rm -rf Aseprite.app/Contents/MacOS/aseprite
cp -rf ../aseprite/build/bin/aseprite Aseprite.app/Contents/MacOS/aseprite
rm -rf Aseprite.app/Contents/Resources/data
cp -rf ../aseprite/build/bin/data Aseprite.app/Contents/Resources/data
cd ..

# Install on /Applications
sudo cp -rf bundle/Aseprite.app /Applications/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment