Building Aseprite from Source on MacOS Catalina 10.15
Aseprite lets you create 2D animations for videogames. From sprites, to pixel-art, retro style graphics, and whatever you like about the 8-bit and 16-bit era.
Aseprite started as an open source software around 2001, and continued with the General Public License (GPLv2) until August 2016. Post which the General Public License (GPLv2) was replaced with the new Aseprite EULA.
As per the new license one can still download its source code, compile it, and use the program to create your assets for commercial games. But, the only restriction is that you cannot redistribute compiled versions of Aseprite. To help support the project, users now have to pay a minimum of $19.99 USD to obtain convenient .exe
or .dmg
installer files.
There is a GPL fork of Aseprite, free to compile and redistribute
but MacOS builds are currently not available
In this post I will describe the various steps I followed to build Aseprite from source on MacOS Catalina 10.15, along with the issues I encountered (and how I resolved them).
I used haxpor/aseprite-macos-buildsh utility to create latest release app of Aseprite for macOS.
Install
- XCode via App Store
- Homebrew via https://brew.sh
- CMake & ninja
$ brew install ninja$ brew install cmake
Now all we need to do is clone the repo, enter it and modify the following line in aseprite.sh
POSTFIXPATH_SDKROOT=Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk
to
POSTFIXPATH_SDKROOT=Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
which can be verified by viewing the contents of Xcode at the given path:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
Now execute the script:
$ git clone https://github.com/haxpor/aseprite-macos-buildsh.git
$ cd aseprite-macos-buildsh
$ bash aseprite.sh
Issue #1
Received the following error message on first run:
CMake Error at third_party/curl/CMake/OtherTests.cmake:89 (message):
Unable to link function recv
Call Stack (most recent call first):
third_party/curl/CMakeLists.txt:792 (include)-- Configuring incomplete, errors occurred!
Someone reported similar issue in the official forum
and the suggested solution was to build curl beforehand and use it
So I did a fresh installation of curl using brew:
brew install curl
Once the installation was over, the following message was displayed:
If you need to have curl first in your PATH, run:
echo 'export PATH="/usr/local/opt/curl/bin:$PATH"' >> ~/.zshrcFor compilers to find curl you may need to set:
export LDFLAGS="-L/usr/local/opt/curl/lib"
export CPPFLAGS="-I/usr/local/opt/curl/include"
Run the command to add curl
to the PATH and modify the aseprite.sh
script to include the USE_SHARED_CURL
and CURL_INCLUDE_DIR
cmake flags. Use the above CPPFLAGS directory as the CURL_INCLUDE_DIR
Issue #2
After making the above modifications and running the script, I received the following error message:
CMake Error at third_party/libarchive/CMakeLists.txt:1641 (MESSAGE):
pid_t doesn't exist on this platform?-- Configuring incomplete, errors occurred!
Similar issue was raised in a forum and the solution was strangely as suggested, I cleared out the contents of /aseprite/build/
folder and executed the build again.
Issue #3
The compilation was successful in the third attempt, but the build failed with the following error message:
[1416/1416] Linking CXX executable bin/aseprite
FAILED: bin/aseprite
...
ld: library not found for -lSKSHAPER_LIBRARY-NOTFOUND
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
Something went wrong
Again, the issue was encountered by multiple users as reported in the following thread: Link
I followed the solution option #2 wherein I downloaded pre-built skia library, extracted it and copied the libskshaper.a
file.
Upon executing the build, finally it worked like a charm
Copying template .app to target location
All done
It was an emotional moment to witness the Asperite application icon in launchpad.
Success!