Skip to content
This repository has been archived by the owner on Sep 1, 2021. It is now read-only.

Commit

Permalink
Merge branch 'release/v20190217'
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreMiras committed Feb 17, 2019
2 parents a7d9e6d + 89f95c4 commit 24bc426
Show file tree
Hide file tree
Showing 77 changed files with 1,097 additions and 3,438 deletions.
19 changes: 15 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,22 @@ services:
- docker

env:
- TAG=etheroll-linux DOCKERFILE=dockerfiles/Dockerfile-linux COMMAND='make test'
- TAG=etheroll-android DOCKERFILE=dockerfiles/Dockerfile-android COMMAND='buildozer android debug'
global:
- DISPLAY=:99.0
matrix:
- TAG=etheroll-linux DOCKERFILE=dockerfiles/Dockerfile-linux COMMAND='make test'
- TAG=etheroll-linux DOCKERFILE=dockerfiles/Dockerfile-linux COMMAND='make uitest'
- TAG=etheroll-android DOCKERFILE=dockerfiles/Dockerfile-android COMMAND='buildozer android debug'

before_install:
- sudo apt update -qq > /dev/null
- sudo apt install --yes --no-install-recommends xvfb

install:
- docker build --tag=$TAG --file=$DOCKERFILE .
- docker build --tag=$TAG --file=$DOCKERFILE --build-arg TRAVIS .

before_script:
- sh -e /etc/init.d/xvfb start

script:
- travis_wait docker run $TAG $COMMAND
- travis_wait docker run -e DISPLAY=unix$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix $TAG $COMMAND
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Build Status](https://secure.travis-ci.org/AndreMiras/EtherollApp.png?branch=develop)](http://travis-ci.org/AndreMiras/EtherollApp)

<a href="https://github.com/AndreMiras/EtherollApp/releases/download/v20181028/etheroll-2018.1028-debug.apk"><img src="https://www.scottishchildrenslottery.com/export/system/modules/com.assense.gaming.stv.template/resources/images/google-play-store.svg" width="200"></a>
<a href="https://github.com/AndreMiras/EtherollApp/releases/download/v20181028/etheroll-2019.0217-debug.apk"><img src="https://www.scottishchildrenslottery.com/export/system/modules/com.assense.gaming.stv.template/resources/images/google-play-store.svg" width="200"></a>

Provably fair dice game running on the [Ethereum blockchain](https://etheroll.com/#/smart-contract).
Built with Python, [Kivy](https://github.com/kivy/kivy) and love.
Expand Down
1 change: 0 additions & 1 deletion blacklist.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
lib-dynload/_csv.so
distutils/*
xml/*
pdb.{doc,pyo}
profile.{doc,pyo}
Expand Down
117 changes: 50 additions & 67 deletions buildozer.spec
Original file line number Diff line number Diff line change
Expand Up @@ -38,69 +38,46 @@ version.filename = %(source.dir)s/version.py
# (list) Application requirements
# comma seperated e.g. requirements = sqlite3,kivy
requirements =
hostpython3crystax==3.6,
python3crystax==3.6,
setuptools,
kivy==1.10.1,
plyer==1.3.1,
oscpy==0.3.0,
sqlite3,
android,
gevent,
attrdict==2.0.0,
certifi==2018.10.15,
cffi,
https://github.com/AndreMiras/KivyMD/archive/9b2206a.tar.gz,
openssl,
pyelliptic==1.5.7,
asn1crypto==0.24.0,
coincurve==7.1.0,
bitcoin==1.1.42,
devp2p==0.9.3,
pycryptodome==3.4.6,
pbkdf2==1.3,
py-ecc==1.4.2,
pysha3==1.0.2,
pyyaml==3.12,
scrypt==0.8.6,
ethereum==2.1.1,
ptyprocess==0.5.2,
pexpect==4.4.0,
Pygments==2.2.0,
decorator==4.2.1,
ipython-genutils==0.2.0,
traitlets==4.3.2,
ipython==5.5.0,
click==6.7,
pickleshare==0.7.4,
simplegeneric==0.8.1,
wcwidth==0.1.7,
prompt-toolkit==1.0.15,
https://github.com/ethereum/pyethapp/archive/8406f32.zip,
idna==2.6,
typing==3.6.4,
eth-keys==0.2.0b3,
chardet==3.0.4,
cytoolz==0.9.0,
eth-abi==1.2.2,
eth-account==0.3.0,
eth-hash==0.2.0,
eth-keyfile==0.5.1,
rlp==0.6.0,
eth-keys==0.2.0b3,
eth-rlp==0.1.2,
attrdict==2.0.0,
eth-account==0.2.2,
eth-typing==2.0.0,
eth-utils==1.2.1,
gevent,
hexbytes==0.1.0,
https://github.com/AndreMiras/garden.layoutmargin/archive/20180517.tar.gz,
https://github.com/AndreMiras/KivyMD/archive/69f3e88.tar.gz,
https://github.com/AndreMiras/pyetheroll/archive/884805b.tar.gz,
https://github.com/corpetty/py-etherscan-api/archive/cb91fb3.tar.gz,
idna==2.7,
kivy==90c86f8,
lru-dict==1.1.5,
web3==4.0.0b11,
certifi==2018.1.18,
chardet==3.0.4,
urllib3==1.22,
requests==2.18.4,
https://github.com/corpetty/py-etherscan-api/archive/cb91fb3.zip,
eth-testrpc==1.3.3,
eth-hash==0.1.1,
pyethash==0.1.27,
cytoolz==0.9.0,
toolz==0.9.0,
eth-abi==1.0.0,
eth-utils==1.0.1,
raven==6.6.0,
openssl,
oscpy==0.3.0,
parsimonious==0.8.1,
plyer==1.3.1,
pycryptodome==3.4.6,
Pygments==2.2.0,
python3==3.7.1,
qrcode==6.0,
raven==6.9.0,
requests==2.20.0,
requests-cache==0.4.13,
qrcode,
https://github.com/AndreMiras/garden.layoutmargin/archive/20180517.zip
rlp==1.0.3,
setuptools,
toolz==0.9.0,
urllib3==1.24.1,
web3==4.8.1
# (str) Custom source folders for requirements
# Sets custom source for any requirements with recipes
Expand Down Expand Up @@ -153,28 +130,28 @@ fullscreen = 0
#android.presplash_color = #FFFFFF
# (list) Permissions
#android.permissions = INTERNET
android.permissions = INTERNET
android.permissions = INTERNET,WRITE_EXTERNAL_STORAGE
# (int) Android API to use
#android.api = 19
# (int) Target Android API, should be as high as possible.
android.api = 27
# (int) Minimum API required
#android.minapi = 9
# (int) Minimum API your APK will support.
android.minapi = 21
# (int) Android SDK version to use
#android.sdk = 20
android.sdk = 20
# (str) Android NDK version to use
#android.ndk = 9c
# android.ndk = 10
android.ndk = 17c
# (int) Android NDK API to use. This is the minimum API your app will support, it should usually match android.minapi.
android.ndk_api = 21
# (bool) Use --private data storage (True) or --dir public storage (False)
#android.private_storage = True
# (str) Android NDK directory (if empty, it will be automatically downloaded.)
#android.ndk_path =
android.ndk_path = ~/.buildozer/crystax-ndk
# (str) Android SDK directory (if empty, it will be automatically downloaded.)
#android.sdk_path =
Expand All @@ -187,6 +164,12 @@ android.ndk_path = ~/.buildozer/crystax-ndk
# when an update is due and you just want to test/build your package
# android.skip_update = False
# (bool) If True, then automatically accept SDK license
# agreements. This is intended for automation only. If set to False,
# the default, you will be shown the license when first running
# buildozer.
android.accept_sdk_license = True
# (str) Android entry point, default is ok for Kivy-based app
#android.entrypoint = org.renpy.android.PythonActivity
Expand Down Expand Up @@ -221,7 +204,7 @@ android.blacklist_src = blacklist.txt
# (str) python-for-android branch to use, defaults to master
#p4a.branch = stable
p4a.branch = master
p4a.branch = 0.7.0
# (str) OUYA Console category. Should be one of GAME or APP
# If you leave this blank, OUYA support will not be enabled
Expand Down
26 changes: 7 additions & 19 deletions dockerfiles/Dockerfile-android
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,14 @@
# docker run -it --rm etheroll-android
FROM ubuntu:18.04

ARG TRAVIS=false
ENV USER="user"
ENV HOME_DIR="/home/${USER}"
ENV WORK_DIR="${HOME_DIR}" \
PATH="${HOME_DIR}/.local/bin:${PATH}"
ENV DOCKERFILES_VERSION="master" \
DOCKERFILES_URL="https://raw.githubusercontent.com/AndreMiras/dockerfiles"
ENV MAKEFILES_URL="${DOCKERFILES_URL}/${DOCKERFILES_VERSION}/buildozer_android_new"
# currently needed because buildozer still uses `tools/android` binary
# even though we have the new `tools/bin/sdkmanager` available
ENV USE_SDK_WRAPPER=true


# configure locale
Expand All @@ -30,15 +28,15 @@ ENV LANG="en_US.UTF-8" \
LC_ALL="en_US.UTF-8"

# install system dependencies (required to setup all the tools)
RUN apt update -qq > /dev/null && apt install -qq --yes --no-install-recommends \
RUN apt install -qq --yes --no-install-recommends \
make curl ca-certificates xz-utils unzip openjdk-8-jdk sudo python-pip \
python-setuptools

# install build dependencies (required to successfully build the project)
# TODO: should this go to a Makefile instead so it can be shared/reused?
RUN apt install -qq --yes --no-install-recommends \
python3.6 libpython3.6-dev python3-setuptools \
autoconf automake libtool libltdl-dev libffi-dev bsdtar
autoconf automake libtool libltdl-dev libffi-dev bsdtar zip

# prepare non root env
RUN useradd --create-home --shell /bin/bash ${USER}
Expand All @@ -49,23 +47,13 @@ RUN echo "%sudo ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
USER ${USER}
WORKDIR ${WORK_DIR}

# downloads and installs CrystaX NDK
RUN curl --location --progress-bar ${MAKEFILES_URL}/crystax_ndk.mk --output crystax_ndk.mk
# using `bsdtar` since `tar` is failing extracting it on Travis
RUN make -f crystax_ndk.mk TAR=`which bsdtar`

# downloads and installs Android SDK
RUN curl --location --progress-bar ${MAKEFILES_URL}/android_sdk.mk --output android_sdk.mk
RUN make -f android_sdk.mk

# install buildozer and dependencies
RUN curl --location --progress-bar ${MAKEFILES_URL}/buildozer.mk --output buildozer.mk
RUN make -f buildozer.mk

# links SDK and NDK to where buildozer is expecting to see them
RUN mkdir -p ${HOME}/.buildozer/android/platform
RUN ln -sfn ${HOME}/.android ${HOME}/.buildozer/android/platform/android-sdk-20
RUN ln -sfn ${HOME}/.android/crystax-ndk ${HOME}/.buildozer/
# enforces buildozer master (afebba5) until next release
RUN pip install --upgrade https://github.com/kivy/buildozer/archive/afebba5.zip

COPY . ${WORK_DIR}
# limits the amount of logs for Travis
RUN if [ "${TRAVIS}" = "true" ]; then sed 's/log_level = [0-9]/log_level = 1/' -i buildozer.spec; fi
ENTRYPOINT ["./dockerfiles/start.sh"]
24 changes: 20 additions & 4 deletions dockerfiles/Dockerfile-linux
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@
# docker run etheroll-linux 'make test'
# Or for interactive shell:
# docker run -it --rm etheroll-linux
# For running UI:
# xhost +"local:docker@"
# docker run -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix etheroll-linux 'make uitest'
# TODO:
# - delete archives to keep small the container small
# - setup caching (for apt, and pip)
FROM ubuntu:18.04

ENV USER="user"
ENV HOME_DIR="/home/${USER}"
ENV WORK_DIR="${HOME_DIR}"

# configure locale
RUN apt update -qq > /dev/null && apt install --yes --no-install-recommends \
locales && \
Expand All @@ -30,7 +36,17 @@ RUN apt update -qq > /dev/null && apt install --yes --no-install-recommends \
RUN apt install --yes --no-install-recommends \
libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev

WORKDIR /app
COPY . /app
RUN make system_dependencies
# prepare non root env
RUN useradd --create-home --shell /bin/bash ${USER}
# with sudo access and no password
RUN usermod -append --groups sudo ${USER}
RUN echo "%sudo ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers

USER ${USER}
WORKDIR ${WORK_DIR}
COPY . ${WORK_DIR}

RUN sudo make system_dependencies
# required by Kivy `App.user_data_dir`
RUN mkdir ~/.config
ENTRYPOINT ["./dockerfiles/start.sh"]
6 changes: 6 additions & 0 deletions docs/Troubleshoot.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ if not is_gradle_build:
```


Uninstaling the app using adb:
```
buildozer android adb -- uninstall com.github.andremiras.etheroll
```



## Kivy

Expand Down
30 changes: 12 additions & 18 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
web3==4.0.0b11
eth-testrpc==1.3.3
https://github.com/corpetty/py-etherscan-api/archive/cb91fb3.zip#egg=py-etherscan-api
eth-utils==1.2.1
flake8
future
https://github.com/AndreMiras/garden.layoutmargin/archive/20180517.tar.gz#egg=layoutmargin
https://github.com/AndreMiras/KivyMD/archive/69f3e88.tar.gz#egg=kivymd
https://github.com/AndreMiras/pyetheroll/archive/884805b.tar.gz#egg=pyetheroll
https://github.com/corpetty/py-etherscan-api/archive/cb91fb3.tar.gz#egg=py-etherscan-api
isort
Kivy==1.10.1
https://github.com/AndreMiras/KivyMD/archive/9b2206a.tar.gz#egg=kivymd
ethereum==2.1.1
# 2017/10/30 develop
https://github.com/ethereum/pyethapp/archive/8406f32.zip#egg=pyethapp
raven==6.6.0
requests-cache
kivy==1.10.1
kivyunittest==0.1.8
qrcode==5.3
eth-rlp==0.1.2
rlp==0.6.0
# compatible with libcrypto.so.1.1
# https://github.com/golemfactory/golem-messages/pull/112/files
https://github.com/mfranciszkiewicz/pyelliptic/archive/1.5.10.tar.gz#egg=pyelliptic
https://github.com/AndreMiras/garden.layoutmargin/archive/20180517.zip#egg=layoutmargin
plyer==1.3.1
oscpy==0.3.0
plyer==1.3.1
qrcode==6.0
raven==6.9.0
requests-cache
web3==4.8.1
Loading

0 comments on commit 24bc426

Please sign in to comment.