maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Vala for Maemo development (https://talk.maemo.org/showthread.php?t=18968)

Benson 2008-09-03 23:55

Re: Vala for Maemo development
 
Quote:

Originally Posted by BoxOfSnoo (Post 218140)
Ok, help? Monodevelop failed miserably on Ubuntu. Eclipse has no clue how to plug in valable. vala won't install on the tablet 'cause it needs c-compiler which isn't available.

Any clues or should I start learning in joe and valac on the desktop?

So I'm not the only one mad enough to try that?

As far as vala on the tablet, it works. You have to set up the SDK repo (which contains some packages that require removal of large chunks of your system to install, and thus is hazardous; you've been warned), and then apt-get install gcc, libgtk2.0-dev, and probably some other *-dev packages.
But that's not as easy as it sounds, if you've been keeping up with SSU, because the *-dev packages in the SDK repo are not updated to new versions, and depend on the * packages of the same version; several of these wound up a revision or patch level behind the installed version. No sweat; just a
Code:

apt-get install problem-package=1.1.1
will install version 1.1.1, even though it's a downgrade. Then you can carry on.
But, that's not as easy as it sounds either, because osso-software-version-rx34-unlocked depends on the new versions, and you don't want to remove that. (Though apt-get will be happy to suggest it when you give the downgrade command.)
So, I put lies in /var/lib/dpkg/status, which is as easy as it sounds (finally!); edit /var/lib/dpkg/status, search for osso-software, and change the versions in Depends as needed. Do that each time you catch a new dependency problem that way.
Now this probably broke future SSUs; I guess I'll have to manually patch the new osso-software-version-rx34-unlocked to permit the old versions of the problematic packages. But anyone still reading this far should be able to do that, or live without SSU on one boot image.

Another option might be to start from a clean diablo flash, and not do the SSU; I think the versions would match then, and everything would install without incident. You'd still be unable to perform any SSUs until the SDK repo is up-to-date.
Bottom line: If you're scared, don't do any of this!

If you're not scared, clone to an SD if you haven't yet (you'll probably need the extra room anyway), and back up your entire ext2/3 partition before you add the SDK repo. (Oh, and if you're not scared, you're crazy. Just so you know. :cool:)

The GTK hello-world example in waf works fine, so I know Vala is working; as seen in my post above, I don't quite have it building what I want to build, but I think my trouble is platform-irrelevant.

BoxOfSnoo 2008-09-04 19:39

Re: Vala for Maemo development
 
I just tried out something much simpler: installing in deblet. It's chrooted already, so I could keep the systems separate.

I just finished testing this basic sample: http://live.gnome.org/Vala/BasicSample and it compiled in 12.260s on my tablet, to a final binary. To generate the C and header file it took 10.364s

So, yes, C is considerably faster, but I'd call 12 seconds acceptable! I'm going to have to try out some projects that are more complex and see how it scales...

More info: I tried building the Hildon sample on the same page; it wouldn't build, it doesn't seem to like either Gtk or Hildon packages. I have to surf around in the VAPI files and see if they're there or not.

Bundyo 2008-10-08 19:45

Re: Vala for Maemo development
 
Quote:

Originally Posted by Benson (Post 220635)
Hmmm... Any progress on the X VAPI? The hostwin source you sent me seems to depend on it, so presumably you've got something. Might it be tar-worthy?

(And I'm all for a Vala talk, too. I won't be there, though, so I hope it gets videoed, or at least slides posted and maybe audio recordings.)

Ah, c**p, didn't see that before... No, X VAPI is dead end for now, maybe i'll resurrect it later, however the good news is that hostwin shouldn't be dependent on it, maybe i tried something, so feel free to remove any mentions of it :)

EDIT: Removing mentions of X in src/wscript should be enough.

Updated the source - removed X. At the old place:
http://www.internettablettalk.com/fo...&postcount=122

Benson 2008-10-08 20:01

Re: Vala for Maemo development
 
I tried something like that, but it seemed to break worse. Like I said, I think I did something wrong. Maybe time for another go at it, though, now I know I was at least apparently on the right track...

Bundyo 2008-10-08 20:09

Re: Vala for Maemo development
 
You just need to run

./waf configure
./waf build (or just ./waf)

in the root dir of the project :)

Bundyo 2008-10-23 22:30

Re: Vala for Maemo development
 
Vala 0.4.0 was released some days ago. Has the following new things/changes:
  • Support more flexible constructors.
  • Partial support for reading and writing .gir files.
  • Improve compiler performance.
  • Copy arrays where necessary.
  • Basic support for static properties.
  • Partial support for struct holding object references.
  • Add tracker indexer bindings (Roberto Majadas)
  • Updates to the GLib, GTK+, and GStreamer bindings.
  • Many bug fixes.

Some things i discovered:

They apparently rushed Vala 0.4 without updating all VAPIs with their new syntax additions (which seem to be required) (or maybe they didn't intend to update them all :)).

So if you happen across an error message in the C compile stage that says something about not declared something_construct, be sure to add [CCode (has_construct_function = false)] right above the class constructor in the vapi file. I don't know which ones don't have constructor, so better fix them on sight :)

For instance Hildon.Window was without one, so it should be fixed like this in the vapi:

Code:

    [CCode (cheader_filename = "hildon/hildon.h")]
    public class Window : Gtk.Window, Atk.Implementor, Gtk.Buildable {
        public void add_toolbar (Gtk.Toolbar toolbar);
        public void add_with_scrollbar (Gtk.Widget child);
        public bool get_is_topmost ();
        public weak Gtk.Menu get_menu ();
->      [CCode (has_construct_function = false)]
        public Window ();
        public void remove_toolbar (Gtk.Toolbar toolbar);
        public void set_menu (Gtk.Menu menu);
        public bool is_topmost { get; }
        public virtual signal void clipboard_operation (int operation);
    }

The good thing is that Vala 0.4 compiles much faster.

Also be wary of their fix for the UIManager's new_merge_id - doesn't seem to work as intended (or at all :)

Patches upstream are probably encouraged.

hns 2009-03-04 11:27

Re: Vala for Maemo development
 
Quote:

Originally Posted by Jaffa (Post 218548)
Right, to get Valable:
  1. Install Vala
  2. Install ctags
  3. Get Valable: bzr branch lp:valable - this should give you a 'valable' directory.
  4. Open Eclipse
  5. Select File > Import... > General > Existing Projects into Workspace
  6. Set root directory to the 'valable' directory from step 2.
  7. Project should compile :-)
  8. Right click on the project and select Run as > Eclipse application - a new Eclipse should open
  9. Select File > New > Project... > Vala > Vala Project, enter some details, and create a new Vala file in it.

I've not yet looked at exporting the plugin for installation into Eclipse - it's a while off that yet. Let me know if this doesn't work.

Thanks for these instructions. I found that installing valable as plug-in is actually quite simple. Once you have valable installed (step 7), choose File -> Export -> Deployable plug-ins and fragments, choose the output folder, and then copy the generated plug-in to the plugins folder in your eclipse installation.

Now for the bad part - the plug-in installs, but is currently broken for me. :(

Bundyo 2009-03-04 14:44

Re: Vala for Maemo development
 
BTW, since you opened this thread - MonoDevelop 2.0 is in beta now. Vala completion doesn't work reliably yet, but the editor is quite stable.

Jaffa 2009-03-16 22:12

Re: Vala for Maemo development
 
Vala 0.5.7 is now in Extras-Devel:

http://www.internettablettalk.com/fo...172#post272172

Bundyo 2009-03-29 22:20

Re: Vala for Maemo development
 
Monodevelop 2.0 beta 2. Has packages for Debian/Unstable now.

http://monodevelop.com/Download/Rele...lop_2.0_Beta_2
http://monodevelop.com/Download


All times are GMT. The time now is 17:57.

vBulletin® Version 3.8.8