Skip to content

Commit

Permalink
Add new debian binary package for MicroPython (#577)
Browse files Browse the repository at this point in the history
* Add new debian binary package for MicroPython

* depend on micropython-lib

* update changelog
  • Loading branch information
WasabiFan committed Dec 25, 2018
1 parent 89f36c5 commit e859d0e
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 3 deletions.
5 changes: 4 additions & 1 deletion debian/changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python-ev3dev2 (2.0.0~beta3) stable; urgency=medium
python-ev3dev2 (2.0.0~beta3) UNRELEASED; urgency=medium

[Daniel Walton]
* brickpi(3) support use of the Motor class
Expand All @@ -16,6 +16,9 @@ python-ev3dev2 (2.0.0~beta3) stable; urgency=medium
* MoveJoyStick should use SpeedPercent
* renamed GyroSensor rate_and_angle to angle_and_rate

[Kaelin Laundry]
* Added new binary package for Micropython

[Viktor Garske]
* Fixed error when using Motor.is_stalled

Expand Down
11 changes: 10 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Maintainer: ev3dev Python team <python-team@ev3dev.org>
Section: python
Priority: optional
Standards-Version: 3.9.8
Build-Depends: python3-setuptools (>= 0.6b3), python3-all (>= 3.4), debhelper (>= 9), dh-python, python3-pillow
Build-Depends: python3-setuptools (>= 0.6b3), python3-all (>= 3.4), debhelper (>= 9), dh-python, python3-pillow, mpy-cross
VCS-Git: https://github.com/ev3dev/ev3dev-lang-python.git
VCS-Browser: https://github.com/ev3dev/ev3dev-lang-python

Expand All @@ -15,3 +15,12 @@ Description: Python language bindings for ev3dev
devices on hardware that is supported by ev3dev.org - a
minimal Debian distribution optimized for the LEGO
MINDSTORMS EV3.

Package: micropython-ev3dev2
Architecture: all
Depends: ${misc:Depends}, micropython, micropython-lib
Description: Python language bindings for ev3dev for MicroPython
This package is a pure Python binding to the peripheral
devices on hardware that is supported by ev3dev.org - a
minimal Debian distribution optimized for the LEGO
MINDSTORMS EV3. This package is designed to run on MicroPython.
51 changes: 50 additions & 1 deletion debian/rules
Original file line number Diff line number Diff line change
@@ -1,12 +1,61 @@
#!/usr/bin/make -f
#export DH_VERBOSE=1

export PYBUILD_NAME=python3-ev3dev
export PYBUILD_NAME=ev3dev2

VERSION=$(shell dpkg-parsechangelog | sed -rne 's,^Version: (.*),\1,p' | sed 's,~,,')

mpy_files = \
ev3dev2/__init__.mpy \
ev3dev2/_platform/__init__.mpy \
ev3dev2/_platform/brickpi.mpy \
ev3dev2/_platform/brickpi3.mpy \
ev3dev2/_platform/ev3.mpy \
ev3dev2/_platform/evb.mpy \
ev3dev2/_platform/fake.mpy \
ev3dev2/_platform/pistorms.mpy \
ev3dev2/auto.mpy \
ev3dev2/button.mpy \
ev3dev2/control/__init__.mpy \
ev3dev2/control/GyroBalancer.mpy \
ev3dev2/control/rc_tank.mpy \
ev3dev2/control/webserver.mpy \
ev3dev2/display.mpy \
ev3dev2/fonts/__init__.mpy \
ev3dev2/led.mpy \
ev3dev2/motor.mpy \
ev3dev2/port.mpy \
ev3dev2/power.mpy \
ev3dev2/sensor/__init__.mpy \
ev3dev2/sensor/lego.mpy \
ev3dev2/sound.mpy \
ev3dev2/unit.mpy \
ev3dev2/version.mpy \
ev3dev2/wheel.mpy

%:
dh $@ --with python3 --buildsystem=pybuild

%.mpy: %.py
mpy-cross -v -v -mcache-lookup-bc $<

# compile .py > .mpy
override_dh_auto_build: $(mpy_files)
# build python3 package
dh_auto_build

# fail build if any files aren't installed into a package
override_dh_install:
dh_install --fail-missing

override_dh_auto_install:
# install python3 package
dh_auto_install
# install .mpy files for micropython
for d in $(mpy_files); do \
install -D --mode=644 $$d debian/micropython-ev3dev2/usr/lib/micropython/ev3dev2/$${d#*/}; \
done

override_dh_auto_configure:
echo $(VERSION) > RELEASE-VERSION
dh_auto_configure
Expand Down

0 comments on commit e859d0e

Please sign in to comment.