Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save rkmax/ca5892c1d44bf3fdbe081784d67d5d5a to your computer and use it in GitHub Desktop.

Select an option

Save rkmax/ca5892c1d44bf3fdbe081784d67d5d5a to your computer and use it in GitHub Desktop.

Revisions

  1. rkmax revised this gist Nov 26, 2022. 2 changed files with 101 additions and 55 deletions.
    55 changes: 0 additions & 55 deletions aseprite-build-and-install-on-macos.sh
    Original file line number Diff line number Diff line change
    @@ -1,55 +0,0 @@
    #!/bin/bash

    # README: A more updated version is on the comments by (ashmna)[https://gist.github.com/ashmna]
    # See at: https://gist.github.com/allangarcia/938b052a7d55d1652052e4259364260b?permalink_comment_id=4265898#gistcomment-4265898

    # this is for tools required
    brew update
    brew install ninja
    brew install cmake

    # crete the default root directory
    cd $HOME/Developer
    mkdir Aseprite
    cd Aseprite

    # download skia m81
    curl -O -L "https://github.com/aseprite/skia/releases/download/m81-b607b32047/Skia-macOS-Release-x64.zip"
    unzip Skia-macOS-Release-x64.zip -d skia-m81

    # this is the project itselft
    git clone --recursive https://github.com/aseprite/aseprite.git

    # compiling aseprite
    cd aseprite
    mkdir build
    cd build
    cmake \
    -DCMAKE_BUILD_TYPE=RelWithDebInfo \
    -DCMAKE_OSX_ARCHITECTURES=x86_64 \
    -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 \
    -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk \
    -DLAF_BACKEND=skia \
    -DSKIA_DIR=../../skia-m81 \
    -DSKIA_LIBRARY_DIR=../../skia-m81/out/Release-x64 \
    -G Ninja \
    ..
    ninja aseprite
    cd ../..

    # bundle app from trial
    mkdir bundle
    cd bundle
    curl -O -J "https://www.aseprite.org/downloads/trial/Aseprite-v1.2.27-trial-macOS.dmg"
    mkdir mount
    yes qy | hdiutil attach -quiet -nobrowse -noverify -noautoopen -mountpoint mount Aseprite-v1.2.27-trial-macOS.dmg
    cp -rf mount/Aseprite.app .
    hdiutil detach mount
    rm -rf Aseprite.app/Contents/MacOS/aseprite
    cp -rf ../aseprite/build/bin/aseprite Aseprite.app/Contents/MacOS/aseprite
    rm -rf Aseprite.app/Contents/Resources/data
    cp -rf ../aseprite/build/bin/data Aseprite.app/Contents/Resources/data
    cd ..

    # Install on /Applications
    sudo cp bundle/Aseprite.app /Applications/
    101 changes: 101 additions & 0 deletions aseprite_macos_update_install.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,101 @@
    #!/usr/bin/env bash

    set -e

    target_osx=$(sw_vers -productVersion)
    project_dir=/Users/rkmax/development/aseprite
    skia_dir=/Users/rkmax/development/skia
    arch="$(uname -m)"

    bundle_trial_url=https://www.aseprite.org/downloads/trial/Aseprite-v1.2.40-trial-macOS.dmg

    install_update_deps() {
    macos_deps
    dep_skia
    dep_aseprite
    }

    macos_deps() {
    brew update
    brew install cmake ninja
    }

    dep_skia() {
    rm -rf $skia_dir
    mkdir -p $skia_dir
    cd $skia_dir

    latest_url=$(curl -s https://api.github.com/repos/aseprite/skia/releases/latest | grep "browser_download_url.*-macOS.*${arch}.zip" | cut -d : -f 2,3 | tr -d \")
    name=$(basename "${latest_url}")

    if [ ! -f "${name}" ]; then
    echo "Downloading ${name}"

    # the value already include '"'
    # shellcheck disable=SC1073
    wget ${latest_url}
    fi

    unzip "${name}"
    }

    dep_aseprite() {
    if [ ! -d $project_dir ]; then
    git clone --recursive https://github.com/aseprite/aseprite.git $project_dir
    fi

    cd $project_dir
    git pull
    }

    build_bin() {
    cd $project_dir
    mkdir -p build
    cd build

    cmake \
    -DCMAKE_BUILD_TYPE=RelWithDebInfo \
    -DCMAKE_OSX_ARCHITECTURES="${arch}" \
    -DCMAKE_OSX_DEPLOYMENT_TARGET="${target_osx}" \
    -DCMAKE_MACOSX_RPATH=ON \
    -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk \
    -DLAF_BACKEND=skia \
    -DSKIA_DIR="${skia_dir}" \
    -DSKIA_LIBRARY_DIR="${skia_dir}/out/Release-${arch}" \
    -DSKIA_LIBRARY="${skia_dir}/out/Release-${arch}/libskia.a" \
    -DPNG_ARM_NEON:STRING=on \
    -G Ninja ..

    ninja aseprite
    }

    package_app() {
    mkdir -p "${project_dir}/bundle"
    cd "${project_dir}/bundle"


    name=$(basename "${bundle_trial_url}")
    if [ ! -f "${name}" ]; then
    echo "Downloading bundle assets"
    wget "${bundle_trial_url}"
    fi

    mkdir -p mount
    yes qy | hdiutil attach -quiet -nobrowse -noverify -noautoopen -mountpoint mount "${name}"
    cp -r mount/Aseprite.app .
    hdiutil detach -quiet mount

    rm -rf Aseprite.app/Contents/MacOS/aseprite
    rm -rf Aseprite.app/Contents/Resources/data
    cp -r "${project_dir}/build/bin/aseprite" Aseprite.app/Contents/MacOS/aseprite
    cp -r "${project_dir}/build/bin/data" Aseprite.app/Contents/Resources/data
    }

    install_app() {
    sudo cp -r "${project_dir}/bundle/Aseprite.app" /Applications/
    }

    install_update_deps
    build_bin
    package_app
    install_app
  2. @allangarcia allangarcia revised this gist Aug 18, 2022. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions aseprite-build-and-install-on-macos.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,7 @@
    #!/bin/bash

    # README: A more updated version is on the comments by (ashmna)[https://gist.github.com/ashmna]
    # See at: https://gist.github.com/allangarcia/938b052a7d55d1652052e4259364260b?permalink_comment_id=4265898#gistcomment-4265898

    # this is for tools required
    brew update
  3. @allangarcia allangarcia revised this gist Aug 18, 2022. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions aseprite-build-and-install-on-macos.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,7 @@
    #!/bin/bash

    # README: A more updated version is on the comments by (ashmna)[https://gist.github.com/ashmna]

    # this is for tools required
    brew update
    brew install ninja
  4. @allangarcia allangarcia revised this gist Jun 7, 2021. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion aseprite-build-and-install-on-macos.sh
    Original file line number Diff line number Diff line change
    @@ -46,4 +46,7 @@ rm -rf Aseprite.app/Contents/MacOS/aseprite
    cp -rf ../aseprite/build/bin/aseprite Aseprite.app/Contents/MacOS/aseprite
    rm -rf Aseprite.app/Contents/Resources/data
    cp -rf ../aseprite/build/bin/data Aseprite.app/Contents/Resources/data
    cd ..
    cd ..

    # Install on /Applications
    sudo cp bundle/Aseprite.app /Applications/
  5. @allangarcia allangarcia revised this gist Jun 7, 2021. 2 changed files with 49 additions and 53 deletions.
    49 changes: 49 additions & 0 deletions aseprite-build-and-install-on-macos.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,49 @@
    #!/bin/bash

    # this is for tools required
    brew update
    brew install ninja
    brew install cmake

    # crete the default root directory
    cd $HOME/Developer
    mkdir Aseprite
    cd Aseprite

    # download skia m81
    curl -O -L "https://github.com/aseprite/skia/releases/download/m81-b607b32047/Skia-macOS-Release-x64.zip"
    unzip Skia-macOS-Release-x64.zip -d skia-m81

    # this is the project itselft
    git clone --recursive https://github.com/aseprite/aseprite.git

    # compiling aseprite
    cd aseprite
    mkdir build
    cd build
    cmake \
    -DCMAKE_BUILD_TYPE=RelWithDebInfo \
    -DCMAKE_OSX_ARCHITECTURES=x86_64 \
    -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 \
    -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk \
    -DLAF_BACKEND=skia \
    -DSKIA_DIR=../../skia-m81 \
    -DSKIA_LIBRARY_DIR=../../skia-m81/out/Release-x64 \
    -G Ninja \
    ..
    ninja aseprite
    cd ../..

    # bundle app from trial
    mkdir bundle
    cd bundle
    curl -O -J "https://www.aseprite.org/downloads/trial/Aseprite-v1.2.27-trial-macOS.dmg"
    mkdir mount
    yes qy | hdiutil attach -quiet -nobrowse -noverify -noautoopen -mountpoint mount Aseprite-v1.2.27-trial-macOS.dmg
    cp -rf mount/Aseprite.app .
    hdiutil detach mount
    rm -rf Aseprite.app/Contents/MacOS/aseprite
    cp -rf ../aseprite/build/bin/aseprite Aseprite.app/Contents/MacOS/aseprite
    rm -rf Aseprite.app/Contents/Resources/data
    cp -rf ../aseprite/build/bin/data Aseprite.app/Contents/Resources/data
    cd ..
    53 changes: 0 additions & 53 deletions aseprite-build-on-macos.sh
    Original file line number Diff line number Diff line change
    @@ -1,53 +0,0 @@
    #!/bin/zsh

    cd $HOME/Developer

    # this is for tools required
    brew update
    brew install ninja
    brew install cmake

    # this is the dependency codes
    git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
    git clone -b aseprite-m81 https://github.com/aseprite/skia.git

    # compiling skia
    export PATH="${PWD}/depot_tools:${PATH}"
    cd skia
    python tools/git-sync-deps
    gn gen out/Release-x64 --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 skia_use_sfntly=false skia_use_freetype=true skia_use_harfbuzz=true skia_pdf_subset_harfbuzz=true skia_use_system_freetype2=false skia_use_system_harfbuzz=false target_cpu=\"x64\" extra_cflags=[\"-stdlib=libc++\", \"-mmacosx-version-min=10.9\"] extra_cflags_cc=[\"-frtti\"]"
    ninja -C out/Release-x64 skia modules
    cd ..

    # this is the project itselft
    git clone --recursive https://github.com/aseprite/aseprite.git

    # compiling aseprite
    cd aseprite
    mkdir build
    cd build
    cmake \
    -DCMAKE_BUILD_TYPE=RelWithDebInfo \
    -DCMAKE_OSX_ARCHITECTURES=x86_64 \
    -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 \
    -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk \
    -DLAF_BACKEND=skia \
    -DSKIA_DIR=../../skia \
    -DSKIA_LIBRARY_DIR=../../skia/out/Release-x64 \
    -G Ninja \
    ..
    ninja aseprite
    cd ..

    # bundle app from trial
    mkdir bundle
    cd bundle
    curl -O -J "https://www.aseprite.org/downloads/trial/Aseprite-v1.2.18-trial-macOS.dmg"
    mkdir mount
    yes qy | hdiutil attach -quiet -nobrowse -noverify -noautoopen -mountpoint mount Aseprite-v1.2.18-trial-macOS.dmg
    cp -rf mount/Aseprite.app .
    hdiutil detach mount
    rm -rf Aseprite.app/Contents/MacOS/aseprite
    cp -rf ../aseprite/build/bin/aseprite Aseprite.app/Contents/MacOS/aseprite
    rm -rf Aseprite.app/Contents/Resources/
    cp -rf ../aseprite/build/bin/data Aseprite.app/Contents/Resources/
  6. @allangarcia allangarcia created this gist May 6, 2020.
    53 changes: 53 additions & 0 deletions aseprite-build-on-macos.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,53 @@
    #!/bin/zsh

    cd $HOME/Developer

    # this is for tools required
    brew update
    brew install ninja
    brew install cmake

    # this is the dependency codes
    git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
    git clone -b aseprite-m81 https://github.com/aseprite/skia.git

    # compiling skia
    export PATH="${PWD}/depot_tools:${PATH}"
    cd skia
    python tools/git-sync-deps
    gn gen out/Release-x64 --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 skia_use_sfntly=false skia_use_freetype=true skia_use_harfbuzz=true skia_pdf_subset_harfbuzz=true skia_use_system_freetype2=false skia_use_system_harfbuzz=false target_cpu=\"x64\" extra_cflags=[\"-stdlib=libc++\", \"-mmacosx-version-min=10.9\"] extra_cflags_cc=[\"-frtti\"]"
    ninja -C out/Release-x64 skia modules
    cd ..

    # this is the project itselft
    git clone --recursive https://github.com/aseprite/aseprite.git

    # compiling aseprite
    cd aseprite
    mkdir build
    cd build
    cmake \
    -DCMAKE_BUILD_TYPE=RelWithDebInfo \
    -DCMAKE_OSX_ARCHITECTURES=x86_64 \
    -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 \
    -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk \
    -DLAF_BACKEND=skia \
    -DSKIA_DIR=../../skia \
    -DSKIA_LIBRARY_DIR=../../skia/out/Release-x64 \
    -G Ninja \
    ..
    ninja aseprite
    cd ..

    # bundle app from trial
    mkdir bundle
    cd bundle
    curl -O -J "https://www.aseprite.org/downloads/trial/Aseprite-v1.2.18-trial-macOS.dmg"
    mkdir mount
    yes qy | hdiutil attach -quiet -nobrowse -noverify -noautoopen -mountpoint mount Aseprite-v1.2.18-trial-macOS.dmg
    cp -rf mount/Aseprite.app .
    hdiutil detach mount
    rm -rf Aseprite.app/Contents/MacOS/aseprite
    cp -rf ../aseprite/build/bin/aseprite Aseprite.app/Contents/MacOS/aseprite
    rm -rf Aseprite.app/Contents/Resources/
    cp -rf ../aseprite/build/bin/data Aseprite.app/Contents/Resources/