diff --git a/buildozer/tools/packer/.gitignore b/buildozer/tools/packer/.gitignore index e893b4d..738caae 100644 --- a/buildozer/tools/packer/.gitignore +++ b/buildozer/tools/packer/.gitignore @@ -1 +1,2 @@ packer_cache +output-from-netboot-iso diff --git a/buildozer/tools/packer/README.md b/buildozer/tools/packer/README.md index 462aec5..37d6574 100644 --- a/buildozer/tools/packer/README.md +++ b/buildozer/tools/packer/README.md @@ -18,3 +18,4 @@ You want to edit `http/preseed.cfg` and `template.json` before building an image - [compact the image](https://crysol.github.io/recipe/2013-10-15/virtualbox-compact-vmdk-images/) - trigger a build on travis, torrent creation and gdrive upload when buildozer is released + - https://www.packer.io/docs/builders/virtualbox-ovf.html diff --git a/buildozer/tools/packer/http/preseed.cfg b/buildozer/tools/packer/http/preseed.cfg index 423c81f..0ad12aa 100644 --- a/buildozer/tools/packer/http/preseed.cfg +++ b/buildozer/tools/packer/http/preseed.cfg @@ -12,10 +12,10 @@ d-i netcfg/wireless_wep string ### Mirror d-i mirror/country string manual -# d-i mirror/http/hostname string fr.archive.ubuntu.com -# d-i mirror/http/directory string /ubuntu -d-i mirror/http/hostname string 192.168.1.16:3142 -d-i mirror/http/directory string /fr.archive.ubuntu.com/ubuntu +d-i mirror/http/hostname string fr.archive.ubuntu.com +d-i mirror/http/directory string /ubuntu +# d-i mirror/http/hostname string 192.168.1.16:3142 +# d-i mirror/http/directory string /fr.archive.ubuntu.com/ubuntu d-i mirror/http/proxy string ### Time diff --git a/buildozer/tools/packer/http/welcome/buildozer.css b/buildozer/tools/packer/http/welcome/buildozer.css index 6871cd2..0cd7a9f 100644 --- a/buildozer/tools/packer/http/welcome/buildozer.css +++ b/buildozer/tools/packer/http/welcome/buildozer.css @@ -5,3 +5,11 @@ body { pre { padding: 20px; } + +.warning { + background-color: #fff5f6; + border-left: 2px solid #c0392b; + padding: 20px; + margin-bottom: 2.5rem; + padding-bottom: 1px; +} diff --git a/buildozer/tools/packer/http/welcome/index.html b/buildozer/tools/packer/http/welcome/index.html index 95ed6e3..34eeab3 100644 --- a/buildozer/tools/packer/http/welcome/index.html +++ b/buildozer/tools/packer/http/welcome/index.html @@ -21,31 +21,66 @@

How to use the VM

- Buildozer has been used to build a project and should be functionnal - for yours. It is preferrable to add a Shared Folder and build from there. + Buildozer is ready to be used. You'll need internet connection for + download the Android SDK/NDK (automatically done), and during the first + compilation. +
+ It is preferrable to add a share a folder + between your host and the VM, then build from there.
+ By the time we shipped the VM and you using it, you may need to update buildozer.

- Go into your project directory, then: -

# Just build your application
-buildozer android_new debug
-
-# Build your application, deploy on the phone,
-# run it, and display the logs from the phone
-buildozer android_new debug deploy run logcat
+ Don't try to use latest Android SDK or NDK. The defaults from buildozer + works: Android SDK 20, Android NDK 9c. Recent Android SDK doesn't work + the same as before (no more android command), and python-for-android + project have issues with it. As for NDK, you can use r13c, it works too.

-

+

    +
  1. First time only, in your project directory: buildozer init
  2. +
  3. Adjust the buildozer.spec: +
    [buildozer]
    +# change the name of your app
    +package.name = myapp
    +
    +# change the domain of your package
    +package.domain = com.mydomain
    +
    +# specify hostpython2 manually. If you want to use python 3, check buildozer
    +# README about it, the VM is not preinstalled for that.
    +requirements = hostpython2,kivy
    +
    +[buildozer]
    +# update the build directory (issue with virtualbox shared folder and symlink)
    +build_dir = /build/myapp
    +
  4. +
  5. Build your application: buildozer android_new debug
  6. +
  7. Build and deploy, run and get the logs: buildozer android_new debug deploy run logcat
  8. +
+ +

Share a folder

+

+ Virtualbox allows you to share a folder between your computer and the + VM. To do, just: +

    +
  1. Go into Devices < Shared Folders < Shared Folders Settings
  2. +
  3. Add a new folder, select the automount option
  4. +
  5. Reboot the VM (that's easier)
  6. +
  7. You'll find your new directory at /media/sf_directoryname
  8. +
+

+ +
Virtualbox doesn't support symlink in Shared Folder anymore. So buildozer will fail during the build.
We already created a /build directory where you can put your build in it. Edit your buildozer.ini:
[buildozer]
 build_dir = /build/buildozer-myapp
-

+
- -

Update buildozer

+

Update buildozer

The buildozer version you have may be outdated, as well as the dependencies. The best is to regulary update buildozer: diff --git a/buildozer/tools/packer/scripts/additional-packages.sh b/buildozer/tools/packer/scripts/additional-packages.sh index f8ee816..b97ebe8 100644 --- a/buildozer/tools/packer/scripts/additional-packages.sh +++ b/buildozer/tools/packer/scripts/additional-packages.sh @@ -1,10 +1,13 @@ #!/bin/bash -eux +# Don't use openjdk-9, the conf directory is missing, and we get +# an error when using the android sdk: +# "Can't read cryptographic policy directory: unlimited" wget http://bootstrap.pypa.io/get-pip.py python get-pip.py rm get-pip.py -apt-get -y install lib32z1 lib32ncurses5 +apt-get -y install lib32stdc++6 lib32z1 lib32ncurses5 apt-get -y install build-essential -apt-get -y install git openjdk-9-jdk --no-install-recommends zlib1g-dev +apt-get -y install git openjdk-8-jdk --no-install-recommends zlib1g-dev pip install cython buildozer python-for-android diff --git a/buildozer/tools/packer/scripts/setup.sh b/buildozer/tools/packer/scripts/setup.sh index 701f09d..2338387 100644 --- a/buildozer/tools/packer/scripts/setup.sh +++ b/buildozer/tools/packer/scripts/setup.sh @@ -38,15 +38,17 @@ sed -i "s:Greybird:Adwaita:g" /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xsetting sed -i "s:Greybird:Adwaita:g" /etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml sed -i "s:Greybird:Adwaita:g" /etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml sed -i "s:Greybird:Adwaita:g" /etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/xfce4-notifyd.xml +sed -i "s:elementary-xfce-darker:elementary-xfce-darkest:g" /etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml sed -i "s:elementary-xfce-dark:elementary-xfce-darkest:g" /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml # add desktop icon wget $PACKER_HTTP_ADDR/buildozer.desktop mkdir -p /home/kivy/Desktop cp buildozer.desktop /home/kivy/Desktop/ -chown kivy.kivy /home/kivy/Desktop +chown kivy.kivy -R /home/kivy/Desktop +chmod +x /home/kivy/Desktop/buildozer.desktop mv buildozer.desktop /usr/share/applications/ -sed -i "s:^favorites=.*$:favorites=buildozer.desktop,exo-terminal-emulator.desktop,exo-web-browser.desktop,exo-file-manager.desktop,org.gnome.Software.desktop,xfhelp4.desktop:g" /etc/xdg/xdg-xubuntu/xfce4/whiskermenu/defaults.rc +sed -i "s:^favorites=.*$:favorites=buildozer.desktop,exo-terminal-emulator.desktop,exo-web-browser.desktop,xfce-keyboard-settings.desktop,exo-file-manager.desktop,org.gnome.Software.desktop,xfhelp4.desktop:g" /etc/xdg/xdg-xubuntu/xfce4/whiskermenu/defaults.rc # copy welcome directory mkdir -p /usr/share/applications/buildozer-welcome