Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Integration issues with GNAT GPS in Ubuntu

269 views
Skip to first unread message

Yannick Duchêne (Hibou57)

unread,
Apr 11, 2012, 12:31:14 PM4/11/12
to
Hi,

Just installed GPS in Ubuntu, late, as I usually use something else.

I encountered an integration issue, and seems the bug
http://www.mail-archive.com/debian-b...@lists.debian.org/msg774486.html
is still there

I had to manually create the desktop file. And by the way, there seems to
be no file type for GPR files neither.

How to solve, locally (not system wide):

In “~/.local/mime/packages” create a file named “gnat-project.xml”, edit
to give it this content:

<?xml version="1.0" encoding="UTF-8"?>

<mime-info
xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/x-gnat-project">
<sub-class-of type="text/plain"/>
<comment xml:lang="en">GNAT Project</comment>
<comment xml:lang="fr">Projet GNAT</comment>
<icon name="gnat-gps"/>
<glob pattern="*.gpr"/>
</mime-type>
</mime-info>

That's the file type definition for GNAT project files.

Copy “/usr/share/gps/icons/48px/gps_48.png” to
“~/.local/share/icons/xxx/gnat-gps.png” where “xxx” is your active local
icon set subdirectory (if you have one).

In “~/.local/share/applications”, create a file “gnat-gps.desktop”, whose
content is similar to the one suggested in the above ling, with tiny
variations:

[Desktop Entry]
Name=GNAT GPS
Comment=The GNAT Programming System
Comment[ca]=Sistema de programació de GNAT
Comment[fr]=Environnement de Programmation GNAT
Exec=/usr/bin/gnat-gps
Icon=gnat-gps
MimeType=application/x-gnat-project;
Terminal=false
Type=Application
Categories=Development;
StartupNotify=true

That's the menu entry definition and MIME‑type application association.

From a console, run the following commands:

update-mime-database ~/.local/share/mime
update-menus

That will update your environment.

GNAT GPR files should display with the GNAT GPS icons, should run GPS when
you click on, and a menu entry for GPS should have appeared in your
Applications menu.

--
“Syntactic sugar causes cancer of the semi-colons.” [1]
“Structured Programming supports the law of the excluded muddle.” [1]
[1]: Epigrams on Programming — Alan J. — P. Yale University

Yannick Duchêne (Hibou57)

unread,
Apr 11, 2012, 12:49:34 PM4/11/12
to
Le Wed, 11 Apr 2012 18:31:14 +0200, Yannick Duchêne (Hibou57)
<yannick...@yahoo.fr> a écrit:

> From a console, run the following commands:
>
> update-mime-database ~/.local/share/mime
> update-menus

Sorry, one was missing:

update-desktop-database ~/.local

Without this one, GPS won't be invoked when you click on a project file.

Yannick Duchêne (Hibou57)

unread,
Apr 25, 2012, 4:14:48 AM4/25/12
to
Le Wed, 11 Apr 2012 18:49:34 +0200, Yannick Duchêne (Hibou57)
<yannick...@yahoo.fr> a écrit:

> Le Wed, 11 Apr 2012 18:31:14 +0200, Yannick Duchêne (Hibou57)
> <yannick...@yahoo.fr> a écrit:
>
>> From a console, run the following commands:
>>
>> update-mime-database ~/.local/share/mime
>> update-menus
>
> Sorry, one was missing:
>
> update-desktop-database ~/.local
>
> Without this one, GPS won't be invoked when you click on a project file.

Still not perfect, as you may have noticed.

Create a file named “open-gnat-project”, and give it this content:

#!/bin/sh
gnat-gps "-P$1" &

move it in you “~/bin” directory and give it the executable attribute.

In the previously suggested “gnat-gps.desktop” file, change

Exec=/usr/bin/gnat-gps

into

Exec=open-gnat-project

Then run again from a terminal

update-desktop-database ~/.local
update-menus

Now GPS will open on you project when you click on a project file, instead
of opening with a dialog requesting you to browse for a project file. More
handy.

Yannick Duchêne (Hibou57)

unread,
Apr 26, 2012, 7:09:35 AM4/26/12
to
Le Wed, 11 Apr 2012 18:31:14 +0200, Yannick Duchêne (Hibou57)
<yannick...@yahoo.fr> a écrit:

> Hi,
>
> Just installed GPS in Ubuntu, late, as I usually use something else.
>
> I encountered an integration issue, and seems the bug

A more severe bug seems to be with the outline view. Whatever I click on
the outline view, GPS crashes and I get this on the terminal (need to
start GPS from a terminal to get the message):

raised STORAGE_ERROR : s-intman.adb:139 explicit raise

Do you get the same? That's for Ubuntu Maverick. Not tested on Windows.

Álex R.

unread,
May 4, 2012, 10:34:23 AM5/4/12
to
Yannick Duchêne (Hibou57) wrote:

> Le Wed, 11 Apr 2012 18:31:14 +0200, Yannick Duchêne (Hibou57)
> <yannick...@yahoo.fr> a écrit:
>
>> Hi,
>>
>> Just installed GPS in Ubuntu, late, as I usually use something else.
>>
>> I encountered an integration issue, and seems the bug
>
> A more severe bug seems to be with the outline view. Whatever I click on
> the outline view, GPS crashes and I get this on the terminal (need to
> start GPS from a terminal to get the message):
>
> raised STORAGE_ERROR : s-intman.adb:139 explicit raise
>
> Do you get the same? That's for Ubuntu Maverick. Not tested on Windows.
>

I have seen this in the past, In some of my installations it happened and in
others not. Which meant that somehow it could be fixed, but I didn't narrow
it down. Sorry to be of so little help.

IIRC that in these cases I settled on using the packaged gnat-gps.
0 new messages