[Nix-dev] Qt Creator issues

Baptist BENOIST return_0 at live.com
Fri May 31 18:50:31 CEST 2013


Hi,

I had the time to look at qtcreator and am improving its derivation. Here are the current changes:
-You can now choose to install qt or a full version of it by using qt or qtFull (a simple override enabling the doc, demos and examples options. Everything is now correctly installed =)
-qtcreator has been updated to v2.7.1
-The relation between qt and qtcreator is now clearer: qt definition is directly overriden in the qtcreator's default.nix to simply enable the developerBuild
option depending if we want the full version or not.

Also, I now better understand what the "problem" truely is. Facts are that in Nix you "must" create specific development environments in order to have the libraries and tools you want including qmake. See http://nixos.org/wiki/Howto_develop_software_on_nixos if you didn't already, reasons are explained inside.
On the other side, QtCreator requires to find Qt components (by using qmake or a qt.conf file) in environment variables, etc. to be able to use them (including doc, examples and demos).

Which means that we have now two solutions:
-The first one is to consider that using QtCreator without Qt is a nonsense as it has been made for it. Considering this offers the possibility to make qt and required tools (even gcc!) inherited by QtCreator in order to have both together included in the symlinked directories created by nix when building your environment. This is the only solution to enable QtCreator to be "fully" installed by simply specifying its package name (not qt and tools).
-The second one, which is the one I and apparently also QtCreator developers believe in, is that QtCreator is not directly related to a specific Qt version and can even be used for projects that do not uses Qt at all. By considering this, the only solution is to manually adding the qtFull package and build tools (gcc make, valgrind, etc.) in your desired environment. Then QtCreator will recognize everything and work as you expected ;-)

As I do not have an access to the official repositories, I have pushed my current work on my personal fork of nixpkgs and will make a pull request when fully checked...

With what I have done, you will be able to have the whole thing working by simply adding the qtcreator and qt48Full in a development environment. Removal of the files I spoke about on my last may also be required ;-)

Regards,

return_0 at live.com
________________________________
De : Bjørn Forsman<mailto:bjorn.forsman at gmail.com>
Envoyé : ‎29/‎05/‎2013 19:38
À : Baptist BENOIST<mailto:return_0 at live.com>; nix-dev<mailto:nix-dev at lists.science.uu.nl>
Objet : Re: [Nix-dev] Qt Creator issues

Hi BENOIST,

Thanks for replying.

On 28 May 2013 22:56, Baptist BENOIST <return_0 at live.com> wrote:
> Hi,
>
> I wrote the QtCreator derivation a few months ago but did not used it
> recently...

Ok.

>> Today I tried using Qt Creator in NixOS. I found two issues:
>>
>> The first issue is that there is no way to create applications from
>> File -> New File or Project. On Ubuntu I have an "Applications" entry
>> just above the "Libraries" entry. On NixOS the "Applications" entry is
>> missing. I suspect this is related to this error that is spewed all
>> over the terminal (100 times or so) after clicking on File -> New File
>> or Project:
>>
>> Cannot update Qt version information:
>> /nix/store/0g7rv5wclspqz80pb2dkjxqxf2651xar-qt-4.8.3/bin/qmake cannot
>> be run.
>
> This message is not prompted on a clean and up to date configuration (see
> the attached screenshot).
> If this can help, mine is based on the version 4.8.4 of Qt4
> qt4_for_qtcreator...

Weird. I have qt-4.8.4 too. I rebuilt my system maybe a week ago or
so. I have qtcreator in environment.systemPackages, so it's definitely
not an old qtcreator installed with nix-env.

> Anyways, I do not have the applications entry too.
> I only used this application to open CMake projects and did not saw that the
> Applications entry was missing because I only opened existing projects.

Ok.

>> The path it refers to doesn't exist. (And building qtcreator again
>> from source still refers to the same broken nix store path! I need to
>> confirm this.)
>
>> The second issue is that there are no examples in the examples tab; it
>> is empty. I think this should fix itself if qt is built with examples
>> & demos. (Because skimming over the source it seems that Qt knows
>> where the demos & examples are installed, so qtcreator can ask the
>> library.)
>
> Facts that examples are not defaultly present is not really an issue.
> As examples are optional for disk usage reasons (which I totally agree as an
> heavy VM user) on other distros such as ArchLinux and debian (maybe not
> ubuntu), and because I did not need it, I did not tried to add examples.

Well, maybe not a bug-like issue, but when installing Qt Creator I
think having the examples (which are integrated into the IDE)
available makes a lot of sense.

FYI, with a plain qt install:

./configure -prefix /tmp/qt-lib/ -v -no-separate-debug-info -release
-no-fast -confirm-license -opensource
make
make install

$ du -sc /tmp/qt-lib/* | sort -nr
498032  totalt
318264  /tmp/qt-lib/doc
71148   /tmp/qt-lib/lib
39828   /tmp/qt-lib/examples
19424   /tmp/qt-lib/include
18388   /tmp/qt-lib/bin
12784   /tmp/qt-lib/demos
7296    /tmp/qt-lib/translations
4168    /tmp/qt-lib/plugins
3076    /tmp/qt-lib/mkspecs
2584    /tmp/qt-lib/tests
424     /tmp/qt-lib/imports
328     /tmp/qt-lib/q3porting.xml
320     /tmp/qt-lib/phrasebooks

Regarding size, doc is the worst offender here (and it is disabled in
nixpkgs), with 300 MB! lib is 71 MB, examples 40 MB and demos 13 MB.

>> I tried to build qt4_for_qtcreator without "-nomake examples
>> -nomake demos", but that didn't do it. It didn't even make qt install
>> the examples & demos in $out. Well, that's confusing.
>
> Did you tried with "-make examples -make demos"?
> According to the derivation (I did not wrote the Qt one, only occasional
> maintaining), examples should be installed in
> $out/share/doc/${name}/examples.

No I didn't try that. But I tried building qt outside of nix and then
it installs examples & demos with this configure line:

./configure -prefix /tmp/qt-lib/ -v -no-separate-debug-info -release
-no-fast -confirm-license -opensource
make
make install

IOW, removing "-nomake ..." should make it work. I don't know what
happened when I built it with nix.

> I only wrote this derivation because it was non-existing and I needed it for
> my own usage, if you want to contribute by improving it, you are welcome =)

Yes, I'd like to improve it. But the build-time for Qt is really high
in my VM. I think it took 2-3 hours to build. Next time I'll
definitely prefix the command with "time" so I'll know for sure.

> When I will have enough time (I unfortunately cannot give you a precise
> date), I will update it to the version 2.7.1. Maybe that the Applications
> entry will be working as intended. You can even create an issue on github if
> you want to work/discuss on it with commits ;-)

Ok.

Best regards,
Bjørn Forsman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20130531/c1a8cde0/attachment-0001.html 


More information about the nix-dev mailing list