[Qt-interest] Deploying on Mac -- bundle size is huge?

Ian Clark mrrooster at gmail.com
Fri Oct 1 11:01:51 CEST 2010


On 1 October 2010 08:39, Lorenzo Bettini <lorenzo.bettini at gmail.com> wrote:
> On 09/27/2010 10:50 PM, Michael Jackson wrote:
[macdeployqt]
>
> is there a similar deploy utility for Linux and Windows as well?
>
Not that I'm aware of. Packaging stuff that you want to work on as
many distros as possible can be a little tricky. I think you have 3
choices.

1. Package your app with an apropriate packageing tool for the distro
you're targetting, and make the qt libs a dependency. (Most linux
distros include qt)
2. Mention the requirement for qt, and let the user install whatever
package they have on their system for qt.
3. Ship the qt libs with your application and have a run script that
ensures these are loaded correctly.

I ship a small freeware Qt app on linux and I go with option 2 and 3,
advising the user that if the main executable doesn't run they should
execute the shellscript. My build.sh script for linux contains the
following:-

<------------ cut
cat > Yasst.sh <<!
#!/bin/sh
appname=\`basename \$0 | sed s,\.sh\$,,\`
dirname=\`dirname \$0\`

if [ "\`echo \$dirname | cut -c1\`" != "/" ]; then
        dirname=\$PWD/\$dirname
fi
LD_LIBRARY_PATH=\$dirname
export LD_LIBRARY_PATH
\$dirname/\$appname \$*
!
chmod +x Yasst.sh
cat > qt.conf <<!QT
[Paths]
plugins=plugins
!QT

<------------ cut

This creates a .sh to run the program, and the correct qt.conf to
ensure I load the correct plugins.

There's more information on this here:

http://doc.qt.nokia.com/4.7/deployment-x11.html

Cheers,

Ian



More information about the Qt-interest-old mailing list