http://gcompris.net/mediawiki-1.31.0/api.php?action=feedcontributions&user=Dmadaan&feedformat=atomGCompris - User contributions [en]2024-03-29T05:45:33ZUser contributionsMediaWiki 1.31.0http://gcompris.net/mediawiki-1.31.0/index.php?title=New_contributor&diff=4639New contributor2017-08-31T14:24:15Z<p>Dmadaan: /* New contributor */</p>
<hr />
<div>== New contributor ==<br />
<br />
New contributors should read this page carefully.<br />
<br />
You must follow the coding guidelines described in those links: <br />
<br />
[[Qt Quick development process#Coding guidelines]]<br />
<br />
[[GSOC newcomers#Code quality]]<br />
<br />
You can find all the other information about our development process from the [[developer's corner]].<br />
<br />
If you want to develop a new activity for GCompris, a good start is to follow the instructions on this page : [[An exercise for new contributors]].<br />
<br />
Always look at existing activities, and take a look at their code when you have a problem.<br />
You have to think by yourself, try and fail to find solutions. This is not a school assessment.<br />
<br />
Test your work, be sure there are no warnings and you didn't break a thing before asking for a review.<br />
<br />
We can only provide limited feedback to get you started. <br />
<br />
To create a new activity, you will need to develop it by yourself.<br />
Think about making a detailed mockup, that will help you solve the main design questions, and make it easier to communicate the idea. Once you are clear with your idea, you should make a proposal of your activity based on [[GSOC newcomers]] explaining the general purpose of your activity, mockups for each screen etc. Then, when you are ready with your proposal, send a mail to '''gcompris-devel@kde.org'''.<br />
Then, once the mockup is accepted, of course you will have to work on it. When you have a prototype of the activity almost working, then we can provide a little more help if needed.<br />
<br />
For the graphics, if you can, try to follow the [[artwork guidelines]]. In any case, once an activity is ready, the images have to be checked and updated by our main artist.<br />
<br />
Please use the mailing list to share your thoughts, issues, and wishes to our community and follow [http://rurounijones.github.io/blog/2009/03/17/how-to-ask-for-help-on-irc/ How to ask for help on IRC] while asking questions on IRC.<br />
<br />
Note: If you plan to apply for next GSoC, please check [[GSOC newcomers]], and especially the last paragraph.</div>Dmadaanhttp://gcompris.net/mediawiki-1.31.0/index.php?title=Developer%27s_corner&diff=4613Developer's corner2017-05-30T13:45:22Z<p>Dmadaan: Edit official repository link</p>
<hr />
<div>{{TOCright}}<br />
= Contact =<br />
<br />
This page is about the '''Qt version'''. Follow there for the [[Developer's corner Gtk|Gtk+ legacy version]].<br />
<br />
== How to report a bug ==<br />
<br />
To fill a bug report for GCompris:<br />
<br />
* Legacy Gtk+ Version: [http://bugzilla.gnome.org/query.cgi gnome bugzilla] and select GCompris in the product list.<br />
* New Qt Quick version: [https://bugs.kde.org KDE bug tracker] and select GCompris in the product list or for [https://phabricator.kde.org/maniphest/query/0Xc51jhWJnw0/#R internal development we use Phabricator]<br />
<br />
== Mailing list ==<br />
<br />
You can join and browse the [https://mail.kde.org/mailman/listinfo/gcompris-devel GCompris mailing list].<br />
<br />
This mailing list is used by the developers and users willing to stay aware of what’s going on. You will get new release announcements. Users can join the list and report bugs, discuss feature they would like to have, ...<br />
<br />
The language is English. There is also a user mailing list in [https://mail.kde.org/mailman/listinfo/gcompris-france French] and in [https://lists.sourceforge.net/lists/listinfo/gcompris-portugues Portuguese]. If you want to create a user list in your language, please contact me (bruno.coudoin@gcompris.net).<br />
<br />
== Chat ==<br />
<br />
You can enter in contact with the users and developers of [http://en.wikipedia.org/wiki/IRC GCompris on IRC]. The server is irc.freenode.net on the channel #gcompris.<br />
<br />
To join an IRC server, you can use the [https://hexchat.github.io excellent hexchat software] or [http://webchat.freenode.net/ directly in your browser].<br />
<br />
= Development =<br />
<br />
== Documentation of the Qt Quick Version (Under development) ==<br />
<br />
This is a new version of GCompris based on the [http://doc.qt.io/qt-5/qtquick-index.html Qt Quick] technology. Our users expect us to deliver a version that runs on Desktop and on Tablets. Sadly with the Gtk+ version these was no easy way to achieve this. The decision has been taken to rewrite completely GCompris on a new framework. This is a departure from the Gtk+ development framework that was based on the C and the Python language. Now the development will be done with a mix of QML, JavaScript and C++.<br />
<br />
The rewrite will not happen overnight and we need your help. If you are interesting in discovering the Qt Quick technology while doing something useful, you can do the port of a GCompris activity.<br />
<br />
* Qt Quick [https://cgit.kde.org/gcompris.git/ official repository] or [https://github.com/gcompris/GCompris-qt GitHub mirror]<br />
* [[Qt Quick development process]]<br />
* [[Qt Quick Migration status]]<br />
* [[Contribution process]]<br />
<br />
=== New contributor ===<br />
<br />
If you want to develop a new activity for GCompris a good start is to follow the instructions on this page : [[An exercise for new contributors]].<br />
<br />
=== Design ===<br />
<br />
* [[Administration design]]<br />
* [[Dataset handling]]<br />
<br />
=== Translation ===<br />
<br />
Translations are managed by the [http://l10n.kde.org/ KDE translation teams]. If you would like to participate in the translation of GCompris you must contact the KDE translation team you want to participate in.<br />
<br />
* [http://l10n.kde.org/stats/gui/stable-kf5/po/gcompris_qt.po/ Translation status for the stable version]<br />
* [http://l10n.kde.org/stats/gui/trunk-kf5/po/gcompris_qt.po/ Translation status for the development version]<br />
* [http://websvn.kde.org/trunk/l10n-kf5/ To get the po file to translate], navigate in the subversion from the previous link, select your locale then go to the subdirectory messages/extragear-edu/.<br />
* [http://gcompris.net/voicestats Voice recording status] for each locale.<br />
* [[Word Lists Qt|Additional localized list of words]]<br />
* [[Advanced color translation]]<br />
* [[Voice translation Qt|Voice translation]]<br />
* [[Web site translation]] is managed by volunteers.<br />
<br />
== The Drawing board ==<br />
<br />
These are pages to hold the different discussion for things we are working on:<br />
<br />
* [[Ideas for activities]]<br />
* [[Star system review]]<br />
* [[Language Learning]]<br />
<br />
[[Category:Developer]]<br />
[[Category:English]]</div>Dmadaanhttp://gcompris.net/mediawiki-1.31.0/index.php?title=Qt_Quick_development_process&diff=4611Qt Quick development process2017-05-18T17:55:24Z<p>Dmadaan: /* Compilation */</p>
<hr />
<div>{{TOCright}}<br />
= Learning Qt Quick =<br />
<br />
Some pointers to discover Qt Quick:<br />
* [http://doc.qt.io/qt-5/gettingstarted.html Getting Started with Qt]<br />
* [http://doc.qt.io/qt-5/gettingstartedqml.html Getting Started Programming with Qt Quick]<br />
* [http://qmlbook.org/index.html Qml Book]<br />
<br />
A step by step exercise to dig into Qt Quick with the QtCreator development environment:<br />
* [http://qt-project.org/doc/qtcreator QtCreator]<br />
<br />
= Coding Style =<br />
<br />
We follow [http://qt-project.org/doc/qt-5/qml-codingconventions.html this coding style].<br />
<br />
= Source code =<br />
<br />
Here is the [http://quickgit.kde.org/?p=gcompris.git official repository] for the source code. Alternatively you can also get the code on [https://github.com/bdoin/GCompris-qt GitHub].<br />
<br />
= Compilation prerequisites =<br />
<br />
For Debian based systems, in order to compile GCompris you need to install the following packages:<br />
<br />
== Compilation chain ==<br />
<br />
<code><pre><br />
sudo apt-get install cmake<br />
sudo apt-get install cmake-curses-gui # Optional<br />
sudo apt-get install g++<br />
sudo apt-get install libgl1-mesa-dev<br />
</pre></code><br />
<br />
== Qt5 ==<br />
<br />
<code><pre><br />
sudo apt-get install qt5-default<br />
sudo apt-get install qtdeclarative5-dev<br />
sudo apt-get install qtmultimedia5-dev<br />
sudo apt-get install libqt5svg5-dev<br />
sudo apt-get install libqt5xmlpatterns5-dev<br />
sudo apt-get install libqt5sensors5-dev<br />
sudo apt-get install qml-module-qtquick-particles2<br />
sudo apt-get install qttools5-dev-tools<br />
</pre></code><br />
<br />
= Compilation =<br />
<br />
[https://cmake.org/download/ CMake] is a cross-platform free software program for managing the build process of software using a compiler-independent method.<br />
The minimum version to compile GCompris is 2.8 (recommended 3.5.1)<br />
<br />
* Get the [https://cgit.kde.org/gcompris.git/ source code]:<br />
<pre><br />
git clone https://github.com/gcompris/GCompris-qt<br />
</pre><br />
* Initialize the git submodule(s)<br />
<pre><br />
cd gcompris<br />
git submodule init && git submodule update<br />
</pre><br />
* Download and Install the latest stable version of [https://www.qt.io/download-open-source/#section-2 Qt] (This includes QtCreator in the Tools/QtCreator directory. Recommended version-5.5.0). For running on Android, download the Android version. <br />
* Start QtCreator and open the project file CMakeLists.txt at the root of the source code<br />
* Create a build directory and set it in Qt Creator<br />
* Compile and run it. (No need of giving any arguments to CMake, if QtCreator asks for it)<br />
<br />
To compile from the command line you need:<br />
* export Qt5_DIR=$HOME/Qt/5.4.2/5.4/lib/cmake/Qt5 (This path varies with your installed version)<br />
* mkdir build<br />
* cd build<br />
* cmake ..<br />
* make<br />
<br />
To make it run on Android you need first to follow [http://qt-project.org/doc/qt-5/android-support.html these instructions].<br />
<br />
= Generate core API documentation =<br />
<br />
KDE uses [http://quickgit.kde.org/?p=kapidox.git kapidox], a wrapper around [http://www.doxygen.org doxygen] to generate API documentation. Kapidox uses [https://github.com/agateau/doxyqml doxyqml] for generating documentation for QML code.<br />
<br />
In GCompris we document all classes in the src/core/ directory.<br />
<br />
To build this API documentation you need:<br />
<br />
* Install doxygen.<br />
* Build kapidox from http://quickgit.kde.org/?p=kapidox.git<br />
* Install doxyqml from https://github.com/agateau/doxyqml. (Note: need at least version 0.2.0 that supports readonly QML properties.)<br />
<br />
Then do<br />
<br />
kgenapidox ./path/to/gcompris-checkout/<br />
<br />
and find your documentation under apidocs/.<br />
<br />
= Adding a new activity =<br />
<br />
== Automatically ==<br />
<br />
Let's say you want to port the algebra_by activity.<br />
<br />
<pre><br />
cd src/activities<br />
./createit.sh algebra_by<br />
</pre><br />
<br />
And you're done, you can run ''CMake'' again in QtCreator and your activity should appear on the list.<br />
<br />
== Manually ==<br />
<br />
You must create a directory for your activity in src/activities. In it, create an ActivityInfo.qml, CMakeLists.txt and your qml entry point AlgebraBy.qml.<br />
<br />
* in src/activities/activities.txt add the directory name of your activity (keep the file sorted).<br />
* check algebra_by/ActivityInfo.qml that the name references you Qml activity entry point and that the icon point to your icon name (preferred format is svg).<br />
<br />
== Getting old menus ==<br />
<br />
If your activity is an existing one, you can move its ported ''ActivityInfo'' and icon:<br />
<br />
<pre><br />
git mv tools/menus/algebra_by.qml src/activities/algebra_by/AlgebraBy.qml<br />
git mv tools/menus/resource/algebra_by.svg src/activities/algebra_by/algebra_by<br />
</pre><br />
<br />
== Extending another activity ==<br />
<br />
If the activity is just an extension of an existing one you have to create it either manually or automatically and then change you .qml file to extend another one. The 'erase_clic' activity is a good example.<br />
<br />
In your .qml file:<br />
<br />
* just import the activity you want to extend with for example: ''import "qrc:/gcompris/src/activities/erase"''<br />
* instead of have your root item being an 'ActivityBase' you just create an object of the base type you want to extend like Erase.<br />
* Use a property to pass parameters to your base item and customize it<br />
<br />
= Coding guidelines =<br />
<br />
Keep only small Javascript in the QML code, all the game logic must be in your Javascript file. This makes it easier to read the activity logic. It is possible to have several Javascript files if needed. The QML files must be seen as the graphical interface description and the Javascript the logic of the game.<br />
<br />
== Resolution independence ==<br />
<br />
Your activity must look nice on tablets and desktops. The resolution and ''dpi'' value may differ a lot.<br />
<br />
=== Images and Graphics ===<br />
<br />
On mobile with high ''dpi'' the size of your images and graphics will look smaller. You must set an initial size related to ApplicationInfo.ratio like this:<br />
<br />
<pre><br />
Image {<br />
id: ball<br />
source: "qrc:/gcompris/src/activities/ballcatch/resource/ball.svg"<br />
sourceSize.height: 100 * ApplicationInfo.ratio<br />
}<br />
</pre><br />
<br />
<br />
====== Convert png images to svg ======<br />
<br />
We prefer svg format for images for activities. Convert your 'png' images to 'svg' like this:<br />
<br />
1) Copy all your png images inside a folder.<br><br />
2) Copy this python [https://raw.githubusercontent.com/iamutkarshtiwari/pngTosvg/master/png2svg.py script] inside the same folder. <br><br />
3) Run the above python script.<br><br />
<br />
Voila! New converted svg images are created in the same directory.<br />
<br />
=== Fonts ===<br />
<br />
The situation for fonts is comparable. The [http://doc.qt.io/qt-5/qml-qtquick-text.html#font.pointSize-prop font.pointSize] property of Text-like QML elements handles device independence to a certain degree. An exception are devices with relativ low-dpi and a high resolution (i.e. many tablet devices >= 10'), where fonts are rendered too small when using pointSize.<br />
<br />
For this case we use calculated constant ApplicationInfo.fontRatio, that must be used a factor to a font.pointSize value. This is done automatically when the size is set via the fontSize property of the GCFont type, which is the recommended way to specify font-sizes. Example:<br />
<br />
<pre><br />
GCText {<br />
id: text<br />
text: "Text"<br />
fontSize: 14<br />
font.weight: Font.DemiBold<br />
color: "white"<br />
}<br />
</pre><br />
<br />
You can also use the internal pseudo enum values of GCText, that specify some often used font-sizes:<br />
<br />
<pre><br />
readonly property int tinySize: 10.0<br />
readonly property int smallSize: 12.0<br />
readonly property int regularSize: 14.0<br />
readonly property int mediumSize: 16.0<br />
readonly property int largeSize: 24.0<br />
readonly property int hugeSize: 32.0<br />
</pre><br />
<br />
<pre><br />
GCText {<br />
...<br />
fontSize: regularSize<br />
...<br />
}<br />
</pre><br />
<br />
== Window resize ==<br />
<br />
Your activity must adapt its content properly when the window is resized.<br />
<br />
== Screen rotation ==<br />
<br />
Your activity must support screen rotation. If you use a layout or you specify an item coordinated related to the window width you are safe. If you create absolute coordinate items, you may need to reset them when the screen is changed. To detect a rotation you can add a code like this in your ''ActivityBase'':<br />
<br />
<pre><br />
onWidthChanged: Activity.widthChanged()<br />
</pre><br />
<br />
== Audio ==<br />
<br />
Creating Audio items is rather slow. If you have a lot of items on the screen, do not create an Audio item for each. Instead create a single Audio and pass it to all your items.<br />
<br />
In order to play audio only if audio has been enabled in the preferences, use the core ''GCAudio'' item instead of ''Audio''. Make sure to use ''import "../../core"''.<br />
<br />
== Background image ==<br />
<br />
You must not use a background image to bring useful informations. It is not possible to keep the background aligned with items when the resolution is changed.<br />
<br />
== Adding a configuration for a specific activity ==<br />
<br />
Each activity can have a specific configuration (for example, changing the locale of the activity, having different modes...). A simple example can be found on Traffic activity where you can change between images and colors to display the cars.<br />
<br />
To add configuration, you need to add the "config" value in the Bar.<br />
Then you have to add a DialogActivityConfig item where you will define the component item of the dialog. You need to define the following functions:<br />
* setDefaultValues to set the values when displaying the configuration.<br />
* onLoadData which is called to load the existing data from configuration.<br />
* onSaveData which is called to save the configuration in configuration file and where you can also send signals to dynamically change current activity settings.<br />
<br />
The data should be set in "dataToSave" attribute which is a map (pairs of key, values) where the keys are strings and values are javascript var (can be strings, lists...).<br />
<br />
Accessing the component items can be done using: dialogActivityConfig.configItem.<br />
<br />
For the data to be loaded at start of activity, you also need to call "dialogActivityConfig.getInitialConfiguration()" on Component.onCompleted() of your pageComponent item.<br />
<br />
== Compiling GCompris for Desktop ==<br />
You can still use QtCreator to develop. Within it, open the CMakeLists.txt on top-level of GCompris. Select a directory (create a folder at same level as the gcompris folder for example) and then click on "Run CMake" button then finish.<br />
<br />
To compile GCompris on command line, you can create a directory GCompris-qt-build at same level as the gcompris folder, go into it and type "cmake ../gcompris && make". You have the possibility to check which activities you want to compile or not.<br />
<br />
If you want to create an auto extractible package for linux platforms, you need to launch cmake using: "cmake -DBUILD_STANDALONE=ON ../gcompris && make". <br />
<br />
=== Troubleshooting ===<br />
<br />
* If you get the error: "The imported target "Qt5::Gui" references the file "Qt5Gui_EGL_LIBRARY-NOTFOUND" but this file does not exist."<br />
<br />
<pre><br />
sudo apt-get install libgl1-mesa-glx<br />
</pre><br />
<br />
try again <br />
If this still shows the same error or tells you - /usr/bin/ld: cannot find -lGL - <br />
do :<br />
<pre><br />
on a 32 bits system<br />
cd /usr/lib/i386-linux-gnu<br />
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 libGL.so<br />
<br />
on a 64 bits system<br />
cd /usr/lib/x86_64-linux-gnu<br />
sudo ln -s /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 libGL.so<br />
</pre><br />
<br />
* If you miss the GL/gl.h header, install it with ''sudo apt-get install mesa-common-dev''<br />
<br />
* If you get the error: "The imported target "Qt5::Gui" references the file "Qt5Gui_EGL_LIBRARY-NOTFOUND" but this file does not exist."<br />
<br />
<br />
<br />
== Compiling GCompris for Android ==<br />
You need first to install '''ant''' (java tool) from your favorite package manager.<br />
Then install openjdk (for example it could be openjdk-8-jdk from your favorite package manager).<br />
<br />
Then you need to download and install android ndk ([https://developer.android.com/tools/sdk/ndk/index.html NDK]) and android sdk ([https://developer.android.com/sdk/index.html SDK]).<br />
<br />
You also need to install the KDE extra-cmake-modules dependency (apt-get install extra-cmake-modules).<br />
<br />
To make it easier and because we don't need eclipse contained in adt-bundle-linux-x86-xxxxx, copy the directory sdk under for example ~/Android/ and rename it as android-sdk. Also, rename android-ndk-r9d as android-ndk and copy it under ~/Android/<br />
<br />
The Android SDK you have downloaded does not contain yet an Android platform or any third-party libraries. In fact. In order to start developing applications, you must install the Platform-tools and at least one version of the Android platform, using the SDK Manager.<br />
To start the SDK Manager, please execute the program "android".<br />
Please read SDK Readme.txt under android-sdk to get more precise informations.<br />
<br />
Then you need to add some environment variables by editing ~/.bashrc to add at the end (put the directories where you installed ndk/sdk):<br />
<pre><br />
export ANDROID_NDK=~/Android/android-ndk<br />
export ANDROID_NDK_ROOT=$ANDROID_NDK<br />
export ANDROID_SDK_ROOT=~/Android/android-sdk<br />
export PATH=$PATH:~/Android/android-sdk/platform-tools<br />
export Qt5_android=~/Qt5.5.1/5.5/android_armv7/<br />
</pre><br />
<br />
It may be possible that ccmake tells you that sdk version is not installed for its version 19.<br />
Go then to ~/Android/android-sdk/tools/ then start the shell program ./android.<br />
Install Kitkat 4.4.1.<br />
<br />
With Qt5.3, you'll probably need to create symbolic links for Qt libraries (if you have the error Qt5.3.0/5.3/android_armv7/lib/libQt5Core.so.5.3.0 not found):<br />
<pre><br />
cd Qt5.3.0/5.3/android_armv7/lib<br />
for f in $(ls *.so); do ln -s $f $f.5.3.0; done<br />
</pre><br />
<br />
(At this point, if you do not find the directory android_armv7, you may have downloaded the wrong qt setup file. You have probably downloaded <br />
Qt 5.5.1 for Linux <br />
instead of <br />
Qt 5.5.1 for Android)<br />
<br />
Create a folder at the same level as the gcompris folder and into it type "ccmake -DQt5_DIR=${Qt5_android} -DCMAKE_TOOLCHAIN_FILE=/usr/share/ECM/toolchain/Android.cmake -Wno-dev ../gcompris_developers/ && make && make apk_debug" to get a GCompris apk.<br />
This opens ccmake which is a console application. Run the configuration step by typing "C" on you keyboard.<br />
<br />
If it tells you "Could not find a package configuration file provided by Qt5", press "e" to set the path for Qt5_DIR.<br />
To do this, press "enter", this will place the cursor on the first path line. With the down key go to Qt5_DIR line, press again "Enter" then modify the path.<br />
For example the path can be: /home/myname/Qt5.3.0/5.3/android_armv7/lib/cmake/Qt5 where Qt5.3.0 is the Qt installation directory.<br />
<br />
Then press "G" to build and "E" to quit.<br />
<br />
Problems which could occurs while using ccmake:<br />
<br />
* ccmake is telling you that it does not find opengl (qopengl.h:122:21: fatal error: GL/gl.h: No such file or directory) : you are maybe pointing to the wrong path. You are pointing to the qt5 desktop library instead of pointing to the arm libraries: You have maybe pointed to /home/myname/Qt5.5.0/5.5/gcc/lib/cmake/Qt5Core/ when you should point to /home/myname/Qt5.5.0/5.5/android_armv7/lib/cmake/Qt5Core.<br />
<br />
* ccmake is telling you that it does not find ANDROID_DEPLOY_QT: You are maybe pointing to /home/myname/Qt5.5.0/5.5/android_armv7/bin you have to point to the androiddeployqt file /home/myname/Qt5.5.0/5.5/android_armv7/bin/androiddeployqt<br />
<br />
* ccmake is telling you that you have an Invalid minSdkVersion version, minSdkVersion must be >= 16. This maybe due to the incorrect sdkVersion. You should change the minSdkVersion to 16 or 18 in the AndroidManifest.xml.cmake in the source directory. If it does not work and the minSdkVersion is reset each time then you may be doing the change in buildDirectory/android/AndroidManifest.xml.cmake and not in sourceDirectory/android/AndroidManifest.xml.cmake.<br />
<br />
This is how ccmake could looks like once started:<br />
<pre><br />
ANDROID_ABI armeabi <br />
ANDROID_DEPLOY_QT /home/myname/Qt5.5.0/5.5/android_armv7/bin/androiddeployqt<br />
ANDROID_JAVA_API_LEVEL android-19<br />
ANDROID_NATIVE_API_LEVEL 19<br />
BUILD_STANDALONE ON<br />
CMAKE_ASM_COMPILER /home/myname/Development/Android/android-ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/b<br />
CMAKE_BUILD_TYPE<br />
CMAKE_INSTALL_PREFIX /home/myname/Development/Android/android-ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/u<br />
COMPRESSED_AUDIO ogg<br />
ECM_DIR ECM_DIR-NOTFOUND<br />
EXECUTABLE_OUTPUT_PATH /home/myname/Development/GComprisNew/GCompris-qt/bin<br />
KF5_DIR KF5_DIR-NOTFOUND<br />
LIBRARY_OUTPUT_PATH /home/myname/Development/GComprisNew/GCompris-qt/libs/armeabi<br />
LIBRARY_OUTPUT_PATH_ROOT /home/myname/Development/GComprisNew/GCompris-qt<br />
Qt5AndroidExtras_DIR /home/myname/Qt5.5.0/5.5/android_armv7/lib/cmake/Qt5AndroidExtras<br />
Qt5Core_DIR /home/myname/Qt5.5.0/5.5/android_armv7/lib/cmake/Qt5Core<br />
Qt5Gui_DIR /home/myname/Qt5.5.0/5.5/android_armv7/lib/cmake/Qt5Gui<br />
Qt5LinguistTools_DIR /home/myname/Qt5.5.0/5.5/android_armv7/lib/cmake/Qt5LinguistTools<br />
Qt5Multimedia_DIR /home/myname/Qt5.5.0/5.5/android_armv7/lib/cmake/Qt5Multimedia<br />
Qt5Network_DIR /home/myname/Qt5.5.0/5.5/android_armv7/lib/cmake/Qt5Network<br />
Qt5Qml_DIR /home/myname/Qt5.5.0/5.5/android_armv7/lib/cmake/Qt5Qml<br />
Qt5Quick_DIR /home/myname/Qt5.5.0/5.5/android_armv7/lib/cmake/Qt5Quick<br />
Qt5Svg_DIR /home/myname/Qt5.5.0/5.5/android_armv7/lib/cmake/Qt5Svg<br />
Qt5Widgets_DIR /home/myname/Qt5.5.0/5.5/android_armv7/lib/cmake/Qt5Widgets<br />
Qt5XmlPatterns_DIR /home/myname/Qt5.5.0/5.5/android_armv7/lib/cmake/Qt5XmlPatterns<br />
Qt5Xml_DIR /home/myname/Qt5.5.0/5.5/android_armv7/lib/cmake/Qt5Xml <br />
QML_BOX2D_LIBRARY /home/myname/Development/GComprisNew/GCompris-qt/external/qml-box2d/<br />
<br />
</pre><br />
<br />
<br />
=== Creating the apk ===<br />
<br />
To create the apk in your android build directory:<br />
<pre><br />
make BuildTranslations<br />
make apk_debug<br />
</pre><br />
<br />
== Deploying on android device ==<br />
To deploy, plug you computer to your tablet. Go into you tablet preferences, switch on the developer mode.<br />
<br />
Into the console, type the following command:<br />
<pre>adb install -r GCompris-debug.apk</pre><br />
<br />
== Compiling GCompris for SailfishOS ==<br />
You need to download and install the sailfishOS SDK ([https://sailfishos.org/develop/ SDK]).<br />
Once done, you need to start the mersdk virtual machine:<br />
<pre><br />
VBoxManage startvm MerSDK<br />
</pre><br />
<br />
And ssh into it: <br />
<pre><br />
ssh -p 2222 -i ~/SailfishOS/vmshare/ssh/private_keys/engine/mersdk mersdk@localhost<br />
</pre><br />
<br />
In order to build you need to install cmake and git: <br />
<pre><br />
sb2 -t SailfishOS-armv7hl -m sdk-install -R zypper install cmake git<br />
</pre><br />
<br />
Then, you need to log in armv7hl:<br />
<pre><br />
sb2 -t SailfishOS-armv7hl<br />
</pre><br />
<br />
Clone the source code and on a separate folder type:<br />
<pre><br />
cmake -DSAILFISHOS=1 -DBUILD_ARCH=armv7hl ../gcompris/ && make package<br />
</pre><br />
<br />
You will probably have the following error at the end: CPack Error: Problem copying the package: /home/mersdk/build_arm/_CPack_Packages/Linux/RPM/gcompris-0.34-Linux.rpm to /home/mersdk/build_arm/gcompris-0.34-Linux.rpm but it's ok.<br />
You can find the generated package at: /home/mersdk/build_ arm/_CPack_Packages/Linux/RPM/harbour-gcompris-qt-0.34-1.armv7hl.rpm.<br />
<br />
If you want to build the translations, you need to install gettext (for msgattrib) and follow the chapter [[Qt_Quick_development_process#Getting_and_compiling_translations]].<br />
'''/!\ Does a Subversion package exist?''' Maybe [https://openrepos.net/content/nieldk/subversion-0 https://openrepos.net/content/nieldk/subversion-0]?<br />
<br />
You can also build for emulator (replace all armv7hl above with i486).<br />
To install on emulator, run the SailfishOS emulator and copy the rpm into it. You can copy it from the mersdk vm using the shared folders to get it from the mersdk and on your host:<br />
<pre><br />
scp -P 2223 -i ~/SailfishOS/vmshare/ssh/private_keys/SailfishOS_Emulator/nemo harbour-gcompris-qt-0.34_1-1.i486.rpm nemo@localhost:RPMS<br />
ssh -p 2223 -i ~/SailfishOS/vmshare/ssh/private_keys/SailfishOS_Emulator/nemo nemo@localhost<br />
pkcon install-local harbour-gcompris-qt-0.34-1_1.i486.rpm<br />
</pre><br />
It should now appear on the emulator.<br />
<br />
<br />
== Compiling GCompris for Ubuntu click ==<br />
You need to have a ubuntu OS installed and the ubuntu sdk (sudo apt-get install ubuntu-sdk).<br />
<br />
Clone the source code in a GCompris-qt folder.<br />
<br />
Then, you need to create the chroot environment (it can take some time) and log into it: <br />
<pre><br />
sudo click chroot -a armhf -f ubuntu-sdk-14.10 create<br />
sudo click chroot -a armhf -f ubuntu-sdk-14.10 run<br />
</pre><br />
You can use a newer one instead of 14.10.<br />
<br />
Inside the chroot, you need to manually install the QtQuickControls module and run the compilation command:<br />
<pre><br />
apt-get install qml-module-qtquick-controls:armhf<br />
cmake -DWITH_UBUNTU=on -DUBUNTU_CLICK=1 -DQt5_DIR=/usr/lib/arm-linux-gnueabihf/cmake/Qt5/ ../GCompris-qt/ && export QT_SELECT=qt5-arm-linux-gnueabihf && make && make DESTDIR=/tmp/click/ install<br />
</pre><br />
<br />
To compile and embed translations, you need to follow the chapter [[Qt_Quick_development_process#Getting_and_compiling_translations]].<br />
<br />
Then outside the chroot, you need to run the click command to create the package:<br />
<pre><br />
click build /tmp/click/<br />
</pre><br />
<br />
This will create the click package.<br />
<br />
== Compiling GCompris for Windows ==<br />
Compilation on Windows has been tested with mingw only.<br />
Download and install Qt for Windows with mingw ([http://www.qt.io/download-open-source/#section-2 http://www.qt.io/]). You also need to install NSIS ([http://nsis.sourceforge.net/Download NSIS homepage]).<br />
<br />
Then, in a in Qt/mingw console:<br />
<pre><br />
cmake -G"MinGW Makefiles" ..\gcompris && mingw32-make && mingw32-make package.<br />
</pre><br />
The package creation can take some time because of the dependencies retrieval.<br />
<br />
== Compiling GCompris for Mac OS X ==<br />
Compilation on OSX is quite similar to Linux.<br><br />
Install [http://www.cmake.org/ CMake]. The minimum version to compile GCompris is 2.8.<br />
Download and install [https://www.qt.io/download-open-source/#section-2 Qt] for OSX.<br />
Box2D compilation is not yet supported in macOSX, you have to disable it during compilation.<br />
Then in console:<br />
<pre><br />
$ git clone https://github.com/gcompris/GCompris-qt.git <br />
$ cd GCompris-qt<br />
$ git submodule init && git submodule update<br />
$ export Qt5_DIR=$HOME/Qt5.7.0/5.7/clang_64/lib/cmake/Qt5/<br />
(This path would vary with your Qt5 folder location)<br />
$ mkdir build<br />
$ cd build<br />
$ cmake -DQML_BOX2D_MODULE=disabled ..<br />
$ make<br />
</pre><br />
<br />
This should successfully build GCompris on your Mac.<br />
To run, start the GCompris-qt.app file in '''build/bin/''' folder.<br />
<br />
'''Issues:'''<br />
If you face issues regarding no 'svg/image load'. <br />
-Copy the plugins from <pre>~/Qt5.7.0/5.7/clang_64/plugins/</pre> to <br />
<pre>build/bin/GCompris-qt.app/Contents/Plugins/</pre><br />
<br />
== Getting and compiling translations ==<br />
By default, no translation are present in the git repository. We need to get them from the KDE svn [http://websvn.kde.org/trunk/l10n-kf5/ KDE i10n svn].<br />
You can see the translation status at [http://l10n.kde.org/stats/gui/trunk-kf5/po/gcompris_qt.po/ GCompris translation status].<br />
<br />
You need to have subversion and msgattrib installed.<br />
<br />
To get all the translation files, you need to create the Makefile using cmake (see above) and type:<br />
<br />
<pre><br />
make getSvnTranslations<br />
</pre><br />
<br />
This will copy all the po files to a po/ folder in the source directory.<br />
<br />
Once you have done this, you need to '''run again cmake''' in order to have all the translations handled.<br />
Then, to build the translations used by GCompris, type:<br />
<pre><br />
make BuildTranslations<br />
</pre><br />
<br />
Then go into the bin directory and type ./gcompris-qt to launch the software (or running from QtCreator). In the configuration dialog box, you can choose your language. Restart the application to see the language change.<br />
<br />
If you're compiling using Qt Creator, you can go to the Projects tab and in Build Steps, add a build step and check BuildTranslations.<br />
<br />
== Getting translations from the Gtk version ==<br />
<br />
When adding a Gtk ported activity in the QtQuick version, if you used the strings for texts of the Gtk version, you can update all existing translation files. For this, first you need to update existing translation files using (this will add the new strings which will be untranslated for now):<br />
<br />
<pre><br />
make UpdateTranslations<br />
</pre><br />
<br />
Then, using the convertPo.py tool (and the updateAll.sh which applies it to all translations), you can update the files to get the translations from the Gtk version (if they existed).<br />
<br />
== Adding resources ==<br />
<br />
* For resources, you have to put them in the ''resource'' directory of your activity<br />
* A compiled ''qrc'' file named ''youractivity.rcc'' is auto generated by the compilation chain<br />
* You must run ''cmake'' again to have new resources included in the ''qrc''<br />
* If you change a resource, a simple make will update the ''rcc'' file<br />
* To reference your resource, use a qrc:/ url in the source. The path is:<br />
<pre><br />
qrc:/gcompris/src/activities/*youractivity*/resource/*myfile.svg*<br />
</pre><br />
<br />
[[Category:English]]</div>Dmadaanhttp://gcompris.net/mediawiki-1.31.0/index.php?title=An_exercise_for_new_contributors&diff=4610An exercise for new contributors2017-05-18T17:51:35Z<p>Dmadaan: Modify links and add link for review of exercise.</p>
<hr />
<div>== Exercise ==<br />
<br />
In order to help you practice in the GCompris framework, I propose you to make this little exercise.<br />
<br />
'''Mandatory:''' GCompris development is done on a '''GNU/Linux''' distribution of your choice.<br />
<br />
* Install GNU/Linux on your computer if you don't already have it.<br />
* Download and Install the latest stable version of [https://www.qt.io/download-open-source/#section-2 QtCreator] (version 5.6.0 recommended) <br />
* Install [https://cmake.org/download/ CMake] (version 3.5.1 recommended)<br />
* Get the GCompris code from the Kde Git version control system (or see below the GitHub option).<br />
** git clone https://github.com/gcompris/GCompris-qt<br />
** cd GCompris-qt<br />
** git submodule init && git submodule update (to retrieve box2d)<br />
* Configure you Git username and email<br />
** git config --global user.email "your_email@example.com"<br />
** git config --global user.name "FirstName LastName"<br />
* Create a branch for your development<br />
** git checkout -b exercise<br />
* Start QtCreator and open the project file CMakeLists.txt at the root of the source code<br />
* Compile and run it.<br />
* Create a new activity using the supplied ''createit.sh'' script. For example, use your nick name as the activity name.<br />
** cd src/activities<br />
** ./createit.sh 'my_new_activity'<br />
* Update the copyrights of the different files with your name and email.<br />
* Compile GCompris again in Qt Creator, check you new activity is present<br />
* Modify the activity to display an image, a rectangle and a text.<br />
* (Warning, if you add resources in you activity's resource directory you must run ''cmake'' again).<br />
** You can search for code examples in other activities and check the [http://doc.qt.io/qt-5/gettingstartedqml.html Qml getting started].<br />
* Add an event to a graphical object so that clicking on it does something visual.<br />
* Use git add and git commit to commit your changes locally.<br />
** git add 'my new activity'<br />
** git commit -m "commitMessage"<br />
<br />
=== Publish your patch on GitHub ===<br />
<br />
* Create an account on [https://github.com github]<br />
* Fork [https://github.com/gcompris/GCompris-qt GCompris]<br />
** Look at these [http://help.github.com/fork-a-repo/ instructions]<br />
* Code your activity<br />
* Commit the code<br />
* Push it<br />
** git push<br />
* Send a pull request on github or create a task in the "Need review" section at https://phabricator.kde.org/project/view/142/ with the description and link to your diff at https://phabricator.kde.org/differential/diff/create/ <br />
<br />
You can visit [http://gcompris.net/wiki/Qt_Quick_development_process Qt Quick development process] for more details.<br />
<br />
[[Category:English]]</div>Dmadaanhttp://gcompris.net/mediawiki-1.31.0/index.php?title=GSOC_newcomers&diff=4609GSOC newcomers2017-05-18T17:25:47Z<p>Dmadaan: /* When accepted */</p>
<hr />
<div>== Write a SoK/GSoC proposal ==<br />
You are a student and want to participate to either sok or gsoc. For this, you have to write a proposal on what you plan to do.<br />
<br />
Important note: If you don't follow this, your application will not be considered.<br />
<br />
=== Idea pages ===<br />
There are several pages that can help you find what we'd like to see on GCompris:<br />
* You can navigate in our phabricator pages: https://phabricator.kde.org/project/view/1/<br />
* There are ideas here: http://gcompris.net/wiki/Ideas_for_activities<br />
* https://bugs.kde.org/buglist.cgi?quicksearch=gcompris&list_id=1393147<br />
If you have ideas that are not listed there, don't hesitate to propose them.<br />
<br />
The aim is not to do everything. You have to keep in mind the time length of the event.<br />
=== Proposal writing steps===<br />
You need to describe what you plan to do. For each activity:<br />
* Write the general purpose.<br />
* Describe of this purpose will be achieved.<br />
* Provide a mockup of each screen you want to realise or improve, describing what the role of the elements are. <br />
<br />
The final realisation could be different from what is planned at the beginning but this step is important for you and for us.'''<br />
<br />
=== Be realistic ===<br />
Review process and corrections take time. In reality as much as the first code completion. Take this fact into account when doing your timeline. We prefer realistic plans!<br />
If you plan to work on several activities, due to review time, at one point of the project you will have to work on them in parallel.<br />
<br />
=== Submit ===<br />
Send a mail to '''gcompris-devel@kde.org''' with a link to your proposal (github page, google doc, personal website...) and estimated timeline.<br />
In the timeline, don't forget that mentors have to review the changes and then changes will probably have to be done in the code.<br />
<br />
=== Introduction to GCompris community ===<br />
If you haven't gotten in touch previously, we ask new comers to do a little exercise: http://gcompris.net/wiki/An_exercise_for_new_contributors.<br />
<br />
=== Proposal submission ===<br />
The submission of the proposal must be done on the corresponding website before the deadline.<br />
<br />
=== Check table ===<br />
In order to avoid missing steps, refer to this table before submitting your proposal.<br />
{| class="wikitable"<br />
|-<br />
! Steps to do<br />
! Done<br />
|-<br />
| Write project general purpose,<br />
|-<br />
| Draw mockup for each screen,<br />
|-<br />
| Describe the different objects of a view and their interactions,<br />
|-<br />
| Provide a realistic timetable for each project sub part,<br />
|-<br />
| Write down basic tests for each project sub part,<br />
|}<br />
<br />
== When accepted ==<br />
<br />
Congratulations, you have been selected to participate to GCompris GSoC or SoK.<br />
Here are a few links to start your community bonding period and set up your environment.<br />
<br />
=== Introduction to GCompris community ===<br />
If you haven't done it yet, send a mail to gcompris-devel@kde.org to introduce yourself:<br />
* Name, country, university... Whatever you want to share that can be useful.<br />
* Describe what you plan to do in GCompris, which part of GCompris will you improve...<br />
<br />
=== Setting your KDE account ===<br />
If you don't have one, you need to create a KDE account (https://identity.kde.org/). Then you need to apply for a KDE Developer account (https://community.kde.org/Infrastructure/Get_a_Developer_Account#Apply_for_an_account) and ask for a developer access (precise that you will do GSOC/SoK under GCompris). More information can be found at https://community.kde.org/Sysadmin/GitKdeOrgManual#How_to_get_read-write_developer_access <br />
<br />
We also plan to use https://phabricator.kde.org/ to track our progress so you'll also need an account.<br />
It provides a lot of useful tools:<br />
* https://phabricator.kde.org/paste/ to paste text (crash reports, code snippets...)<br />
* https://phabricator.kde.org/differential/ for code review.<br />
* https://phabricator.kde.org/conpherence/ for having multiple people conversations.<br />
* https://phabricator.kde.org/maniphest/ to create tasks and follow their achievements.<br />
<br />
First step is to assign to yourself all the tasks you plan to do in https://phabricator.kde.org/project/view/1/.<br />
<br />
=== Using git on KDE ===<br />
You can see the git at https://phabricator.kde.org/source/gcompris/ (or https://cgit.kde.org/gcompris.git if you are not connected).<br />
As you will push work on it, you need to clone git@git.kde.org:gcompris.git.<br />
<br />
You can create a branch for your GSoC: git checkout -b mybranch and work on it.<br />
Don't forget to rebase on master from time to time.<br />
Once you think you finished your activity, you need to create a code review for mentors to comment the code.<br />
<br />
=== Informing on your progress ===<br />
In a work, the most important thing is communication. Without it, we can't know what the other people are doing, if they have issues...<br />
Do not hesitate to discuss as long as you have issues to be sure you've understood and fixed all of them.<br />
<br />
Also, you need to create a blog detailing what you have done and add your blog posts to https://planetkde.org/ in order to the KDE community to follow what you've done. If you do not have one, you can create one using https://pages.github.com/ or Wordpress. please try to do a blog post at least '''every month'''.<br />
<br />
Moreover, using maniphest phabricator, you can describe precisely what you will do, state your task status and this will permit us and you to see where you are in your timeline (late or in advance).<br />
<br />
=== Code quality ===<br />
<br />
We hope that GCompris will be maintained for years if not decades. It is thus important that your code is clean enough to be reviewed and amended by anyone knowing Qt Quick.<br />
<br />
Here are some points you have to check:<br />
<br />
* Copyright headers in each source file must contain your copyright if you create them<br />
* Once your code is done, make some clean up, there should not be any unused variable or file.<br />
* Follow coding rules and indent properly your code.<br />
* Avoid files with many global variables or functions with too many parameters. This indicates that there is something wrong in your code.<br />
* Avoid repeated code. There is an option in Qt Creator to refactor a QML object. It will be put in a dedicated file named after the object id (right click -> refactoring).<br />
* Try to follow an object orientated approach by putting javascript functions specific to a QML object within the object itself instead of the global javascript file. This makes it easy to see what's possible to do with a Qml object.<br />
* The preferred graphic format is SVG.<br />
* If you take content from the Internet, graphics, sounds or anything it must be credited in a README file in the resource directory. It must name the file, the copyright and the link where you took it. the copyright must be compatible with the GPL.<br />
* We rely on a lot on graphics but not everyone is skilled enough to make them. The good practise is to re-use existing graphics from GCompris (you can easily mix and change SVG files with Inkscape). If no graphic come close to what you need, the first place to check is [http://openclipart.org http://openclipart.org]<br />
* If you don't find open content good enough don't worry, the GCompris graphic team will redo them when your activity is ready.<br />
* GCompris is translated in many languages. Thus, we need to take care of it in the code. All the strings that should be translated must be between qsTr(). Don't put variables in qsTr(), only real strings (in "").<br />
* Prefix your commit messages by the activity name, i.e: "sudoku, fix bad anchor of the grid".<br />
<br />
=== Development workflow ===<br />
<br />
Once you have your KDE account you have commit rights on the GCompris repository and on other KDE projects. But you must not commit on the master branch directly, you must notice the maintainers of GCompris that you are ready and the review process will start.<br />
<br />
Your development must be done in a specific branch on the KDE GCompris git. Name your branch with the following scheme :<br />
<br />
* [sok|gsoc]_[nickname]_[activity_name]<br />
<br />
As we mention, code quality is of major importance. When you get review feedback change your code accordingly and tell you are ready for another review. Understand that it takes time to make review, so please take in account all our remarks and take time to refactor your code to make it clean, simple, logical and easy to read.<br />
<br />
<br />
=== Check table ===<br />
As mentioned earlier review requires a lot of time. Again a quick check table to help you before submitting a review request.<br />
{| class="wikitable"<br />
|-<br />
! Steps to do<br />
! Done<br />
|-<br />
| Every file must have a license header with your name on it if you wrote it.<br />
|-<br />
| Every strings that should be translated must be between qsTr().<br />
|-<br />
| Variable names and files must "tell' what they do. pointImageRepeater is prefereble to repeater.<br />
|-<br />
| Prefix your commit messages by the activity name, i.e: "sudoku, fix bad anchor of the grid".<br />
|-<br />
| Clean unused variables or files.<br />
|-<br />
| Indent properly your code.<br />
|}</div>Dmadaanhttp://gcompris.net/mediawiki-1.31.0/index.php?title=GSOC_newcomers&diff=4608GSOC newcomers2017-05-18T17:21:29Z<p>Dmadaan: /* Write a sok/gsoc proposal */</p>
<hr />
<div>== Write a SoK/GSoC proposal ==<br />
You are a student and want to participate to either sok or gsoc. For this, you have to write a proposal on what you plan to do.<br />
<br />
Important note: If you don't follow this, your application will not be considered.<br />
<br />
=== Idea pages ===<br />
There are several pages that can help you find what we'd like to see on GCompris:<br />
* You can navigate in our phabricator pages: https://phabricator.kde.org/project/view/1/<br />
* There are ideas here: http://gcompris.net/wiki/Ideas_for_activities<br />
* https://bugs.kde.org/buglist.cgi?quicksearch=gcompris&list_id=1393147<br />
If you have ideas that are not listed there, don't hesitate to propose them.<br />
<br />
The aim is not to do everything. You have to keep in mind the time length of the event.<br />
=== Proposal writing steps===<br />
You need to describe what you plan to do. For each activity:<br />
* Write the general purpose.<br />
* Describe of this purpose will be achieved.<br />
* Provide a mockup of each screen you want to realise or improve, describing what the role of the elements are. <br />
<br />
The final realisation could be different from what is planned at the beginning but this step is important for you and for us.'''<br />
<br />
=== Be realistic ===<br />
Review process and corrections take time. In reality as much as the first code completion. Take this fact into account when doing your timeline. We prefer realistic plans!<br />
If you plan to work on several activities, due to review time, at one point of the project you will have to work on them in parallel.<br />
<br />
=== Submit ===<br />
Send a mail to '''gcompris-devel@kde.org''' with a link to your proposal (github page, google doc, personal website...) and estimated timeline.<br />
In the timeline, don't forget that mentors have to review the changes and then changes will probably have to be done in the code.<br />
<br />
=== Introduction to GCompris community ===<br />
If you haven't gotten in touch previously, we ask new comers to do a little exercise: http://gcompris.net/wiki/An_exercise_for_new_contributors.<br />
<br />
=== Proposal submission ===<br />
The submission of the proposal must be done on the corresponding website before the deadline.<br />
<br />
=== Check table ===<br />
In order to avoid missing steps, refer to this table before submitting your proposal.<br />
{| class="wikitable"<br />
|-<br />
! Steps to do<br />
! Done<br />
|-<br />
| Write project general purpose,<br />
|-<br />
| Draw mockup for each screen,<br />
|-<br />
| Describe the different objects of a view and their interactions,<br />
|-<br />
| Provide a realistic timetable for each project sub part,<br />
|-<br />
| Write down basic tests for each project sub part,<br />
|}<br />
<br />
== When accepted ==<br />
<br />
Congratulations, you have been selected to participate to GCompris GSOC or SoK.<br />
Here are a few links to start your community bonding period and set up your environment.<br />
<br />
=== Introduction to GCompris community ===<br />
If you haven't done it yet, send a mail to gcompris-devel@kde.org to introduce yourself:<br />
* Name, country, university... Whatever you want to share that can be useful.<br />
* Describe what you plan to do in GCompris, which part of GCompris will you improve...<br />
<br />
=== Setting your KDE account ===<br />
If you don't have one, you need to create a KDE account (https://identity.kde.org/). Then you need to apply for a KDE Developer account (https://community.kde.org/Infrastructure/Get_a_Developer_Account#Apply_for_an_account) and ask for a developer access (precise that you will do GSOC/SoK under GCompris). More information can be found at https://community.kde.org/Sysadmin/GitKdeOrgManual#How_to_get_read-write_developer_access <br />
<br />
We also plan to use https://phabricator.kde.org/ to track our progress so you'll also need an account.<br />
It provides a lot of useful tools:<br />
* https://phabricator.kde.org/paste/ to paste text (crash reports, code snippets...)<br />
* https://phabricator.kde.org/differential/ for code review<br />
* https://phabricator.kde.org/conpherence/ for having multiple people conversations<br />
* https://phabricator.kde.org/maniphest/ to create tasks and follow their achievements<br />
<br />
First step is to assign to yourself all the tasks you plan to do in https://phabricator.kde.org/project/view/1/.<br />
<br />
=== Using git on KDE ===<br />
You can see the git at https://phabricator.kde.org/diffusion/GCOMPRIS/ (or https://cgit.kde.org/gcompris.git if you are not connected).<br />
As you will push work on it, you need to clone git@git.kde.org:gcompris.git.<br />
<br />
You can create a branch for your gsoc: git checkout -b mybranch and work on it.<br />
Don't forget to rebase on master from time to time.<br />
Once you think you finished your activity, you need to create a code review for mentors to comment the code.<br />
<br />
=== Informing on your progress ===<br />
In a work, the most important thing is communication. Without it, we can't know what the other people are doing, if they have issues...<br />
Do not hesitate to discuss as long as you have issues to be sure you've understood and fixed all of them.<br />
<br />
Also, you need to create a blog detailing what you have done and add your blog posts to https://planetkde.org/ in order to the KDE community to follow what you've done. If you do not have one, you can create one using https://pages.github.com/ or Wordpress. please try to do a blog post at least '''every month'''.<br />
<br />
Moreover, using maniphest phabricator, you can describe precisely what you will do, state your task status and this will permit us and you to see where you are in your timeline (late or in advance).<br />
<br />
=== Code quality ===<br />
<br />
We hope that GCompris will be maintained for years if not decades. It is thus important that your code is clean enough to be reviewed and amended by anyone knowing Qt Quick.<br />
<br />
Here are some points you have to check:<br />
<br />
* Copyright headers in each source file must contain your copyright if you create them<br />
* Once your code is done, make some clean up, there should not be any unused variable or file.<br />
* Follow coding rules and indent properly your code.<br />
* Avoid files with many global variables or functions with too many parameters. This indicates that there is something wrong in your code.<br />
* Avoid repeated code. There is an option in Qt Creator to refactor a QML object. It will be put in a dedicated file named after the object id (right click -> refactoring).<br />
* Try to follow an object orientated approach by putting javascript functions specific to a QML object within the object itself instead of the global javascript file. This makes it easy to see what's possible to do with a Qml object.<br />
* The preferred graphic format is SVG.<br />
* If you take content from the Internet, graphics, sounds or anything it must be credited in a README file in the resource directory. It must name the file, the copyright and the link where you took it. the copyright must be compatible with the GPL.<br />
* We rely on a lot on graphics but not everyone is skilled enough to make them. The good practise is to re-use existing graphics from GCompris (you can easily mix and change SVG files with Inkscape). If no graphic come close to what you need, the first place to check is [http://openclipart.org http://openclipart.org]<br />
* If you don't find open content good enough don't worry, the GCompris graphic team will redo them when your activity is ready.<br />
* GCompris is translated in many languages. Thus, we need to take care of it in the code. All the strings that should be translated must be between qsTr(). Don't put variables in qsTr(), only real strings (in "").<br />
* Prefix your commit messages by the activity name, i.e: "sudoku, fix bad anchor of the grid".<br />
<br />
=== Development workflow ===<br />
<br />
Once you have your KDE account you have commit rights on the GCompris repository and on other KDE projects. But you must not commit on the master branch directly, you must notice the maintainers of GCompris that you are ready and the review process will start.<br />
<br />
Your development must be done in a specific branch on the KDE GCompris git. Name your branch with the following scheme :<br />
<br />
* [sok|gsoc]_[nickname]_[activity_name]<br />
<br />
As we mention, code quality is of major importance. When you get review feedback change your code accordingly and tell you are ready for another review. Understand that it takes time to make review, so please take in account all our remarks and take time to refactor your code to make it clean, simple, logical and easy to read.<br />
<br />
<br />
=== Check table ===<br />
As mentioned earlier review requires a lot of time. Again a quick check table to help you before submitting a review request.<br />
{| class="wikitable"<br />
|-<br />
! Steps to do<br />
! Done<br />
|-<br />
| Every file must have a license header with your name on it if you wrote it.<br />
|-<br />
| Every strings that should be translated must be between qsTr().<br />
|-<br />
| Variable names and files must "tell' what they do. pointImageRepeater is prefereble to repeater.<br />
|-<br />
| Prefix your commit messages by the activity name, i.e: "sudoku, fix bad anchor of the grid".<br />
|-<br />
| Clean unused variables or files.<br />
|-<br />
| Indent properly your code.<br />
|}</div>Dmadaanhttp://gcompris.net/mediawiki-1.31.0/index.php?title=Qt_Quick_development_process&diff=4596Qt Quick development process2017-01-02T21:26:42Z<p>Dmadaan: minSdkVersion error during compilation for android.</p>
<hr />
<div>{{TOCright}}<br />
= Learning Qt Quick =<br />
<br />
Some pointers to discover Qt Quick:<br />
* [http://doc.qt.io/qt-5/gettingstarted.html Getting Started with Qt]<br />
* [http://doc.qt.io/qt-5/gettingstartedqml.html Getting Started Programming with Qt Quick]<br />
* [http://qmlbook.org/index.html Qml Book]<br />
<br />
A step by step exercise to dig into Qt Quick with the QtCreator development environment:<br />
* [http://qt-project.org/doc/qtcreator QtCreator]<br />
<br />
= Coding Style =<br />
<br />
We follow [http://qt-project.org/doc/qt-5/qml-codingconventions.html this coding style].<br />
<br />
= Source code =<br />
<br />
Here is the [http://quickgit.kde.org/?p=gcompris.git official repository] for the source code. Alternatively you can also get the code on [https://github.com/bdoin/GCompris-qt GitHub].<br />
<br />
= Compilation prerequisites =<br />
<br />
For Debian based systems, in order to compile GCompris you need to install the following packages:<br />
<br />
== Compilation chain ==<br />
<br />
<code><pre><br />
sudo apt-get install cmake<br />
sudo apt-get install cmake-curses-gui # Optional<br />
sudo apt-get install g++<br />
sudo apt-get install libgl1-mesa-dev<br />
</pre></code><br />
<br />
== Qt5 ==<br />
<br />
<code><pre><br />
sudo apt-get install qt5-default<br />
sudo apt-get install qtdeclarative5-dev<br />
sudo apt-get install qtmultimedia5-dev<br />
sudo apt-get install libqt5svg5-dev<br />
sudo apt-get install libqt5xmlpatterns5-dev<br />
sudo apt-get install libqt5sensors5-dev<br />
sudo apt-get install qml-module-qtquick-particles2<br />
sudo apt-get install qttools5-dev-tools<br />
</pre></code><br />
<br />
= Compilation =<br />
<br />
[https://cmake.org/download/ CMake] is a cross-platform free software program for managing the build process of software using a compiler-independent method.<br />
The minimum version to compile GCompris is 2.8 (recommended 3.5.1)<br />
<br />
* Get the [http://quickgit.kde.org/?p=gcompris.git source code]:<br />
<pre><br />
git clone https://github.com/gcompris/GCompris-qt<br />
</pre><br />
* Initialize the git submodule(s)<br />
<pre><br />
cd gcompris<br />
git submodule init && git submodule update<br />
</pre><br />
* Download and Install the latest stable version of [https://www.qt.io/download-open-source/#section-2 Qt] (This includes QtCreator in the Tools/QtCreator directory. Recommended version-5.5.0). For running on Android, download the Android version. <br />
* Start QtCreator and open the project file CMakeLists.txt at the root of the source code<br />
* Create a build directory and set it in Qt Creator<br />
* Compile and run it. (No need of giving any arguments to CMake, if QtCreator asks for it)<br />
<br />
To compile from the command line you need:<br />
* export Qt5_DIR=$HOME/Qt/5.4.2/5.4/lib/cmake/Qt5 (This path varies with your installed version)<br />
* mkdir build<br />
* cd build<br />
* cmake ..<br />
* make<br />
<br />
To make it run on Android you need first to follow [http://qt-project.org/doc/qt-5/android-support.html these instructions].<br />
<br />
= Generate core API documentation =<br />
<br />
KDE uses [http://quickgit.kde.org/?p=kapidox.git kapidox], a wrapper around [http://www.doxygen.org doxygen] to generate API documentation. Kapidox uses [https://github.com/agateau/doxyqml doxyqml] for generating documentation for QML code.<br />
<br />
In GCompris we document all classes in the src/core/ directory.<br />
<br />
To build this API documentation you need:<br />
<br />
* Install doxygen.<br />
* Build kapidox from http://quickgit.kde.org/?p=kapidox.git<br />
* Install doxyqml from https://github.com/agateau/doxyqml. (Note: need at least version 0.2.0 that supports readonly QML properties.)<br />
<br />
Then do<br />
<br />
kgenapidox ./path/to/gcompris-checkout/<br />
<br />
and find your documentation under apidocs/.<br />
<br />
= Adding a new activity =<br />
<br />
== Automatically ==<br />
<br />
Let's say you want to port the algebra_by activity.<br />
<br />
<pre><br />
cd src/activities<br />
./createit.sh algebra_by<br />
</pre><br />
<br />
And you're done, you can run ''CMake'' again in QtCreator and your activity should appear on the list.<br />
<br />
== Manually ==<br />
<br />
You must create a directory for your activity in src/activities. In it, create an ActivityInfo.qml, CMakeLists.txt and your qml entry point AlgebraBy.qml.<br />
<br />
* in src/activities/activities.txt add the directory name of your activity (keep the file sorted).<br />
* check algebra_by/ActivityInfo.qml that the name references you Qml activity entry point and that the icon point to your icon name (preferred format is svg).<br />
<br />
== Getting old menus ==<br />
<br />
If your activity is an existing one, you can move its ported ''ActivityInfo'' and icon:<br />
<br />
<pre><br />
git mv tools/menus/algebra_by.qml src/activities/algebra_by/AlgebraBy.qml<br />
git mv tools/menus/resource/algebra_by.svg src/activities/algebra_by/algebra_by<br />
</pre><br />
<br />
== Extending another activity ==<br />
<br />
If the activity is just an extension of an existing one you have to create it either manually or automatically and then change you .qml file to extend another one. The 'erase_clic' activity is a good example.<br />
<br />
In your .qml file:<br />
<br />
* just import the activity you want to extend with for example: ''import "qrc:/gcompris/src/activities/erase"''<br />
* instead of have your root item being an 'ActivityBase' you just create an object of the base type you want to extend like Erase.<br />
* Use a property to pass parameters to your base item and customize it<br />
<br />
= Coding guidelines =<br />
<br />
Keep only small Javascript in the QML code, all the game logic must be in your Javascript file. This makes it easier to read the activity logic. It is possible to have several Javascript files if needed. The QML files must be seen as the graphical interface description and the Javascript the logic of the game.<br />
<br />
== Resolution independence ==<br />
<br />
Your activity must look nice on tablets and desktops. The resolution and ''dpi'' value may differ a lot.<br />
<br />
=== Images and Graphics ===<br />
<br />
On mobile with high ''dpi'' the size of your images and graphics will look smaller. You must set an initial size related to ApplicationInfo.ratio like this:<br />
<br />
<pre><br />
Image {<br />
id: ball<br />
source: "qrc:/gcompris/src/activities/ballcatch/resource/ball.svg"<br />
sourceSize.height: 100 * ApplicationInfo.ratio<br />
}<br />
</pre><br />
<br />
<br />
====== Convert png images to svg ======<br />
<br />
We prefer svg format for images for activities. Convert your 'png' images to 'svg' like this:<br />
<br />
1) Copy all your png images inside a folder.<br><br />
2) Copy this python [https://raw.githubusercontent.com/iamutkarshtiwari/pngTosvg/master/png2svg.py script] inside the same folder. <br><br />
3) Run the above python script.<br><br />
<br />
Voila! New converted svg images are created in the same directory.<br />
<br />
=== Fonts ===<br />
<br />
The situation for fonts is comparable. The [http://doc.qt.io/qt-5/qml-qtquick-text.html#font.pointSize-prop font.pointSize] property of Text-like QML elements handles device independence to a certain degree. An exception are devices with relativ low-dpi and a high resolution (i.e. many tablet devices >= 10'), where fonts are rendered too small when using pointSize.<br />
<br />
For this case we use calculated constant ApplicationInfo.fontRatio, that must be used a factor to a font.pointSize value. This is done automatically when the size is set via the fontSize property of the GCFont type, which is the recommended way to specify font-sizes. Example:<br />
<br />
<pre><br />
GCText {<br />
id: text<br />
text: "Text"<br />
fontSize: 14<br />
font.weight: Font.DemiBold<br />
color: "white"<br />
}<br />
</pre><br />
<br />
You can also use the internal pseudo enum values of GCText, that specify some often used font-sizes:<br />
<br />
<pre><br />
readonly property int tinySize: 10.0<br />
readonly property int smallSize: 12.0<br />
readonly property int regularSize: 14.0<br />
readonly property int mediumSize: 16.0<br />
readonly property int largeSize: 24.0<br />
readonly property int hugeSize: 32.0<br />
</pre><br />
<br />
<pre><br />
GCText {<br />
...<br />
fontSize: regularSize<br />
...<br />
}<br />
</pre><br />
<br />
== Window resize ==<br />
<br />
Your activity must adapt its content properly when the window is resized.<br />
<br />
== Screen rotation ==<br />
<br />
Your activity must support screen rotation. If you use a layout or you specify an item coordinated related to the window width you are safe. If you create absolute coordinate items, you may need to reset them when the screen is changed. To detect a rotation you can add a code like this in your ''ActivityBase'':<br />
<br />
<pre><br />
onWidthChanged: Activity.widthChanged()<br />
</pre><br />
<br />
== Audio ==<br />
<br />
Creating Audio items is rather slow. If you have a lot of items on the screen, do not create an Audio item for each. Instead create a single Audio and pass it to all your items.<br />
<br />
In order to play audio only if audio has been enabled in the preferences, use the core ''GCAudio'' item instead of ''Audio''. Make sure to use ''import "../../core"''.<br />
<br />
== Background image ==<br />
<br />
You must not use a background image to bring useful informations. It is not possible to keep the background aligned with items when the resolution is changed.<br />
<br />
== Adding a configuration for a specific activity ==<br />
<br />
Each activity can have a specific configuration (for example, changing the locale of the activity, having different modes...). A simple example can be found on Traffic activity where you can change between images and colors to display the cars.<br />
<br />
To add configuration, you need to add the "config" value in the Bar.<br />
Then you have to add a DialogActivityConfig item where you will define the component item of the dialog. You need to define the following functions:<br />
* setDefaultValues to set the values when displaying the configuration.<br />
* onLoadData which is called to load the existing data from configuration.<br />
* onSaveData which is called to save the configuration in configuration file and where you can also send signals to dynamically change current activity settings.<br />
<br />
The data should be set in "dataToSave" attribute which is a map (pairs of key, values) where the keys are strings and values are javascript var (can be strings, lists...).<br />
<br />
Accessing the component items can be done using: dialogActivityConfig.configItem.<br />
<br />
For the data to be loaded at start of activity, you also need to call "dialogActivityConfig.getInitialConfiguration()" on Component.onCompleted() of your pageComponent item.<br />
<br />
== Compiling GCompris for Desktop ==<br />
You can still use QtCreator to develop. Within it, open the CMakeLists.txt on top-level of GCompris. Select a directory (create a folder at same level as the gcompris folder for example) and then click on "Run CMake" button then finish.<br />
<br />
To compile GCompris on command line, you can create a directory GCompris-qt-build at same level as the gcompris folder, go into it and type "cmake ../gcompris && make". You have the possibility to check which activities you want to compile or not.<br />
<br />
If you want to create an auto extractible package for linux platforms, you need to launch cmake using: "cmake -DBUILD_STANDALONE=ON ../gcompris && make". <br />
<br />
=== Troubleshooting ===<br />
<br />
* If you get the error: "The imported target "Qt5::Gui" references the file "Qt5Gui_EGL_LIBRARY-NOTFOUND" but this file does not exist."<br />
<br />
<pre><br />
sudo apt-get install libgl1-mesa-glx<br />
</pre><br />
<br />
try again <br />
If this still shows the same error or tells you - /usr/bin/ld: cannot find -lGL - <br />
do :<br />
<pre><br />
on a 32 bits system<br />
cd /usr/lib/i386-linux-gnu<br />
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 libGL.so<br />
<br />
on a 64 bits system<br />
cd /usr/lib/x86_64-linux-gnu<br />
sudo ln -s /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 libGL.so<br />
</pre><br />
<br />
* If you miss the GL/gl.h header, install it with ''sudo apt-get install mesa-common-dev''<br />
<br />
* If you get the error: "The imported target "Qt5::Gui" references the file "Qt5Gui_EGL_LIBRARY-NOTFOUND" but this file does not exist."<br />
<br />
<br />
<br />
== Compiling GCompris for Android ==<br />
You need first to install '''ant''' (java tool) from your favorite package manager.<br />
Then install openjdk (for example it could be openjdk-8-jdk from your favorite package manager).<br />
<br />
Then you need to download and install android ndk ([https://developer.android.com/tools/sdk/ndk/index.html NDK]) and android sdk ([https://developer.android.com/sdk/index.html SDK]).<br />
<br />
You also need to install the KDE extra-cmake-modules dependency (apt-get install extra-cmake-modules).<br />
<br />
To make it easier and because we don't need eclipse contained in adt-bundle-linux-x86-xxxxx, copy the directory sdk under for example ~/Android/ and rename it as android-sdk. Also, rename android-ndk-r9d as android-ndk and copy it under ~/Android/<br />
<br />
The Android SDK you have downloaded does not contain yet an Android platform or any third-party libraries. In fact. In order to start developing applications, you must install the Platform-tools and at least one version of the Android platform, using the SDK Manager.<br />
To start the SDK Manager, please execute the program "android".<br />
Please read SDK Readme.txt under android-sdk to get more precise informations.<br />
<br />
Then you need to add some environment variables by editing ~/.bashrc to add at the end (put the directories where you installed ndk/sdk):<br />
<pre><br />
export ANDROID_NDK=~/Android/android-ndk<br />
export ANDROID_NDK_ROOT=$ANDROID_NDK<br />
export ANDROID_SDK_ROOT=~/Android/android-sdk<br />
export PATH=$PATH:~/Android/android-sdk/platform-tools<br />
export Qt5_android=~/Qt5.5.1/5.5/android_armv7/<br />
</pre><br />
<br />
It may be possible that ccmake tells you that sdk version is not installed for its version 19.<br />
Go then to ~/Android/android-sdk/tools/ then start the shell program ./android.<br />
Install Kitkat 4.4.1.<br />
<br />
With Qt5.3, you'll probably need to create symbolic links for Qt libraries (if you have the error Qt5.3.0/5.3/android_armv7/lib/libQt5Core.so.5.3.0 not found):<br />
<pre><br />
cd Qt5.3.0/5.3/android_armv7/lib<br />
for f in $(ls *.so); do ln -s $f $f.5.3.0; done<br />
</pre><br />
<br />
(At this point, if you do not find the directory android_armv7, you may have downloaded the wrong qt setup file. You have probably downloaded <br />
Qt 5.5.1 for Linux <br />
instead of <br />
Qt 5.5.1 for Android)<br />
<br />
Create a folder at the same level as the gcompris folder and into it type "ccmake -DQt5_DIR=${Qt5_android} -DCMAKE_TOOLCHAIN_FILE=/usr/share/ECM/toolchain/Android.cmake -Wno-dev ../gcompris_developers/ && make && make apk_debug" to get a GCompris apk.<br />
This opens ccmake which is a console application. Run the configuration step by typing "C" on you keyboard.<br />
<br />
If it tells you "Could not find a package configuration file provided by Qt5", press "e" to set the path for Qt5_DIR.<br />
To do this, press "enter", this will place the cursor on the first path line. With the down key go to Qt5_DIR line, press again "Enter" then modify the path.<br />
For example the path can be: /home/myname/Qt5.3.0/5.3/android_armv7/lib/cmake/Qt5 where Qt5.3.0 is the Qt installation directory.<br />
<br />
Then press "G" to build and "E" to quit.<br />
<br />
Problems which could occurs while using ccmake:<br />
<br />
* ccmake is telling you that it does not find opengl (qopengl.h:122:21: fatal error: GL/gl.h: No such file or directory) : you are maybe pointing to the wrong path. You are pointing to the qt5 desktop library instead of pointing to the arm libraries: You have maybe pointed to /home/myname/Qt5.5.0/5.5/gcc/lib/cmake/Qt5Core/ when you should point to /home/myname/Qt5.5.0/5.5/android_armv7/lib/cmake/Qt5Core.<br />
<br />
* ccmake is telling you that it does not find ANDROID_DEPLOY_QT: You are maybe pointing to /home/myname/Qt5.5.0/5.5/android_armv7/bin you have to point to the androiddeployqt file /home/myname/Qt5.5.0/5.5/android_armv7/bin/androiddeployqt<br />
<br />
* ccmake is telling you that you have an Invalid minSdkVersion version, minSdkVersion must be >= 16. This maybe due to the incorrect sdkVersion. You should change the minSdkVersion to 16 or 18 in the AndroidManifest.xml.cmake in the source directory. If it does not work and the minSdkVersion is reset each time then you may be doing the change in buildDirectory/android/AndroidManifest.xml.cmake and not in sourceDirectory/android/AndroidManifest.xml.cmake.<br />
<br />
This is how ccmake could looks like once started:<br />
<pre><br />
ANDROID_ABI armeabi <br />
ANDROID_DEPLOY_QT /home/myname/Qt5.5.0/5.5/android_armv7/bin/androiddeployqt<br />
ANDROID_JAVA_API_LEVEL android-19<br />
ANDROID_NATIVE_API_LEVEL 19<br />
BUILD_STANDALONE ON<br />
CMAKE_ASM_COMPILER /home/myname/Development/Android/android-ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/b<br />
CMAKE_BUILD_TYPE<br />
CMAKE_INSTALL_PREFIX /home/myname/Development/Android/android-ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/u<br />
COMPRESSED_AUDIO ogg<br />
ECM_DIR ECM_DIR-NOTFOUND<br />
EXECUTABLE_OUTPUT_PATH /home/myname/Development/GComprisNew/GCompris-qt/bin<br />
KF5_DIR KF5_DIR-NOTFOUND<br />
LIBRARY_OUTPUT_PATH /home/myname/Development/GComprisNew/GCompris-qt/libs/armeabi<br />
LIBRARY_OUTPUT_PATH_ROOT /home/myname/Development/GComprisNew/GCompris-qt<br />
Qt5AndroidExtras_DIR /home/myname/Qt5.5.0/5.5/android_armv7/lib/cmake/Qt5AndroidExtras<br />
Qt5Core_DIR /home/myname/Qt5.5.0/5.5/android_armv7/lib/cmake/Qt5Core<br />
Qt5Gui_DIR /home/myname/Qt5.5.0/5.5/android_armv7/lib/cmake/Qt5Gui<br />
Qt5LinguistTools_DIR /home/myname/Qt5.5.0/5.5/android_armv7/lib/cmake/Qt5LinguistTools<br />
Qt5Multimedia_DIR /home/myname/Qt5.5.0/5.5/android_armv7/lib/cmake/Qt5Multimedia<br />
Qt5Network_DIR /home/myname/Qt5.5.0/5.5/android_armv7/lib/cmake/Qt5Network<br />
Qt5Qml_DIR /home/myname/Qt5.5.0/5.5/android_armv7/lib/cmake/Qt5Qml<br />
Qt5Quick_DIR /home/myname/Qt5.5.0/5.5/android_armv7/lib/cmake/Qt5Quick<br />
Qt5Svg_DIR /home/myname/Qt5.5.0/5.5/android_armv7/lib/cmake/Qt5Svg<br />
Qt5Widgets_DIR /home/myname/Qt5.5.0/5.5/android_armv7/lib/cmake/Qt5Widgets<br />
Qt5XmlPatterns_DIR /home/myname/Qt5.5.0/5.5/android_armv7/lib/cmake/Qt5XmlPatterns<br />
Qt5Xml_DIR /home/myname/Qt5.5.0/5.5/android_armv7/lib/cmake/Qt5Xml <br />
QML_BOX2D_LIBRARY /home/myname/Development/GComprisNew/GCompris-qt/external/qml-box2d/<br />
<br />
</pre><br />
<br />
<br />
=== Creating the apk ===<br />
<br />
To create the apk in your android build directory:<br />
<pre><br />
make BuildTranslations<br />
make apk_debug<br />
</pre><br />
<br />
== Deploying on android device ==<br />
To deploy, plug you computer to your tablet. Go into you tablet preferences, switch on the developer mode.<br />
<br />
Into the console, type the following command:<br />
<pre>adb install -r GCompris-debug.apk</pre><br />
<br />
== Compiling GCompris for SailfishOS ==<br />
You need to download and install the sailfishOS SDK ([https://sailfishos.org/develop/ SDK]).<br />
Once done, you need to start the mersdk virtual machine:<br />
<pre><br />
VBoxManage startvm MerSDK<br />
</pre><br />
<br />
And ssh into it: <br />
<pre><br />
ssh -p 2222 -i ~/SailfishOS/vmshare/ssh/private_keys/engine/mersdk mersdk@localhost<br />
</pre><br />
<br />
In order to build you need to install cmake and git: <br />
<pre><br />
sb2 -t SailfishOS-armv7hl -m sdk-install -R zypper install cmake git<br />
</pre><br />
<br />
Then, you need to log in armv7hl:<br />
<pre><br />
sb2 -t SailfishOS-armv7hl<br />
</pre><br />
<br />
Clone the source code and on a separate folder type:<br />
<pre><br />
cmake -DSAILFISHOS=1 -DBUILD_ARCH=armv7hl ../gcompris/ && make package<br />
</pre><br />
<br />
You will probably have the following error at the end: CPack Error: Problem copying the package: /home/mersdk/build_arm/_CPack_Packages/Linux/RPM/gcompris-0.34-Linux.rpm to /home/mersdk/build_arm/gcompris-0.34-Linux.rpm but it's ok.<br />
You can find the generated package at: /home/mersdk/build_ arm/_CPack_Packages/Linux/RPM/harbour-gcompris-qt-0.34-1.armv7hl.rpm.<br />
<br />
If you want to build the translations, you need to install gettext (for msgattrib) and follow the chapter [[Qt_Quick_development_process#Getting_and_compiling_translations]].<br />
'''/!\ Does a Subversion package exist?''' Maybe [https://openrepos.net/content/nieldk/subversion-0 https://openrepos.net/content/nieldk/subversion-0]?<br />
<br />
You can also build for emulator (replace all armv7hl above with i486).<br />
To install on emulator, run the SailfishOS emulator and copy the rpm into it. You can copy it from the mersdk vm using the shared folders to get it from the mersdk and on your host:<br />
<pre><br />
scp -P 2223 -i ~/SailfishOS/vmshare/ssh/private_keys/SailfishOS_Emulator/nemo harbour-gcompris-qt-0.34_1-1.i486.rpm nemo@localhost:RPMS<br />
ssh -p 2223 -i ~/SailfishOS/vmshare/ssh/private_keys/SailfishOS_Emulator/nemo nemo@localhost<br />
pkcon install-local harbour-gcompris-qt-0.34-1_1.i486.rpm<br />
</pre><br />
It should now appear on the emulator.<br />
<br />
<br />
== Compiling GCompris for Ubuntu click ==<br />
You need to have a ubuntu OS installed and the ubuntu sdk (sudo apt-get install ubuntu-sdk).<br />
<br />
Clone the source code in a GCompris-qt folder.<br />
<br />
Then, you need to create the chroot environment (it can take some time) and log into it: <br />
<pre><br />
sudo click chroot -a armhf -f ubuntu-sdk-14.10 create<br />
sudo click chroot -a armhf -f ubuntu-sdk-14.10 run<br />
</pre><br />
You can use a newer one instead of 14.10.<br />
<br />
Inside the chroot, you need to manually install the QtQuickControls module and run the compilation command:<br />
<pre><br />
apt-get install qml-module-qtquick-controls:armhf<br />
cmake -DWITH_UBUNTU=on -DUBUNTU_CLICK=1 -DQt5_DIR=/usr/lib/arm-linux-gnueabihf/cmake/Qt5/ ../GCompris-qt/ && export QT_SELECT=qt5-arm-linux-gnueabihf && make && make DESTDIR=/tmp/click/ install<br />
</pre><br />
<br />
To compile and embed translations, you need to follow the chapter [[Qt_Quick_development_process#Getting_and_compiling_translations]].<br />
<br />
Then outside the chroot, you need to run the click command to create the package:<br />
<pre><br />
click build /tmp/click/<br />
</pre><br />
<br />
This will create the click package.<br />
<br />
== Compiling GCompris for Windows ==<br />
Compilation on Windows has been tested with mingw only.<br />
Download and install Qt for Windows with mingw ([http://www.qt.io/download-open-source/#section-2 http://www.qt.io/]). You also need to install NSIS ([http://nsis.sourceforge.net/Download NSIS homepage]).<br />
<br />
Then, in a in Qt/mingw console:<br />
<pre><br />
cmake -G"MinGW Makefiles" ..\gcompris && mingw32-make && mingw32-make package.<br />
</pre><br />
The package creation can take some time because of the dependencies retrieval.<br />
<br />
== Compiling GCompris for Mac OS X ==<br />
Compilation on OSX is quite similar to Linux.<br><br />
Install [http://www.cmake.org/ CMake]. The minimum version to compile GCompris is 2.8.<br />
Download and install [https://www.qt.io/download-open-source/#section-2 Qt] for OSX.<br />
Box2D compilation is not yet supported in macOSX, you have to disable it during compilation.<br />
Then in console:<br />
<pre><br />
$ git clone https://github.com/gcompris/GCompris-qt.git <br />
$ cd GCompris-qt<br />
$ git submodule init && git submodule update<br />
$ export Qt5_DIR=$HOME/Qt5.7.0/5.7/clang_64/lib/cmake/Qt5/<br />
(This path would vary with your Qt5 folder location)<br />
$ mkdir build<br />
$ cd build<br />
$ cmake -DQML_BOX2D_MODULE=disabled ..<br />
$ make<br />
</pre><br />
<br />
This should successfully build GCompris on your Mac.<br />
To run, start the GCompris-qt.app file in '''build/bin/''' folder.<br />
<br />
'''Issues:'''<br />
If you face issues regarding no 'svg/image load'. <br />
-Copy the plugins from <pre>~/Qt5.7.0/5.7/clang_64/plugins/</pre> to <br />
<pre>build/bin/GCompris-qt.app/Contents/Plugins/</pre><br />
<br />
== Getting and compiling translations ==<br />
By default, no translation are present in the git repository. We need to get them from the KDE svn [http://websvn.kde.org/trunk/l10n-kf5/ KDE i10n svn].<br />
You can see the translation status at [http://l10n.kde.org/stats/gui/trunk-kf5/po/gcompris_qt.po/ GCompris translation status].<br />
<br />
You need to have subversion and msgattrib installed.<br />
<br />
To get all the translation files, you need to create the Makefile using cmake (see above) and type:<br />
<br />
<pre><br />
make getSvnTranslations<br />
</pre><br />
<br />
This will copy all the po files to a po/ folder in the source directory.<br />
<br />
Once you have done this, you need to '''run again cmake''' in order to have all the translations handled.<br />
Then, to build the translations used by GCompris, type:<br />
<pre><br />
make BuildTranslations<br />
</pre><br />
<br />
Then go into the bin directory and type ./gcompris-qt to launch the software (or running from QtCreator). In the configuration dialog box, you can choose your language. Restart the application to see the language change.<br />
<br />
If you're compiling using Qt Creator, you can go to the Projects tab and in Build Steps, add a build step and check BuildTranslations.<br />
<br />
== Getting translations from the Gtk version ==<br />
<br />
When adding a Gtk ported activity in the QtQuick version, if you used the strings for texts of the Gtk version, you can update all existing translation files. For this, first you need to update existing translation files using (this will add the new strings which will be untranslated for now):<br />
<br />
<pre><br />
make UpdateTranslations<br />
</pre><br />
<br />
Then, using the convertPo.py tool (and the updateAll.sh which applies it to all translations), you can update the files to get the translations from the Gtk version (if they existed).<br />
<br />
== Adding resources ==<br />
<br />
* For resources, you have to put them in the ''resource'' directory of your activity<br />
* A compiled ''qrc'' file named ''youractivity.rcc'' is auto generated by the compilation chain<br />
* You must run ''cmake'' again to have new resources included in the ''qrc''<br />
* If you change a resource, a simple make will update the ''rcc'' file<br />
* To reference your resource, use a qrc:/ url in the source. The path is:<br />
<pre><br />
qrc:/gcompris/src/activities/*youractivity*/resource/*myfile.svg*<br />
</pre><br />
<br />
[[Category:English]]</div>Dmadaanhttp://gcompris.net/mediawiki-1.31.0/index.php?title=GSOC_newcomers&diff=4590GSOC newcomers2016-11-13T18:54:11Z<p>Dmadaan: /* Setting your KDE account */</p>
<hr />
<div>== Write a sok/gsoc proposal ==<br />
You are a student and want to participate to either sok or gsoc. For this, you have to write a proposal on what you plan to do.<br />
<br />
Important note: if you don't follow this, your application will not be considered.<br />
<br />
=== Idea pages ===<br />
There are several pages that can help you find what we'd like to see on GCompris:<br />
* you can navigate in our phabricator pages: https://phabricator.kde.org/project/view/1/<br />
* there are ideas here: http://gcompris.net/wiki/Ideas_for_activities<br />
* https://bugs.kde.org/buglist.cgi?quicksearch=gcompris&list_id=1393147<br />
If you have ideas that are not listed there, don't hesitate to propose them.<br />
<br />
The aim is not to do everything. You have to keep in mind the time length of the event.<br />
<br />
You need to describe what you plan to do (which activities, how, if possible have mock-ups...) and give a timeline for the project.<br />
<br />
Send a mail to '''gcompris-devel@kde.org''' with a link to your proposal (github page, google doc, personal website...) and estimated timeline.<br />
In the timeline, don't forget that mentors have to review the changes and then changes will probably have to be done in the code.<br />
<br />
=== Introduction to GCompris community ===<br />
If you haven't gotten in touch previously, we ask new comers to do a little exercise: http://gcompris.net/wiki/An_exercise_for_new_contributors.<br />
<br />
=== Proposal submission ===<br />
The submission of the proposal must be done on the corresponding website before the deadline.<br />
<br />
== When accepted ==<br />
<br />
Congratulations, you have been selected to participate to GCompris GSOC or SoK.<br />
Here are a few links to start your community bonding period and set up your environment.<br />
<br />
=== Introduction to GCompris community ===<br />
If you haven't done it yet, send a mail to gcompris-devel@kde.org to introduce yourself:<br />
* Name, country, university... Whatever you want to share that can be useful.<br />
* Describe what you plan to do in GCompris, which part of GCompris will you improve...<br />
<br />
=== Setting your KDE account ===<br />
If you don't have one, you need to create a KDE account (https://identity.kde.org/). Then you need to apply for a KDE Developer account (https://community.kde.org/Infrastructure/Get_a_Developer_Account#Apply_for_an_account) and ask for a developer access (precise that you will do GSOC/SoK under GCompris). More information can be found at https://community.kde.org/Sysadmin/GitKdeOrgManual#How_to_get_read-write_developer_access <br />
<br />
We also plan to use https://phabricator.kde.org/ to track our progress so you'll also need an account.<br />
It provides a lot of useful tools:<br />
* https://phabricator.kde.org/paste/ to paste text (crash reports, code snippets...)<br />
* https://phabricator.kde.org/differential/ for code review<br />
* https://phabricator.kde.org/conpherence/ for having multiple people conversations<br />
* https://phabricator.kde.org/maniphest/ to create tasks and follow their achievements<br />
<br />
First step is to assign to yourself all the tasks you plan to do in https://phabricator.kde.org/project/view/1/.<br />
<br />
=== Using git on KDE ===<br />
You can see the git at https://phabricator.kde.org/diffusion/GCOMPRIS/ (or http://quickgit.kde.org/?p=gcompris.git if you are not connected).<br />
As you will push work on it, you need to clone git@git.kde.org:gcompris.git.<br />
<br />
You can create a branch for your gsoc: git checkout -b mybranch and work on it.<br />
Don't forget to rebase on master from time to time.<br />
Once you think you finished your activity, you need to create a code review for mentors to comment the code.<br />
<br />
=== Informing on your progress ===<br />
In a work, the most important thing is communication. Without it, we can't know what the other people are doing, if they have issues...<br />
Do not hesitate to discuss as long as you have issues to be sure you've understood and fixed all of them.<br />
<br />
Also, you need to create a blog detailing what you have done and add your blog posts to https://planetkde.org/ in order to the KDE community to follow what you've done. If you do not have one, you can create one using https://pages.github.com/ or Wordpress. please try to do a blog post at least '''every month'''.<br />
<br />
Moreover, using maniphest phabricator, you can describe precisely what you will do, state your task status and this will permit us and you to see where you are in your timeline (late or in advance).<br />
<br />
=== Code quality ===<br />
<br />
We hope that GCompris will be maintained for years if not decades. It is thus important that your code is clean enough to be reviewed and amended by anyone knowing Qt Quick.<br />
<br />
Here are some points you have to check:<br />
<br />
* Copyright headers in each source file must contain your copyright if you create them<br />
* Once your code is done, make some clean up, there should not be any unused variable or file.<br />
* Follow coding rules and indent properly your code.<br />
* Avoid files with many global variables or functions with too many parameters. This indicates that there is something wrong in your code.<br />
* Avoid repeated code. There is an option in Qt Creator to refactor a QML object. It will be put in a dedicated file named after the object id (right click -> refactoring).<br />
* Try to follow an object orientated approach by putting javascript functions specific to a QML object within the object itself instead of the global javascript file. This makes it easy to see what's possible to do with a Qml object.<br />
* The preferred graphic format is SVG.<br />
* If you take content from the Internet, graphics, sounds or anything it must be credited in a README file in the resource directory. It must name the file, the copyright and the link where you took it. the copyright must be compatible with the GPL.<br />
* We rely on a lot on graphics but not everyone is skilled enough to make them. The good practise is to re-use existing graphics from GCompris (you can easily mix and change SVG files with Inkscape). If no graphic come close to what you need, the first place to check is [http://openclipart.org http://openclipart.org]<br />
* If you don't find open content good enough don't worry, the GCompris graphic team will redo them when your activity is ready.<br />
* GCompris is translated in many languages. Thus, we need to take care of it in the code. All the strings that should be translated must be between qsTr(). Don't put variables in qsTr(), only real strings (in "").<br />
* Prefix your commit messages by the activity name, i.e: "sudoku, fix bad anchor of the grid".<br />
<br />
=== Development workflow ===<br />
<br />
Once you have your KDE account you have commit rights on the GCompris repository and on other KDE projects. But you must not commit on the master branch directly, you must notice the maintainers of GCompris that you are ready and the review process will start.<br />
<br />
Your development must be done in a specific branch on the KDE GCompris git. Name your branch with the following scheme :<br />
<br />
* [sok|gsoc]_[nickname]_[activity_name]<br />
<br />
As we mention, code quality is of major importance. When you get review feedback change your code accordingly and tell you are ready for another review. Understand that it takes time to make review, so please take in account all our remarks and take time to refactor your code to make it clean, simple, logical and easy to read.</div>Dmadaan