diff --git a/cbindings/Qt5Pas.pro b/cbindings/Qt5Pas.pro index 7b3cb37..b9626dc 100644 --- a/cbindings/Qt5Pas.pro +++ b/cbindings/Qt5Pas.pro @@ -10,13 +10,13 @@ -# Binding Release Version 1.2.14 against Qt5 5.6 LTS release. +# Binding Release Version 1.2.15 against Qt5 5.6 LTS release. # WebKit widgets are disabled until webenginewidgets are implemented. -VERSION = 1.2.14 +VERSION = 1.2.15 VER_MAJ = 1 VER_MIN = 2 -VER_PAT = 14 +VER_PAT = 15 win32:VERSION_PE_HEADER = 1.2 QT += gui network printsupport diff --git a/cbindings/package/changelog.libqt5pas b/cbindings/package/changelog similarity index 89% rename from cbindings/package/changelog.libqt5pas rename to cbindings/package/changelog index 30e6d7f..2b7ca25 100644 --- a/cbindings/package/changelog.libqt5pas +++ b/cbindings/package/changelog @@ -1,3 +1,15 @@ +libqt5pas (1.2.15) unstable; urgency=medium + + * Release of new version. + * removed QTimer_singleShot4() overload because it cannot be used with + Qt5 < 5.10 + * use QTimer::singleShot() with QObject context from Qt 5.9.0 + * fixed Qt documentation inconsistency about QTimer::singleShot() + overload. + * Please see Lazarus at gitlab for further change details. + + -- David Bannon Tue, 05 Sep 2023 22:02:35 +1000 + libqt5pas (1.2.9) unstable; urgency=medium * TLazAccessibleObject accessinility functionality for Qt5 widgetsets diff --git a/cbindings/package/libqt5pas.spec b/cbindings/package/libqt5pas.spec index bc13c07..152f0fb 100644 --- a/cbindings/package/libqt5pas.spec +++ b/cbindings/package/libqt5pas.spec @@ -30,6 +30,9 @@ Lazarus main, current release versions do not need it. "/usr/share/doc/libqt5pas/changelog.gz" "/usr/share/doc/libqt5pas/copyright" +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + %changelog * Sat Dec 3 2022 David Bannon - INSERT_FULL_VER - Follow release of Qt5 bindings 1.2.11 in lazarus-main, lib Package diff --git a/cbindings/package/package-lib b/cbindings/package/package-lib index e153fa6..1a6c30f 100644 --- a/cbindings/package/package-lib +++ b/cbindings/package/package-lib @@ -6,30 +6,16 @@ # Resonable lintian and rpmlint result. See end of script ! # # David Bannon 2022-11-25 -# NAMING -# Hard to be sure, no clear definition and varying conventions in use but - -# ftp.debian.org/debian/pool/main/q/qt6-base - typical... -# libqt6opengl6-dev_6.4.1-1_armhf.deb -# libqt6opengl6_6.3.1-1_i386.deb -# Note that the '6' appears 3 times but in each case refers to the same thing ! -# So, we always have a name including 'qt6' then ending in'6' and then a VerNo starting with '6' -# And all three '6' are both in main package and -dev package. -# And the number of the beast shall be 666 ..... -# The actual, binary library file is libQt6OpenGL.so.6.4.1 so the trailing '6' on the name has dissapeared ! -# So, we will do - -# Library, binary libQt6Pas.so.6.2.3 -# Package, libqt6pas6_6.2.0-1_amd64.deb -# Dev Package libqt6pas6-dev.6.2.0-1_amd64.deb -# The '0' in above will be rev'ed by every change Z makes to the interface, the 6.2 is the LTS Qt6 release - - -PACKVER='4' # should start at '1', rev if you re-package same binary + +PACKVER='1' # should start at '1', rev if you re-package same binary LIBNAME=libQt5Pas PRODUCT="libqt5pas" # lib has upper case Q - P, this appears in Package name, add '1' to lib, -dev to devlib CURRENT=`pwd` - # library will be called something like ./libQt6Pas.so.6.2.3, the package libqt6pas6_6.2.0-1_amd64.deb and libqt6pas6-dev.6.2.0-1_amd64 + # library will be called something like - + # libQt5Pas.so.1.2.14, the package libqt5pas1_2.14-1_amd64.deb and libqt5pas-dev_2.14-1_amd64 + # libqt5pas-1.2.14-1.x86_64.rpm and libqt5pas-devel-1.2.14-1.x86_64.rpm cd .. LIBFILE=$(find . -maxdepth 1 ! -type l -name "$LIBNAME""*") cd $CURRENT @@ -52,6 +38,8 @@ M_ARCH=`uname -m` # Might return, eg aarch64, x86_64. Raspi running 32bit return WHOAMI="David Bannon " BUILDDATE=`date -R` + + function WriteControl () { if [ "$1" = "DEV" ]; then echo "Package: $PRODUCT-dev" >> BUILD/DEBIAN/control @@ -100,7 +88,7 @@ function DebianPackage () { rm -rf BUILD mkdir -p BUILD/DEBIAN mkdir -p BUILD/usr/lib/"$DIR_ARCH" - mkdir -p BUILD/usr/share/doc/"$PRODUCT" + mkdir -p BUILD/usr/share/doc/"$PRODUCT""$MAJORVER" WriteControl cp ../"$FULLLIBNAME" BUILD/usr/lib/"$DIR_ARCH"/. ln -s -r BUILD/usr/lib/"$DIR_ARCH"/"$FULLLIBNAME" BUILD/usr/lib/"$DIR_ARCH"/"$LIBNAME".so."$MAJORVER"."$MINORVER" @@ -108,16 +96,28 @@ function DebianPackage () { # Don't link to base name, Lintian objects 'cos thats the -dev package's job chmod 0644 BUILD/usr/lib/"$DIR_ARCH"/* - cp copyright "BUILD/usr/share/doc/$PRODUCT/copyright" + cp copyright "BUILD/usr/share/doc/$PRODUCT$MAJORVER/copyright" echo "activate-noawait ldconfig" > BUILD/DEBIAN/triggers echo "libQt5Pas $MAJORVER libqt5pas$MAJORVER" > BUILD/DEBIAN/shlibs - gzip -knc --best changelog.libqt5pas >> BUILD/usr/share/doc/"$PRODUCT"/changelog.gz + + dch -cchangelog -v "$MAJORVER"."$MINORVER"."$EXTRAVER" -D"unstable" "Release of new version." + if [ -f whatsnew ]; then + echo "---------- Including whatsnew in changelog" + while IFS= read -r Line; do + dch -cchangelog --append "$Line" + done < whatsnew + fi + dch -cchangelog --append "Please see Lazarus at gitlab for further change details." + + gzip -knc --best changelog >> BUILD/usr/share/doc/"$PRODUCT$MAJORVER"/changelog.gz + ls -l BUILD/usr/share/doc/"$PRODUCT$MAJORVER" + gzip -knc --best changelog >> changelog.gz # ------ Make the md5sum file ----------- cd BUILD md5sum usr/lib/"$DIR_ARCH"/"$LIBNAME".so."$MAJORVER"."$VERSION" > DEBIAN/md5sums - md5sum usr/share/doc/"$PRODUCT"/copyright >> DEBIAN/md5sums - md5sum usr/share/doc/"$PRODUCT"/changelog.gz >> DEBIAN/md5sums + md5sum usr/share/doc/"$PRODUCT$MAJORVER"/copyright >> DEBIAN/md5sums + md5sum usr/share/doc/"$PRODUCT$MAJORVER"/changelog.gz >> DEBIAN/md5sums cd .. chmod -R g-w BUILD fakeroot dpkg-deb -b BUILD/. "$PRODUCT"1_"$VERSION"-"$PACKVER"_"$ARCH".deb @@ -136,7 +136,7 @@ function DebianPackageDev () { #cp ../qt62.pas BUILD/usr/share/pascal/qt6/. chmod 0644 BUILD/usr/share/pascal/qt5/* cp copyright BUILD/usr/share/doc/"$PRODUCT-dev"/copyright - gzip -knc --best changelog.libqt5pas >> BUILD/usr/share/doc/"$PRODUCT-dev"/changelog.gz + gzip -knc --best changelog >> BUILD/usr/share/doc/"$PRODUCT-dev"/changelog.gz # ------ Make the md5sum file ----------- cd BUILD @@ -169,8 +169,8 @@ function MakeRPM () { echo "========= RPM Devel Package ========" mkdir -p "$RDIR"/usr/share/doc/"$PRODUCT"-devel chmod 755 "$RDIR"/usr/share/doc/"$PRODUCT"-devel - cp copyright "$RDIR"/usr/share/doc/"$PRODUCT"-devel/copyright - gzip -knc --best changelog.libqt5pas >> "$RDIR"/usr/share/doc/"$PRODUCT"-devel/changelog.gz + cp copyright "$RDIR"/usr/share/doc/"$PRODUCT"-devel/copyright + gzip -knc --best changelog >> "$RDIR"/usr/share/doc/"$PRODUCT"-devel/changelog.gz cd "$RDIR"/usr/"$RDIR_ARCH" ln -s "$FULLLIBNAME" "$LIBNAME".so cd "$CURRENT" @@ -186,7 +186,7 @@ function MakeRPM () { mkdir -p "$RDIR"/usr/share/doc/"$PRODUCT" chmod 755 "$RDIR"/usr/share/doc/"$PRODUCT" cp copyright "$RDIR/usr/share/doc/"$PRODUCT"/copyright" - gzip -knc --best changelog.libqt5pas >> "$RDIR"/usr/share/doc/"$PRODUCT"/changelog.gz + gzip -knc --best changelog >> "$RDIR"/usr/share/doc/"$PRODUCT"/changelog.gz cp ../"$FULLLIBNAME" "$RDIR"/usr/"$RDIR_ARCH"/. chmod 755 "$RDIR"/usr/"$RDIR_ARCH"/"$FULLLIBNAME" ln -s -r "$RDIR"/usr/"$RDIR_ARCH"/"$FULLLIBNAME" "$RDIR"/usr/"$RDIR_ARCH"/"$LIBNAME".so."$MAJORVER"."$MINORVER" @@ -196,7 +196,8 @@ function MakeRPM () { sed -i "s/^Version:*./Version: ${MAJORVER}.${VERSION}/" "$RDIR"/"$PRODUCT".spec sed -i "s/^Release:*./Release: ${PACKVER}/" "$RDIR"/"$PRODUCT".spec sed -i "s/INSERT_FULL_VER/Version: ${FULLVER}/" "$RDIR"/"$PRODUCT".spec - sed -i "s/INSERT_VERSION/${MAJORVER}.${VERSION}/" "$RDIR"/"$PRODUCT".spec +# sed -i "s/INSERT_VERSION/${MAJORVER}.${VERSION}/" "$RDIR"/"$PRODUCT".spec + sed -i "s/INSERT_EXTRAVER/${EXTRAVER}/" "$RDIR"/"$PRODUCT".spec cp -f "$RDIR"/"$PRODUCT".spec "$PRODUCT""$1".spec-just-used cd "$RDIR" fakeroot rpmbuild --target "$M_ARCH" --buildroot "$CURRENT"/"$RDIR" -bb "$PRODUCT".spec @@ -230,7 +231,7 @@ rm -f *.deb *.rpm *.gz strip --remove-section=.comment ../"$FULLLIBNAME" -DebianPackage +DebianPackage # do before dev package because it updates the changelog DebianPackageDev echo " ====== Finished Building Debs =======" MakeRPM @@ -246,10 +247,12 @@ rm -Rf "$TARNAME" rm -Rf BUILD ls -ltr -# ------- RESTORE ME --------------- lintian -IiE *.deb +echo "---------------- DEB Lintian Results ----------------------------" -#echo " === OK, now make the rpms with fakeroot bash ./rpm-package.bash ===" +lintian -IiE *.deb +echo "---------------- RPM Lint Results --------------------------------" +rpmlint -i *.rpm # --------------- RPM LINT Issues ------------------------------ diff --git a/cbindings/package/rpm-package b/cbindings/package/rpm-package index 1006f92..657d56a 100644 --- a/cbindings/package/rpm-package +++ b/cbindings/package/rpm-package @@ -58,10 +58,16 @@ function MakeRPM () { chmod 755 "$RDIR"/usr/share/doc/"$PRODUCT"-devel cp copyright "$RDIR"/usr/share/doc/"$PRODUCT"-devel/copyright gzip -knc --best changelog.libqt5pas >> "$RDIR"/usr/share/doc/"$PRODUCT"-devel/changelog.gz - ln -s "$RDIR"/usr/"$RDIR_ARCH"/"$FULLLIBNAME" "$RDIR"/usr/"$RDIR_ARCH"/"$LIBNAME".so + # ln -s "$RDIR"/usr/"$RDIR_ARCH"/"$FULLLIBNAME" "$RDIR"/usr/"$RDIR_ARCH"/"$LIBNAME".so + + cd "$RDIR"/usr/"$RDIR_ARCH" + ln -s "$FULLLIBNAME" "$LIBNAME".so + cd "$CURRENT" + cp ../qt5.pas "$RDIR/usr/share/doc/"$PRODUCT"-devel/." cp libqt5pas-devel.spec "$RDIR"/"$PRODUCT".spec sed -i "s/INSERT_DEPEND/${PRODUCT} = ${VERSION}, qt5-qtbase-devel/" "$RDIR"/"$PRODUCT".spec + # sed -i "s/INSERT_DEPEND/${PRODUCT} = ${MAJORVER}.${VERSION}/" "$RDIR"/"$PRODUCT".spec sed -i "s/INSERT_RDIR/${RDIR}/" "$RDIR"/"$PRODUCT".spec else echo "==== RPM Lib Package FULLLIBNAME $FULLLIBNAME ===" @@ -116,6 +122,7 @@ function SetUpArch () { } +strip --remove-section=.comment ../"$FULLLIBNAME" SetUpArch echo "Arch setup version=$VERSION" MakeRPM diff --git a/cbindings/package/whatsnew b/cbindings/package/whatsnew new file mode 100644 index 0000000..1693e89 --- /dev/null +++ b/cbindings/package/whatsnew @@ -0,0 +1,3 @@ +removed QTimer_singleShot4() overload because it cannot be used with Qt5 < 5.10 +use QTimer::singleShot() with QObject context from Qt 5.9.0 +fixed Qt documentation inconsistency about QTimer::singleShot() overload. diff --git a/cbindings/refresh.bash b/cbindings/refresh.bash new file mode 100644 index 0000000..60bdee8 --- /dev/null +++ b/cbindings/refresh.bash @@ -0,0 +1,46 @@ +#!/bin/bash + +# A script, run from the git dir pulled down from https://github.com/davidbannon/libqt5pas +# expects to be run from the cbinding dir. +# It gets the relevent files from gitlab, checks to see if we are out of date +# and updates the local repo if we are. +# After this, you will make the library and then package it. Finally, commit and upload binaries. + +# David Bannon, September 4, 2023 + + +LAZARUS_GIT="/home/dbannon/bin/Lazarus/lazarus-git/" +CURRENT=`pwd` +TMP="/tmp" +TMPFILE="lazarus-main-lcl-interfaces-qt5" +TMPPATH="$TMPFILE"/"lcl/interfaces/qt5/cbindings" +DIFFRES="" + +cd $TMP +rm -f "$TMPFILE".zip +rm -Rf "$TMPFILE" + +wget --output-document="$TMPFILE".zip https://gitlab.com/freepascal.org/lazarus/lazarus/-/archive/main/lazarus-main.zip?path=lcl/interfaces/qt5 +unzip -q "$TMPFILE".zip + +echo "comparing "$TMP"/"$TMPPATH"/"Qt5Pas.pro" with "$CURRENT"/"Qt5Pas.pro"" + +DIFFRES=`diff "$TMP"/"$TMPPATH"/"Qt5Pas.pro" "$CURRENT"/"Qt5Pas.pro"` + +echo "$DIFFRES" + +if [ "$DIFFRES" == "" ]; then + echo "No update needed, we will exit" + exit +fi + +echo "--------------- update needed" +rm -Rf "$CURRENT"/"src" + +cp -r "$TMP"/"$TMPPATH"/* "$CURRENT"/. + +cd "$CURRENT" +git status + +echo "you should now type qmake -qt=qt5; make and wait a while" +echo "After that, run the package-lib script in package dir" diff --git a/cbindings/src/qtimer_c.cpp b/cbindings/src/qtimer_c.cpp index 51979d4..d89b2b0 100644 --- a/cbindings/src/qtimer_c.cpp +++ b/cbindings/src/qtimer_c.cpp @@ -81,15 +81,6 @@ void QTimer_singleShot3(int msec, void (*TimeoutEvent)()) QTimer::singleShot(msec, TimeoutEvent); } -void QTimer_singleShot4(int msec, const QObjectH context, void (*TimeoutEvent)()) -{ - #if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)) - QTimer::singleShot(msec, (const QObject*)context, TimeoutEvent); - #else - QTimer::singleShot(msec, TimeoutEvent); - #endif -} - void QTimer_start(QTimerH handle, int msec) { ((QTimer *)handle)->start(msec); diff --git a/cbindings/src/qtimer_c.h b/cbindings/src/qtimer_c.h index 3f67bfe..66be94d 100644 --- a/cbindings/src/qtimer_c.h +++ b/cbindings/src/qtimer_c.h @@ -29,7 +29,6 @@ C_EXPORT bool QTimer_isSingleShot(QTimerH handle); C_EXPORT void QTimer_singleShot(int msec, const QObjectH receiver, const char* member); C_EXPORT void QTimer_singleShot2(int msec, Qt::TimerType timerType, const QObjectH receiver, const char* member); C_EXPORT void QTimer_singleShot3(int msec, void (*TimeoutEvent)()); -C_EXPORT void QTimer_singleShot4(int msec, const QObjectH context, void (*TimeoutEvent)()); C_EXPORT void QTimer_start(QTimerH handle, int msec); C_EXPORT void QTimer_start2(QTimerH handle); C_EXPORT void QTimer_stop(QTimerH handle);