Documentation/Maemo Eclipse Tutorial/Using ESbox
(wikify slightly, incomplete) |
(wikify some more) |
||
Line 289: | Line 289: | ||
First, select the build configuration. Change the build configuration to <span><font face="monospace">DIABLO_X86</font></span> or <span><font face="monospace">FREMANTLE_X86</font></span>. | First, select the build configuration. Change the build configuration to <span><font face="monospace">DIABLO_X86</font></span> or <span><font face="monospace">FREMANTLE_X86</font></span>. | ||
- | Right-click the project and select '''Properties''', figures [[# | + | Right-click the project and select '''Properties''', figures [[#figure-esbox_usage_python_06_properties|8.31]]. |
- | + | <div id="figure-esbox_usage_python_06_properties"> | |
- | + | [[Image:python-06-properties.png|frame|center|alt=Screenshot of Python project properties|Figure 8.31: Python Project Properties]] | |
- | + | </div> | |
- | + | ||
- | [[Image:python-06-properties.png| | + | |
- | + | ||
- | Select '''Maemo Build Configurations''' and activate the configuration, figures [[# | + | Select '''Maemo Build Configurations''' and activate the configuration, figures [[#figure-esbox_usage_python_07_configuration|8.32]] |
- | + | <div id="figure-esbox_usage_python_07_configuration"> | |
- | + | [[Image:python-07-configuration.png|frame|center|alt=Screenshot of Python project build configuration|Figure 8.32: Python Project Build Configuration]] | |
- | + | </div> | |
- | + | ||
- | [[Image:python-07-configuration.png| | + | |
- | + | ||
- | To launch the project on Maemo SDK, right-click the project and select '''Run As > Python Maemo Local Application''', figure [[# | + | To launch the project on Maemo SDK, right-click the project and select '''Run As > Python Maemo Local Application''', figure [[#figure-esbox_usage_python_08_run_as|8.33]]. |
- | + | <div id="figure-esbox_usage_python_08_run_as"> | |
- | + | [[Image:python-08-run-as.png|frame|center|alt=Screenshot of Pyton project run as a local application|Figure 8.33: Python Project Run as Local Application]] | |
- | + | </div> | |
- | + | ||
- | [[Image:python-08-run-as.png| | + | |
- | + | ||
- | Select the file you want to run on Maemo SDK. Do not select setup.py because it is used only for Debian package creation, figure [[# | + | Select the file you want to run on Maemo SDK. Do not select setup.py because it is used only for Debian package creation, figure [[#figure-esbox_usage_python_09_run_file|8.34]]. |
- | + | <div id="figure-esbox_usage_python_09_run_file"> | |
- | + | [[Image:python-09-run-file.png|frame|center|alt=Screenshot of selecting a file on launch of a Python project|Figure 8.34: Python Project Select File on Launch]] | |
- | + | </div> | |
- | + | ||
- | [[Image:python-09-run-file.png| | + | |
- | + | ||
- | If Maemo Application Framework is not running, ESbox asks you to launch it. When you have launched Maemo Application Framework successfully, you can see the Application Framework and the program running, figure [[# | + | If Maemo Application Framework is not running, ESbox asks you to launch it. When you have launched Maemo Application Framework successfully, you can see the Application Framework and the program running, figure [[#figure-esbox_usage_python_10_result|8.35]]. |
- | + | <div id="figure-esbox_usage_python_10_result"> | |
- | | | + | [[Image:python-10-result.png|frame|center|alt=Screenshot of the result of launching a local Python project|Figure 8.35: Python Project Local Launch Result]] |
- | + | </div> | |
- | + | ||
- | + | ||
- | + | ||
== Running Python Applications on a Maemo Device == | == Running Python Applications on a Maemo Device == | ||
Line 338: | Line 323: | ||
To be able to run your Python application on a Maemo device, Maemo PC Connectivity must be installed on the device and Maemo Host PC Connectivity on the host PC. For more information, see ESbox installation chapters. | To be able to run your Python application on a Maemo device, Maemo PC Connectivity must be installed on the device and Maemo Host PC Connectivity on the host PC. For more information, see ESbox installation chapters. | ||
- | First, make sure that < | + | First, make sure that <code>DIABLO_ARMEL</code> or <code>FREMANTLE_ARMEL</code> target is selected by right-clicking the project and selecting '''Maemo Build Configurations'''. Select <code>DIABLO_ARMEL</code> or <code>FREMANTLE_ARMEL</code> as the target, figure [[#figure-esbox_usage_python_remote_02_target|8.36]]. |
- | + | <div id="figure-esbox_usage_python_remote_02_target"> | |
- | + | [[Image:python-remote-02-target.png|frame|center|alt=Screenshot of selecting a Python project target|Figure 8.36: Select Python Project Target]] | |
- | + | </div> | |
- | + | ||
- | [[Image:python-remote-02-target.png| | + | |
- | + | ||
If there is no configuration for the target, ESbox asks you to create one. To configure a new target, click '''Select all'''. | If there is no configuration for the target, ESbox asks you to create one. To configure a new target, click '''Select all'''. | ||
Line 353: | Line 335: | ||
To be able to run your application on a Maemo device, you need to make sure that all the required runtime dependencies for your application are available on the device. | To be able to run your application on a Maemo device, you need to make sure that all the required runtime dependencies for your application are available on the device. | ||
- | Select '''Project Menu > Validate Installed Packages'''. On the first page, select the project to be validated, figure [[# | + | Select '''Project Menu > Validate Installed Packages'''. On the first page, select the project to be validated, figure [[#figure-esbox_usage_python_c_remote_04_validate_device|8.37]]. |
- | + | <div id="figure-esbox_usage_python_c_remote_04_validate_device"> | |
- | + | [[Image:c-remote-04-validate-device.png|frame|center|alt=Screenshot of package validation menu|Figure 8.37: Validate Packages Menu]] | |
- | + | </div> | |
- | + | ||
- | [[Image:c-remote-04-validate-device.png| | + | |
- | + | ||
- | On the '''Target Selection''' page, select the correct Maemo device connection and < | + | On the '''Target Selection''' page, select the correct Maemo device connection and <code>ARMEL</code> target, Figure [[#figure-esbox_usage_python_c_remote_05_validate_targets|8.38]]. |
- | + | <div id="figure-esbox_usage_python_c_remote_05_validate_targets"> | |
- | | | + | [[Image:c-remote-05-validate-targets.png|frame|center|alt=Screenshot of validating package targets|'''Figure 8.38:''' Validate Package Targets]] |
- | + | </div> | |
- | + | ||
- | + | ||
- | + | ||
To start the validation, click '''Finish''' on the last page. This installs the required packages for the selected project on the Maemo device. | To start the validation, click '''Finish''' on the last page. This installs the required packages for the selected project on the Maemo device. | ||
Line 379: | Line 355: | ||
To be able to run your application on a Maemo device, Maemo PC Connectivity must be installed on the device and Maemo Host PC Connectivity on the host PC. For more information, see ESbox installation chapters. | To be able to run your application on a Maemo device, Maemo PC Connectivity must be installed on the device and Maemo Host PC Connectivity on the host PC. For more information, see ESbox installation chapters. | ||
- | After you have set the target to <span><font face="monospace">ARMEL</font></span> you can run your application on the Maemo device. To run the application, right-click the project and select '''Run As > Maemo Remote Application''', figure [[# | + | After you have set the target to <span><font face="monospace">ARMEL</font></span> you can run your application on the Maemo device. To run the application, right-click the project and select '''Run As > Maemo Remote Application''', figure [[#figure-esbox_usage_python_remote_03_run|8.39]]. |
- | + | <div id="figure-esbox_usage_python_remote_03_run"> | |
- | + | [[Image:python-remote-03-run.png|frame|center|alt=Screenshot of Python project being run as a remote application|Figure 8.39: Python Project Run as Remote Application]] | |
- | + | </div> | |
- | + | ||
- | [[Image:python-remote-03-run.png| | + | |
- | + | ||
- | Select the Python file you want to run. Do not select setup.py because it is used only for Debian package creation. Select SSH as the connection type (using SBRSH requires additional configuration). Select the correct device connection. | + | Select the Python file you want to run. Do not select <code>setup.py</code> because it is used only for Debian package creation. Select SSH as the connection type (using SBRSH requires additional configuration). Select the correct device connection. |
You can now see your application running on the Maemo device. | You can now see your application running on the Maemo device. | ||
Line 395: | Line 368: | ||
{{ambox | {{ambox | ||
- | |text=To be able to use VNC Viewer, the < | + | |text=To be able to use VNC Viewer, the <code>x11vnc</code> service must be installed on the Maemo device either separately (<code>apt-get install x11vnc</code>) or as part of Maemo PC Connectivity. |
}} | }} | ||
== Debugging Python Applications == | == Debugging Python Applications == | ||
- | To be able to debug a project, you must set at least one breakpoint into one of the source files. To add a breakpoint somewhere, open a source file, right-click on the left source side panel and select '''Add Breakpoint''', figure [[# | + | To be able to debug a project, you must set at least one breakpoint into one of the source files. To add a breakpoint somewhere, open a source file, right-click on the left source side panel and select '''Add Breakpoint''', figure [[#figure-esbox_usage_python_debug_01_breakpoint|8.40]]. |
- | + | <div id="figure-esbox_usage_python_debug_01_breakpoint"> | |
- | + | [[Image:python-debug-01-breakpoint.png|frame|center|alt=Screenshot of adding a breakpoint to a Python project|Figure 8.40: Add Breakpoint to Python Project]] | |
- | + | </div> | |
- | + | ||
- | [[Image:python-debug-01-breakpoint.png| | + | |
- | + | ||
- | To launch your project in debug mode, right-click the project and select '''Debug As > Maemo Local or Remote Application'''. When prompted, accept changing to the debug perspective, figure [[# | + | To launch your project in debug mode, right-click the project and select '''Debug As > Maemo Local or Remote Application'''. When prompted, accept changing to the debug perspective, figure [[#figure-esbox_usage_python_debug_02_debug|8.41]]. |
- | + | <div id="figure-esbox_usage_python_debug_02_debug"> | |
- | + | [[Image:python-debug-02-debug.png|frame|center|alt=Screenshot of debugging a Python project|Figure 8.41: Debug Python Project as]] | |
- | + | </div> | |
- | + | ||
- | [[Image:python-debug-02-debug.png| | + | |
- | + | ||
- | In the debug perspective, you can stop and continue the execution, step lines, inspect variables, and so on. See Figures [[# | + | In the debug perspective, you can stop and continue the execution, step lines, inspect variables, and so on. See Figures [[#figure-esbox_usage_python_debug_03_perspective|8.42]] and [[#figure-esbox_usage_python_debug_04_variables|8.43]]. |
{{ambox | {{ambox | ||
Line 424: | Line 391: | ||
}} | }} | ||
- | + | <div id="figure-esbox_usage_python_debug_03_perspective"> | |
- | + | [[Image:python-debug-03-perspective.png|frame|center|alt=Screenshot of Python debug view|Figure 8.42: Python Debug View]] | |
- | + | </div> | |
- | + | ||
- | [[Image:python-debug-03-perspective.png| | + | |
- | + | ||
- | + | <div id="figure-esbox_usage_python_debug_04_variables"> | |
- | + | [[Image:python-debug-04-variables.png|frame|center|alt=Screenshot of inspecting Python variables|Figure 8.43: Inspect Python Variables]] | |
- | + | </div> | |
- | + | ||
- | [[Image:python-debug-04-variables.png| | + | |
- | + | ||
== Debian Packaging ESbox Project == | == Debian Packaging ESbox Project == | ||
Line 444: | Line 405: | ||
=== Debian Package Structure === | === Debian Package Structure === | ||
- | Debian structure is < | + | Debian structure is <code>debian</code> folder under project directory. If you do not have Debian structure in your project you can create it by right clicking project and choosing '''Debian Package > Create Debian Structure'''. |
Python projects need setup.py script to create a Debian package and it should be in the project root folder. You can create setup.py from the last page of the '''Structure''' wizard. | Python projects need setup.py script to create a Debian package and it should be in the project root folder. You can create setup.py from the last page of the '''Structure''' wizard. | ||
- | ESbox does not automate the whole Debian structure creation process, so you might need to manually modify the files in < | + | ESbox does not automate the whole Debian structure creation process, so you might need to manually modify the files in <code>debian</code> folder. A Debian installation package is built using <code>Makefile</code> located at <code>debian/rules</code> directory. Other files are usually install scripts and metadata. |
You can find complete information on the Debian installation package structure from [http://www.debian.org/doc/maint-guide/ Debian New Maintainers' Guide] | You can find complete information on the Debian installation package structure from [http://www.debian.org/doc/maint-guide/ Debian New Maintainers' Guide] | ||
Line 468: | Line 429: | ||
=== Repositories and package types === | === Repositories and package types === | ||
- | In the Debian package manager < | + | In the Debian package manager <code>apt</code> (used in Scratchbox and Maemo devices), the <code>sources.list</code> repository configuration files contain two kinds of entries: <code>deb</code> and <code>deb-src</code> repositories. Both point to external or local repositories of packages (called system packages here). <code>deb</code> repositories point to binary packages while <code>deb-src</code> repositories point to the (usually in sync) source packages for those binary packages. |
One source package may generate several binary packages; for instance, one for programs and primary data, one for auxiliary data, one for libraries, and one for development. | One source package may generate several binary packages; for instance, one for programs and primary data, one for auxiliary data, one for libraries, and one for development. | ||
- | In < | + | In <code>apt</code>, when fetching the sources for a binary package, you start with an interesting binary package and find its corresponding source package (for example, <code>apt-get source <package></code>). |
=== Source package structure === | === Source package structure === | ||
- | The sources for a package come usually in three files: a ''control file'' (< | + | The sources for a package come usually in three files: a ''control file'' (<code>*.dsc</code>), an ''archive'' (<code>*.tar.gz</code> or <code>*.tar.bz2</code>), and a ''patch'' (<code>*.diff.gz</code>). <code>apt-get source</code> command invokes the <code>dpkg-source</code> command to expand the archive and apply the patch. The control file is used when rebuilding the binary package. |
- | Once extracted, the contents of the original patched sources vary wildly. The contents may contain a bare-bones < | + | Once extracted, the contents of the original patched sources vary wildly. The contents may contain a bare-bones <code>Makefile</code> project, an autotools-based project, a nest of programs and libraries and test code, or even another archive. |
- | There is one guarantee, though: the package expands to contain a < | + | There is one guarantee, though: the package expands to contain a <code>debian</code> directory and its various control files (see the "Source packages" chapter of the [http://www.debian.org/doc/debian-policy/ch-source.html Debian Policy Manual] for more details). |
- | The < | + | The <code>debian/rules</code> file is an executable <code>Makefile</code> which is the primary means of interaction with the source from the perspective of a Debian package. In other words, even if the extracted sources contain autoconf files or <code>Makefiles</code>, you must use <code>debian/rules</code> to configure, build, clean, install, and re-package the package. |
- | For example, < | + | For example, <code>debian/rules configure</code>, <code>debian/rules build</code>, <code>debian/rules install</code> are typical ways to use a source package. |
- | It must be mentioned that even < | + | It must be mentioned that even <code>debian/rules</code> can have varying degrees of fluctuation in the targets it provides. Most packages not developed in the Debian project itself come from a large community of people who think differently, and the targets vary accordingly. While the utility <code>dh_make</code> tries to promote a standard set of guidelines, some projects may, for instance, lack a <code>configure</code> target (or have several), lack a <code>build</code> target (or have several), and so on. |
ESbox attempts to corral this kind of diversity with its import wizard. | ESbox attempts to corral this kind of diversity with its import wizard. | ||
Line 492: | Line 453: | ||
=== Using the Wizard === | === Using the Wizard === | ||
- | Find the wizard under '''File > Import > ESbox > Project from Debian Repository''', figure [[# | + | Find the wizard under '''File > Import > ESbox > Project from Debian Repository''', figure [[#figure-esbox_usage_import_package_wizard|8.44]]. |
- | + | <div id="figure-esbox_usage_import_package_wizard"> | |
- | | | + | [[Image:ImportPackageWizard.png|frame|center|alt=Screenshot of project import|Figure 8.44: Import]] |
- | + | </div> | |
- | + | ||
- | + | ||
- | + | ||
- | Select the package to import, figure [[# | + | Select the package to import, figure [[#figure-esbox_usage_import_package_select|8.45]]. |
- | + | <div id="figure-esbox_usage_import_package_select"> | |
- | | | + | [[Image:ImportPackageSelect.png|frame|center|alt=Screenshot of selecting a package during ESBox prject import|Figure 8.45: Import ESbox Project from Repository - Select Package]] |
- | + | </div> | |
- | + | ||
- | + | ||
- | + | ||
The target providing packages is one of the Scratchbox targets on the host PC. | The target providing packages is one of the Scratchbox targets on the host PC. | ||
{{ambox | {{ambox | ||
- | |text=The target must have the necessary < | + | |text=The target must have the necessary <code>deb-src</code> entries in <code>sources.list</code>. Standard Maemo SDK configurations have such entries by default. |
|} | |} | ||
Line 522: | Line 477: | ||
The '''Always re-fetch source components''' option asks the wizard to always go to the network and find the source components (the .dsc file, archives, and patches) for the package. This may be necessary if you have modified the package locally. | The '''Always re-fetch source components''' option asks the wizard to always go to the network and find the source components (the .dsc file, archives, and patches) for the package. This may be necessary if you have modified the package locally. | ||
- | The '''Delete source components''' option deletes the < | + | The '''Delete source components''' option deletes the <code>.dsc</code> file, source archives, and patches after extraction. |
- | Next, select the build targets for the package, figure [[# | + | Next, select the build targets for the package, figure [[#figure-esbox_usage_import_package_project|8.46]]. |
- | + | <div id="figure-esbox_usage_import_package_project"> | |
- | | | + | [[Image:ImportPackageProject.png|frame|center|alt=Screenshot of project configuration during import of ESBox project|Figure 8.46: Import ESbox Project from Repository - Project Configuration]] |
- | + | </div> | |
- | + | ||
- | + | ||
- | + | ||
- | The next page prepares for the source fetch, figure [[# | + | The next page prepares for the source fetch, figure [[#figure-esbox_usage_import_package_fetch0|8.47]]. |
- | + | <div id="figure-esbox_usage_import_package_fetch0"> | |
- | + | [[Image:ImportPackageFetch0.png|frame|center|alt=Screenshot of fetching and imprting during import of a ESBox project|Figure 8.47: Import ESbox Project from Repository - Fetching and Importing, proxy]] | |
- | + | </div> | |
- | + | ||
- | + | ||
- | + | ||
Visit the link to ensure your proxy is configured, or else the download does not work. | Visit the link to ensure your proxy is configured, or else the download does not work. | ||
- | Press '''Next''' to start the process, figure [[# | + | Press '''Next''' to start the process, figure [[#figure-esbox_usage_import_package_fetch1|8.48]]. |
- | + | <div id="figure-esbox_usage_import_package_fetch1"> | |
- | + | [[Image:ImportPackageFetch1.png|frame|center|alt=Screenshot of fetching and imprting during import of an ESBox project|Figure 8.48: Import ESbox Project from Repository - Fetching and Importing, fetching]] | |
- | + | </div> | |
- | + | ||
- | + | ||
- | + | ||
- | If the fetch fails | + | If the fetch fails then it is usually indicated by a long pause after the '''Building dependency tree''' message - press '''Cancel''' to abort the process. You can select '''View Log''' from the dialog, press '''Back''', then press '''Next''' again to retry. |
The next page lets you choose the project type and builder for the package. | The next page lets you choose the project type and builder for the package. | ||
- | This is a normal case, figure [[# | + | This is a normal case, figure [[#figure-esbox_usage_import_package_convert1|8.49]]. |
- | + | <div id="figure-esbox_usage_import_package_convert1"> | |
- | | | + | [[Image:ImportPackageConvert1.png|frame|center|alt=Screenshot of convert a project during import of an ESBox project|Figure 8.49: Import ESbox Project from Repository - Convert Project]] |
- | + | </div> | |
- | + | ||
- | + | ||
- | + | ||
- | Here, the project (sysstat from earlier pages) expands into a project with a < | + | Here, the project (sysstat from earlier pages) expands into a project with a <code>Makefile</code>. Also (off-screen) there are C sources and headers. Thus, the wizard is able to guess the project type. This page, therefore, is merely informative and you can press '''Next'''. |
An imported package may, however, be provided as a compressed archive with patches. In this case, you can preconfigure the project to extract the sources and decide whether the project is really the one you are looking for. | An imported package may, however, be provided as a compressed archive with patches. In this case, you can preconfigure the project to extract the sources and decide whether the project is really the one you are looking for. | ||
- | The following screenshot shows the inimitable bash shell, which is packaged as an archive, figure [[# | + | The following screenshot shows the inimitable bash shell, which is packaged as an archive, figure [[#figure-esbox_usage_import_package_convert2|8.50]]. |
- | + | <div id="figure-esbox_usage_import_package_convert2"> | |
- | | | + | [[Image:ImportPackageConvert2.png|frame|center|alt=Screenshot of project conversion during import of an ESBox project|Figure 8.50: Import ESbox Project from Repository - Convert Project, compressed archive]] |
- | + | </div> | |
- | + | ||
- | + | ||
- | + | ||
To handle this case, the wizard selects a build rule, which appears to be a configuration rule. This would be expected to extract the archive and apply the patches. | To handle this case, the wizard selects a build rule, which appears to be a configuration rule. This would be expected to extract the archive and apply the patches. | ||
- | You can manually select the rule for configuration, if desired. For example, bash can be built in several configurations for different footprints. Here are the rules found in bash's < | + | You can manually select the rule for configuration, if desired. For example, bash can be built in several configurations for different footprints. Here are the rules found in bash's <code>debian/rules</code>, figure [[#figure-esbox_usage_import_package_convert3|8.51]]. |
- | + | <div id="figure-esbox_usage_import_package_convert3"> | |
- | | | + | [[Image:ImportPackageConvert3.png|frame|center|alt=Screenshot of project conversion during import of an ESBox project|Figure 8.51: Import ESbox Project from Repository - Convert Project, rule selection]] |
- | + | </div> | |
- | + | ||
- | + | ||
- | + | ||
Select a rule and click '''Setup project...''' to run the build for the given rule. The build results go to the Console behind the wizard. | Select a rule and click '''Setup project...''' to run the build for the given rule. The build results go to the Console behind the wizard. | ||
- | For < | + | For <code>bash</code>, and probably other packages, this configure step actually proceeds to build the entire program and run its tests, you may '''Cancel''' after the archive has been extracted and the patches have been applied, then proceed with the wizard, figure [[#figure-esbox_usage_import_package_convert3b|8.52]]. |
- | + | <div id="figure-esbox_usage_import_package_convert3b"> | |
- | | | + | [[Image:ImportPackageConvert3b.png|frame|center|alt=Screenshot of building during import of an ESBox project|Figure 8.52: Import ESbox Project from Repository - Convert Project, building]] |
- | + | </div> | |
- | + | ||
- | + | ||
- | + | ||
- | Once the configuration step has been run, the conversion page updates its guess about the project, figure [[# | + | Once the configuration step has been run, the conversion page updates its guess about the project, figure [[#figure-esbox_usage_import_package_convert4|8.53]]. |
- | + | <div id="figure-esbox_usage_import_package_convert4"> | |
- | | | + | [[Image:ImportPackageConvert4.png|frame|center|alt=Screenshot of project conversion during import of an ESBox project|Figure 8.53: Import ESbox Project from Repository - Convert Project, updated]] |
- | + | </div> | |
- | + | ||
- | + | ||
- | + | ||
Once the project type and builder type are known, you can '''Finish''' the wizard. | Once the project type and builder type are known, you can '''Finish''' the wizard. |
Latest revision as of 14:04, 11 November 2010
ESbox supports C, C++, Python and Qt4 projects. This chapter briefly describes how to create different types of projects and applications and how to run, test and debug applications using Maemo SDK and a Maemo device.
ESbox requires that C/C++, Python and Qt4 development environments are installed on the host PC where Maemo SDK is run and on the Maemo device. For detailed instructions on how to install ESbox and the required development environments, see ESbox installation chapters. You need PC Connectivity to connect the Maemo device to the host PC and ESbox. For instructions on how to install and configure Maemo PC Connectivity on the Maemo device and Maemo Host PC Connectivity on the host PC where the ESbox Eclipse environment is run, see PC Connectivity documentation.
Before creating your first project with ESbox, make sure that you can connect to your Maemo device from the host PC (that PC Connectivity has been properly installed and configured).
[edit] Creating C/C++ and Qt4 Projects
[edit] C/C++ and Qt4 Templates
Templates define the basic structure of the project. Most of the templates are examples but you can also use them as a basic structure for your project.
To create a new C or C++ project, select File > New > Project, figure 8.1.
- C > C Maemo Project
- C++ > C++ Maemo Project
For Qt4 projects, select C++ project.
ESbox supports simple Qt4, Makefile and Autotools projects, figure 8.2.
Select any of the available templates on the Template Project Type page, figure 8.3.
Maemo 4 templates are only for Diablo targets and Maemo 5 templates for Fremantle. Select the correct template depending on your installation. |
[edit] C/C++ and Qt4 Targets
You can select multiple targets for a project. Optimized targets are compiled using compiler optimization while debug targets are compiled with debug options.
If you want to run a project on a Maemo device, select the ARMEL
target. To run a project on the emulator, select the X86
target.
Select all targets for a project, figure 8.4. You can change the targets after you have created the project.
If you do not see any targets on the Project Configuration page, check that Maemo SDK targets are installed and install them if necessary. For more information on how to install Maemo SDK and targets for ESbox, see ESbox installation chapters.
[edit] C/C++ and Qt4 Metadata
Other project pages define different metadata the template uses. You can specify additional information in the fields or use the default values, figure 8.5.
After defining the values, click Finish to create a project.
[edit] Validating C/C++ and Qt4 Project Packages for Maemo SDK
When you have created a new project, ESbox suggests package validation, figure 8.6. If you are not sure that the required development environments have been installed for your targets, click Yes.
ESbox installs all the required dependencies for your project for the selected targets, if they are not installed already, figure 8.7.
If ESbox asks you about changing the target, click Yes to accept. Accept and install any packages ESbox suggests, and close the package validation wizard when the installation is complete.
You can also validate project packages afterwards. To start the validation, select Project > Project Menu > Validate Installed Packages.
During validation, the projects are scanned for dependencies using the following information:
- Autotools projects:
PKG_CHECK_MODULES
macros inconfigure.ac
- Makefile projects: default metapackages for the project type and libraries detected through
pkg-config
invocations
[edit] Running C/C++ and Qt4 Applications on Maemo SDK
First, select the build configuration. Change the build configuration to DIABLO_X86 (Debug)
or FREMANTLE_X86 (Debug)<code>.
To activate the selected configuration, right-click the project and select Build Configurations > Set active, figure 8.8.
To add or remove targets, select Manage in the same menu.
The project is ready to be launched on Maemo SDK. To launch it, right-click the project and select Run As > Maemo Local Application, figure 8.9.
If Maemo Application Framework is not running, ESbox asks you to launch it. When you have launched the Application Framework successfully, you can see the Application Framework and the program running, figure 8.10.
[edit] Running C/C++ and Qt4 Applications on a Maemo Device
To be able to run your application on a Maemo device, Maemo PC Connectivity must be installed on the device and Maemo Host PC Connectivity on the host PC. For more information, see ESbox installation chapters.
Because the device uses <code>ARMEL binaries, you must to change the target platform to DIABLO_ARMEL
or FREMANTLE_ARMEL
and rebuild your application for the Maemo device.
First, make sure that DIABLO_ARMEL
or FREMANTLE_ARMEL
target is selected by right-clicking the project and selecting Properties > Build Configurations > Manage, figure 8.11.
Set the target to DIABLO_ARMEL
or FREMANTLE_ARMEL
, figure 8.12.
Right-click the project, select Build Configurations > Set Active and activate DIABLO_ARMEL (Debug)
or FREMANTLE_ARMEL (Debug)
, figure 8.13.
[edit] Validating C/C++ and Qt4 Project Packages on a Maemo Device
To be able to run your application on the Maemo device, you need to make sure that all the required runtime dependencies for your application are available on the device.
Select Project Menu > Validate Installed Packages. On the first page, select the project to be validated, figure 8.14.
On the Target Selection page, select the correct Maemo device connection and ARMEL target, Figure 8.15.
To start the validation, click Finish on the last page. This installs the required packages for the selected project on the Maemo device.
You can also validate project packages afterwards. To start the validation, select Project > Project Menu > Validate Installed Packages.
[edit] Running C/C++ and Qt4 Projects on a Maemo Device
To be able to run your application on a Maemo device, Maemo PC Connectivity must be installed on the device and Maemo Host PC Connectivity on the host PC. For more information, see ESbox installation chapters.
After you have set the target to ARMEL
and built your application as ARMEL
, you can run your application on the Maemo device. To run the application, right-click the project and select Run As > Maemo Remote Application, figure 8.16.
Select SSH as the connection type (using the SBRSH connection type requires additional configuration), figure 8.17.
Select the device connection, figure 8.16. Use USB connection because it is faster than Bluetooth or WLAN.
You can now see your application running on the Maemo device.
You can use VNC Viewer to control the Maemo device and your application running on it. Select Window > Show View > Other > VNC Viewer.
To use VNC Viewer, the x11vnc service must be installed on the Maemo device either separately (apt-get install x11vnc) or as part of Maemo PC Connectivity. |
[edit] Debugging C/C++ and Qt4 Applications
To be able to debug a project, you must set at least one breakpoint into one of the source files. To add a breakpoint somewhere, open a source file, right-click on the left source side panel and select Add Breakpoint, figure 8.19.
To launch your project in debug mode, right-click the project and select Debug As > Maemo Local or Remote Application. When prompted, accept changing to the debug perspective, figure 8.20.
In the debug perspective, you can stop and continue the execution, step lines, inspect variables, and so on. See Figures 8.21 and 8.22.
You can switch back and forth between perspectives by selecting from the top right corner. |
[edit] Creating Python Projects
ESbox Python projects require that Python is installed on the host PC. For more information, see ESbox installation chapters.
[edit] Python Templates
Templates define the basic structure of the project. Most of the templates are examples but you can also use them as a basic structure for your project.
To create a new Python project, select File > New > Project and then Python Maemo Project, figure 8.23.
Select any of the Python example templates on the Template page, figure 8.24.
[edit] Python Targets
Select DIABLO_X86
or FREMANTLE_X86
as the target, figure 8.25.
[edit] Python Metadata
The Basic Settings page defines different metadata the selected template uses. You can specify additional information in the fields or use the default values, figure 8.26.
[edit] Python Configuration
You can define the Python configuration settings on the last page. If the wizard cannot find an existing Python configuration, it suggests to create a new configuration.
You can use the default values and click Finish to a create project, figure 8.27.
If there is no previous configuration for your project, ESbox asks you to create a new configuration. To create one, click Yes.
For the Python interpreter configuration, you can add all the Python paths and confirm this by clicking OK, figure 8.28.
[edit] Validating Python Project Packages
When you have created a new project, ESbox suggests package validation. Click Yes to accept, figure 8.29.
Click Finish on the Package Validation Wizard dialog, figure 8.30. ESbox installs all the required dependencies for the selected targets.
If ESbox asks you about changing the target, click Yes to accept. Accept and install any packages ESbox suggests, and close the package validation wizard when the installation is complete.
You can also validate project packages afterwards. To start the validation, select Project > Project Menu > Validate Installed Packages.
During validation, the projects are scanned for dependencies using Python package imports from the source files.
[edit] Running Python Applications on Maemo SDK
First, select the build configuration. Change the build configuration to DIABLO_X86 or FREMANTLE_X86.
Right-click the project and select Properties, figures 8.31.
Select Maemo Build Configurations and activate the configuration, figures 8.32
To launch the project on Maemo SDK, right-click the project and select Run As > Python Maemo Local Application, figure 8.33.
Select the file you want to run on Maemo SDK. Do not select setup.py because it is used only for Debian package creation, figure 8.34.
If Maemo Application Framework is not running, ESbox asks you to launch it. When you have launched Maemo Application Framework successfully, you can see the Application Framework and the program running, figure 8.35.
[edit] Running Python Applications on a Maemo Device
To be able to run your Python application on a Maemo device, Maemo PC Connectivity must be installed on the device and Maemo Host PC Connectivity on the host PC. For more information, see ESbox installation chapters.
First, make sure that DIABLO_ARMEL
or FREMANTLE_ARMEL
target is selected by right-clicking the project and selecting Maemo Build Configurations. Select DIABLO_ARMEL
or FREMANTLE_ARMEL
as the target, figure 8.36.
If there is no configuration for the target, ESbox asks you to create one. To configure a new target, click Select all.
[edit] Validating Python Project Packages on a Maemo Device
To be able to run your application on a Maemo device, you need to make sure that all the required runtime dependencies for your application are available on the device.
Select Project Menu > Validate Installed Packages. On the first page, select the project to be validated, figure 8.37.
On the Target Selection page, select the correct Maemo device connection and ARMEL
target, Figure 8.38.
To start the validation, click Finish on the last page. This installs the required packages for the selected project on the Maemo device.
During validation, the projects are scanned for dependencies using Python package imports from the source files.
[edit] Running Python Projects on a Maemo Device
To be able to run your application on a Maemo device, Maemo PC Connectivity must be installed on the device and Maemo Host PC Connectivity on the host PC. For more information, see ESbox installation chapters.
After you have set the target to ARMEL you can run your application on the Maemo device. To run the application, right-click the project and select Run As > Maemo Remote Application, figure 8.39.
Select the Python file you want to run. Do not select setup.py
because it is used only for Debian package creation. Select SSH as the connection type (using SBRSH requires additional configuration). Select the correct device connection.
You can now see your application running on the Maemo device.
You can use VNC Viewer to control the Maemo device and your application running on it. Select Window > Show View > Other > VNC Viewer.
To be able to use VNC Viewer, the x11vnc service must be installed on the Maemo device either separately (apt-get install x11vnc ) or as part of Maemo PC Connectivity. |
[edit] Debugging Python Applications
To be able to debug a project, you must set at least one breakpoint into one of the source files. To add a breakpoint somewhere, open a source file, right-click on the left source side panel and select Add Breakpoint, figure 8.40.
To launch your project in debug mode, right-click the project and select Debug As > Maemo Local or Remote Application. When prompted, accept changing to the debug perspective, figure 8.41.
In the debug perspective, you can stop and continue the execution, step lines, inspect variables, and so on. See Figures 8.42 and 8.43.
You can switch back and forth between perspectives by selecting from the top right corner. |
[edit] Debian Packaging ESbox Project
You can create Debian installation packages for your C/C++, Qt4 and Python projects using ESbox wizards. ESbox also provides some tools to help in creating the Debian package structure, and building and installing the package.
[edit] Debian Package Structure
Debian structure is debian
folder under project directory. If you do not have Debian structure in your project you can create it by right clicking project and choosing Debian Package > Create Debian Structure.
Python projects need setup.py script to create a Debian package and it should be in the project root folder. You can create setup.py from the last page of the Structure wizard.
ESbox does not automate the whole Debian structure creation process, so you might need to manually modify the files in debian
folder. A Debian installation package is built using Makefile
located at debian/rules
directory. Other files are usually install scripts and metadata.
You can find complete information on the Debian installation package structure from Debian New Maintainers' Guide
[edit] Building Debian Package
ESbox can create a Debian installation package from your project by right clicking project and choosing Debian Package > Build Debian Package. If the project does not have Debian structure defined, the wizard helps you to create one. You must select the destination where the new Debian package is created.
[edit] Installing Debian Package
After you have built a Debian installation package, you can install it inside ESbox by right-clicking project and choosing Debian Package > Install Debian Package.
[edit] Importing Projects from Repository
[edit] Background
This feature assumes you know a little bit about the workings of Debian packages. If not, the full details are in The Debian GNU/Linux FAQ; Chapter 7 - Basics of the Debian package management system.
[edit] Repositories and package types
In the Debian package manager apt
(used in Scratchbox and Maemo devices), the sources.list
repository configuration files contain two kinds of entries: deb
and deb-src
repositories. Both point to external or local repositories of packages (called system packages here). deb
repositories point to binary packages while deb-src
repositories point to the (usually in sync) source packages for those binary packages.
One source package may generate several binary packages; for instance, one for programs and primary data, one for auxiliary data, one for libraries, and one for development.
In apt
, when fetching the sources for a binary package, you start with an interesting binary package and find its corresponding source package (for example, apt-get source <package>
).
[edit] Source package structure
The sources for a package come usually in three files: a control file (*.dsc
), an archive (*.tar.gz
or *.tar.bz2
), and a patch (*.diff.gz
). apt-get source
command invokes the dpkg-source
command to expand the archive and apply the patch. The control file is used when rebuilding the binary package.
Once extracted, the contents of the original patched sources vary wildly. The contents may contain a bare-bones Makefile
project, an autotools-based project, a nest of programs and libraries and test code, or even another archive.
There is one guarantee, though: the package expands to contain a debian
directory and its various control files (see the "Source packages" chapter of the Debian Policy Manual for more details).
The debian/rules
file is an executable Makefile
which is the primary means of interaction with the source from the perspective of a Debian package. In other words, even if the extracted sources contain autoconf files or Makefiles
, you must use debian/rules
to configure, build, clean, install, and re-package the package.
For example, debian/rules configure
, debian/rules build
, debian/rules install
are typical ways to use a source package.
It must be mentioned that even debian/rules
can have varying degrees of fluctuation in the targets it provides. Most packages not developed in the Debian project itself come from a large community of people who think differently, and the targets vary accordingly. While the utility dh_make
tries to promote a standard set of guidelines, some projects may, for instance, lack a configure
target (or have several), lack a build
target (or have several), and so on.
ESbox attempts to corral this kind of diversity with its import wizard.
[edit] Using the Wizard
Find the wizard under File > Import > ESbox > Project from Debian Repository, figure 8.44.
Select the package to import, figure 8.45.
The target providing packages is one of the Scratchbox targets on the host PC.
{{ambox
|text=The target must have the necessary deb-src
entries in sources.list
. Standard Maemo SDK configurations have such entries by default.
|}
The package selector shows a tree of packages organized by category. You can search by typing in the filter (for words in the name or description) or typing in the tree (for the name alone).
The Fetch build dependencies option ensures that, in addition to fetching the source for the selected package, any packages needed to build the source are installed as well.
The Always re-fetch source components option asks the wizard to always go to the network and find the source components (the .dsc file, archives, and patches) for the package. This may be necessary if you have modified the package locally.
The Delete source components option deletes the .dsc
file, source archives, and patches after extraction.
Next, select the build targets for the package, figure 8.46.
The next page prepares for the source fetch, figure 8.47.
Visit the link to ensure your proxy is configured, or else the download does not work.
Press Next to start the process, figure 8.48.
If the fetch fails then it is usually indicated by a long pause after the Building dependency tree message - press Cancel to abort the process. You can select View Log from the dialog, press Back, then press Next again to retry.
The next page lets you choose the project type and builder for the package.
This is a normal case, figure 8.49.
Here, the project (sysstat from earlier pages) expands into a project with a Makefile
. Also (off-screen) there are C sources and headers. Thus, the wizard is able to guess the project type. This page, therefore, is merely informative and you can press Next.
An imported package may, however, be provided as a compressed archive with patches. In this case, you can preconfigure the project to extract the sources and decide whether the project is really the one you are looking for.
The following screenshot shows the inimitable bash shell, which is packaged as an archive, figure 8.50.
To handle this case, the wizard selects a build rule, which appears to be a configuration rule. This would be expected to extract the archive and apply the patches.
You can manually select the rule for configuration, if desired. For example, bash can be built in several configurations for different footprints. Here are the rules found in bash's debian/rules
, figure 8.51.
Select a rule and click Setup project... to run the build for the given rule. The build results go to the Console behind the wizard.
For bash
, and probably other packages, this configure step actually proceeds to build the entire program and run its tests, you may Cancel after the archive has been extracted and the patches have been applied, then proceed with the wizard, figure 8.52.
Once the configuration step has been run, the conversion page updates its guess about the project, figure 8.53.
Once the project type and builder type are known, you can Finish the wizard.
Projects imported from Debian packages can be edited, navigated, built, and launched like normal ESbox projects. You can, of course, also recreate Debian packages from them.
[edit] Related Topics
- This page was last modified on 11 November 2010, at 14:04.
- This page has been accessed 13,605 times.