Wednesday, July 24, 2019

How to install OpenToonz and Synfig on a Chromebook

Backstory

I've wanted to dabble in digital art for some time now, and I finally got up the motivation to play around with it a bit on my dinosaur laptop. My 8 year old was showing some interest in drawing, and I thought she might have fun doing animation, so I started looking around for animation software. I found several programs, including opentoonz, synfig, and pencil2d. While she was immediately fascinated (and almost just a quickly lost interest), I was annoyed by how difficult it was to try to draw anything with a mouse.

Not long ago we had replaced my wife's aging Lenovo Twist with a Lenovo C330 Chromebook. For under $250 it was quite adequate for her needs. Being that it was a touch screen device, I thought it might be better suited for digital art, so I began looking into whether the programs I'd installed in Ubuntu could be used on it. There wasn't a Chromebook version, per se (boo), but it turns out that Chromebooks can now run Linux apps (yay!), but only if they have a version for ARM processors (boo).  "Welp," I thought, "guess I'll just have to see about building from source." How hard could that be, right?

For any non-techies who just want this to work, don't be scared. It's actually pretty straight forward...



First off, Linux support isn't installed by default, it needs to be enabled in the "Settings" menu:


My wife's Chromebook only has 32gb of flash storage, and with the existing overhead, I had about 14-17gb of free space to work with.  I found the opentoonz instructions for building from source, overcame a weird wrinkle with automake while building the tiff library (mitigated by the red step below), and just when things were looking good, make crashed about 60% of the way in.  The error message pointed to an issue with the Qt library dependency.

The Linux distro included with Chrome OS is Debian 9 (stretch), which includes Qt 5.7.  Opentoonz, however, needs Qt 5.11 or newer.  I wasted more time than I'd like to admit trying to build it from scratch (I nearly succeeded until the hard drive ran out of space... derp).  Then I fiddled around with downloading deb packages from debian.org and installing them one by one. After a few of this it occurred to me that I could probably just install the repo and use apt to do all the downloading and installing. I'm embarrassed that it took me so long to get my eureka moment. 

Once I overcame the lack of the add-apt-repository tool (by installing it), I decided to just upgrade the whole distro and proceed with the opentoonz instructions as written. I still had to fix the wonky tiff library config file, but otherwise it was smooth sailing.  I quickly looked up how to create desktop icons in Chrome OS for Linux apps, and now I have OpenToonz, Synfig, and Pencil2d sitting on my shelf... on the much nicer Dell Inspiron 14 Chromebook I bought for myself =P.

These are the images I found for my icons:



Procedure

  • Upgrade Chrome OS to version 69+ [documentation]
  • Turn on Linux (Beta)
  • Upgrade Linux to Debian 10 (Buster)
    • sudo apt-get install software-properties-common (to get add-apt-repository)
    • sudo add-apt-repository -s "http://deb.debian.org/debian buster main contrib non-free"
    • sudo apt update
    • sudo apt upgrade
  • Build opentoonz from source [documentation]
    • sudo apt-get install build-essential git cmake pkg-config libboost-all-dev qt5-default qtbase5-dev libqt5svg5-dev qtscript5-dev qttools5-dev qttools5-dev-tools libqt5opengl5-dev qtmultimedia5-dev libsuperlu-dev liblz4-dev libusb-1.0-0-dev liblzo2-dev libpng-dev libjpeg-dev libglew-dev freeglut3-dev libsdl2-dev libfreetype6-dev libjson-c-dev qtwayland5
    • sudo apt-get install libmypaint-dev
    • git clone https://github.com/opentoonz/opentoonz
    • mkdir -p $HOME/.config/OpenToonz
    • cp -r opentoonz/stuff $HOME/.config/OpenToonz/
    • cat << EOF > $HOME/.config/OpenToonz/SystemVar.ini
      [General]
      OPENTOONZROOT="$HOME/.config/OpenToonz/stuff"
      OpenToonzPROFILES="$HOME/.config/OpenToonz/stuff/profiles"
      TOONZCACHEROOT="$HOME/.config/OpenToonz/stuff/cache"
      TOONZCONFIG="$HOME/.config/OpenToonz/stuff/config"
      TOONZFXPRESETS="$HOME/.config/OpenToonz/stuff/projects/fxs"
      TOONZLIBRARY="$HOME/.config/OpenToonz/stuff/projects/library"
      TOONZPROFILES="$HOME/.config/OpenToonz/stuff/profiles"
      TOONZPROJECTS="$HOME/.config/OpenToonz/stuff/projects"
      TOONZROOT="$HOME/.config/OpenToonz/stuff"
      TOONZSTUDIOPALETTE="$HOME/.config/OpenToonz/stuff/studiopalette"
      EOF 
    • cd opentoonz/thirdparty/tiff-4.0.3
    • sed -i 's|$ac_aux_dir/config.guess|/usr/share/automake-1.16/config.guess|' configure
    • ./configure --with-pic --disable-jbig
    • make -j$(nproc)
    • cd ../../
    • cd toonz
    • mkdir build
    • cd build
    • cmake ../sources
    • make -j$(nproc)
    • sudo make install
    • [Optional] cd ~ ; rm -rf opentoonz
  • Build Synfig from source [documentation]
    • git clone https://github.com/synfig/synfig.git ~/synfig.git
    • cd ~/synfig.git
    • ./1-setup-linux-native.sh
    • ./2-build-production.sh
  • Make desktop icons [inspiration]
    • mkdir -p ~/.local/share/applications
    • cat << EOF > $HOME/.local/share/applications/opentoonz.desktop
      [Desktop Entry]
      Name=OpenToonz
      Comment=2D animations
      GenericName=Animation
      X-GNOME-FullName=OpenToonz
      Exec=/opt/opentoonz/bin/opentoonz
      Terminal=false
      Type=Application
      Categories=Graphics;
      Icon=$HOME/.local/share/applications/opentoonz.png
      EOF 
    • cat << EOF > $HOME/.local/share/applications/synfig.desktop
      [Desktop Entry]
      Name=Synfig
      Comment=2D animations
      GenericName=Animation
      X-GNOME-FullName=Synfig
      Exec=$HOME/synfig.git/_production/build/bin/synfigstudio
      Terminal=false
      Type=Application
      Categories=Graphics;
      Icon=$HOME/.local/share/applications/synfig.png
      EOF
    • wget -O $HOME/.local/share/applications/opentoonz.png https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilAppbTr9uMWvwYWd8CDwJFnPg04IzmdserZzl6SKR2_PFOlkaFst5cvwyZrot90ELYIpRU6I02mvV7bz4BbDe0LVprVWwnocYQvWcp2yS4Cgn97oQfIbtTbUfmrSJoC80Yc9cd4mUmXg/s200/opentoonz.png
    • wget -O $HOME/.local/share/applications/synfig.png https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKS6CJoRl4m26uHflNy8dpnyTpQr4ELcY7eHOqQYH7-NQh9xYPamDYY9H3X263HsCujoJLWdwh0rogGH_mKY_z8COTuhb3Nw2fAvIA-zZy-IYlt8es6ZZDSCHFyqHGUvw3uujARmq4kpI/s200/synfig.png
  • BONUS Install pencil2d
    • sudo apt install pencil2d





5 comments:

  1. uh, i did all the things for opentoonz.. but i cant find it anywhere

    ReplyDelete
  2. how do i open opentoonz from terminal? im on a chromebook so yeah

    ReplyDelete
    Replies
    1. Sadly I wiped the linux virtual machine in the processes of getting Star Stable Online to work on the chromebook, and I never bothered to reinstall opentoonz because... squirrel...

      Delete