Skip to content

Instantly share code, notes, and snippets.

@allangarcia
Last active April 22, 2024 17:33
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/
@allangarcia
Copy link
Author

I was thinking more about a QT Python application, that run the command under the hoods... My twitter was never responded (By Aseprite). Now I'm a little busy trying to get a job, doing interviews and tests. But when I have the time I'll put together a "make your own aseprite bundler" patent pending LOL. Name to be defined. If they complain about it, I mention the twitter and they never say no.

@allangarcia
Copy link
Author

Also, in the meantime, I'll not update my gist. Two reasons... to give your credit to your comment. And because I didn't test agains M1 Macs. Also the time issue.

@rkmax
Copy link

rkmax commented Nov 26, 2022

I just write a version that does work on my mac M1, idk if also works for macos with x86 processor but in theory should work because is arch aware https://gist.github.com/rkmax/ca5892c1d44bf3fdbe081784d67d5d5a

@csmitherman0
Copy link

I tried using the updated version on my M1 MacBook. I ran the terminal using Rosetta and ran the script, and it seems to have failed at the very end. The cp commands at the end are failing, throwing a "no such file or directory" error.

@kjblanchard
Copy link

kjblanchard commented Jan 30, 2024

Thanks for the bundle steps! First time making a macos bundle. However the curl command in the script didn't work (it created an empty file instead of downoading the dmg), and the cp command at the end didn't have a -R so it didn't work right.

curl https://www.aseprite.org/downloads/trial/Aseprite-v1.3.2-trial-macOS.dmg --output ase.dmg
yes qy | hdiutil attach -quiet -nobrowse -noverify -noautoopen -mountpoint mount ase.dmg
.. (All other commands worked fine until the cp) ..
cp -R Aseprite.app /Applications

I am using a m1 macbook pro as well.

@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

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