cannot create click packages for QML Extension Library + Tabbed Touch UI

Bug #1215937 reported by Jamie Strandboge
30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
qtcreator (Ubuntu)
Fix Released
High
Zoltan Balogh
Saucy
Fix Released
High
Zoltan Balogh

Bug Description

After setting up a QML Extension Library + Tabbed Touch UI project following bug #1215913, if I click the Packaging button on the far left, I am told "Click packaging is only available for QML projects".

Certainly this is due to the fact that the appstore and click don't have the concept of fat packages yet. Attached is a rather dumb script to create click packages. Here are the steps:

1. create a QML Extension Library + Tabbed Touch UI project following bug #1215913 (being careful not to use dashes or underscores in the name (see bug #1215133 and bug #1215918). Eg "myapp".
2. create manifest.json in the toplvel source, with something like the following (adjusting description, maintainer, name and title):
{
    "description": "description of myapp",
    "framework": "ubuntu-sdk-13.10",
    "hooks": {
        "myapp": {
            "apparmor": "myapp.json",
            "desktop": "app/myapp.desktop"
        }
    },
    "maintainer": "Your Name <email address hidden>",
    "name": "com.ubuntu.developer.myappdevid.myapp",
    "title": "myapp",
    "version": "0.1"
}
3. create the security manifest, myapp.json, with the following (adjusting policy_groups as necessary):
{
  "policy_groups": [
    "networking"
             ],
  "policy_version": 1.0
}
4. put the attached 'make-click' in your toplevel source directory, and run it:
Reading /tmp/tmp.JPZZJf7oCx/backend/backend.pro
 Reading /tmp/tmp.JPZZJf7oCx/backend/modules/myapp/myapp.pro
...
make[2]: Leaving directory `/tmp/tmp.JPZZJf7oCx/backend/modules/myapp'
make[1]: Leaving directory `/tmp/tmp.JPZZJf7oCx/backend'
Adjust the manifest to include: "architecture": "amd64",
Adjust the desktop file
Clean out install dir
Running: click build /tmp/tmp.JPZZJf7oCx
Successfully built package in './com.ubuntu.developer.myappdevid.myapp_0.1_amd64.click'.

Install with: sudo click install --force-missing-framework --user=jamie ./com.ubuntu.developer.myappdevid.myapp_0.1_amd64.click

Now, make-click is dumb. Really dumb. It doesn't know about .pro files, etc. There is a cc_args that can be adjusted for your project. Eg, if you need dbus compiled in, use:
cc_args="CONFIG+=dbus"

To have proper integration, qtcreator should:
1. build the package in %buildDir%
2. clean out %buildDir% in some reasonable manner
3. generate the initial app/*.desktop file in the toplevel source, being careful of bug #1204595, and using "qmlscene -I backend/modules app/myapp.qml"
4. generate the click package in the %buildDir% (eg, 'cd %buildDir% && click build .')

Step '4' for now should detect the architecture and add this to the manifest:
  "architecture": "<qtcreator detected arch>",

When fat packages (or whatever implementation is chosen) are in use, step '4' should be adjusted for that.

Tags: appstore
Revision history for this message
Jamie Strandboge (jdstrand) wrote :
Zoltan Balogh (bzoltan)
Changed in qtcreator (Ubuntu Saucy):
status: New → Confirmed
importance: Undecided → Wishlist
Revision history for this message
Zoltan Balogh (bzoltan) wrote :

The very core of the issue is that we have little understanding on how the cross build of the C++/Qt projects should be handled in the Click world. If a developer wants to upload a phablet application with a QML extension to the application store then this extension should be built for armhf target on a x86 environment. The on device build will be out of the options and the RO image will not make it possible. All other chroot based builders are made for .dsc debian style building. The whole feature set of the C++ development scenarios should be first cover before we can start working on the Click packaging of the QML extensions.

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

My initial understanding was that we originally recommended creating QML extensions in C++ and packaging them in separate .deb packages. I don't have a comment on shipped C++ extensions except to say that if they are supposed to be available to all apps, the extension must necessarily be shipped as a deb for them to have access to the extension.

For a project I am working on, I personally need to have C++ code to do various things, and this is the only template that would get me close to what I need. In my case, it isn't going to ship an extension for anyone else to use-- it just needs to ship the .so file that it will use. I think this will by far be the more prevalent use case for app developers and this is what we should target for 13.10 (I realize the appstore needs to be able to handle packages with compiled code and this isn't all worked out yet, but it is also planned for 13.10 AIUI). This is the perspective that I had when I filed this and the various "QML Extension Library + Tabbed Touch UI" bugs last week.

Looking at the various templates we have related to this, we have "QML Extension Library" and "QML Extension Library + Tabbed Touch UI". I suggest "QML Extension Library" be used when developing an extension to be distributed as a deb, and "QML Extension Library + Tabbed Touch UI" to be used when developing an application that needs to ship/use its own extension. Perhaps we should rename "QML Extension Library + Tabbed Touch UI" to "Tabbed Touch UI with C++ internal extension" (or something).

In terms of 13.10, IMHO we should at least modestly support compiled code in click apps in the SDK for developers who want to do more than what is offered with pure QML. Supporting QML extensions via deb files feels more niche, and simply having the "QML Extension Library" available for developers to use is good enough (ie, I don't think it is unreasonable in the short to mid term for people developing a system QML extension to know how to package it in deb format).

Changed in qtcreator (Ubuntu Saucy):
assignee: nobody → Zoltan Balogh (bzoltan)
importance: Wishlist → High
Revision history for this message
Joey Chan (qqworini) wrote :

Follow those steps, I can create a click package for my Ubuntu desktop(x86), but how can I create a click package for phone(e.g. nexus 4) ? I tried use the "build application in device" in qtcreator, I got nothing after compile finished ...

Revision history for this message
Niklas Wenzel (nikwen) wrote :

Any updates on this?

Revision history for this message
Zoltan Balogh (bzoltan) wrote :

The latest release of the SDK has the following mechanism:

1. Each target (armhf, x86) has a click chroot and the cmake projects can be built against these targets. Click package creation for the armhf device is enabled only when the armhf click chroot Kit is sleected

2. The developer should create a click chroot for armhf target in the Tools-> Options -> Ubuntu tab and select that target when opening a project.

3. If the developer has forget to select the armhf target the the .user project file should be deleted and the project should be re-opened

4. After these the click package can be created for cmake projects the same way as for QML projects

Changed in qtcreator (Ubuntu):
status: Confirmed → Fix Released
Changed in qtcreator (Ubuntu Saucy):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.