Skip to content

Instantly share code, notes, and snippets.

@suizokukan
Last active October 22, 2022 14:36
Show Gist options
  • Save suizokukan/fa9eb3025e4714277cc2695432021082 to your computer and use it in GitHub Desktop.
Save suizokukan/fa9eb3025e4714277cc2695432021082 to your computer and use it in GitHub Desktop.
Kivy+Buildozer installation (v5) for python3 projects
##############################################################################
# Kivy+Buildozer installation (v11) for python3 projects
##############################################################################
#
# REQUIREMENTS:
#
# - a fresh-installed Ubuntu 18.04.1 LTS, up-to-dated, rebooted.
# - crystax.tar.xz somewhere, e.g. on an USB key (see PATH2CRYSTAX)
# - an internet connection
#
# HOW TO USE:
#
# - copy this script somewhere in ~ : e.g. cp /path/to/thisscript.sh ~/Desktop
# - $ chmod +x thisscript.sh
# - launch it : $ . ./thisscript.sh
# NOT BY $ ./thisscript.sh (https://stackoverflow.com/questions/18547881)
#
##############################################################################
#
# NOTE :
#
# - cython version to download:
# see https://kivy.org/doc/stable/installation/installation-linux.html#cython
#
# - if apt/apt-get returns an error message like "Unable to lock the administration directory" ?
# see https://askubuntu.com/questions/15433/unable-to-lock-the-administration-directory-var-lib-dpkg-is-another-process
# $ sudo rm /var/lib/apt/lists/lock
#
##############################################################################
#
# TODO:
#
# - preventive download of ANDROID sdk, ANDROID ANT, de SDL, SDL_ttf,
# SDL_image, SDL_mixer
#
##############################################################################
# path to crytax
PATH2CRYSTAX="/media/sui/USB DISK/crystax-ndk-10.3.2-linux-x86_64.tar.xz"
echo "=== KIVY+BUILDOZER installation : official instructions ==="
echo "path to Crystax:" $PATH2CRYSTAX
# I) global dependencies
echo "=== I) global dependencies ==="
# I.1) python-s
echo "=== I.1) python-s ==="
sudo apt-get --yes install python-pip
sudo apt-get --yes install python3-pip
# I.2) libraries required by buildozer (1/3)
echo "=== I.2) libraries required by buildozer (1/3) ==="
pip install 'appdirs' 'colorama>=0.3.3' 'sh>=1.10,<1.12.5' 'jinja2' 'six'
# I.3) libraries required by buildozer (2/3)
echo "=== I.3) libraries required by buildozer (2/3) ==="
# see https://buildozer.readthedocs.io/en/latest/installation.html
sudo -H pip install --upgrade cython==0.25.2
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get --yes install build-essential ccache git libncurses5:i386 libstdc++6:i386 libgtk2.0-0:i386 libpangox-1.0-0:i386 libpangoxft-1.0-0:i386 libidn11:i386 python2.7 python2.7-dev openjdk-8-jdk unzip zlib1g-dev zlib1g:i386
# I.3) libraries required by buildozer (3/3)
echo "=== I.2) libraries required by buildozer (3/3) ==="
sudo apt-get --yes install pkg-config autoconf automake libtool
# II) install kivy : https://kivy.org/doc/stable/installation/installation-linux.htm
echo "=== II) install kivy ==="
# II.1) stable builds:
echo "=== II.1) stable builds ==="
sudo add-apt-repository --yes ppa:kivy-team/kivy
# II.2) Update your package list using your package manager
echo "=== II.2) Update your package list using your package manager ==="
sudo apt-get update
# II.3) Install Kivy
echo "=== II.3) Install Kivy ==="
sudo apt-get --yes install python3-kivy
# III) install buildozer: https://github.com/kivy/buildozer
echo "=== III) install Buildozer ==="
# DO NOT USE:
#sudo -H pip install buildozer
#sudo -H pip install --upgrade buildozer
#
# WORKAROUND TO USE A SPECIFIC VERSION:
# see https://github.com/kivy/buildozer/issues/604
#rm -rf buildozer/
#git clone https://github.com/kivy/buildozer --branch=master
#cd buildozer/
#git checkout tags/v0.33
#python setup.py build
#sudo -H pip install -e .
sudo -H pip install https://github.com/kivy/buildozer/archive/master.zip
buildozer --version
# IV) Installing Buildozer with target Python 3 (CrystaX):
echo "=== IV) Installing Buildozer with target Python 3 (CrystaX) ==="
tar xf "$PATH2CRYSTAX" -C ~/Desktop
echo "=== END OF THE SCRIPT ==="
@danielnjama
Copy link

A big thank you. worked for me when I almost gave up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment