[texworks] PAtch for .desktop file

Stefan Löffler st.loeffler at gmail.com
Sun Dec 12 16:43:29 CET 2010


On 2010-12-10 11:12, Atri wrote:
> On Thu, 2010-12-09 at 08:01 +0100, Stefan Löffler wrote:
>> Hi,
>>
>> On 2010-12-09 05:29, Atri wrote:
>>> Also, I use a patch to fix little complaints in the .desktop file
>>> reported by RPMLint when it looks for problems with a built rpm package.
>>> This patch removes the first shebang line from the .desktop file and
>>> completes the Categories definition in it. Here's the patch
>>>
>>> ----------------------------------------------------------
>>> diff -ur texworks-0.2.99svn702.orig//texworks.desktop
>>> texworks-0.2.99svn702//texworks.desktop
>>> --- texworks-0.2.99svn702.orig//texworks.desktop  2010-12-04
>>> 04:10:09.000000000 +0530
>>> +++ texworks-0.2.99svn702//texworks.desktop   2010-12-04
>>> 06:25:09.694082023 +0530
>>> @@ -1,4 +1,3 @@
>>> -#!/usr/bin/env xdg-open
>>>  [Desktop Entry]
>>>  Type=Application
>>>  Version=1.0
>>> @@ -10,6 +9,5 @@
>>>  Comment[de]=TeX Dokumente einfach bearbeiten, setzen und betrachten
>>>  Icon=TeXworks
>>>  Exec=texworks %F
>>> -MimeType=text/x-tex;application/pdf;
>>> -Categories=Office;
>>> -
>>> +MimeType=text/x-tex;
>>> +Categories=Office;WordProcessor;
>>>
>>> ----------------------------------------------------------
>> Thanks for the patch. I'm still not too sure about how to apply this,
>> though.
>> Could you send the RPMLint complaints?
>> I seem to remember that Debian lintian complained if there was no
>> shebang in the file.
>> Also, Tw does handle pdfs, so the pdf mimetype should be in there, IMO.
>> And regarding the Categories, I wouldn't classify Tw as a WordProcessor
>> (assuming this is interpreted as a "real" word processor, WYSIWYG-like,
>> such as OpenOffice.org Writer). That's why I didn't put it in that
>> category - but maybe my interpretation of the WordProcessor category is
>> wrong...
>>
> The RPMLint warning that goes off when I remove the patch (rather just
> modify it to leave the shebang untouched) is as follows
> ---
> texworks-svn.x86_64: W:
> non-executable-script /usr/share/applications/texworks.desktop
> 0644 /usr/bin/env
> This text file contains a shebang or is located in a path dedicated for
> executables, but lacks the executable bits and cannot thus be executed.
> If
> the file is meant to be an executable script, add the executable bits,
> otherwise remove the shebang or move the file elsewhere.
> ---

OK, I removed the shebang.

> So I finally modified the patch to leave the MimeType as it is (patching
> that was wrong), remove the shebang and to add WordProcessor to the
> category, without which builds on openSUSE just fail. The same category
> is used for other TeX related applications like Kile, TeXmaker and Lyx,
> so I guess it would be alright here too.

Hm, interesting. I just had a look at the Kile package on Ubuntu, and it
has the following categories:
Qt;KDE;Office;Publishing;

So, I added "Qt" to the Tw .desktop file - it is appropriate, after all,
and should not cause problems. Maybe we could also add Tw to
"Publishing" - this is more fitting than "WordProcessor", IMO - but
handling/necessity of this seems distro-dependent.
So, if it is common practice to put TeX related apps in the
"WordProcessor" category, then by all means, use your patch before
building for those platforms (I'd rather not include it in the official
version, though, as I still think its inappropriate for general use and
may cause problems on other distros).

HTH
Stefan


More information about the texworks mailing list