Create an Auto build script for Aseprite on Mac OS

Aseprite is a famous 2D pixel art tool that allow you to create 2D animations, sprites, and any kind of graphics for games. It is not free, you can get a copy from Steam for USD $14.99. http://store.steampowered.com/app/431730/Aseprite/. However, it is open sourced on github, you can create a build by yourself at anytime. This article will show you how to compile and build a copy by yourself and save $14.99.

OS: MacOS 10.12.6. On Aseprite’s system recommendation, it says macOS 10.12.6 Sierra + Xcode 9.0 + macOS 10.13 SDK + Skia.
Require Xcode 9 and Xcode command line tool installed

Auto build script on github

Step1: Download source code to your mac

[code lang=bash]
git clone –recursive https://github.com/aseprite/aseprite.git
[/code]

Step2: Install dependency: Ninja

Build tool Ninja is required, you can have a look at its details at https://ninja-build.org/. On Mac, I would recommend to use the following command line to install it. Open your Terminal:

[code lang=bash]
brew install ninja
[/code]

Step3 : Install dependency: Cmake

makefile manage tool that used to create makefile

[code lang=bash]
brew install cmake
[/code]

Step 4: Install Skia

Skia is a complete 2D graphic library for drawing Text, Geometries, and Images. https://skia.org

[code lang=bash]
cd $HOME
mkdir $HOME/deps
cd $HOME/deps
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
git clone https://github.com/aseprite/skia.git
export PATH="${PWD}/depot_tools:${PATH}"
cd skia
git checkout aseprite-m62
python tools/git-sync-deps
gn gen out/Release –args="is_official_build=true skia_use_system_expat=false skia_use_system_icu=false skia_use_system_libjpeg_turbo=false skia_use_system_libpng=false skia_use_system_libwebp=false skia_use_system_zlib=false"
ninja -C out/Release
[/code]

Final Step: Compile and build

[code lang=bash]
cd aseprite
mkdir build
cd build
cmake \
-DCMAKE_OSX_ARCHITECTURES=x86_64 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.7 \
-DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk \
-DUSE_ALLEG4_BACKEND=OFF \
-DUSE_SKIA_BACKEND=ON \
-DSKIA_DIR=$HOME/deps/skia \
-DWITH_HarfBuzz=OFF \
-G Ninja \
..

ninja aseprite
[/code]

Be careful about the path for OSX_SYS, everyone’s Mac OSX SYS path could be slightly different. So in order to get that:

[code lang=bash]
xcrun –sdk macosx –show-sdk-path
[/code]

If no errors happen, now you could run aseprite by ./aseprite.

Reference

http://www.needone.app/?p=1064

About: arkilis


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.