trinity-devel@lists.pearsoncomputing.net

Message: previous - next
Month: January 2014

tqscintilla-plugin autogenerated Makefile add -lqt which fails (manually builds ok)

From: "David C. Rankin" <drankinatty@...>
Date: Thu, 23 Jan 2014 17:42:19 -0600
Slavek, All,

  Working with tqscintilla/tqscintilla-plugin, I was quite pleased and surprise
to find tqscintilla builds just fine (first time). However, tqscintilla-plugin
build fails due to the autogenerated Makefile including -lqt for libqt in the
g++ command. The major part of the build is done in:

tqscintilla/qt

  Building with:

  cd tqscintilla/qt
  qmake qscintilla.pro
  make

works fine. But the Makefile "install" is broken. While the make produces the
libraries it FAILS to install anything:

1577860 Jan 23 15:38 libqscintilla.so.7.0.1
libqscintilla.so -> libqscintilla.so.7.0.1
libqscintilla.so.7 -> libqscintilla.so.7.0.1
libqscintilla.so.7.0 -> libqscintilla.so.7.0.1


The plugin is built in tqscintilla/designer with:

  cd tqscintilla/designer
  qmake designer.pro
  make

fails with the error:

g++ -luuid  -Wl,-rpath,../ -Wl,-rpath,../qt  -Wl,-rpath,/opt/tqt3/lib -shared -o
libqscintillaplugin.so qscintillaplugin.o   -L../ -L../qt -L/opt/tqt3/lib -luuid
-lqscintilla -lqt
/usr/bin/ld: cannot find -lqt
collect2: error: ld returned 1 exit status

  Looking at the string, it looks for -lqt (that doesn't exists - and is NOT
needed) Changing into the build directory and issuing the command without the
-lqt completes fine:

g++ -luuid  -Wl,-rpath,../ -Wl,-rpath,../qt  -Wl,-rpath,/opt/tqt3/lib -shared -o
libqscintillaplugin.so qscintillaplugin.o   -L../ -L../qt -L/opt/tqt3/lib -luuid
-lqscintilla -lqt

$ ls -al
-rwxr-xr-x 1 nobody root   22174 Jan 23 14:41 libqscintillaplugin.so

  The problem is that qmake autogenerates the Makefile and the Makefile
automatically includes the -lqt for some reason.

  Checking both the tqscintilla/qt/qscintilla.pro and the resulting
tqscintilla/qt/Makefile there is no -lqt added to the g++ command for that app.
Why is it being added to the tqscintilla/designer/Makefile? More importantly -
how do we fix it?

  To get around the install & lib issues, I simply modified my build/package
script to get around the errors:

build() {

  cd ${srcdir}

  ## CMAKE config
  msg "Setting PATH, CMAKE and Trinity Environment variables"
  # Source the QT and TDE profile
  [ "$QTDIR" = "" ] && . /etc/profile.d/tqt3.sh       # or tqt3.sh
  [ "$TDEDIR" = "" ] && . /etc/profile.d/trinity.sh   # or tde.sh

  ## build tqscintilla
  msg "Building - ${pkgname}..."
  cd ${srcdir}/${pkgname#*-}/qt
  qmake qscintilla.pro
  make

  ## build plugin files
  msg "Building - ${pkgname}-plugin..."
  cd ${srcdir}/${pkgname#*-}/designer

  # patch designer/designer.pro; LIBPATH += ../tmplib ../qt
  msg "patching designer/designer.pro; LIBPATH += ../tmplib ../qt"
  sed -i 's/tmplib/\ ..\/qt/' designer.pro

  qmake designer.pro

  # patch the resulting Makefile to remove -lqt
  msg "patching Makefile to remove -lqt"
  sed -i 's/-lqscintilla -lqt/-lqscintilla/' Makefile

  make

}

package() {
  pkgdesc="A port to Qt3 of Neil Hodgson's Scintilla C++ editor class"
  provides=('qscintilla-qt3')
  options=('staticlibs' 'libtool' '!emptydirs' '!strip')

  msg "Packaging - $pkgbase"

  cd ${srcdir}/${pkgname#*-}/qt            # use for non-out-of-source

  make INSTALL_ROOT="${pkgdir}" install    # other form - older package

  # install missing library files
  install -m 755 -Dd "${pkgdir}${QTDIR}/lib"
  install -m 644 -D libqscintilla.so.7.0.1 "${pkgdir}${QTDIR}/lib"
  ln -s ${pkgdir}${QTDIR}/lib/libqscintilla.so.7.0.1
${pkgdir}${QTDIR}/lib/libqscintilla.so
  ln -s ${pkgdir}${QTDIR}/lib/libqscintilla.so.7.0.1
${pkgdir}${QTDIR}/lib/libqscintilla.so.7
  ln -s ${pkgdir}${QTDIR}/lib/libqscintilla.so.7.0.1
${pkgdir}${QTDIR}/lib/libqscintilla.so.7.0

  # installing includes
  for i in qextscintilla*.h; do
    install -m 644 -D $i "${pkgdir}${QTDIR}/include/$i"
  done

  cd ${srcdir}/${pkgname#*-}/designer            # use for non-out-of-source
  install -m 644 -D libqscintillaplugin.so "${pkgdir}${QTDIR}/lib"

}

  I need to confirm that my package contents are the total contents for the
package. Since you build in the ../qt directory and the ../src is not touched
(except by the magic Makefiles) I'm skeptical. My package consists of:

opt/tqt3/include/qextscintillaprinter.h
opt/tqt3/include/qextscintillacommand.h
opt/tqt3/include/qextscintillalexerbatch.h
opt/tqt3/include/qextscintillalexerpython.h
opt/tqt3/include/qextscintillalexerbash.h
opt/tqt3/include/qextscintillalexerjava.h
opt/tqt3/include/qextscintillalexerdiff.h
opt/tqt3/include/qextscintilla.h
opt/tqt3/include/qextscintillabase.h
opt/tqt3/include/qextscintillalexersql.h
opt/tqt3/include/qextscintillalexercpp.h
opt/tqt3/include/qextscintillacommandset.h
opt/tqt3/include/qextscintillalexer.h
opt/tqt3/include/qextscintillaglobal.h
opt/tqt3/include/qextscintillalexeridl.h
opt/tqt3/include/qextscintillalexermakefile.h
opt/tqt3/include/qextscintillalexerjavascript.h
opt/tqt3/include/qextscintillalexerruby.h
opt/tqt3/include/qextscintillalexercss.h
opt/tqt3/include/qextscintillalexerlua.h
opt/tqt3/include/qextscintillamacro.h
opt/tqt3/include/qextscintillalexerperl.h
opt/tqt3/include/qextscintillaapis.h
opt/tqt3/include/qextscintillalexerproperties.h
opt/tqt3/include/qextscintillalexercsharp.h
opt/tqt3/include/qextscintillalexerhtml.h
opt/tqt3/include/qextscintillalexerpov.h
opt/tqt3/include/qextscintillalexertex.h
opt/tqt3/include/qextscintilladocument.h
opt/tqt3/translations/qscintilla_pt_br.qm
opt/tqt3/translations/qscintilla_fr.qm
opt/tqt3/translations/qscintilla_ru.qm
opt/tqt3/translations/qscintilla_de.qm
opt/tqt3/lib/libqscintilla.so
opt/tqt3/lib/libqscintilla.so.7
opt/tqt3/lib/libqscintillaplugin.so
opt/tqt3/lib/libqscintilla.so.7.0.1
opt/tqt3/lib/libqscintilla.so.7.0

  What do you say Slavek?


-- 
David C. Rankin, J.D.,P.E.