You are here

ValaWinPKG Tutorial : manage several versions of Vala

Since its 0.9d version, ValaWinPKG can manage multiple versions of Vala installed on the same computer. The packages for each version will be installed and updated separately.

There a few reasons to do so : for example, Vala 0.12.0 / GLib 2.24.0 needs an old version of LibSoup (2.32) whereas Vala 0.16.0 / GLib 2.32.3 requires a newer one (2.38). This is due to incompatibilities in Vala .vapi files and the GLib itself.

(note : this tutorial cannot help you manage identical Vala versions installed in different folders. This is not supported -yet ?)

1) Install several versions of Vala

You can use the ones you want. We will install for the sake of this tutorial :
- Vala 0.12.0 / GLib 2.24.0 - GTK+ 2 (12.4 Mb)
- Vala 0.16.0 / GLib 2.32.3 - GTK+ 3 (44.8 Mb)

By letting the default installation directory unchanged, you will get 2 separate versions :

2) Install ValaWinPKG

Download and install ValaWinPKG 0.9d (7.76 Mb)

3) Install packages for different versions

* Launch ValaWinPKG. It should automatically detect the last installed version of Vala (0.16.0 here) :

Let's install the WebKitGTK3 package.

* We are now going to switch versions. Click on the first "Change" button and browse to the installation directory of the other version ("c:\vala-0.12.0" here). Open the "bin" folder and double-click on "valac-0.12.exe".

(we could double-click on "valac.exe", too, but we will see the reason later)

The alternative version is detected and now displayed by ValaWinPKG :

The packages list below is adapted, too.

Let's install the WebKitGTK package.

4) Compile !

We will now compile this WebKit sample code with each version of Vala.

First Vala 0.16.0 (GTK+ 3) :
set PKG_CONFIG_PATH=c:\vala-0.16.0\lib\pkgconfig
valac-0.16 --pkg webkitgtk-3.0 webkit-browser.vala

Then Vala 0.12.0 (GTK+ 2) :
set PKG_CONFIG_PATH=c:\vala-0.12.0\lib\pkgconfig
valac-0.12 --pkg webkit-1.0 webkit-browser.vala

We can run the ouput executable (if it doesn't work, try to move it in its Vala version's "bin" folder) :

5) Switch versions again

Later, when we click on "Change" again, the compiler executables will automatically appear in the "Recent" panel, allowing us to switch versions with a simple click. That's the interest of using the numeroted executables.

Well done !

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Enter the characters shown in the image.