You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tde-packaging/arch/3.5.13/trinity-base/trinity-qt3/PKGBUILD

135 lines
4.8 KiB

# Maintainer: Pawel 'l0ner' Soltys <pwslts@gmail.com>
# Contributor: Calvin Morrison <MutantTurkey@gmail.com>
pkgname=trinity-qt3
pkgver=3884
pkgrel=3
pkgdesc="The Qt3 gui toolkit - with Trinity upstream"
arch=('i686' 'x86_64')
url="http://trinitydesktop.org"
license=('GPL')
groups=('trinity-base')
depends=('libpng' 'libxmu' 'libxcursor' 'libxinerama' 'mesa' 'libxft'
'libxrandr' 'libmng')
makedepends=('libxi'
'mysql' 'postgresql' 'unixodbc' 'sqlite3')
# cups [add for cups support, add -cups to ./configure opts]
optdepends=('libmysqlclient' 'postgresql-libs' 'unixodbc')
provides=('trinity-qt3' 'qt3' 'qt3-enhanced' )
conflicts=('qt3')
replaces=('qt3-enhanced')
options=('!libtool' '!emptydirs')
source=('http://mirror.ets.kth.se/trinity/releases/3.5.13/dependencies/qt3-3.3.8.d.tar.gz' 'qt-odbc.patch')
md5sums=('78dc675e84aed595375449818cbb589a'
'32772739fc53062e9151a6e283c52add')
_prefix="/opt/qt"
build() {
msg "Setting enviroment variables..."
export QTDIR="${srcdir}/qt3/"
export PATH=${QTDIR}/bin:${PATH}
export LD_LIBRARY_PATH=${QTDIR}/lib:${LD_LIBRARY_PATH}
export QMAKESPEC=$QTDIR/mkspecs/linux-g++
if [ "$CARCH" = "x86_64" ]; then
export ARCH="-64"
else unset ARCH
fi
# fix build problem against new unixODBC
patch -p1 -i "${srcdir}"/qt-odbc.patch
cd "${srcdir}/qt3"
rm -rf mkspecs/{*aix*,*bsd*,cygwin*,dgux*,darwin*,hpux*,hurd*,irix*,lynxos*,macx*,qnx*,reliant*,sco*,solaris*,tru64*,unixware*,win32*}
sed -i 's|-cp -P -f|-cp -L -f|' qmake/Makefile.unix
rm -rf doc/html examples tutorial
sed -i "s|sub-tutorial sub-examples||" Makefile
sed -i "s|-O2|$CXXFLAGS|" mkspecs/linux-g++/qmake.conf
sed -i "s|-O2|$CXXFLAGS|" mkspecs/linux-g++-32/qmake.conf
sed -i "s|-O2|$CXXFLAGS|" mkspecs/linux-g++-64/qmake.conf
sed -i "s|-I. |$CXXFLAGS -I. |" qmake/Makefile.unix
# auto license acceptance
sed -i "s|read acceptance|acceptance=yes|" configure
msg "Starting configure..."
#make -C qmake || return 1
./configure \
-prefix ${_prefix} \
-platform linux-g++${ARCH} \
-sysconfdir /etc/qt \
-release \
-sm \
-nis \
-stl \
-no-g++-exceptions \
-thread \
-shared \
-system-zlib \
-system-lib{png,jpeg,mng} \
-qt-gif \
-plugin-sql-{mysql,psql,sqlite,odbc}
# 64bit fixes pulled from extras/qt3 PKGBUILD
# fix /opt/qt/lib path
[ "$CARCH" = "x86_64" ] && sed -i "s|/opt/qt/lib64|/opt/qt/lib|g" "${srcdir}"/qt3/src/Makefile
[ "$CARCH" = "x86_64" ] && sed -i "s|/opt/qt/lib64|/opt/qt/lib|g" "${srcdir}"/qt3/tools/designer/designer/Makefile
[ "$CARCH" = "x86_64" ] && sed -i "s|/opt/qt/lib64|/opt/qt/lib|g" "${srcdir}"/qt3/tools/designer/editor/Makefile
[ "$CARCH" = "x86_64" ] && sed -i "s|/opt/qt/lib64|/opt/qt/lib|g" "${srcdir}"/qt3/tools/assistant/lib/Makefile
[ "$CARCH" = "x86_64" ] && sed -i "s|/opt/qt/lib64|/opt/qt/lib|g" "${srcdir}"/qt3/tools/designer/uilib/Makefile
msg "Building - $pkgname..."
# build sql plugins
cd "${srcdir}"/qt3
make -C qmake
cd "${srcdir}"/qt3/plugins/src/sqldrivers/mysql
"${srcdir}"/qt3/bin/qmake -o Makefile "INCPATH+=/usr/include/mysql" "LIBS+=-L/usr/lib/mysql -lmysqlclient" mysql.pro
cd "${srcdir}"/qt3/plugins/src/sqldrivers/psql
"${srcdir}"/qt3/bin/qmake -o Makefile "INCPATH+=/usr/src/include /usr/include/postgresql/server" "LIBS+=-L/usr/lib -lpq" psql.pro
cd "${srcdir}"/qt3
# fix the broken makefiles
# sed -i 's|[[:space:]]*strip.*doc/html.*$|#|g' src/Makefile
# build rest
make
}
package() {
msg "Packaging - $pkgname-$pkgver"
cd "$srcdir/qt3"
# Build ld.so.conf file
echo "${_prefix}" > ${srcdir}/libqt-mt.conf
echo "${_prefix}/lib" >> ${srcdir}/libqt-mt.conf
echo "/opt/trinity/lib" >> ${srcdir}/libqt-mt.conf
# install -d -m755 ${pkgdir}/etc/ld.so.conf.d/
install -D -m755 ${srcdir}/libqt-mt.conf ${pkgdir}/etc/ld.so.conf.d/libqt-mt.conf
# Build and install qt.profile
echo "export QTDIR=${_prefix}" > ${srcdir}/qt.profile
echo "export QT_XFT=true" >> ${srcdir}/qt.profile
echo 'export PATH=$PATH:$QTDIR/bin' >> ${srcdir}/qt.profile
echo 'export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$QTDIR/pkgconfig' >> ${srcdir}/qt.profile
install -D -m755 ${srcdir}/qt.profile ${pkgdir}/etc/profile.d/qt3.sh
make INSTALL_ROOT="$pkgdir" install
rm -rf "${pkgdir}"/opt/qt/{phrasebooks,templates,translations}
sed -i "s|-L${srcdir}/qt3/lib ||g" "${pkgdir}"/opt/qt/lib/*.prl
install -D -m755 qmake/qmake "${pkgdir}"/opt/qt/bin/qmake
ln -sf /opt/qt/bin/qtconfig "${pkgdir}"/opt/qt/bin/qt3config
rm -f "${pkgdir}"/opt/qt/mkspecs/linux-g++$ARCH/linux-g++$ARCH
# install man pages
install -d -m755 "${pkgdir}"/opt/qt/man
cp -r "${srcdir}"/qt3/doc/man/{man1,man3} "${pkgdir}"/opt/qt/man/
}