[
  {
    "path": ".gitignore",
    "content": "aseprite/\ndeps/\n"
  },
  {
    "path": "Aseprite.app/Contents/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleAllowMixedLocalizations</key>\n\t<true/>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>English</string>\n\t<key>CFBundleExecutable</key>\n\t<string>applet</string>\n\t<key>CFBundleIconFile</key>\n\t<string>applet</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>com.apple.ScriptEditor.id.Aseprite</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>Aseprite</string>\n\t<key>CFBundlePackageType</key>\n\t<string>APPL</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleSignature</key>\n\t<string>aplt</string>\n\t<key>LSMinimumSystemVersionByArchitecture</key>\n\t<dict>\n\t\t<key>x86_64</key>\n\t\t<string>10.6</string>\n\t</dict>\n\t<key>LSRequiresCarbon</key>\n\t<true/>\n\t<key>WindowState</key>\n\t<dict>\n\t\t<key>bundleDividerCollapsed</key>\n\t\t<true/>\n\t\t<key>bundlePositionOfDivider</key>\n\t\t<real>0.0</real>\n\t\t<key>dividerCollapsed</key>\n\t\t<false/>\n\t\t<key>eventLogLevel</key>\n\t\t<integer>2</integer>\n\t\t<key>name</key>\n\t\t<string>ScriptWindowState</string>\n\t\t<key>positionOfDivider</key>\n\t\t<real>157</real>\n\t\t<key>savedFrame</key>\n\t\t<string>214 69 700 672 0 0 1280 777 </string>\n\t\t<key>selectedTab</key>\n\t\t<string>result</string>\n\t</dict>\n</dict>\n</plist>\n"
  },
  {
    "path": "Aseprite.app/Contents/PkgInfo",
    "content": "APPLaplt"
  },
  {
    "path": "Aseprite.app/Contents/Resources/description.rtfd/TXT.rtf",
    "content": "{\\rtf1\\ansi\\ansicpg1252\\cocoartf1539\\cocoasubrtf120\n{\\fonttbl}\n{\\colortbl;\\red255\\green255\\blue255;}\n{\\*\\expandedcolortbl;;}\n}"
  },
  {
    "path": "Aseprite.app/Icon\r",
    "content": ""
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2017 Wasin Thonkaew\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# aseprite-macos-buildsh\nAutomated script to create latest release (whatever it will be either development snapshot commit, beta, or release) of Aseprite for macOS\n\nUpdate : Added support x64 Architecture build for SKIA on MacOS\n\nProject is updated against aseprite v.1.2.10 build workflow.\n\n# Pre-Requisite\n\nYou need\n\n* Xcode\n* [CMake](http://www.cmake.org/) (3.4 or greater)\n* [Ninja](https://ninja-build.org/) build system\n* Python 2.x ([version 3](https://github.com/haxpor/aseprite-macos-buildsh/issues/2) didn't work)\n\nFor Xcode, you need to install it by downloading [here](https://developer.apple.com/download/). After successfully installed, execute `xcode-select --install` to install its toolchain, then finally follow along as dialog popup shows up.\n\nNow you're ready to use this script.\n\n# How to Build\n\nJust execute `bash aseprite.sh`. Then open `Aseprite` application.\n\nIf the script asks for root password, enter it. This is to be able to execute command to properly set environment path variable. It's safe, the script never try to do anything beside trying to build the app successfully.\n\n## Command line Configuration\n\nIn case you want to install aseprite to different path, or your `xcode-select` is not set properly, you can use either `--sdk-root` and `--target` to properly set things up before building.\n\n* `--sdk-root`\n\n\tTo set your latest macOS SDK root as part of Xcode toolchain. By default it will query current prefix-value from `xcode-select` and append it with `/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk`. But in case, it doesn't work or `xcode-select` didn't do the work, you can use this option to manually specify it.\n\n* `--target`\n\n\tTo set you target path to install aseprite. By default it will be at `/Applications` but some users might want it differently. In case you use this parameter, please see [#3](https://github.com/haxpor/aseprite-macos-buildsh/issues/3).\n\nSo for example, you will execute\n\n```\nbash aseprite.sh --sdk-root /Volumes/Slave/Applications/Xcode8.3/Xcode.app/Contents/Developer --target ~/slave/Applications\n```\n**note** if you use `--target`, please see [#3](https://github.com/haxpor/aseprite-macos-buildsh/issues/3).\n\nNormal, barebone version with no parameters.\n\n```shell\nbash aseprite.sh\n```\n\nWith custom parameters to specify SDK_ROOT and TARGET\n```shell\nbash aseprite.sh --sdk-root /Volumes/Slave/Applications/YourCustomDir/Xcode.app/Contents/Developer --target ~/YourCustomDir/Appliations\n```\n\n# Behind the Scene\n\nThe script will proceed with following\n* Clone down Aseprite and Skia repository, and its dependencies required to bulid Aseprite.\n* Compile and build dependencies\n* Clone down Aseprite repository, then compile and build for latest release as tagged on Github (can be either beta or release version)\n* Created `.app` bundle at `~/Applications`\n\n> `Aseprite.app` is pre-created bundle file to wrap soon-to-be-built Aseprite. It contains script to execute an aseprite binary file with default executable path at `~/Applications/Aseprite/aseprite`. Such bundle file is created with macOS's Script Editor application.\n\n# Notes\n\n## for building v1.2.9\n\n* If you previously clone any dependencies, the script will know and will instead try to update it from upstream for you. So you're ensured that it will operate on the most latest __release state__ version of Aseprite.\n* Updated version of Aseprite might break cloned dependencies's build workflow especially error about `CC` or `CXX` environment variables are not set to correct path. If this is a case, it's likely that you re-build on previously compiled source code of dependencies in which `cmake` still keeps the old configurations used in successful compile. To resolve the problem, remove the whole build folder namedly `aseprite` then start it all over again. \n* ~~In case you want to build older version of Aseprite, take a look at [Releases](https://github.com/haxpor/aseprite-macos-buildsh/releases) section then find a corresponding target version of Aseprite you look for.~~ - won't work, will stick to latest version only\n\n# Support Aseprite\n\nAseprite is cool. It is free if you build it by yourself like you did above, or you can purchase it at [official website](https://www.aseprite.org/) to avoid spending effort in manual build process.\n\n# Credits\n\nThis automated build script gathers information from Aseprite's [INSTALL.md](https://github.com/aseprite/aseprite/blob/master/INSTALL.md) on how to build, and sum it up together as automated script you're using here.\n\n# License\n[MIT](https://github.com/haxpor/aseprite-macos-buildsh/blob/master/LICENSE), Wasin Thonkaew\n"
  },
  {
    "path": "aseprite.sh",
    "content": "#!/bin/bash\n#\n# Script to automate building latest release of Aseprite (it can be release or beta build)\n# This is for macOS build version.\n\nPOSTFIXPATH_SDKROOT=Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk\nCCPATH_TOOLCHAIN=Toolchains/XcodeDefault.xctoolchain/usr/bin/cc\nCXXPATH_TOOLCHAIN=Toolchains/XcodeDefault.xctoolchain/usr/bin/c++\nSDK_ROOT=`xcode-select -p`\nTARGET=\"/Applications\"\n\n# temporary value for returned value from function\nTEMP_RET=\"\"\n\n# find value of target param --xxx if there's any, if not then TEMP_RET will still be empty \"\", else it will contain value from finding\n# param 1 - parameter key name\n# param 2 - program list of param, usually is $@\n# return 1 if it found, and TEMP_RET is set, otherwise return 0. TEMP_RET will be always set to \"\" (empty) at the beginning of this function.\nfunction findValueOfParam() {\n\t# set empty to temporary return variable first\n\tTEMP_RET=\"\"\n\n\tcount=$#\n\targv=($@)\n\n\tfor (( i=1; i<count; i++ )); do\n\t\tif [ ${argv[i]} = \"$1\" ]; then\n\t\t\tTEMP_RET=${argv[i+1]}\n\t\t\treturn 0\n\t\tfi\n\tdone\n\n\treturn 1\n}\n\n# check if there's any input parameters\nif [ $(($# % 2)) -ne 0 ]; then\n\techo \"Missing some parameter value\"\n\texit 1\nfi\n\n# set the input argument\nif [ \"$#\" -ne 0 ]; then\n\t# if only one parameter\n\tfindValueOfParam \"--sdk-root\" $@\n\n\tif [ $? -eq 0 ]; then\n\t\t# orvewrite set sdk-root\n\t\tSDK_ROOT=$TEMP_RET\n\n\t\t# set to xcode-select as well\n\t\tsudo xcode-select -s \"$SDK_ROOT\"\n\t\techo \"Set SDK_ROOT to $SDK_ROOT\"\n\tfi\n\t\n\tfindValueOfParam \"--target\" $@\n\tif [ $? -eq 0 ]; then\n\t\t# orvewrite set sdk-root\n\t\tTARGET=$TEMP_RET\n\t\techo \"Set TARGET to $TARGET\"\n\tfi\nfi\n\n# check if aseprite directory exists, so we has no need to clone from repository again\nif [ ! -d aseprite ]; then\n\tgit clone --recursive https://github.com/aseprite/aseprite.git\nfi\n\n# change to aseprite directory\ncd aseprite\n\n# checkout master branch\ngit checkout master\n\n# clear the current dirty state of git repository\ngit reset --hard\ngit clean -fd\n\n# fetch all the update down\ngit fetch --all\ngit pull\ngit submodule update --init --recursive\n\n# compile skia\ncd ..\n# check to create deps directory if not exist\nif [ ! -d deps ]; then\n\tmkdir deps\nfi\ncd deps\n\n# check if depot_tools is already cloned\nif [ ! -d depot_tools ]; then\n\tgit clone https://chromium.googlesource.com/chromium/tools/depot_tools.git\nfi\n\n# check if skia is already cloned\nif [ ! -d skia ]; then\n\tgit clone https://github.com/aseprite/skia.git\nfi\n\n# clear the dirty state of both repositories\ncd depot_tools\ngit reset --hard\ngit clean -fd\ngit fetch --all\ngit pull\n\n# change dir back\ncd ../\n\ncd skia\ngit reset --hard\ngit clean -fd\ngit fetch --all\ngit pull\n\n# change dir back\ncd ../\n\n# continue the operation\nexport PATH=\"${PWD}/depot_tools:${PATH}\"\ncd skia\n\n# get proper skia's branch to compile\nSKIA_BRANCH=$(curl \"https://raw.githubusercontent.com/aseprite/aseprite/master/INSTALL.md\" | grep \"aseprite-m[0-9][0-9]\" | sed -n '1p' | perl -n -e '/(aseprite-m\\d\\d)/ && print $1')\ngit checkout $SKIA_BRANCH\n\npython tools/git-sync-deps\ngn 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\\\"]\"\nninja -C out/Release-x64 skia modules\n\ncd ../../\n\n# compile aseprite\ncd aseprite\n# create build dir (if needed)\nif [ ! -d build ]; then\n\tmkdir build\nfi\ncd build\n\n# prepare environment variables\nexport CC=\"$SDK_ROOT/$CCPATH_TOOLCHAIN\"\nexport CXX=\"$SDK_ROOT/$CXXPATH_TOOLCHAIN\"\n\n# checkout the latest tag (release or beta)\ngit checkout `git describe --tags`\ncmake \\\n  -DCMAKE_BUILD_TYPE=RelWithDebInfo \\\n  -DCMAKE_OSX_ARCHITECTURES=x86_64 \\\n  -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 \\\n  -DCMAKE_OSX_SYSROOT=\"$SDK_ROOT/$POSTFIXPATH_SDKROOT\" \\\n  -DLAF_OS_BACKEND=skia \\\n  -DSKIA_DIR=\"${PWD}/../../deps/skia\" \\\n  -DSKIA_LIBRARY_DIR=\"${PWD}/../../deps/skia/out/Release-x64\" \\\n  -DSKIA_LIBRARY=\"${PWD}/../../deps/skia/out/Release-x64/libskia.a\" \\\n  -G Ninja \\\n  .. && \\\nninja aseprite # when finish, build file will be at aseprite/build/bin\n\n# if everything went fine then do final operations\nif [ $? -eq 0 ]; then\n\t# remove existing Aseprite if installed\n\tif [ -d \"$TARGET/Aseprite\" ]; then\n\t\trm -rf \"$TARGET/Aseprite\"\n\tfi\n\t# move result to default ~/Applications\n\tmv bin \"$TARGET/Aseprite\"\n  # check to create target directory\n  if [ -d \"$TARGET/Aseprite.app\" ]; then\n    # if found then copy all the contents of our template .app instead\n    # this is to avoid risking removing any user' files the app might created\n    echo \"Target Aseprite.app directory found, copying contents of template .app to target location instead\"\n\t  # copy application bundle to result\n\t  cp -Rp ../../Aseprite.app/* \"$TARGET/Aseprite.app/\"\n    echo \"All done\"\n  else\n    # if not, then just copy the whole template .app directory to target\n    echo \"Copying template .app to target location\"\n\t  # copy application bundle to result\n\t  cp -Rp ../../Aseprite.app \"$TARGET/Aseprite.app\"\n    echo \"All done\"\n  fi\nelse\n  echo \"Something went wrong\"\nfi\n"
  }
]