You are not logged in.

#1 2009-06-19 14:19:31

tntcoda
Member
Registered: 2007-07-24
Posts: 115

Releasing Linux Software (Qt)

Hi,

I've made some software with C++/Qt that I want to release in the AUR, and for other distributions.

First question is on dependencies, ldd lists the following:

    linux-vdso.so.1 =>  (0x00007fff2cffe000)
    libqwt.so.1 => /usr/lib/libqwt.so.1 (0x00007f95249cd000)
    libQtXml.so.4 => /usr/lib/libQtXml.so.4 (0x00007f9524785000)
    libQtGui.so.4 => /usr/lib/libQtGui.so.4 (0x00007f9523b24000)
    libpng12.so.0 => /usr/lib/libpng12.so.0 (0x00007f95238fc000)
    libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x00007f9523665000)
    libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0x00007f9523422000)
    libSM.so.6 => /usr/lib/libSM.so.6 (0x00007f952321a000)
    libICE.so.6 => /usr/lib/libICE.so.6 (0x00007f9522fff000)
    libXrender.so.1 => /usr/lib/libXrender.so.1 (0x00007f9522df6000)
    libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x00007f9522bc5000)
    libXext.so.6 => /usr/lib/libXext.so.6 (0x00007f95229b3000)
    libX11.so.6 => /usr/lib/libX11.so.6 (0x00007f9522678000)
    libQtNetwork.so.4 => /usr/lib/libQtNetwork.so.4 (0x00007f952235a000)
    libssl.so.0.9.8 => /usr/lib/libssl.so.0.9.8 (0x00007f952210a000)
    libcrypto.so.0.9.8 => /usr/lib/libcrypto.so.0.9.8 (0x00007f9521d7b000)
    libQtCore.so.4 => /usr/lib/libQtCore.so.4 (0x00007f952192b000)
    libz.so.1 => /usr/lib/libz.so.1 (0x00007f9521716000)
    libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0x00007f9521512000)
    librt.so.1 => /lib/librt.so.1 (0x00007f952130a000)
    libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x00007f9521047000)
    libdl.so.2 => /lib/libdl.so.2 (0x00007f9520e43000)
    libpthread.so.0 => /lib/libpthread.so.0 (0x00007f9520c27000)
    libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f9520919000)
    libm.so.6 => /lib/libm.so.6 (0x00007f9520697000)
    libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f9520481000)
    libc.so.6 => /lib/libc.so.6 (0x00007f952012c000)
    libQtSvg.so.4 => /usr/lib/libQtSvg.so.4 (0x00007f951fed2000)
    libpcre.so.0 => /lib/libpcre.so.0 (0x00007f951fca2000)
    libuuid.so.1 => /lib/libuuid.so.1 (0x00007f951fa9e000)
    libexpat.so.1 => /usr/lib/libexpat.so.1 (0x00007f951f875000)
    libXau.so.6 => /usr/lib/libXau.so.6 (0x00007f951f673000)
    libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00007f951f457000)
    /lib/ld-linux-x86-64.so.2 (0x00007f9524c9f000)
    libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00007f951f252000)

Which of these libs need to be listed as specific dependencies of the application? I know that explicitly in my code I have only used Qwt, Qt and OpenSSL, everything else seems to be standard C++/threading libs. Any ideas which libs I need to list as specific dependencies other that the known three?

Secondly, I'm unsure how Qt software is deployed, if anyone can help with this? Specifically my .pro file which qmake uses to generate a makefile contains the following questionable lines:

INCLUDEPATH += /usr/include/qwt
LIBS += -lqwt

This works on my system, but it could obviously be a variable path. Is it up to end-users to manually alter this file or can I automate it somehow? I know most Linux software uses configure scripts to do this kind of thing, but Qt doesn't support these as far as im aware?

And finally how do I set 'make install' to copy the binary to /usr/bin?

If anyone has link to a guide/tutorial on this kind of thing it would be very helpful.

Thanks for any help,

Jack

Offline

#2 2009-06-19 16:22:57

scio
Member
From: Buffalo, NY
Registered: 2008-08-05
Posts: 366

Re: Releasing Linux Software (Qt)

First part:
The linked libraries depend on what you told it to link, there may be unnecessary libraries there.  Otherwise, I would list everything you link against or include.  Looking at the source would probably be easier to tell what you need.

Second part:
I have never deployed software using qmake, but if you don't mind a little research cmake (http://www.cmake.org/) is a very nice way to deploy Qt projects.  It is what KDE uses as well as many other projects.  The CMakeLists.txt files allow you do to things like

find_package(Qt4)

and it will store the paths for you (as long as it has a module for the library).
If you want to stick to qmake, http://wiki.qtcentre.org/index.php?titl … nted_qmake has some additional tips for using it.

Offline

#3 2009-06-19 16:31:56

tntcoda
Member
Registered: 2007-07-24
Posts: 115

Re: Releasing Linux Software (Qt)

Thanks very much, I will look into using cmake.

Offline

#4 2009-06-19 17:41:56

jean_no
Member
Registered: 2007-09-18
Posts: 48

Re: Releasing Linux Software (Qt)

Hi

here is my settings

PKGBUILD :

pkgname=progtestqt4_01
pkgver=0.1.0
pkgrel=3
pkgdesc="Test de C++/QT4"
arch=('i686' 'x86_64')
url=http://www.club-internet.fr/jeannoeldot/
license='GPL2'
depends=('xdg-utils' 'qt' 'sdl_mixer')
makedepends=('qt' 'sdl' 'sdl_mixer')
install=$pkgname.install
source=($pkgname.tar.gz)
md5sums=('2acd93e9d46f40dedcc270c1fd1d8feb')

build() {
  cd $srcdir/$pkgname

  # Build
  qmake || return 1
  make || return 1
  make INSTALL_ROOT=$pkgdir install || return 1
}

.pro :

isEmpty( PREFIX ) {
 PREFIX =  /usr
}
TEMPLATE = app
QT = gui core xml
CONFIG += qt warn_on console release
OBJECTS_DIR = build
MOC_DIR = build
UI_DIR = build
DEFINES += PREFIX=\"$${PREFIX}\"
SOURCES = src/main.cpp \
 src/cweatherday.cpp \
 src/afficheimage.cpp \
 src/cafficheurimage.cpp \
 src/cweatherdlg.cpp \
 src/chelpbrowser.cpp \
 src/cdialtest.cpp \
 src/cverdict.cpp \
 src/SDL/sdlplayer.cpp
FORMS += ui/dlgcolored.ui ui/dialogtest.ui
HEADERS += src/afficheimage.h \
 src/cverdict.h \
 src/cweatherday.h \
 src/cweatherdlg.h \
 src/cdialtest.h \
 src/cafficheurimage.h \
 src/chelpbrowser.h \
 src/SDL/sdlplayer.h
TRANSLATIONS += src/progtestqt401_fr.ts
RESOURCES += src/application.qrc
LIBS += -lSDL_mixer -lSDL
unix {
 TARGET = progtestqt4_01
 target.path +=  $${PREFIX}/bin/
 data.path +=  $${PREFIX}/share/progtestqt4_01/data/
 data.files +=  data/*
 pixmap.path +=  $${PREFIX}/share/pixmaps/
 pixmap.files +=  progtestqt4_01.png
 desktop.path +=  $${PREFIX}/share/applications/
 desktop.files +=  progtestqt4_01.desktop
 INSTALLS +=  target  data  pixmap  desktop
}

hope this help

Offline

Board footer

Powered by FluxBB