Skip to content

Commit

Permalink
release 1.2.15. Fixes to package-lib.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbannon committed Sep 5, 2023
1 parent b095922 commit 4cdfc3a
Show file tree
Hide file tree
Showing 9 changed files with 110 additions and 46 deletions.
6 changes: 3 additions & 3 deletions cbindings/Qt5Pas.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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 <dbannon@internode.on.net> Tue, 05 Sep 2023 22:02:35 +1000

libqt5pas (1.2.9) unstable; urgency=medium

* TLazAccessibleObject accessinility functionality for Qt5 widgetsets
Expand Down
3 changes: 3 additions & 0 deletions cbindings/package/libqt5pas.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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 <tomboy-ng@bannons.id.au> - INSERT_FULL_VER
- Follow release of Qt5 bindings 1.2.11 in lazarus-main, lib Package
Expand Down
67 changes: 35 additions & 32 deletions cbindings/package/package-lib
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -52,6 +38,8 @@ M_ARCH=`uname -m` # Might return, eg aarch64, x86_64. Raspi running 32bit return
WHOAMI="David Bannon <tomboy-ng@bannons.id.au>"
BUILDDATE=`date -R`



function WriteControl () {
if [ "$1" = "DEV" ]; then
echo "Package: $PRODUCT-dev" >> BUILD/DEBIAN/control
Expand Down Expand Up @@ -100,24 +88,36 @@ 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"
ln -s -r BUILD/usr/lib/"$DIR_ARCH"/"$FULLLIBNAME" BUILD/usr/lib/"$DIR_ARCH"/"$LIBNAME".so."$MAJORVER"
# 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
Expand All @@ -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
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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 <enter> ==="
lintian -IiE *.deb

echo "---------------- RPM Lint Results --------------------------------"
rpmlint -i *.rpm

# --------------- RPM LINT Issues ------------------------------

Expand Down
9 changes: 8 additions & 1 deletion cbindings/package/rpm-package
Original file line number Diff line number Diff line change
Expand Up @@ -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 ==="
Expand Down Expand Up @@ -116,6 +122,7 @@ function SetUpArch () {
}


strip --remove-section=.comment ../"$FULLLIBNAME"
SetUpArch
echo "Arch setup version=$VERSION"
MakeRPM
Expand Down
3 changes: 3 additions & 0 deletions cbindings/package/whatsnew
Original file line number Diff line number Diff line change
@@ -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.
46 changes: 46 additions & 0 deletions cbindings/refresh.bash
Original file line number Diff line number Diff line change
@@ -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 <enter> and wait a while"
echo "After that, run the package-lib script in package dir"
9 changes: 0 additions & 9 deletions cbindings/src/qtimer_c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion cbindings/src/qtimer_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4cdfc3a

Please sign in to comment.