latest fixes, got buildozer working. woot woot

This commit is contained in:
Mathieu Virbel 2017-05-13 15:02:30 +02:00
parent 70995b1989
commit 129570c0fe
7 changed files with 71 additions and 21 deletions

View file

@ -1 +1,2 @@
packer_cache packer_cache
output-from-netboot-iso

View file

@ -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/) - [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 - trigger a build on travis, torrent creation and gdrive upload when buildozer is released
- https://www.packer.io/docs/builders/virtualbox-ovf.html

View file

@ -12,10 +12,10 @@ d-i netcfg/wireless_wep string
### Mirror ### Mirror
d-i mirror/country string manual d-i mirror/country string manual
# d-i mirror/http/hostname string fr.archive.ubuntu.com d-i mirror/http/hostname string fr.archive.ubuntu.com
# d-i mirror/http/directory string /ubuntu d-i mirror/http/directory string /ubuntu
d-i mirror/http/hostname string 192.168.1.16:3142 # 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/directory string /fr.archive.ubuntu.com/ubuntu
d-i mirror/http/proxy string d-i mirror/http/proxy string
### Time ### Time

View file

@ -5,3 +5,11 @@ body {
pre { pre {
padding: 20px; padding: 20px;
} }
.warning {
background-color: #fff5f6;
border-left: 2px solid #c0392b;
padding: 20px;
margin-bottom: 2.5rem;
padding-bottom: 1px;
}

View file

@ -21,31 +21,66 @@
<h2>How to use the VM</h2> <h2>How to use the VM</h2>
<p> <p>
Buildozer has been used to build a project and should be functionnal Buildozer is ready to be used. You'll need internet connection for
for yours. It is preferrable to add a Shared Folder and build from there. download the Android SDK/NDK (automatically done), and during the first
compilation.
<br/>
It is preferrable to add a <a href="#sharefolder">share a folder
</a> between your host and the VM, then build from there.<br/>
By the time we shipped the VM and you using it, you may need to By the time we shipped the VM and you using it, you may need to
<a href="#update-buildozer">update buildozer</a>. <a href="#update-buildozer">update buildozer</a>.
</p> </p>
<p> <p>
Go into your project directory, then: <b>Don't try to use latest Android SDK or NDK</b>. The defaults from buildozer
<pre># Just build your application works: Android SDK 20, Android NDK 9c. Recent Android SDK doesn't work
buildozer android_new debug 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.
# Build your application, deploy on the phone,
# run it, and display the logs from the phone
buildozer android_new debug deploy run logcat</pre>
</p> </p>
<p class="warning"> <ol>
<li>First time only, in your project directory: <code>buildozer init</code></li>
<li>Adjust the <code>buildozer.spec</code>:
<pre>[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
</pre></li>
<li>Build your application: <code>buildozer android_new debug</code></li>
<li>Build and deploy, run and get the logs: <code>buildozer android_new debug deploy run logcat</code></li>
</ol>
<h2 id="sharefolder">Share a folder</h2>
<p>
Virtualbox allows you to share a folder between your computer and the
VM. To do, just:
<ol>
<li>Go into Devices &lt; Shared Folders &lt; Shared Folders Settings</li>
<li>Add a new folder, select the automount option</li>
<li>Reboot the VM (that's easier)</li>
<li>You'll find your new directory at <code>/media/sf_directoryname</code></li>
</ol>
</p>
<div class="warning">
Virtualbox doesn't support symlink in Shared Folder anymore. So buildozer Virtualbox doesn't support symlink in Shared Folder anymore. So buildozer
will fail during the build.<br/> will fail during the build.<br/>
We already created a <code>/build</code> directory where you can put your We already created a <code>/build</code> directory where you can put your
build in it. Edit your <code>buildozer.ini</code>: build in it. Edit your <code>buildozer.ini</code>:
<pre>[buildozer] <pre>[buildozer]
build_dir = /build/buildozer-myapp</pre> build_dir = /build/buildozer-myapp</pre>
</p> </div>
<a name="update-buildozer"></a> <h2 id="update-buildozer">Update buildozer</h2>
<h2>Update buildozer</h2>
<p> <p>
The buildozer version you have may be outdated, as well as the dependencies. The buildozer version you have may be outdated, as well as the dependencies.
The best is to regulary update buildozer: The best is to regulary update buildozer:

View file

@ -1,10 +1,13 @@
#!/bin/bash -eux #!/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 wget http://bootstrap.pypa.io/get-pip.py
python get-pip.py python get-pip.py
rm 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 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 pip install cython buildozer python-for-android

View file

@ -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/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/xfwm4.xml
sed -i "s:Greybird:Adwaita:g" /etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/xfce4-notifyd.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 sed -i "s:elementary-xfce-dark:elementary-xfce-darkest:g" /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml
# add desktop icon # add desktop icon
wget $PACKER_HTTP_ADDR/buildozer.desktop wget $PACKER_HTTP_ADDR/buildozer.desktop
mkdir -p /home/kivy/Desktop mkdir -p /home/kivy/Desktop
cp buildozer.desktop /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/ 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 # copy welcome directory
mkdir -p /usr/share/applications/buildozer-welcome mkdir -p /usr/share/applications/buildozer-welcome