├── LICENSE ├── README.md └── compile.sh /LICENSE: -------------------------------------------------------------------------------- 1 | Zero-Clause BSD 2 | ============= 3 | 4 | Permission to use, copy, modify, and/or distribute this software for 5 | any purpose with or without fee is hereby granted. 6 | 7 | THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL 8 | WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES 9 | OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE 10 | FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY 11 | DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 12 | AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT 13 | OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Compile Aseprite on Linux 2 | Here's how to compile aseprite for free on Fedora, Ubuntu, and more! If you want to support the developers, buy it from [Aseprite.org](https://aseprite.org)! 3 | 4 | To run the script, simply open a terminal window, and paste this: 5 | ```bash 6 | bash -c "$(curl -sSf 'https://raw.githubusercontent.com/mak448a/compile-aseprite-linux/refs/heads/main/compile.sh')" 7 | ``` 8 | 9 | Please consider giving this repo a star if you found it helpful. 10 | 11 | If you encounter any errors, please report them in the issues tab. 12 | 13 | ## Where is the executable? 14 | The executable is stored in ~/.local/share/aseprite. Have fun! 15 | 16 | ## How do I run Aseprite? 17 | This script automatically adds Aseprite to your desktop environment's application launcher and to $PATH. 18 | You can launch it from your desktop environment's application launcher or by entering `aseprite` in the terminal. 19 | 20 | ## Credits 21 | I used [Aseprite's official compilation guide](https://github.com/aseprite/aseprite/blob/main/INSTALL.md) to make this script. 22 | -------------------------------------------------------------------------------- /compile.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [[ -z "${XDG_DATA_HOME}" ]] && XDG_DATA_HOME="${HOME}/.local/share" 4 | 5 | INSTALL_DIR="${XDG_DATA_HOME}/aseprite" 6 | BINARY_DIR="${HOME}/.local/bin" 7 | LAUNCHER_DIR="${XDG_DATA_HOME}/applications" 8 | 9 | SIGNATURE_FILE="${INSTALL_DIR}/compile-aseprite-linux" 10 | BINARY_FILE="${BINARY_DIR}/aseprite" 11 | LAUNCHER_FILE="${LAUNCHER_DIR}/aseprite.desktop" 12 | ICON_FILE="${INSTALL_DIR}/data/icons/ase256.png" 13 | 14 | if [[ -f "${SIGNATURE_FILE}" ]] ; then 15 | read -e -p "Aseprite already installed. Update? (y/N): " choice 16 | [[ "${choice}" == [Yy]* ]] \ 17 | || exit 0 18 | else 19 | [[ -d "${INSTALL_DIR}" ]] \ 20 | && { echo "Aseprite already installed to '${INSTALL_DIR}'. Aborting" >&2 ; exit 1 ; } 21 | { [[ -f "${LAUNCHER_FILE}" ]] || [[ -f "${BINARY_FILE}" ]] ; } \ 22 | && { echo "Other aseprite data already installed to home directory. Aborting" >&2 ; exit 1 ; } 23 | fi 24 | 25 | if [[ -z "${TESTING}" ]] ; then 26 | WORK_DIR=$(mktemp -d -t 'compile-aseprite-linux-XXXXX') \ 27 | || { echo "Unable to create temp folder" >&2 ; exit 1 ; } 28 | else 29 | WORK_DIR='compile-aseprite-linux-testing' 30 | mkdir -p "${WORK_DIR}" 31 | fi 32 | WORK_DIR="$(realpath "${WORK_DIR}")" 33 | 34 | cleanup() { 35 | code=$? 36 | echo "Cleaning up." 37 | pushd -0 >/dev/null 38 | dirs -c 39 | if [[ -z "${TESTING}" ]] ; then 40 | rm -rf "${WORK_DIR}" 41 | fi 42 | exit "${code}" 43 | } 44 | 45 | trap "cleanup" EXIT 46 | 47 | pushd "${WORK_DIR}" 48 | 49 | # Download latest version of aseprite 50 | # SOURCE_CODE is a link like https://github.com/aseprite/aseprite/releases/download/vX.X.X.X/Aseprite-vX.X.X.X-Source.zip 51 | SOURCE_CODE=$(curl -s "https://api.github.com/repos/aseprite/aseprite/releases/latest" | awk '/browser_download_url/ {print $2}' | tr -d \") 52 | 53 | wget -q $SOURCE_CODE \ 54 | || { echo "Unable to download the latest version of Aseprite." >&2 ; exit 1 ; } 55 | echo "Aseprite downloaded from: ${SOURCE_CODE}" 56 | 57 | # FILE is a filename like Aseprite-vX.X.X.X-Source.zip 58 | FILE=$(echo $SOURCE_CODE | awk -F/ '{print $NF}') 59 | 60 | # Unzip the source code 61 | unzip -q $FILE -d aseprite \ 62 | || { echo "Unable to decompress the source code, make sure you have the unzip package installed." >&2 ; exit 1 ; } 63 | echo "${FILE} decompresed." 64 | 65 | # Check distro 66 | os_name=$(grep 'NAME=' /etc/os-release | head -n 1 | sed 's/NAME=//' | tr -d '"') 67 | 68 | # Assign package manager to a variable 69 | if [[ "$os_name" == *"Fedora"* ]]; then 70 | package_man="dnf" 71 | elif [[ $os_name == *"Debian"* ]] || [[ $os_name == *"Ubuntu"* ]] || [[ $os_name == *"Mint"* ]]; then 72 | package_man="apt" 73 | elif [[ $os_name == *"Arch"* ]] || [[ $os_name == *"Manjaro"* ]]; then 74 | package_man="pacman" 75 | else 76 | echo "Unsupported distro! If your distro supports APT, DNF or PACMAN, please manually modify the script to set os_name='Ubuntu' for apt, os_name='Fedora' for dnf or os_name='Arch' for pacman. You can also open an issue ticket." 77 | echo "Stopped installation!" 78 | exit 1 79 | fi 80 | 81 | echo "Enter sudo password to install dependencies. This is also a good time to plug in your computer, since compiling will take a long time." 82 | 83 | # Install dependencies 84 | if [[ $package_man == "dnf" ]]; then 85 | cat aseprite/INSTALL.md | grep -m1 "sudo dnf install" | bash 86 | elif [[ $package_man == "apt" ]]; then 87 | cat aseprite/INSTALL.md | grep -m1 "sudo apt-get install" | bash 88 | elif [[ $package_man == "pacman" ]]; then 89 | deps=$(cat aseprite/INSTALL.md | grep -m1 "sudo pacman -S") 90 | deps=${deps/-S/-S --needed --noconfirm} 91 | bash -c "$deps" 92 | 93 | fi 94 | 95 | [[ $? == 0 ]] \ 96 | || { echo "Failed to install dependencies." >&2 ; exit 1 ; } 97 | 98 | pushd aseprite 99 | 100 | # Compile Aseprite with the provided build.sh script in the source code 101 | ./build.sh --auto --norun \ 102 | || { echo "Compilation failed." >&2 ; exit 1 ; } 103 | 104 | popd 105 | 106 | rm -rf "${INSTALL_DIR}" \ 107 | || { echo "Unable to clean up old install." >&2 ; exit 1 ; } 108 | mkdir -p "${INSTALL_DIR}" "${BINARY_DIR}" "${LAUNCHER_DIR}" \ 109 | || { echo "Unable to create install folder." >&2 ; exit 1 ; } 110 | 111 | { mv aseprite/build/bin/* "${INSTALL_DIR}" \ 112 | && touch "${SIGNATURE_FILE}" \ 113 | && ln -sf "${INSTALL_DIR}/aseprite" "${BINARY_FILE}" \ 114 | && cp -f "${WORK_DIR}/aseprite/src/desktop/linux/aseprite.desktop" "${LAUNCHER_FILE}" \ 115 | ; } || { echo "Failed to complete install." >&2 ; exit 1 ; } 116 | 117 | # Replace the values on the .desktop file to the correct ones 118 | sed -i "s|$(grep -m1 TryExec= "${LAUNCHER_FILE}")|TryExec=$BINARY_FILE|g" "${LAUNCHER_FILE}" 119 | sed -i "s|$(grep -m1 Exec= "${LAUNCHER_FILE}")|Exec=$BINARY_FILE %U|g" "${LAUNCHER_FILE}" 120 | sed -i "s|$(grep -m1 Icon= "${LAUNCHER_FILE}")|Icon=$ICON_FILE|g" "${LAUNCHER_FILE}" 121 | 122 | echo "Done compiling!" 123 | echo "The executable is stored in '${INSTALL_DIR}'. Have fun!" 124 | --------------------------------------------------------------------------------