2016-04-11 20:50:11 +00:00
# Table of contents
* [Platforms ](#platforms )
* [Get the source code ](#get-the-source-code )
* [Dependencies ](#dependencies )
2016-04-27 03:11:45 +00:00
* [Windows dependencies ](#windows-dependencies )
2016-10-26 17:58:43 +00:00
* [macOS dependencies ](#macos-dependencies )
2016-04-11 20:50:11 +00:00
* [Linux dependencies ](#linux-dependencies )
* [Compiling ](#compiling )
2016-04-27 03:11:45 +00:00
* [Windows details ](#windows-details )
2016-10-26 17:58:43 +00:00
* [macOS details ](#macos-details )
2016-04-27 03:11:45 +00:00
* [Issues with Retina displays ](#issues-with-retina-displays )
* [Linux details ](#linux-details )
2016-04-11 20:50:11 +00:00
* [Using shared third party libraries ](#using-shared-third-party-libraries )
2016-04-26 18:01:10 +00:00
* [Building Skia dependency ](#building-skia-dependency )
2016-04-27 03:11:45 +00:00
* [Skia on Windows ](#skia-on-windows )
2016-10-26 17:58:43 +00:00
* [Skia on macOS ](#skia-on-macos )
2018-08-08 21:31:48 +00:00
* [Skia on Linux ](#skia-on-linux )
2016-04-11 20:50:11 +00:00
2015-01-06 12:34:40 +00:00
# Platforms
2012-07-08 04:41:14 +00:00
2013-11-23 19:01:34 +00:00
You should be able to compile Aseprite successfully on the following
2012-07-08 04:41:14 +00:00
platforms:
2017-09-19 16:41:28 +00:00
* Windows 10 + VS2015 or VS2017 Community Edition + Windows 10 SDK
2017-09-22 18:41:14 +00:00
* macOS 10.12.6 Sierra + Xcode 9.0 + macOS 10.13 SDK + Skia
2016-04-11 20:50:11 +00:00
* Linux + gcc 4.8 with some C++11 support
2012-07-08 04:41:14 +00:00
2015-01-06 12:34:40 +00:00
# Get the source code
2016-04-13 15:00:12 +00:00
You can get the source code downloading a `Aseprite-v1.x-Source.zip`
2018-08-23 20:35:05 +00:00
file from the latest Aseprite release (*in that case please follow the
compilation instructions inside the `.zip` file*):
2015-01-06 12:34:40 +00:00
2016-04-13 15:00:12 +00:00
https://github.com/aseprite/aseprite/releases
2015-01-06 12:34:40 +00:00
2016-04-13 15:00:12 +00:00
Or you can clone the repository and all its submodules using the
following command:
2015-01-06 12:34:40 +00:00
git clone --recursive https://github.com/aseprite/aseprite.git
2016-04-13 15:00:12 +00:00
To update an existing clone you can use the following commands:
2015-11-20 02:12:07 +00:00
cd aseprite
git pull
git submodule update --init --recursive
2016-04-27 03:54:47 +00:00
You can use [Git for Windows ](https://git-for-windows.github.io/ ) to
2016-04-27 03:11:45 +00:00
clone the repository on Windows.
2015-01-06 12:34:40 +00:00
2016-04-11 20:50:11 +00:00
# Dependencies
2012-07-08 04:41:14 +00:00
2016-04-27 03:11:45 +00:00
To compile Aseprite you will need:
* The latest version of [CMake ](http://www.cmake.org/ ) (3.4 or greater)
* [Ninja ](https://ninja-build.org ) build system
2018-08-08 21:31:48 +00:00
* You will need a compiled version of the Skia library.
Please check the details about [how to build Skia ](#building-skia-dependency )
on your platform.
2016-04-27 03:11:45 +00:00
## Windows dependencies
2017-07-24 18:05:16 +00:00
First of all, you will need:
* Windows 10 (we don't support cross-compiling and don't know if this would be possible)
2017-09-19 16:41:28 +00:00
* [Visual Studio Community Edition ](https://www.visualstudio.com/downloads/ ) (VS2015 or VS2017)
* Windows 10 SDK (it's included with the Visual Studio installer, remember to install it)
2017-07-24 18:05:16 +00:00
Then, you will need an extra little utility: `awk` , used to compile
the libpng library. You can get this utility from MSYS2 distributions
like [MozillaBuild ](https://wiki.mozilla.org/MozillaBuild ).
2016-04-27 03:11:45 +00:00
2018-08-08 21:31:48 +00:00
You will need to [compile Skia ](#skia-on-windows ) before and then
continue in the [Compiling ](#compiling ) section. Remember to check the
[Windows details ](#windows-details ) section to know how to call
`cmake` correctly.
2017-07-24 18:05:16 +00:00
2016-10-26 17:58:43 +00:00
## macOS dependencies
2016-04-27 03:11:45 +00:00
2016-10-26 17:58:43 +00:00
On macOS you will need macOS 10.12 SDK and Xcode 8.0 (older versions
might work).
2016-04-27 03:11:45 +00:00
2018-08-23 20:35:05 +00:00
You must also compile [Skia ](#skia-on-macos ) before starting with the
[compilation ](#compiling ).
2016-04-11 20:50:11 +00:00
## Linux dependencies
2018-08-29 13:24:13 +00:00
You will need the following dependencies on Ubuntu/Debian:
2016-04-11 20:50:11 +00:00
2018-08-29 13:24:13 +00:00
sudo apt-get install -y g++ cmake ninja-build libx11-dev libxcursor-dev
On Fedora:
sudo yum install -y gcc-c++ cmake ninja-build libX11-devel libXcursor-devel mesa-libGL-devel fontconfig-devel
2016-04-11 20:50:11 +00:00
2018-08-23 20:35:05 +00:00
You must also compile [Skia ](#skia-on-linux ) before starting with the
[compilation ](#compiling ).
2016-04-11 20:50:11 +00:00
# Compiling
2013-11-23 19:32:13 +00:00
2016-04-27 03:11:45 +00:00
1. [Get Aseprite code ](#get-the-source-code ), put it in a folder like
`C:\aseprite` , and create a `build` directory inside to leave all
the files that are result of the compilation process (`.exe`,
`.lib` , `.obj` , `.a` , `.o` , etc).
2012-07-08 04:41:14 +00:00
2016-04-27 03:11:45 +00:00
cd C:\aseprite
mkdir build
2012-07-08 04:41:14 +00:00
2013-11-23 19:01:34 +00:00
In this way, if you want to start with a fresh copy of Aseprite
2012-07-08 04:41:14 +00:00
source code, you can remove the `build` directory and start again.
2016-04-27 03:11:45 +00:00
2. Enter in the new directory and execute `cmake` :
2012-07-08 04:41:14 +00:00
2016-04-27 03:11:45 +00:00
cd C:\aseprite\build
cmake -G Ninja ..
2016-04-11 20:50:11 +00:00
2016-04-27 03:11:45 +00:00
Here `cmake` needs different options depending on your
platform. You must check the details for
2016-10-26 17:58:43 +00:00
[Windows ](#windows-details ), [macOS ](#macos-details ), and
2016-04-27 03:11:45 +00:00
[Linux ](#linux-details ). Some `cmake` options can be modified using tools like
[`ccmake` ](https://cmake.org/cmake/help/latest/manual/ccmake.1.html )
or [`cmake-gui` ](https://cmake.org/cmake/help/latest/manual/cmake-gui.1.html ).
2016-04-11 20:50:11 +00:00
2016-04-27 03:11:45 +00:00
3. After you have executed and configured `cmake` , you have to compile
the project:
2012-07-08 04:41:14 +00:00
2016-04-27 03:11:45 +00:00
cd C:\aseprite\build
ninja aseprite
2012-07-08 04:41:14 +00:00
2016-04-27 03:11:45 +00:00
4. When `ninja` finishes the compilation, you can find the executable
inside `C:\aseprite\build\bin\aseprite.exe` .
2012-07-08 04:41:14 +00:00
2016-04-27 03:11:45 +00:00
## Windows details
2012-07-08 04:41:14 +00:00
2018-08-08 21:31:48 +00:00
After you've [compiled Skia ](#skia-on-windows ) you can execute `cmake`
2016-04-27 03:11:45 +00:00
with the following arguments:
2012-07-08 04:41:14 +00:00
2016-04-27 03:11:45 +00:00
cd aseprite
mkdir build
cd build
2018-08-08 21:31:48 +00:00
cmake -DSKIA_DIR=C:\deps\skia -G Ninja ..
2016-04-27 03:11:45 +00:00
ninja aseprite
2016-02-29 15:25:15 +00:00
2016-04-27 03:11:45 +00:00
In this case, `C:\deps\skia` is the directory where Skia was compiled
as described in [Skia on Windows ](#skia-on-windows ) section.
2015-04-10 12:37:56 +00:00
2016-10-26 17:58:43 +00:00
## macOS details
2015-12-30 15:29:53 +00:00
2016-10-26 17:58:43 +00:00
After [compiling Skia ](#skia-on-macos ), you should run `cmake` with
2016-04-27 03:11:45 +00:00
the following parameters and then `ninja` :
2015-12-30 15:29:53 +00:00
2016-04-27 03:11:45 +00:00
cd aseprite
mkdir build
cd build
cmake \
-DCMAKE_OSX_ARCHITECTURES=x86_64 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.7 \
2018-08-06 16:55:11 +00:00
-DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk \
2016-04-27 03:11:45 +00:00
-DSKIA_DIR=$HOME/deps/skia \
2016-05-04 23:19:26 +00:00
-DWITH_HarfBuzz=OFF \
2016-04-27 03:11:45 +00:00
-G Ninja \
..
ninja aseprite
In this case, `$HOME/deps/skia` is the directory where Skia was
2016-10-26 17:58:43 +00:00
compiled as described in [Skia on macOS ](#skia-on-macos ) section.
2012-07-08 04:41:14 +00:00
2016-04-27 03:11:45 +00:00
### Issues with Retina displays
2012-07-09 21:29:36 +00:00
2016-04-27 03:11:45 +00:00
If you have a Retina display, check the following issue:
2014-08-14 03:41:30 +00:00
2016-04-27 03:11:45 +00:00
https://github.com/aseprite/aseprite/issues/589
2016-04-26 18:01:10 +00:00
2016-04-27 03:11:45 +00:00
## Linux details
2016-04-26 18:01:10 +00:00
2018-08-08 21:31:48 +00:00
First you have to [compile Skia ](#skia-on-linux ), then you should run
`cmake` with the following parameters and then `ninja` :
2016-04-26 18:01:10 +00:00
cd aseprite
mkdir build
cd build
2018-08-08 21:31:48 +00:00
cmake -DSKIA_DIR=$HOME/deps/skia -G Ninja ..
2016-04-27 03:11:45 +00:00
ninja aseprite
2016-04-26 18:01:10 +00:00
2018-08-08 21:31:48 +00:00
In this case, `$HOME/deps/skia` is the directory where Skia was
compiled as described in [Skia on Linux ](#skia-on-linux ) section.
2015-04-17 17:30:09 +00:00
2015-01-06 12:34:40 +00:00
# Using shared third party libraries
2013-11-23 19:32:13 +00:00
If you don't want to use the embedded code of third party libraries
(i.e. to use your installed versions), you can disable static linking
configuring each `USE_SHARED_` option.
2016-02-29 15:34:55 +00:00
After running `cmake -G` , you can edit `build/CMakeCache.txt` file,
and enable the `USE_SHARED_` flag (set its value to `ON` ) of the
library that you want to be linked dynamically.
2013-11-23 19:32:13 +00:00
2016-04-27 03:11:45 +00:00
# Building Skia dependency
2016-04-26 18:01:10 +00:00
2016-04-27 03:11:45 +00:00
When you compile Aseprite with [Skia ](https://skia.org ) as back-end on
2016-10-26 17:58:43 +00:00
Windows or macOS, you need to compile a specific version of Skia. In
2016-04-27 03:11:45 +00:00
the following sections you will find straightforward steps to compile
Skia.
2016-04-26 18:01:10 +00:00
2016-04-27 03:11:45 +00:00
You can always check the
2018-01-24 18:56:32 +00:00
[official Skia instructions ](https://skia.org/user/build ) and select
2018-04-20 12:15:00 +00:00
the OS you are building for. Aseprite uses the `aseprite-m67` Skia
2016-07-12 16:37:00 +00:00
branch from `https://github.com/aseprite/skia` .
2016-04-26 18:01:10 +00:00
2016-04-27 03:11:45 +00:00
## Skia on Windows
2016-04-26 18:01:10 +00:00
2016-04-27 03:11:45 +00:00
Download
[Google depot tools ](https://storage.googleapis.com/chrome-infra/depot_tools.zip )
and uncompress it in some place like `C:\deps\depot_tools` .
2016-04-26 18:01:10 +00:00
2017-09-19 16:41:28 +00:00
Then open a command line follow these steps:
2016-04-26 18:01:10 +00:00
2017-09-19 16:41:28 +00:00
For VS2015:
2017-09-19 16:45:34 +00:00
2016-04-27 03:11:45 +00:00
call "%VS140COMNTOOLS%\vsvars32.bat"
2017-09-19 16:41:28 +00:00
For VS2017:
2017-09-19 16:45:34 +00:00
2017-09-19 16:41:28 +00:00
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat"
Then:
2017-09-19 16:45:34 +00:00
2016-04-27 03:11:45 +00:00
set PATH=C:\deps\depot_tools;%PATH%
cd C:\deps\depot_tools
gclient sync
2016-04-26 18:01:10 +00:00
2016-04-27 03:11:45 +00:00
(The `gclient` command might print an error like
`Error: client not configured; see 'gclient config'` .
Just ignore it.)
2016-04-26 18:01:10 +00:00
2016-04-27 03:11:45 +00:00
cd C:\deps
2018-08-17 17:27:49 +00:00
git clone -b aseprite-m67 https://github.com/aseprite/skia.git
2016-04-26 18:01:10 +00:00
cd skia
2017-09-19 16:41:28 +00:00
python tools/git-sync-deps
2016-04-26 18:01:10 +00:00
2017-09-19 16:45:34 +00:00
(The `tools/git-sync-deps` will take some minutes because it downloads
a lot of packages, please wait and re-run the same command in case it
fails.)
2016-04-26 18:01:10 +00:00
2017-09-19 16:41:28 +00:00
For VS2015:
2017-09-19 16:45:34 +00:00
2017-09-19 16:41:28 +00:00
gn gen out/Release --args="is_official_build=true skia_use_system_expat=false skia_use_system_libjpeg_turbo=false skia_use_system_libpng=false skia_use_system_libwebp=false skia_use_system_zlib=false target_cpu=""x86"""
2018-07-24 19:18:54 +00:00
ninja -C out/Release skia
2017-09-19 16:41:28 +00:00
For VS2017:
2017-09-19 16:45:34 +00:00
2018-07-24 18:29:11 +00:00
gn gen out/Release --args="is_official_build=true skia_use_system_expat=false skia_use_system_libjpeg_turbo=false skia_use_system_libpng=false skia_use_system_libwebp=false skia_use_system_zlib=false target_cpu=""x86"" cc=2017"
2018-07-24 19:18:54 +00:00
ninja -C out/Release skia
2016-04-26 18:01:10 +00:00
2016-04-27 03:11:45 +00:00
More information about these steps in the
2017-09-19 16:41:28 +00:00
[official Skia documentation ](https://skia.org/user/build ).
2016-04-26 18:01:10 +00:00
2016-10-26 17:58:43 +00:00
## Skia on macOS
2016-04-26 18:01:10 +00:00
2016-04-27 03:11:45 +00:00
These steps will create a `deps` folder in your home directory with a
couple of subdirectories needed to build Skia (you can change the
`$HOME/deps` with other directory). Some of these commands will take
several minutes to finish:
2016-04-26 18:01:10 +00:00
2016-04-27 03:11:45 +00:00
mkdir $HOME/deps
cd $HOME/deps
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
2018-08-17 17:27:49 +00:00
git clone -b aseprite-m67 https://github.com/aseprite/skia.git
2016-05-04 21:40:41 +00:00
export PATH="${PWD}/depot_tools:${PATH}"
2016-04-27 03:11:45 +00:00
cd skia
2017-09-19 16:41:28 +00:00
python tools/git-sync-deps
2018-04-28 14:58:34 +00:00
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 extra_cflags_cc=[\"-frtti\"]"
2018-07-24 19:18:54 +00:00
ninja -C out/Release skia
2016-04-27 03:11:45 +00:00
After this you should have all Skia libraries compiled. When you
[compile Aseprite ](#compiling ), remember to add
`-DSKIA_DIR=$HOME/deps/skia` parameter to your `cmake` call as
2016-10-26 17:58:43 +00:00
described in the [macOS details ](#macos-details ) section.
2016-04-27 03:11:45 +00:00
More information about these steps in the
2017-09-19 16:41:28 +00:00
[official Skia documentation ](https://skia.org/user/build ).
2018-08-08 21:31:48 +00:00
## Skia on Linux
These steps will create a `deps` folder in your home directory with a
couple of subdirectories needed to build Skia (you can change the
`$HOME/deps` with other directory). Some of these commands will take
several minutes to finish:
mkdir $HOME/deps
cd $HOME/deps
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
2018-08-17 17:27:49 +00:00
git clone -b aseprite-m67 https://github.com/aseprite/skia.git
2018-08-08 21:31:48 +00:00
export PATH="${PWD}/depot_tools:${PATH}"
cd skia
python tools/git-sync-deps
gn gen out/Release --args="is_debug=false 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 skia
After this you should have all Skia libraries compiled. When you
[compile Aseprite ](#compiling ), remember to add
`-DSKIA_DIR=$HOME/deps/skia` parameter to your `cmake` call as
described in the [Linux details ](#linux-details ) section.
More information about these steps in the
[official Skia documentation ](https://skia.org/user/build ).