1
0
aki d12f0bdf88 refactor: Overhaul build system for reliability and future portability
This commit introduces a major refactoring of the Aseprite build process. It replaces the previous fragile system (prone to dependency fetching failures) with an interim multi-distribution Docker approach, paving the way for a future transition to Flatpak.

**Problems Addressed:**

*   **Build Fragility & Dependency Fetching:** The prior method, compiling dependencies from source within a generic container, frequently failed due to network issues and rate limiting during source/sub-dependency acquisition (e.g., Skia's `git-sync-deps`), often late in the process. Source state inconsistencies could also cause failures.
*   **Complexity of Full Source Builds:** Managing the compilation of the entire dependency tree from source was complex.

**New Architecture & Rationale:**

*   **Host-Side Source Preparation (`prepare_sources.sh`):** Isolates the problematic source fetching and state management to a host-side script run *before* the main build. Key features:
    *   Handles cloning/updating core sources (`depot_tools`, Skia, Aseprite).
    *   Runs Skia `git-sync-deps` with **robust retry logic** to specifically address rate limit errors.
    *   Includes an `--check-integrity` flag which performs **aggressive checks and resets** (fetching, checking out specific tags/commits, resetting state) to ensure the local source directories precisely match the required state for the build, potentially involving significant network activity.
*   **Distribution-Specific Builds (Interim Step):** Introduced `Dockerfile.arch`, `Dockerfile.debian`, `Dockerfile.fedora`. These use native package managers to install pre-built *common* development libraries within the container, simplifying the Docker build stage itself. Requires OS detection or manual selection (`TARGET_DISTRO`).
*   **Clear Build Stages (Makefile):** Orchestrates source preparation, image building, and final binary extraction (`docker cp` to `./output/bin`).
*   **Cleaned Structure:** Removed obsolete scripts/files (`compile.sh`, generic `Dockerfile`, `docker-compose.yml`) and updated `.gitignore`.

**Limitations & Future Direction (Flatpak):**

*   **Fetching Challenges Persist:** While reliability is improved by isolating source prep and adding retries/integrity checks in `prepare_sources.sh`, the core challenge of potential rate limits or network issues during this initial step remains.
*   **Flatpak for Portability:** The current multi-distro Docker setup is an **intermediate solution**. The ultimate goal and **forward-maintained approach** is migrating to **Flatpak (`flatpak-builder`)**. Flatpak will provide a **unified, distribution-agnostic build environment** using standard runtimes and produce a **portable `.flatpak` bundle**, eliminating the need for OS detection/separate Dockerfiles and ensuring consistent builds *after* sources are successfully prepared.
2025-05-05 01:16:07 +08:00
2025-02-05 09:17:00 +01:00

Docker Aseprite container

This repository allows you to compile Aseprite without installing any build tools. All that is required is Docker.

After spending hours trying to get Aseprite to compile, I decided to just make a Docker image for it

Currently the script checks out Skia version m102 and Aseprite version 1.2.40. You can easily change this in compile.sh by changing the -b flag to the desired versions.

If any of the folders of the projects folder isn't empty, the script will skip checking out the latest versions. In order to re-download, delete the according folder.

  • ./dependencies/depot_tools
  • ./dependencies/skia
  • ./output/aseprite

Usage

  • Install docker
  • Clone this repository
  • cd into cloned repository
  • Run make build or make build-compose (The latter will use docker-compose to build the image)
  • Grab a cup of coffee, since this can take quite a while (Compiling build deps, skia, and aseprite)

You can now find the compiled version of Aseprite in the output/aseprite/build/bin folder

FAQ

If you get the following error when running Aseprite: ./aseprite: error while loading shared libraries: libdeflate.so.0: cannot open shared object file: No such file or directory, make sure you have libdeflate installed on your system. Please run sudo apt install -y libdeflate0 libdeflate-dev

If you get the following error: ./aseprite: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No such file or directory, you'll want to install the OpenSSL 1.1 package/library. You may have only OpenSSL 3.x installed, meanwhile Aseprite still uses the v1.1 library.

  • On Arch / Arch based distros, run sudo pacman -Syu openssl-1.1
  • On Ubuntu try: sudo apt install -y libssl1.1

License

MIT License

Copyright (c) 2025 nilsve

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Description
Builds a flatpak bundle of Aseprite using Docker
Readme MIT 159 KiB
Languages
Shell 73.3%
Makefile 17.5%
Dockerfile 9.2%