Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader > Kobo Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 05-27-2018, 12:38 PM   #1
OfficerAction
Connoisseur
OfficerAction can shake the floor when laughingOfficerAction can shake the floor when laughingOfficerAction can shake the floor when laughingOfficerAction can shake the floor when laughingOfficerAction can shake the floor when laughingOfficerAction can shake the floor when laughingOfficerAction can shake the floor when laughingOfficerAction can shake the floor when laughingOfficerAction can shake the floor when laughingOfficerAction can shake the floor when laughingOfficerAction can shake the floor when laughing
 
Posts: 80
Karma: 63118
Join Date: May 2018
Device: Kobo Aura One
Kobo Development Tutorial: 0 to Hero

Hey folks

I have noticed that getting into Kobo development can be very confusing if you have no experience in the field, so I decided to write a guide for those who want to get into it. For this guide I am assuming you are using Window as your primary OS.
So the first step is seting up a Linux virtual machine.
I am using VirtualBox and Lubuntu 18.4 32bit (Kobos use 32bit processors so this might save us some truble), but any Linux should be fine.
Make sure you assign enought Processors, RAM and VRAM to the VM and run through the installation process.

Once it is up and running open up a terminal and update the system by typing the following commands:
Code:
sudo apt update
sudo apt upgrade
It will be very usefull to install the VirtualBox guest additons.
Click on the insert guest additions menu item and type:
Code:
sudo apt install dkms
sudo /media/YOURUSERNAME/VBox_GAs_5.2.8/VBoxLinuxAdditions.run
After a quick reboot we can finally make the screen bigger and enable bidirectional copy & paste

Now here comes the interesting part.
We have to setup the arm toolchain and build Qt.

Download the toolchain form:
https://github.com/kobolabs/Kobo-Rea..._linux.tar.bz2

Extract it and move it to your home directory (or any other).
Code:
tar xf ~/Downloads/gcc-linaro-arm-linux-gnueabihf-4.8-2013.04-20130417_linux.tar.bz2 -C ~
Add the toolchain to your path by editing the bash startup script:
Code:
sudo nano ~/.bashrc
Scroll all the way down and add the following line, save.
Code:
PATH=$PATH:~/gcc-linaro-arm-linux-gnueabihf-4.8-2013.04-20130417_linux/bin
Restart your terminal or type in:
Code:
source ~/.bashrc
arm-linux-gnueabihf-gcc should be a known command now.

Building Qt will be a bit harder.
Download the Qt 4.8.5 sources from:
https://download.qt.io/archive/qt/4....c-4.8.5.tar.gz

Again extract it to your home directory and cd into it:
Code:
tar xf ~/Downloads/qt-everywhere-opensource-src-4.8.5.tar.gz -C ~
cd ~/qt-everywhere-opensource-src-4.8.5/
We need to make a new platformtarget for the Kobo

Code:
cp -r ./mkspecs/qws/linux-arm-gnueabi-g++ ./mkspecs/qws/linux-arm-gnueabihf-g++
Now use an editor of your choice to modify ./mkspecs/qws/linux-arm-gnueabihf-g++/qmake.conf like this:
Code:
#
# qmake configuration for building with arm-linux-gnueabihf-g++
#

include(../../common/linux.conf)
include(../../common/gcc-base-unix.conf)
include(../../common/g++-unix.conf)
include(../../common/qws.conf)

QMAKE_CFLAGS_RELEASE   = -O3 -march=armv7-a -mfpu=neon -mfloat-abi=hard -D__arm__ -D__ARM_NEON__
QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO = -O3 -g -march=armv7-a -mfpu=neon -mfloat-abi=hard -D__arm__ -D__ARM_NEON__

QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE
QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO

# modifications to g++.conf
QMAKE_CC                = arm-linux-gnueabihf-gcc
QMAKE_CXX               = arm-linux-gnueabihf-g++
QMAKE_LINK              = arm-linux-gnueabihf-g++
QMAKE_LINK_SHLIB        = arm-linux-gnueabihf-g++

# modifications to linux.conf
QMAKE_AR                = arm-linux-gnueabihf-ar cqs
QMAKE_OBJCOPY           = arm-linux-gnueabihf-objcopy
QMAKE_STRIP             = arm-linux-gnueabihf-strip

load(qt_config)

We need to install some dependencies:
Code:
sudo apt install gettext autoconf libglib2.0-dev build-essential libtool libdbus-1-dev
sudo apt install zlib1g-dev  libpng-dev libxext-dev  libssl-dev
sudo ln -s /usr/include/i386-linux-gnu/openssl/opensslconf.h  /usr/include/openssl/
Befor building Qt we need to configure it. This is the configuration I use:
Code:
./configure -embedded arm -xplatform qws/linux-arm-gnueabihf-g++ -opensource -confirm-license -prefix ~/qt_kobo_4_8_5 \
-qt-libjpeg -svg -nis -dbus -openssl -sql-sqlite \
-nomake demos -nomake docs -nomake translations \
-no-stl -no-webkit -no-qt3support -no-phonon -no-phonon-backend -no-multimedia -no-accessibility \
-no-javascript-jit -no-script -no-scripttools -no-opengl -no-gtkstyle -no-gif -no-cups -no-largefile \
-no-accessibility  -no-audio-backend -no-declarative -no-libtiff -no-libmng -no-pch -no-declarative-debug \
-no-sql-db2 -no-sql-ibase -no-sql-mysql -no-sql-oci -no-sql-odbc -no-sql-psql -no-sql-sqlite2 -no-sql-sqlite_symbian \
-no-sql-tds -no-mmx -no-3dnow -no-sse -no-sse2  \
-qt-gfx-linuxfb -qt-gfx-transformed \
-no-gfx-qvfb -no-gfx-vnc -no-gfx-multiscreen -no-gfx-directfb -no-gfx-qnx -no-gfx-integrityfb \
-no-kbd-qvfb -no-kbd-tty -no-kbd-linuxinput -no-kbd-qnx -no-kbd-integrity \
-no-mouse-qvfb -no-mouse-linuxtp -no-mouse-pc -no-mouse-tslib \
-DQT_KEYPAD_NAVIGATION -DQT_NO_QWS_CURSOR \
-little-endian -make tools -release -continue \
-I /usr/include/dbus-1.0 -I /usr/lib/i386-linux-gnu/dbus-1.0/include

Finally we can start the build process. Grab a tea and type:
Code:
make -j4
make install
If that went through install QtCreator:
Code:
sudo apt install qtcreator
Configure it by adding GCC and G++ compilers of the toolchain, the Qt 4.8.5 version we just built and create a Kit to make use of them.

Congratulations! You are now able compile qt aplications for your Kobo device

To run them on the device check out sergeyvl12's Kobo Launcher:
https://www.mobileread.com/forums/sh...d.php?t=201632
OfficerAction is offline   Reply With Quote
Old 05-27-2018, 02:23 PM   #2
Python Master
Member
Python Master began at the beginning.
 
Python Master's Avatar
 
Posts: 13
Karma: 10
Join Date: Mar 2018
Location: Toronto
Device: Kobo Aura One
Nice guide! It's great to see all the information compiled in one place
Python Master is offline   Reply With Quote
Old 05-27-2018, 03:14 PM   #3
geek1011
Wizard
geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.
 
Posts: 2,736
Karma: 6990705
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD
Looks good!
geek1011 is offline   Reply With Quote
Old 07-11-2018, 05:30 AM   #4
zavorra
Junior Member
zavorra knows what is on the back of the AURYN.zavorra knows what is on the back of the AURYN.zavorra knows what is on the back of the AURYN.zavorra knows what is on the back of the AURYN.zavorra knows what is on the back of the AURYN.zavorra knows what is on the back of the AURYN.zavorra knows what is on the back of the AURYN.zavorra knows what is on the back of the AURYN.zavorra knows what is on the back of the AURYN.zavorra knows what is on the back of the AURYN.zavorra knows what is on the back of the AURYN.
 
zavorra's Avatar
 
Posts: 8
Karma: 9886
Join Date: Jul 2018
Device: Kobo Clara HD
Thank you, this is a great post. It should be set as sticky by the admins
zavorra is offline   Reply With Quote
Old 02-27-2022, 10:26 PM   #5
DragoonGT
Junior Member
DragoonGT began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Feb 2022
Device: Kobo Libra 2
Is there an updated version of this guide? I recently bought a Libra 2 and wanted to try something fun with it. I have no experience with Qt or Linux, so I would really appreciate some help.
I looked at the Qt's download archives and the kobolabs github page and it seems like there is an updated version of the toolchain and I also see Qt 5 and 6. So I tried using this guide (on Ubuntu 20.4), just substituting Qt 4.8.5 with 5.15.2 and gcc linaro 4.8 with 4.9.4. Unfortunately, things didn't work out. Some things have changed, like the folder structured of the extracted Qt source files, no qws, some configuration options have changed, etc. I was able to figure some things out, but still got a lot of warnings and errors when I run "make". I think I must have done a lot of things wrong, but I have no idea what.

I have creeped around and this is the only guide which comprehensively details all the steps and the commands that need to entered in the terminal. You've done a really good job at explaining things for newbies like me. It would be great if you could post an update to it. Thanks!
DragoonGT is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
building Kobo development environment pasquale8120 Kobo Developer's Corner 36 03-29-2019 09:02 AM
Can someone get me up to speed with Kobo development? xfbs Kobo Developer's Corner 4 05-27-2018 12:41 PM
Wired - Free eBook of Jonathan Wood Novels (No Hero; Yesterday's Hero) charlesatan Deals and Resources (No Self-Promotion or Affiliate Links) 5 08-02-2012 05:39 PM
Kobo Development forum PeterT Feedback 2 07-17-2012 04:00 PM
iLiad iLiad Full Development Tutorial Hamatole iRex Developer's Corner 5 10-12-2009 06:29 AM


All times are GMT -4. The time now is 03:55 AM.


MobileRead.com is a privately owned, operated and funded community.