[neon/3rdparty/libaccounts-qt/Neon/unstable] debian: add qt6 patch and build

Carlos De Maine null at kde.org
Sat Jun 24 05:20:30 BST 2023


Git commit fccc461cae9187cf0b27a4bca78aee738db16dbd by Carlos De Maine.
Committed on 24/06/2023 at 04:20.
Pushed by carlosdem into branch 'Neon/unstable'.

add qt6 patch and build

A  +224  -0    debian/patches/qt6-toset.diff
M  +1    -0    debian/patches/series
M  +5    -6    debian/rules

https://invent.kde.org/neon/3rdparty/libaccounts-qt/-/commit/fccc461cae9187cf0b27a4bca78aee738db16dbd

diff --git a/debian/patches/qt6-toset.diff b/debian/patches/qt6-toset.diff
new file mode 100644
index 0000000..50c9d8d
--- /dev/null
+++ b/debian/patches/qt6-toset.diff
@@ -0,0 +1,224 @@
+diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
+index 95d5a92ac75365279dad3e3237d0b0fa794c4531..f8b5bf65af1e37c5b76f2819e987a5405b838e5c 100644
+--- a/.gitlab-ci.yml
++++ b/.gitlab-ci.yml
+@@ -1,5 +1,3 @@
+-image: ubuntu:bionic
+-
+ cache:
+   key: apt-cache
+   paths:
+@@ -13,23 +11,19 @@ stages:
+   - test
+   - deploy
+ 
+-before_script:
+-  - export APT_CACHE_DIR=`pwd`/apt-cache && mkdir -pv $APT_CACHE_DIR
+-  - PACKAGES+=" wget" # for downloading dependencies
+-  - PACKAGES+=" libglib2.0-dev libsqlite3-dev libxml2-dev gtk-doc-tools libgirepository1.0-dev gobject-introspection libxml2-utils python3-gi python-gi-dev valac check python3-pip" # for libaccounts-glib
+-  - |
+-      apt-get update -yq && apt-get -o dir::cache::archives="$APT_CACHE_DIR" install -y \
+-          qt5-qmake qttools5-dev-tools qtbase5-dev qtchooser pkg-config doxygen \
+-          $PACKAGES
+-  - apt-get -o dir::cache::archives="$APT_CACHE_DIR" install -y dbus-test-runner lcov gcovr
+-  - pip3 install meson ninja
+-
+-
+ build_dependencies:
++  image: ubuntu:bionic
+   stage: deps
+   artifacts:
+     paths:
+       - staging
++  before_script:
++    - export APT_CACHE_DIR=`pwd`/apt-cache && mkdir -pv $APT_CACHE_DIR
++    - PACKAGES+=" wget" # for downloading dependencies
++    - PACKAGES+=" libglib2.0-dev libsqlite3-dev libxml2-dev gtk-doc-tools libgirepository1.0-dev gobject-introspection libxml2-utils python3-gi python-gi-dev valac check python3-pip" # for libaccounts-glib
++    - apt-get update -yq && apt-get -o dir::cache::archives="$APT_CACHE_DIR" install -y $PACKAGES
++    - pip3 install meson ninja
++
+   script:
+     - STAGING="$PWD/staging"
+ 
+@@ -52,7 +46,15 @@ build_dependencies:
+ 
+ 
+ build_amd64:
++  image: ubuntu:bionic
+   stage: build
++  before_script:
++    - export APT_CACHE_DIR=`pwd`/apt-cache && mkdir -pv $APT_CACHE_DIR
++    - |
++        apt-get update -yq && apt-get -o dir::cache::archives="$APT_CACHE_DIR" install -y \
++            qt5-qmake qttools5-dev-tools qtbase5-dev qtchooser pkg-config doxygen wget libglib2.0-dev libsqlite3-dev libxml2-dev gtk-doc-tools libgirepository1.0-dev gobject-introspection libxml2-utils python3-gi python-gi-dev valac check python3-pip
++    - apt-get -o dir::cache::archives="$APT_CACHE_DIR" install -y dbus-test-runner lcov gcovr
++
+   script:
+     - STAGING="$PWD/staging"
+     - export PKG_CONFIG_PATH="$STAGING/lib/pkgconfig:$PKG_CONFIG_PATH"
+@@ -69,7 +71,16 @@ build_amd64:
+       - build/
+ 
+ test_amd64:
++  image: ubuntu:bionic
+   stage: test
++  before_script:
++    - export APT_CACHE_DIR=`pwd`/apt-cache && mkdir -pv $APT_CACHE_DIR
++    - PACKAGES+=" wget" # for downloading dependencies
++    - |
++        apt-get update -yq && apt-get -o dir::cache::archives="$APT_CACHE_DIR" install -y \
++            qt5-qmake qttools5-dev-tools qtbase5-dev qtchooser pkg-config doxygen \
++            $PACKAGES
++    - apt-get -o dir::cache::archives="$APT_CACHE_DIR" install -y dbus-test-runner lcov gcovr
+   script:
+     - STAGING="$PWD/staging"
+     - export LD_LIBRARY_PATH="$STAGING/lib:$LD_LIBRARY_PATH"
+@@ -83,6 +94,47 @@ test_amd64:
+     paths:
+       - build/
+ 
++build_amd64_qt6:
++  stage: build
++  image: ubuntu:jammy
++  before_script:
++    - export APT_CACHE_DIR=`pwd`/apt-cache && mkdir -pv $APT_CACHE_DIR
++    - apt-get update -yq && apt-get -o dir::cache::archives="$APT_CACHE_DIR" install -y qmake6 qt6-base-dev pkg-config libqt6sql6-sqlite doxygen libdbus-1-dev g++ make libglib2.0-dev gtk-doc-tools libgirepository1.0-dev gobject-introspection libxml2-utils python3-gi python-gi-dev valac check python3-pip libsqlite3-dev libxml2-dev
++  script:
++    - STAGING="$PWD/staging"
++    - find $STAGING
++    - export PKG_CONFIG_PATH="$STAGING/lib/pkgconfig:$PKG_CONFIG_PATH"
++    - export LD_LIBRARY_PATH="$STAGING/lib:$LD_LIBRARY_PATH"
++    - mkdir build
++    - cd build
++    - qmake6 CONFIG+=debug CONFIG+=coverage ..
++    - make -j 4
++  dependencies:
++    - build_dependencies
++  artifacts:
++    paths:
++      - build/
++
++test_amd64_qt6:
++  stage: test
++  image: ubuntu:jammy
++  before_script:
++    - export APT_CACHE_DIR=`pwd`/apt-cache && mkdir -pv $APT_CACHE_DIR
++    - export DEBIAN_FRONTEND=noninteractive
++    - apt-get update -yq && apt-get -o dir::cache::archives="$APT_CACHE_DIR" install -y dbus-test-runner libqtdbusmock1-dev libqtdbustest1-dev lcov gcovr make qmake6 qt6-base-dev pkg-config libqt6sql6-sqlite doxygen libdbus-1-dev g++ make libsqlite3-dev libxml2-dev libglib2.0-dev
++  script:
++    - STAGING="$PWD/staging"
++    - export LD_LIBRARY_PATH="$STAGING/lib:$LD_LIBRARY_PATH"
++    - find build | xargs touch # Avoid rebuilding
++    - cd build
++    - make coverage-html
++  dependencies:
++    - build_dependencies
++    - build_amd64_qt6
++  artifacts:
++    paths:
++      - ./
++
+ pages:
+   stage: deploy
+   script:
+diff --git a/Accounts/account.cpp b/Accounts/account.cpp
+index 2e40c60056119cd67a7f6d36a6a53a882babd39e..104611a25daedc2e6aa0c11eb4b149726cfef58e 100644
+--- a/Accounts/account.cpp
++++ b/Accounts/account.cpp
+@@ -548,7 +548,7 @@ void Account::endGroup()
+ {
+     d->prefix = d->prefix.section(slash, 0, -3,
+                                   QString::SectionIncludeTrailingSep);
+-    if (d->prefix[0] == slash) d->prefix.remove(0, 1);
++    if (!d->prefix.isEmpty() && d->prefix[0] == slash) d->prefix.remove(0, 1);
+ }
+ 
+ /*!
+diff --git a/tests/tst_libaccounts.cpp b/tests/tst_libaccounts.cpp
+index 471e3d58d3ca8bff5e85ecd796b111222ed5ade4..d12091c4b277ab0cac21dbc4d7bb59596f46d80a 100644
+--- a/tests/tst_libaccounts.cpp
++++ b/tests/tst_libaccounts.cpp
+@@ -326,11 +326,11 @@ void AccountsTest::testService()
+     QCOMPARE(service.description(), QStringLiteral("Test description"));
+     QCOMPARE(service.iconName(), QString("general_myservice"));
+     QCOMPARE(service.trCatalog(), QString("accounts"));
+-    QStringList tags;
++    QSet<QString> tags;
+     tags << "email" << "e-mail";
+-    QCOMPARE(service.tags(), tags.toSet());
++    QCOMPARE(service.tags(), tags);
+     // Called twice, because the second time it returns a cached result
+-    QCOMPARE(service.tags(), tags.toSet());
++    QCOMPARE(service.tags(), tags);
+     QVERIFY(service.hasTag("email"));
+     QVERIFY(!service.hasTag("chat"));
+ 
+@@ -516,8 +516,7 @@ void AccountsTest::testAccountValue()
+     QTRY_COMPARE(synced.count(), 1);
+ 
+     /* check that the values we wrote are retrieved successfully */
+-    QVariant val = QVariant::String;
+-    account->value(QString("test"), val);
++    QVariant val = account->value(QString("test"));
+     QCOMPARE(val.toString(), QString("value"));
+ 
+     SettingSource source;
+@@ -687,10 +686,15 @@ void AccountsTest::testAccountService()
+     spyChanged.clear();
+     spyEnabled.clear();
+ 
+-    QStringList expectedChanges;
++    QSet<QString> expectedChanges;
+     expectedChanges << "parameters/server";
+     expectedChanges << "enabled";
+-    QCOMPARE(m_accountServiceChangedFields.toSet(), expectedChanges.toSet());
++#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
++    QSet<QString> changedFields(m_accountServiceChangedFields.begin(), m_accountServiceChangedFields.end());
++#else
++    QSet<QString> changedFields = m_accountServiceChangedFields.toSet();
++#endif
++    QCOMPARE(changedFields, expectedChanges);
+ 
+     QCOMPARE(accountService->value("server").toString(),
+              UTF8("www.example.com"));
+@@ -727,17 +731,34 @@ void AccountsTest::testAccountService()
+ 
+ 
+     /* test some more APIs */
+-    QStringList expectedList;
++    QSet<QString> expectedList;
+     expectedList << "server" << "fallback-conference-server" <<
+         "port" << "old-ssl";
+-    QCOMPARE(accountService->childKeys().toSet(), expectedList.toSet());
+-    QCOMPARE(accountService->childGroups().toSet(), QSet<QString>());
++#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
++    QStringList childKeysList = accountService->childKeys();
++    QSet<QString> childKeys(childKeysList.begin(), childKeysList.end());
++
++    QStringList childGroupsList = accountService->childGroups();
++    QSet<QString> childGroups(childGroupsList.begin(), childGroupsList.end());
++#else
++    QSet<QString> childKeys = accountService->childKeys().toSet();
++    QSet<QString> childGroups = accountService->childGroups().toSet();
++#endif
++
++    QCOMPARE(childKeys, expectedList);
++    QCOMPARE(childGroups, QSet<QString>());
+     QCOMPARE(accountService->contains("port"), true);
+     accountService->endGroup();
+ 
+-    expectedList.clear();
+-    expectedList << "parameters";
+-    QCOMPARE(accountService->childGroups().toSet(), expectedList.toSet());
++    QSet<QString> expectedList2;
++    expectedList2 << "parameters";
++#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
++    QStringList childGroupsList2 = accountService->childGroups();
++    QSet<QString> childGroups2(childGroupsList2.begin(), childGroupsList2.end());
++#else
++    QSet<QString> childGroups2 = accountService->childGroups().toSet();
++#endif
++    QCOMPARE(childGroups2, expectedList2);
+ 
+     /* Remove one key */
+     accountService->remove("parameters/port");
diff --git a/debian/patches/series b/debian/patches/series
index a6fc60b..e50d6d4 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 Install-the-doc-FILES.patch
 Build-docs-if-doxygen-is-available.patch
+qt6-toset.diff
diff --git a/debian/rules b/debian/rules
index 84e8d76..86ea76f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -13,20 +13,19 @@ override_dh_auto_clean:
 	dh_auto_clean
 
 execute_after_dh_auto_clean:
-	rm -rf build5
+	rm -rf build6
 
 override_dh_auto_configure:
-	QT_SELECT=qt6 dh_auto_configure -- LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH)
-	QT_SELECT=qt5 dh_auto_configure -Bbuild5 -- LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH) $top_builddir=/workspace/build5
+	QT_SELECT=qt5 dh_auto_configure -- LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH)
+	mkdir -p build6 && cd build6 && qmake6 "QMAKE_CFLAGS_RELEASE=${CFLAGS} ${CPPFLAGS}" "QMAKE_CFLAGS_DEBUG=${CFLAGS} ${CPPFLAGS}" "QMAKE_CXXFLAGS_RELEASE=${CXXFLAGS} ${CPPFLAGS}" "QMAKE_CXXFLAGS_DEBUG=${CXXFLAGS} ${CPPFLAGS}" "QMAKE_LFLAGS_RELEASE=${LDFLAGS}" "QMAKE_LFLAGS_DEBUG=${LDFLAGS}" QMAKE_STRIP=: PREFIX=/usr .. && cd ..
 
 override_dh_auto_build:
 	dh_auto_build
-	dh_auto_build -Bbuild5 $top_builddir=/workspace/build5
-
+	dh_auto_build -Bbuild6
 
 override_dh_auto_install:
 	dh_auto_install &&	find debian/tmp -name jquery.js -exec ln -sfv /usr/share/javascript/jquery/jquery.js {} \;
-	dh_auto_install -Bbuild5 &&	find debian/tmp -name jquery.js -exec ln -sfv /usr/share/javascript/jquery/jquery.js {} \;
+	dh_auto_install -Bbuild6 &&	find debian/tmp -name jquery.js -exec ln -sfv /usr/share/javascript/jquery/jquery.js {} \;
 
 override_dh_auto_test:
 	# Disable unittests


More information about the Neon-commits mailing list