Update 05 September 2022 ...

option to build the tqt example regex tester, with patch for multiline Matches
master
Ray-V 2 years ago
parent acc9622c99
commit 205b1f604e

@ -466,7 +466,7 @@ sed -i 's|$| |;s|" M|M|g;s|"||g;s| ||g' $TMPVARS/TDEbuilds
## this dialog will only run if any of the selected packages has a README ## this dialog will only run if any of the selected packages has a README
rm -f $TMPVARS/READMEs rm -f $TMPVARS/READMEs
## generate list of READMEs .. ## generate list of READMEs .. except for tdebase & kvkbd which are viewable from their dialog screens ..
RM_LIST=$(find [ACDLM][a-z]* -name "README" | grep -vE "tdebase|kvkbd") RM_LIST=$(find [ACDLM][a-z]* -name "README" | grep -vE "tdebase|kvkbd")
for package in $(cat $TMPVARS/TDEbuilds) for package in $(cat $TMPVARS/TDEbuilds)
do do
@ -488,7 +488,9 @@ Do you want to read them?
10 75 10 75
[[ $? == 0 ]] && dialog --no-collapse --cr-wrap --no-shadow --colors --ok-label "Close" --msgbox \ [[ $? == 0 ]] && dialog --no-collapse --cr-wrap --no-shadow --colors --ok-label "Close" --msgbox \
" "
$(cat $TMPVARS/READMEs|sed "s|<TDE-installation-directory>|$(cat $TMPVARS/INSTALL_TDE)|")" \ $(cat $TMPVARS/READMEs|sed "s|<TDE-installation-directory>|$(cat $TMPVARS/INSTALL_TDE)|;\
s|<tde-version>|$(cat $TMPVARS/TDEVERSION)|;\
s|=y|=\\\Zb\\\Z2y\\\Zn|;s|=p|=\\\Zb\\\Z2p\\\Zn|")" \
30 75 30 75
} }
@ -499,9 +501,11 @@ rm -f $TMPVARS/PKG_CONFIG_PATH_MOD
[[ $(grep -o tqt3 $TMPVARS/TDEbuilds) ]] && { [[ $(grep -o tqt3 $TMPVARS/TDEbuilds) ]] && {
dialog --cr-wrap --nocancel --no-shadow --colors --title " TQt options " --item-help --checklist \ dialog --cr-wrap --nocancel --no-shadow --colors --title " TQt options " --item-help --checklist \
" "
A minimal packaging of tqt3 will install only the run-time library required for TDE, and the headers and binaries required to build most of TDE. A minimal packaging of tqt3 will install only the run-time library
required for TDE, and the headers and binaries required to build
most\Zb\Z2*\Zn of TDE.
But tdepim, ksquirrel, tdevelop, and ktorrent need additional libraries. \Zb\Z2*\Zn tdepim, ksquirrel, tdevelop, and ktorrent need additional libraries.
If you select minimal packaging and intend to build any of those at any time, select keeping their required libs now. If you select minimal packaging and intend to build any of those at any time, select keeping their required libs now.
TQt html documentation is ~21M, and can be excluded from the package. TQt html documentation is ~21M, and can be excluded from the package.
@ -509,7 +513,7 @@ TQt html documentation is ~21M, and can be excluded from the package.
The only mkspecs required is the one for linux-g++ The only mkspecs required is the one for linux-g++
" \ " \
25 75 6 \ 26 75 6 \
" minimal" "Minimal packaging" off "\Zb\Z6 Exclude libs and binaries not required for TDE \Zn" \ " minimal" "Minimal packaging" off "\Zb\Z6 Exclude libs and binaries not required for TDE \Zn" \
" pim_ksq" " ├─ Keep lib for tdepim and/or ksquirrel" off "\Zb\Z6 Only required if minimal packaging selected \Zn" \ " pim_ksq" " ├─ Keep lib for tdepim and/or ksquirrel" off "\Zb\Z6 Only required if minimal packaging selected \Zn" \
" tdevel" " ├─ Keep libs for tdevelop" off "\Zb\Z6 Only required if minimal packaging selected \Zn" \ " tdevel" " ├─ Keep libs for tdevelop" off "\Zb\Z6 Only required if minimal packaging selected \Zn" \

@ -0,0 +1,29 @@
There is an option to build the regex tester included in the tqt3/examples/regexptester directory.
The patch is to expand the 'Match' row vertically to enable multiline matches to be viewed.
Use the command line option 'build_regextester' to include the regextester build:
build_regextester=y ./BUILD-TDE.sh to build unpatched
build_regextester=p ./BUILD-TDE.sh to build with the patch
It will be installed to the TDE binary directory as 'regextester'.
"A Small Application for Testing Regular Expressions
Regular expressions can sometimes be tricky to get right,
especially those that use the * quantifier. This application lets
you type in a regexp (without doubling the backslashes) and some
test text, and to execute the regexp and see the results. If you
click the Copy button the regexp will be copied to the clipboard
(with the backslashes doubled, ready for you to paste into your
program). Previous regexps and test texts are remembered
throughout the session and can be accessed by dropping down the
comboboxes."
For an introduction to regex, from a konsole:
'khelpcenter help:/kate/regular-expressions.html'
Guidance on what the tqt regex engine supports is given in ntqregexp.html which will be installed to:
'<TDE-installation-directory>/doc/tqt3-<tde-version>/ntqregexp.html'

@ -40,7 +40,7 @@ untar_fn
sed -i "s|^QMAKE_CFLAGS[^_].*$|& $SET_march ${NO_WARN:-}|" mkspecs/linux-g++/qmake.conf sed -i "s|^QMAKE_CFLAGS[^_].*$|& $SET_march ${NO_WARN:-}|" mkspecs/linux-g++/qmake.conf
## RPATH is set to $ORIGIN/../lib to locate libs during the build ## RPATH is set to $ORIGIN/../lib to locate libs during the build
## and added during configure to apply only to tqt3 build ## and added during configure with the -R option
sed -i "s|QMAKE_RPATH.*$|QMAKE_RPATH =|" mkspecs/linux-g++/qmake.conf sed -i "s|QMAKE_RPATH.*$|QMAKE_RPATH =|" mkspecs/linux-g++/qmake.conf
## tqt libs might be installed in $([T]QTDIR)/lib64 ## tqt libs might be installed in $([T]QTDIR)/lib64
@ -141,7 +141,7 @@ echo "yes" | \
-plugin-style-sgi \ -plugin-style-sgi \
-plugin-style-windows \ -plugin-style-windows \
-fast \ -fast \
-R-Wl,-rpath,\'\\\$\$ORIGIN/../lib:$INST_RPATH\' -R-Wl,-rpath,\'\\\$\$ORIGIN/../lib:$INST_RPATH\' ## +$INST_RPATH for run-time RPATH
## don't build tutorial and examples which won't be installed because the release version is being built ## 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 -i $NUMJOBS symlinks src-qmake src-moc sub-src sub-tools || exit 1
@ -243,4 +243,76 @@ $PRGNAM:
$PRGNAM: $PRGNAM:
" > $PKG/install/slack-desc " > $PKG/install/slack-desc
## build regextester ..
[[ ${build_regextester:-} == [yp] ]] && {
cd examples/regexptester
rm regexptester.pro
## include the patch ..
[[ $build_regextester == p ]] && \
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;
@@ -169 +189 @@
- regexComboBox->insertItem(tr("[A-Z]+=(\\\\d+):(\\\\d*)"));
+ regexComboBox->insertItem(tr("(\`{3})[^\`]+\\\\1"));
@@ -171 +191 @@
- textComboBox->insertItem(tr("ABC=12:3456"));
+ textComboBox->insertItem(tr("\`\`\`script\\ncode here\\n\`\`\`\\n\\n\`\`\`\\ncode\\n\`\`\`"));
EOF
## This is most likely 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/lib64/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
QTDIR=$PKG$INSTALL_TDE COMPILER_CXX=g++ 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 makepkg_fn

@ -33,7 +33,8 @@ URLs for this and other locations are @ https://www.trinitydesktop.org/mirrorsta
* BUILD= - sets the package build identifier, overriding the SlackBuild default of 1 * BUILD= - sets the package build identifier, overriding the SlackBuild default of 1
* GCC_VIS=0 - override setting gcc visibility if it has been set ON in tdelibs * GCC_VIS=0 - override setting gcc visibility if it has been set ON in tdelibs
* FEAT= - for development builds - see get-source.sh * FEAT= - for development builds - see get-source.sh
* GVZ_DOCS=1 - see graphviz.SlackBuild * GVZ_DOCS=1 - for graphviz, include pdf and html documentation - see SlackBuild
* build_regextester= - build the regex tester from the tqt3 example - see the tqt3 README
--- ---

Loading…
Cancel
Save