Skip to content

Commit

Permalink
adds Raspberry PI Raspian build setup
Browse files Browse the repository at this point in the history
  • Loading branch information
myTonino committed Nov 10, 2016
1 parent ec12710 commit bcb0e7c
Show file tree
Hide file tree
Showing 28 changed files with 651 additions and 361 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Tonino Resources

Version History
---------------
- v1.0.19 Adds Raspian build
- v1.0.18 Updated calibration recognition
- v1.0.17 Bug fixes
- v1.0.16 Bug fixes
Expand Down
1 change: 1 addition & 0 deletions src/build-centos.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,5 @@ cp translations/*.qm dist/translations
cp $QT/translations/qt_de.qm dist/translations
cp $QT/translations/qt_es.qm dist/translations
cp $QT/translations/qt_fr.qm dist/translations
cp $QT/translations/qt_it.qm dist/translations
tar -cf dist-centos.tar dist
2 changes: 1 addition & 1 deletion src/build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ sed -i "s/_VERSION_/${VERSION}/g" debian/DEBIAN/control

cp doc/changelog debian/usr/share/doc/tonino
cp doc/copyright debian/usr/share/doc/tonino
cp doc/tonino.1 debian/usr/share/man/tonino
cp doc/tonino.1 debian/usr/share/man/man1/tonino.1

gzip -9 debian/usr/share/man/man1/tonino.1
gzip -9 debian/usr/share/doc/tonino/changelog
Expand Down
1 change: 1 addition & 0 deletions src/build-mac2-pi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ mkdir dist/Tonino.app/Contents/Resources/translations
cp $QT_PATH/translations/qt_de.qm dist/Tonino.app/Contents/Resources/translations
cp $QT_PATH/translations/qt_es.qm dist/Tonino.app/Contents/Resources/translations
cp $QT_PATH/translations/qt_fr.qm dist/Tonino.app/Contents/Resources/translations
cp $QT_PATH/translations/qt_it.qm dist/Tonino.app/Contents/Resources/translations
cp translations/tonino_??.qm dist/Tonino.app/Contents/Resources/translations

# copy firmware and file icon
Expand Down
1 change: 1 addition & 0 deletions src/build-mac3-pi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ mkdir dist/Tonino.app/Contents/Resources/translations
cp $QT_PATH/translations/qt_de.qm dist/Tonino.app/Contents/Resources/translations
cp $QT_PATH/translations/qt_es.qm dist/Tonino.app/Contents/Resources/translations
cp $QT_PATH/translations/qt_fr.qm dist/Tonino.app/Contents/Resources/translations
cp $QT_PATH/translations/qt_it.qm dist/Tonino.app/Contents/Resources/translations
cp translations/tonino_??.qm dist/Tonino.app/Contents/Resources/translations

# copy firmware and file icon
Expand Down
1 change: 1 addition & 0 deletions src/build-mac35-pi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ mkdir dist/Tonino.app/Contents/Resources/translations
cp $QT_PATH/translations/qt_de.qm dist/Tonino.app/Contents/Resources/translations
cp $QT_PATH/translations/qt_es.qm dist/Tonino.app/Contents/Resources/translations
cp $QT_PATH/translations/qt_fr.qm dist/Tonino.app/Contents/Resources/translations
cp $QT_PATH/translations/qt_it.qm dist/Tonino.app/Contents/Resources/translations
cp translations/tonino_??.qm dist/Tonino.app/Contents/Resources/translations

# copy firmware and file icon
Expand Down
134 changes: 134 additions & 0 deletions src/build-rpi3-pi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
#!/bin/sh
#
# build-rpi3-pi.sh
#
# Copyright (c) 2016, Paul Holleis, Marko Luther
# All rights reserved.
#
#
# LICENSE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.


export QT_SELECT="default"
export QTTOOLDIR="/usr/lib/arm-linux-gnueabihf/qt5/bin"
export QTLIBDIR="/usr/lib/arm-linux-gnueabihf"

export QT=/usr/lib/arm-linux-gnueabihf/qt5

rm -f ui/.*.ui
rm -f qrc/.*.qrc

# ui
find ui -iname "*.ui" | while read f
do
fullfilename=$(basename $f)
fn=${fullfilename%.*}
pyuic5 -o uic/${fn}.py --from-imports ui/${fn}.ui
done

# qrc
find qrc -iname "*.qrc" | while read f
do
fullfilename=$(basename $f)
fn=${fullfilename%.*}
pyrcc5 -o uic/${fn}_rc.py qrc/${fn}.qrc
done

# translations
pylupdate5 conf/tonino.pro
lrelease -qt=5 -verbose conf/tonino.pro

# clean build
rm -rf build dist

#pyinstaller
# --noconfirm \
# --clean \
# --log-level=WARN \
# -D \
# tonino-linux.spec
pyinstaller -D -n tonino -y -c --log-level=WARN "tonino.py"

mv dist/tonino dist/tonino.d
mv dist/tonino.d/* dist
rm -rf dist/tonino.d

cp -R /usr/local/lib/python3.4/dist-packages/matplotlib/mpl-data/ dist
rm -rf dist/mpl-data/sample_data
cp conf/tonino-toni.xml dist
cp -R icons dist
cp doc/README.txt dist
cp doc/LICENSE.txt dist
mkdir dist/includes
mkdir dist/includes/linux
cp includes/tonino-*.hex dist/includes
cp includes/tinyTonino-*.hex dist/includes
## sudo apt-get install avrdude
cp /usr/bin/avrdude dist/includes/linux
cp /etc/avrdude.conf dist/includes/linux
cp conf/qt.conf dist
mkdir dist/translations
cp translations/*.qm dist/translations
cp /usr/share/qt5/translations/qt_de.qm dist/translations
cp /usr/share/qt5/translations/qt_es.qm dist/translations
cp /usr/share/qt5/translations/qt_fr.qm dist/translations
cp /usr/share/qt5/translations/qt_it.qm dist/translations



## generate the .deb package

cp raspbian/DEBIAN/control debian/DEBIAN/
VERSION=$(python -c 'import lib; print(lib.__version__)')
NAME=tonino-linux-${VERSION}

# fix debian/DEBIAN/control _VERSION_
sed -i "s/_VERSION_/${VERSION}/g" debian/DEBIAN/control


# prepare debian directory

cp doc/changelog debian/usr/share/doc/tonino
cp doc/copyright debian/usr/share/doc/tonino
cp doc/tonino.1 debian/usr/share/man/man1/tonino.1

rm -f debian/usr/share/man/man1/tonino.1.gz
gzip -9 debian/usr/share/man/man1/tonino.1
chmod +r debian/usr/share/man/man1/tonino.1.gz
rm -f debian/usr/share/doc/tonino/changelog.gz
gzip -9 debian/usr/share/doc/tonino/changelog

chmod +r debian/usr/share/applications/tonino.desktop
chmod -x debian/usr/share/applications/tonino.desktop
chmod +rx debian/usr/bin/tonino
chmod -R +r dist
chmod +x dist/icons

# buid .deb package (into /usr/share)

tar -cf dist-rpi.tar dist
rm -rf debian/usr/share/tonino
tar -xf dist-rpi.tar -C debian/usr/share
mv debian/usr/share/dist debian/usr/share/tonino
find debian -name .svn -exec rm -rf {} \; > /dev/null 2>&1
chown -R root:root debian
chmod -R go-w debian
rm ${NAME}_raspbian-jessie.deb
chmod 755 debian/DEBIAN
chmod 755 debian/DEBIAN/postinst
chmod 755 debian/DEBIAN/prerm
dpkg-deb --build debian ${NAME}_raspbian-jessie.deb

1 change: 1 addition & 0 deletions src/build-ubuntu.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,5 @@ cp translations/*.qm dist/translations
cp $QT/translations/qt_de.qm dist/translations
cp $QT/translations/qt_es.qm dist/translations
cp $QT/translations/qt_fr.qm dist/translations
cp $QT/translations/qt_it.qm dist/translations
tar -cf dist-ubuntu.tar dist
2 changes: 1 addition & 1 deletion src/debian/usr/share/applications/tonino.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ GenericName=Roast Color Meter
Comment=Evaluates coffee roast degree
Exec=tonino %U
TryExec=tonino
Icon=tonino.png
Icon=/usr/share/tonino/icons/tonino.png
Terminal=false
Categories=Utility;
MimeType=application/x-tonino-toni;
6 changes: 6 additions & 0 deletions src/debian/usr/share/doc/tonino/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
tonino (1.0.19-1) precise; urgency=low
* new upstream release
* fixes since 1.0.18:
- adds Raspian build
-- <[email protected]> Thu, 10 Nov 2016 19:32:14 +0200

tonino (1.0.18-1) precise; urgency=low
* new upstream release
* fixes since 1.0.17:
Expand Down
27 changes: 15 additions & 12 deletions src/doc/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ o Windows
o Mac OS X (>=10.7.x)

- Install USB/serial driver from FTDI
http://www.ftdichip.com/Drivers/VCP.htm
http://www.ftdichip.com/Drivers/VCP.htm
NOTE: OS X 10.9 and later contain already support for the FTDI hardware and therefore no additional driver needs to be installed on those systems
- Download and run the Tonino App OS X installer
- Double click on the dmg file you just downloaded
- Double click the disk image which appears on your desktop
- Drag the Tonino application icon to your Applications directory
- Drag the Tonino application icon to your Applications directory
- On OS X 10.8 Mountain Lion and higher you need to tick "Allow applications downloaded from Anywhere" in the Security & Privacy Preference Panel to start the app


Expand Down Expand Up @@ -99,16 +99,19 @@ The Tonino app uses the following libraries in unmodified forms:
- bbfreeze, Copyright (c) 2007-2012 brainbot technologies AG. Distributed under the zlib/libpng license.


VERSION HISTORY

v1.0.18 (29.10.2016)
- Updated calibration recognition

v1.0.17 (5.09.2016)
- Bug fixes

v1.0.16 (26.08.2016)
- Bug fixes
VERSION HISTORY

v1.0.19 (10.11.2016)
- Adds Raspian build

v1.0.18 (29.10.2016)
- Updated calibration recognition

v1.0.17 (5.09.2016)
- Bug fixes

v1.0.16 (26.08.2016)
- Bug fixes

v1.0.15 (2.08.2016)
- Adds TinyTonino firmware v2.0.4
Expand Down
12 changes: 12 additions & 0 deletions src/doc/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
tonino (1.0.19-1) precise; urgency=low
* new upstream release
* fixes since 1.0.18:
- adds Raspian build
-- <[email protected]> Thu, 10 Nov 2016 19:32:14 +0200

tonino (1.0.18-1) precise; urgency=low
* new upstream release
* fixes since 1.0.17:
- updated calibration recognition
-- <[email protected]> Sat, 29 Oct 2016 19:32:14 +0200

tonino (1.0.17-1) precise; urgency=low
* new upstream release
* fixes since 1.0.16:
Expand Down
2 changes: 1 addition & 1 deletion src/lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

__version__ = '1.0.18'
__version__ = '1.0.19'
17 changes: 14 additions & 3 deletions src/lib/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def __init__(self, args):
self.tiny_low_rb = 1.475 # green disk r/b target
self.tiny_high_rb = 3.07 # red disk r/b target
self.tiny_rb_range_low = 0.13 # green disk r/b range
self.tiny_rb_range_high = 0.245 # red disk r/b range
self.tiny_rb_range_high = 0.255 # red disk r/b range

# variables
self.workingDirectory = None
Expand Down Expand Up @@ -989,6 +989,7 @@ def __init__(self, parent=None,app=None):
self.ui.actionCut.triggered.connect(self.actionCut)
self.ui.actionCopy.triggered.connect(self.actionCopy)
self.ui.actionPaste.triggered.connect(self.actionPaste)
self.ui.actionQuit.triggered.connect(self.close)
self.ui.pushButtonUpload.setEnabled(False)

# enable buttons
Expand Down Expand Up @@ -1565,14 +1566,24 @@ def verifyDirty(self):
else:
return True

def close(self):
self.closeEvent(None)

def closeEvent(self,event):
if self.closing or self.verifyDirty():
if not self.closing:
self.app.saveSettings()
self.app.ser.closePort()
self.closing = True
event.accept()
if event:
event.accept()
else:
QApplication.exit()
else:
event.ignore()
if event:
event.ignore()
else:
QApplication.exit()


###########################################################################################################################################
Expand Down
3 changes: 2 additions & 1 deletion src/lib/serialport.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,13 @@ def openPort(self,port):
self.SP.open()
time.sleep(.1) # avoid possible hickups on startup
except serial.SerialException:
self.SP.close()
self.closePort()

def closePort(self):
try:
self.port = None
self.SP.close()
time.sleep(0.7) # on OS X opening a serial port too fast after closing the port get's disabled
except:
pass

Expand Down
11 changes: 11 additions & 0 deletions src/raspbian/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Source: tonino
Package: tonino
Version: _VERSION_
Section: misc
Depends: libc6 (>= 2.19)
Priority: extra
Architecture: armhf
Installed-Size: 67510
Maintainer: Marko Luther <[email protected]>
Homepage: http://my-tonino.com
Description: The Tonino app allows to configure the Tonino roast color meter as well as to design and upload scales
2 changes: 1 addition & 1 deletion src/setup-install.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ RequestExecutionLevel admin
!define py2exeOutputDir 'dist'
!define PRODUCT_NAME "Tonino"
!define PRODUCT_EXE "tonino.exe"
!define PRODUCT_VERSION "1.0.18.0"
!define PRODUCT_VERSION "1.0.19.0"
!define PRODUCT_PUBLISHER "Marko Luther, Paul Holleis"
!define PRODUCT_WEB_SITE "http://my-tonino.com"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\${PRODUCT_EXE}"
Expand Down
2 changes: 1 addition & 1 deletion src/setup-install3.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ RequestExecutionLevel admin
!define py2exeOutputDir 'dist'
!define PRODUCT_NAME "Tonino"
!define PRODUCT_EXE "tonino.exe"
!define PRODUCT_VERSION "1.0.18.0"
!define PRODUCT_VERSION "1.0.19.0"
!define PRODUCT_PUBLISHER "Marko Luther, Paul Holleis"
!define PRODUCT_WEB_SITE "http://my-tonino.com"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\${PRODUCT_EXE}"
Expand Down
Loading

0 comments on commit bcb0e7c

Please sign in to comment.