You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
374 lines
13 KiB
Bash
374 lines
13 KiB
Bash
#!/bin/sh
|
|
# Generated by Alien's SlackBuild Toolkit: http://slackware.com/~alien/AST
|
|
# Copyright 2009, 2010, 2011, 2012, 2013, 2014, 2015 Eric Hameleers, Eindhoven, Netherlands
|
|
# Copyright 2015-2017 Thorn Inurcide USA
|
|
# Copyright 2015-2017 tde-slackbuilds project on GitHub
|
|
# All rights reserved.
|
|
#
|
|
# Permission to use, copy, modify, and distribute this software for
|
|
# any purpose with or without fee is hereby granted, provided that
|
|
# the above copyright notice and this permission notice appear in all
|
|
# copies.
|
|
#
|
|
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
|
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
# IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
|
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
|
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
# SUCH DAMAGE.
|
|
|
|
# Much help from the 12.2 SlackBuild script of qt3. And from SBo qt3 script
|
|
# Man pages are not installed by 'make install' and have not been manually installed
|
|
|
|
PRGNAM=tqt3
|
|
VERSION=$TDEVERSION
|
|
BUILD=${BUILD:-1}
|
|
TAG=${TAG:-_tde}
|
|
|
|
source ../../get-source.sh
|
|
getsource_fn
|
|
|
|
untar_fn
|
|
|
|
## add -march, -mtune and no_warn options to CFLAGS where they've been set in BUILD-TDE.sh
|
|
sed -i "s|^QMAKE_CFLAGS[^_].*$|& $SET_march ${NO_WARN:-}|" mkspecs/linux-g++/qmake.conf
|
|
sed -i "s|CONFIG.*$|& ${NO_WARN:+warn_off}|" mkspecs/linux-g++/qmake.conf
|
|
|
|
## RPATH is set to $ORIGIN/../lib to locate libs during the build
|
|
## and added during configure with the -R option
|
|
## lib suffix might be 64
|
|
## add -headerdir as set in configure
|
|
## allow building with clang, either build-time or run-time
|
|
[[ ! $(grep COMPILER mkspecs/linux-g++/qmake.conf) ]] && {
|
|
echo $'--- mkspecs/linux-g++/qmake.conf
|
|
+++ mkspecs/linux-g++/qmake.conf
|
|
@@ -11 +11 @@
|
|
-QMAKE_CC = gcc
|
|
+QMAKE_CC = $(COMPILER)
|
|
@@ -29 +29 @@
|
|
-QMAKE_CXX = g++
|
|
+QMAKE_CXX = $(COMPILER_CXX)
|
|
@@ -42,2 +42,2 @@
|
|
-QMAKE_INCDIR_X11 = /usr/X11R6/include
|
|
-QMAKE_LIBDIR_X11 = /usr/X11R6/lib
|
|
+QMAKE_INCDIR_X11 = /usr/include/X11
|
|
+QMAKE_LIBDIR_X11 = /usr/lib'"$LIBDIRSUFFIX"$'
|
|
@@ -45,3 +45,3 @@
|
|
-QMAKE_LIBDIR_TQT = $(TQTDIR)/lib
|
|
-QMAKE_INCDIR_OPENGL = /usr/X11R6/include
|
|
-QMAKE_LIBDIR_OPENGL = /usr/X11R6/lib
|
|
+QMAKE_LIBDIR_TQT = $(TQTDIR)/lib'"$LIBDIRSUFFIX"$'
|
|
+QMAKE_INCDIR_OPENGL = /usr/include/GL
|
|
+QMAKE_LIBDIR_OPENGL = /usr/lib'"$LIBDIRSUFFIX"$'
|
|
@@ -49,2 +49,2 @@
|
|
-QMAKE_LINK = g++
|
|
-QMAKE_LINK_SHLIB = g++
|
|
+QMAKE_LINK = $(COMPILER_CXX)
|
|
+QMAKE_LINK_SHLIB = $(COMPILER_CXX)
|
|
@@ -58 +58 @@
|
|
-QMAKE_RPATH = -Wl,-rpath,
|
|
+QMAKE_RPATH =
|
|
' | patch -p0
|
|
}
|
|
|
|
## don't install html docs if 'nodocs' has been selected
|
|
[[ $TQT_OPTS == *nodocs* ]] && sed -i '/htmldocs/d' src/qt_install.pri
|
|
|
|
## install translations only for the languages set with I18N
|
|
(cd translations
|
|
I18N=$(echo $I18N | tr '[:upper:]' '[:lower:]' | tr '_' '-')
|
|
for lang in $I18N
|
|
do
|
|
file="${file:+${file}:}*${lang}*"
|
|
done
|
|
GLOBIGNORE=${file:-}
|
|
rm *)
|
|
## for a minimal build
|
|
[[ $TQT_OPTS == *minimal* ]] && {
|
|
sed -i '/translations/d' src/qt_install.pri
|
|
sed -i '/phrasebooks/d' tools/linguist/linguist/linguist.pro
|
|
sed -i '/templates/d' tools/designer/designer/designer.pro
|
|
}
|
|
|
|
## only need linux-g++
|
|
[[ $TQT_OPTS == *mkspecs* ]] && {
|
|
(cd mkspecs
|
|
GLOBIGNORE=linux-g++
|
|
rm -rf *)
|
|
}
|
|
|
|
## install desktop files to applications/tde as for the other TDE desktop files
|
|
sed -i 's|desktop.path = $$share.path/applications|&/tde|' tools/assistant/assistant.pro
|
|
sed -i 's|desktop.path = $$share.path/applications|&/tde|' tools/qtconfig/qtconfig.pro
|
|
sed -i 's|desktop.path = $$share.path/applications|&/tde|' tools/designer/designer/designer.pro
|
|
sed -i 's|desktop.path = $$share.path/applications|&/tde|' tools/linguist/linguist/linguist.pro
|
|
|
|
listdocs_fn
|
|
|
|
chown_fn
|
|
|
|
#cd_builddir_fn - don't use
|
|
|
|
## datadir is where mkspecs is installed
|
|
## gcc visibility hidden is the default in mkspecs/..qmake.conf
|
|
echo "yes" | \
|
|
./configure \
|
|
-no-exceptions \
|
|
-prefix $TQTDIR \
|
|
-libdir $TQTDIR/lib$LIBDIRSUFFIX \
|
|
-bindir $TQTDIR/bin \
|
|
-headerdir $TQTDIR/include/tqt \
|
|
-plugindir $TQTDIR/lib$LIBDIRSUFFIX/tqt/plugins \
|
|
-datadir $TQTDIR/lib$LIBDIRSUFFIX/tqt \
|
|
-translationdir $TQTDIR/share/tqt/translations \
|
|
-release \
|
|
${VERBOSE:+-verbose} \
|
|
-I/usr/include/freetype2 \
|
|
-I/usr/include/mysql \
|
|
-I/usr/include/tirpc \
|
|
-L/usr/lib$LIBDIRSUFFIX \
|
|
-system-zlib \
|
|
-qt-imgfmt-png \
|
|
-qt-imgfmt-mng \
|
|
-qt-gif \
|
|
-thread \
|
|
-stl \
|
|
-nis \
|
|
-cups \
|
|
-pch \
|
|
-xft \
|
|
-xrender \
|
|
-xrandr \
|
|
-xcursor \
|
|
-tablet \
|
|
-xinerama \
|
|
-plugin-style-cde \
|
|
-plugin-style-compact \
|
|
-plugin-style-motif \
|
|
-plugin-style-motifplus \
|
|
-plugin-style-platinum \
|
|
-plugin-style-sgi \
|
|
-plugin-style-windows \
|
|
-fast \
|
|
-R-Wl,-rpath,\'\\\$\$ORIGIN/../lib:$INST_RPATH\' ## +$INST_RPATH for run-time RPATH
|
|
|
|
#| cc1plus: error: one or more PCH files were found, but they were invalid
|
|
#| <command-line>: fatal error: tqtdesignercore: No such file or directory
|
|
## Not a fatal error causing a build failure - qmake_image_collection.o compiles later
|
|
## at its correct position in the Makefile OBJECTS list - but the error message is misleading
|
|
sed -i 's|./qmake_image_collection.o:.*$|& tqtdesignercore.gch/c++|' tools/designer/designer/Makefile
|
|
|
|
## don't build tutorial and examples which won't be installed because the release version is being built
|
|
make -i $NUMJOBS symlinks src-qmake src-moc sub-src sub-tools || exit 1
|
|
make install INSTALL_ROOT=$PKG || exit 1
|
|
|
|
## for a minimal packaging
|
|
[[ $TQT_OPTS == *minimal* ]] && {
|
|
(cd $PKG$TQTDIR/
|
|
rm lib$LIBDIRSUFFIX/libtqt[de]*
|
|
[[ $TQT_OPTS != *tdevel* ]] && rm lib$LIBDIRSUFFIX/libtqas* && {
|
|
[[ $TQT_OPTS != *pim_ksq* ]] && rm lib$LIBDIRSUFFIX/libtqui*
|
|
}
|
|
rm bin/???????*
|
|
rm bin/tqm2ts
|
|
[[ $TQT_OPTS != *ktorrent* ]] && rm -rf lib$LIBDIRSUFFIX/tqt/plugins/designer
|
|
)} || true # otherwise will exit 1 if [[ $TQT_OPTS == *ktorrent* ]]
|
|
|
|
installdocs_fn
|
|
|
|
## Ref issue #37
|
|
## Set up tqt3.sh to add TDE PATHs only if xinitrc -> xinitrc.tde
|
|
mkdir -p $PKG/etc/profile.d
|
|
#
|
|
echo '#!'"/bin/sh
|
|
|
|
# Only add TDE PATHs if TDE is set as the chosen DE
|
|
[[ \$(readlink -e /etc/X11/xinit/xinitrc) == *xinitrc.tde ]] && {
|
|
|
|
# Environment path variable for the tQt package.
|
|
export TQTDIR=$TQTDIR
|
|
" > $PKG/etc/profile.d/tqt3.sh
|
|
|
|
echo "echo '# Add TDE library directory:
|
|
$INSTALL_TDE/lib$LIBDIRSUFFIX
|
|
' > /etc/ld.so.conf.d/tqt3.conf
|
|
" >> $PKG/etc/profile.d/tqt3.sh
|
|
|
|
[[ $TQTDIR != $INSTALL_TDE ]] && {
|
|
echo "echo '# Add TQT library directory:
|
|
$TQTDIR/lib$LIBDIRSUFFIX
|
|
' >> /etc/ld.so.conf.d/tqt3.conf
|
|
" >> $PKG/etc/profile.d/tqt3.sh
|
|
}
|
|
|
|
[[ $(cat $TMPVARS/PKG_CONFIG_PATH_MOD) != set ]] && PC_HASH="#"
|
|
echo "
|
|
# Update PKG_CONFIG_PATH for TDE:
|
|
#
|
|
## add path for INSTALL_TDE ..
|
|
[[ \$PKG_CONFIG_PATH != *$INSTALL_TDE/lib$LIBDIRSUFFIX/pkgconfig* ]] && \\
|
|
PKG_CONFIG_PATH=\$PKG_CONFIG_PATH:$INSTALL_TDE/lib$LIBDIRSUFFIX/pkgconfig
|
|
## .. and for TQTDIR if different" >> $PKG/etc/profile.d/tqt3.sh
|
|
|
|
[[ $TQTDIR != $INSTALL_TDE ]] && \
|
|
echo "[[ \$PKG_CONFIG_PATH != *$TQTDIR/lib$LIBDIRSUFFIX/pkgconfig* ]] && \\
|
|
PKG_CONFIG_PATH=\$PKG_CONFIG_PATH:$TQTDIR/lib$LIBDIRSUFFIX/pkgconfig" >> $PKG/etc/profile.d/tqt3.sh
|
|
|
|
echo "#
|
|
## remove duplicated paths:
|
|
${PC_HASH:-}PKG_CONFIG_PATH=\$(echo \$PKG_CONFIG_PATH| tr : \\\\n | awk '!seen[\$0]++' | tr \\\\n :|sed 's|:\$||')
|
|
#
|
|
export PKG_CONFIG_PATH
|
|
} || {
|
|
[[ -e /etc/ld.so.conf.d/tqt3.conf ]] && {
|
|
echo '# TDE library directory to be added:
|
|
' > /etc/ld.so.conf.d/tqt3.conf
|
|
}
|
|
}" >> $PKG/etc/profile.d/tqt3.sh
|
|
|
|
## set up a placeholder file to enable removal with removepkg -
|
|
## contents will be added from tqt3.sh
|
|
mkdir -p $PKG/etc/ld.so.conf.d
|
|
echo '# Placeholder - TDE library directory to be added:
|
|
' > $PKG/etc/ld.so.conf.d/tqt3.conf
|
|
|
|
echo '#!'"/bin/csh
|
|
# Environment path variable for the tQt package:
|
|
setenv TQTDIR $TQTDIR
|
|
" > $PKG/etc/profile.d/tqt3.csh
|
|
|
|
strip_fn
|
|
|
|
mkdir_install_fn
|
|
|
|
cat <<EOINS >> $PKG/install/doinst.sh
|
|
## csh
|
|
# Update PKG_CONFIG_PATH:
|
|
[[ ! \$( grep $INSTALL_TDE/lib$LIBDIRSUFFIX/pkgconfig etc/profile.d/pkgconfig.csh ) ]] && \\
|
|
sed -i "s|pkgconfig$|pkgconfig:$INSTALL_TDE/lib$LIBDIRSUFFIX/pkgconfig|" etc/profile.d/pkgconfig.csh
|
|
[[ ! \$( grep $TQTDIR/lib$LIBDIRSUFFIX/pkgconfig etc/profile.d/pkgconfig.csh ) ]] && \\
|
|
sed -i "s|pkgconfig$|pkgconfig:$TQTDIR/lib$LIBDIRSUFFIX/pkgconfig|" etc/profile.d/pkgconfig.csh
|
|
EOINS
|
|
|
|
chmod 755 $PKG/etc/profile.d/*
|
|
|
|
# Add this to the doinst.sh:
|
|
cat <<EOINS >> $PKG/install/doinst.sh
|
|
# May need to add ld.so.conf.d to /etc/ld.so.conf for Slackware 14.2 users:
|
|
[[ ! \$(grep ld.so.conf.d /etc/ld.so.conf) ]] && \\
|
|
sed -i '1 i include /etc/ld.so.conf.d/*.conf' /etc/ld.so.conf
|
|
|
|
[[ -x /sbin/ldconfig ]] && /sbin/ldconfig
|
|
EOINS
|
|
|
|
doinst_sh_fn
|
|
|
|
echo "
|
|
# HOW TO EDIT THIS FILE:
|
|
# The 'handy ruler' below makes it easier to edit a package description. Line
|
|
# up the first '|' above the ':' following the base package name, and the '|'
|
|
# on the right side marks the last column you can put a character in. You must
|
|
# make exactly 11 lines for the formatting to be correct. It's also
|
|
# customary to leave one space after the ':'.
|
|
|-----handy-ruler------------------------------------------------------|
|
|
$PRGNAM: tqt3 (C++ GUI application framework)
|
|
$PRGNAM:
|
|
$PRGNAM: tQt is a multiplatform C++ GUI application framework
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
" > $PKG/install/slack-desc
|
|
|
|
## build regextester ..
|
|
[[ ${build_regextester:-} == [yY1pP] ]] && {
|
|
cd examples/regexptester
|
|
rm regexptester.pro
|
|
|
|
## include the patch ..
|
|
[[ $build_regextester == [pP] ]] && \
|
|
patch -p0 << EOF
|
|
--- regexptester.cpp
|
|
+++ regexptester.cpp
|
|
@@ -22 +22 @@
|
|
- regexComboBox->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Preferred);
|
|
+ regexComboBox->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Minimum);
|
|
@@ -27 +27 @@
|
|
- textComboBox->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Preferred);
|
|
+ textComboBox->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Minimum);
|
|
@@ -69 +69 @@
|
|
- resize(TQSize(500, 350).expandedTo(minimumSizeHint()));
|
|
+ resize(TQSize(500, 500).expandedTo(minimumSizeHint()));
|
|
@@ -98 +98,14 @@
|
|
- const int OFFSET = 5;
|
|
+// count number of new line characters, \n, to determine the number of lines in the 'Match'
|
|
+// based on ntqregexp.html, search(Eric) example
|
|
+ TQString str_in = re.cap(0);
|
|
+ TQRegExp nlf( "\\n" ); // match \n
|
|
+ int pos = 0; // its position in the string
|
|
+ int num_lf = 0; // number of \n counted
|
|
+ while ( pos >= 0 ) {
|
|
+ pos = nlf.search( str_in, pos );
|
|
+ if ( pos >= 0 ) {
|
|
+ pos += nlf.matchedLength(); // move to new position
|
|
+ num_lf++; // increment count of \n
|
|
+ }
|
|
+ }
|
|
+ const int OFFSET = 5 + num_lf;
|
|
@@ -120,0 +134,8 @@
|
|
+ resultTable->setText(row, 0, "");
|
|
+// last line in 'Match' may not end with new line character
|
|
+ resultTable->item(row, 0)->setSpan( num_lf + 1 , 1);
|
|
+ resultTable->setText(row, 1, "");
|
|
+ resultTable->item(row, 1)->setSpan( num_lf + 1 , 1);
|
|
+ resultTable->setText(row, 2, "");
|
|
+ resultTable->item(row, 2)->setSpan( num_lf + 1 , 1);
|
|
+ row+=num_lf;
|
|
@@ -144 +165 @@
|
|
- statusBar->message(tr("Executed \"%1\" on \"%2\"")
|
|
+ statusBar->message(tr("Ran \"%1\" on \"%2\"")
|
|
@@ -168,2 +189,2 @@
|
|
- regexLabel->setText(tr("&Regex:"));
|
|
- regexComboBox->insertItem(tr("[A-Z]+=(\\\\d+):(\\\\d*)"));
|
|
+ regexLabel->setText(tr("Rege&x:"));
|
|
+ regexComboBox->insertItem(tr("([\`~]{3})[^\`~]+\\\\1"));
|
|
@@ -171 +192 @@
|
|
- textComboBox->insertItem(tr("ABC=12:3456"));
|
|
+ textComboBox->insertItem(tr("\`\`\`bash\\n#!/bin/bash\\na number\\nof lines\\nof script\\n\`\`\`\\n\\n\`\`\`\\npre text\\n\`\`\`"));
|
|
@@ -176 +197 @@
|
|
- executePushButton->setText(tr("&Execute"));
|
|
+ executePushButton->setText(tr("&Run"));
|
|
EOF
|
|
|
|
## This could be a first build of tqt3, so build with the packaging directory binaries
|
|
$PKG$INSTALL_TDE/bin/tqmake -project -o regextester.pro
|
|
$PKG$INSTALL_TDE/bin/tqmake TARGET=regextester -spec $PKG$INSTALL_TDE/lib$LIBDIRSUFFIX/tqt/mkspecs/linux-g++
|
|
|
|
sed -i "s|-ltqt-mt|$PKG$INSTALL_TDE/lib$LIBDIRSUFFIX/libtqt-mt.so.3|" Makefile
|
|
sed -i "s|tqmake|$PKG$INSTALL_TDE/bin/tqmake|" Makefile
|
|
|
|
make
|
|
|
|
strip regextester
|
|
|
|
cp regextester $PKG$INSTALL_TDE/bin
|
|
|
|
grep -A 10 "A Small Application" regexptester.doc | sed 's|\\title ||' > $PKG$INSTALL_TDE/doc/$PRGNAM-$TDEVERSION/regextester.doc
|
|
sed "s|Perl's lookbehind|<span style='background-color:yellow'>&|;\
|
|
s|are not supported|&</span>|;\
|
|
s|there are no \\\A, \\\Z or \\\z|<span style='background-color:yellow'>&|;\
|
|
504s|assertions|&</span>|" ../../doc/html/ntqregexp.html > $PKG$INSTALL_TDE/doc/$PRGNAM-$TDEVERSION/ntqregexp.html
|
|
}
|
|
|
|
makepkg_fn
|