diff options
Diffstat (limited to 'net-libs/signon-oauth2')
14 files changed, 906 insertions, 1 deletions
diff --git a/net-libs/signon-oauth2/Manifest b/net-libs/signon-oauth2/Manifest index e72c43495e7b..ee3fe2845582 100644 --- a/net-libs/signon-oauth2/Manifest +++ b/net-libs/signon-oauth2/Manifest @@ -1,6 +1,19 @@ +AUX 0001-Port-QSignalSpys-to-PMF-syntax.patch 10255 BLAKE2B 4c37af2d97f3052754c6aebf67bd460cab6fa40ab59db6cbe375cb0287aff225d1cf791d5680435d73b6e55977a64672e95e0cecdc55c2dc4556e39e1b87e832 SHA512 6f1d948272c0a2938de482e92493161667d2509e761342c51050e0e413e6c00cf7fe0f50fb45ad2849907a3251d1fd3c5205253c8d0b402000f54b288aac74ac +AUX 0002-Port-to-new-connection-syntax.patch 4543 BLAKE2B a9b69c5270141f4c24525ee6cb662f95a589f55ccf2f90308477081aa7b1ad6d3d86343effd93729b69f5e673d448fc6bf0b67759d75b0d91d3db7f79efdbf7d SHA512 23c5eefe1c9b7fd2404d61b2d660f808f5f8ed84e1e1bda1f77b3333d20c049f67b56471f680646ea41d281be89d780745ea28aec60b5991d3493092fcb3bfeb +AUX 0003-Port-away-from-deprecated-error-signal.patch 1760 BLAKE2B 9c0531b20aadf7bb24659162495836a32c6e75b7e985daed35c5772ec54a5ab5862dfa990b53fd95401e7a8762bc18e9c559ea309fb480dec1385054ca84849b SHA512 1a9d4ed9277f63586d34b294da59c3ce35ceb93f8837a005af025f52047e5c76b834ee2a172fb3dc130e2c27aa3a19a7ad15d88e56b12ff8214a4481f7e5d816 +AUX 0004-Port-away-from-deprecated-qrand.patch 2294 BLAKE2B c69bc5594cdc5ce937ddf034d37dc88be1b8ce432d3f8e6c91ff15be5f41286af9e672b5b2c9920f1a06497907aa33961970ca4b30ffce1b6aa9b8b11a2e4644 SHA512 8ca6fca429243c54b7af7cf9630a9b0c1d841eb988768b2d374e0afacd14015df84e6f217f904a3999be01d304cbd7e16a2e13cc8c1fa7f65bf77a65baa510c3 +AUX 0005-Fix-string-concatenation-in-Qt6.patch 7713 BLAKE2B 8bf013b9008b6053e5fd00dd4dbdf30eb5fe049eb4201249fd03b2f17911eb20fcd6c9e4a7147fdf07ff468d0e048d4de475e3d1dc829d85e9660886f22e46a3 SHA512 90b2ef458bdda4949704c3921bb40fc316b1e00396d0c54ab9d28a3ceb5632bd95bff03e0f6db094e03540aed8dbe036f5996e3bdae00e2ab75b099f3d3d07b3 +AUX 0006-Port-away-from-deprecated-QRegExp.patch 1748 BLAKE2B 74db8998a6ae3e39983a8650206e01e69fa80b33ccf0750a98a4ea44ba00eae0d1a6382f8e9646622cee56234e29c1bb7e7fe97e6f3c36e29aca18d35e782a49 SHA512 857b35de8b2e6d86d013fdd6d1a1b3e9d79707bcc1276e24256a6de01b969e716b2b17bbafb909f845399e70c4613874850e616964a02ce64011242b8793939b +AUX 0007-Build-with-C-17.patch 674 BLAKE2B 14bfd05a70b3872c218643b0ccf384a6ec7551f6ae47bb91cca92d60fb2f2f1cc70614662b1c3a2e809735466694f71ca2667b055843edb2195448fc3f76a06e SHA512 dbe8b43155f92ada6d44617d9eadf0c3b561292fa4d63bb07ea230c300546ae775e024a1178d265b7d229cfc77c85e31e4dae056d49f63a0c1409d0b96ad5607 +AUX 0008-Use-correct-signon-in-example.patch 693 BLAKE2B 887e7ea5c3d901fd1a3525128db2b6cb3fa6b238f37682a81c23efa5e74c226284d3db08fc2bfff0fffba1ee0f5f5236d05733a78323b971f65b50cb86531f78 SHA512 375cd56a271b063120cdb0b91814ff34da21da316622465f0d5152793c686ab4e2552c3e145e6213cec9ffa6b6fd746b3e6b29e5c4ad5e2a7705c08563cb3ea9 +AUX 0009-Port-away-from-deprecated-QString-SplitBehavior.patch 1517 BLAKE2B 447c1df8998a9a8e673581195fc3f4ee8768753ea02967f5e63f27c4607e25f55c3b93362f377c714ae8787111b0cdcf6c24da1d76ddd9f9af02fe1502a375d4 SHA512 605934a62221851182b8abfd5b82a216fa36626098ec5683a74521c153d9f2fe1b45c850161503fe3557e12970bc98c164b8806bc1862d068b0ef7a92091e7fe +AUX 0010-Port-away-from-deprecated-QList-toSet.patch 1220 BLAKE2B 166ae7330bc12acc25a73fc6b100c60f508e5c94df43bd830255fa45e21fd8ea9f32409a85b9da5eea2b58eb6d8bb0839bfd9cb46a9d8bcaed88df8dc68532fc SHA512 37bd0ad71777a9cc9d5bfbc7cd05b47c0c78bdad345d24f9134fc7ea0cbb2e288c93914a408b8bb0d0188bc88613fb8b9562b4e4bd886b2bf371f3dbb8c11b84 AUX signon-oauth2-0.24-dont-install-tests.patch 352 BLAKE2B 6dfa625f68f0178947414dee97ab22a34e366353a7b5b07e166c426a5b86ab418faf31a8bcd868d297ae4b92d10a8231f403810f66d6f4dbfd31a0afeba4165a SHA512 af1908f5e2549182823847df5ef80b933adc6d4a15f39c63d4a82cb8540e97a29c60c7056f17fb2db314ed92d51594d5f76687862018a70f1de592ecb3a928d1 AUX signon-oauth2-0.25-cxxflags.patch 795 BLAKE2B 6dfd833830d7344f962fb97bde7c54f976be2c41988e90837225f3adfc0cc4b651aa670f35a95dc481ce651d10942a0d386e03f86dca117d4145928cda965111 SHA512 94dffe79441d5ea90acc29e1d457bdec2e762c18a169ae8873963ed612709d472ac55985ca21c41298557eda4e65879d70a595eda635df75a46c7bdea3ab675e +AUX signon-oauth2-0.25-drop-fno-rtti.patch 699 BLAKE2B 9913bb6405ecba28b2661c6c72245f71f0d4070110729a492a7dc01aa6de248d2a2fd06fb497ff213aeaf9f0f9ef63022993558a85409abb01efcf0d6698c7fa SHA512 08f2fa31707655af966cc99296e3497ab922d84a81348ab7d16557232ca6a967d452798ff510fda9724b59b8fbda3c7107ecfc4b8f064ab974889b3675108a8b AUX signon-oauth2-0.25-pkgconfig-libdir.patch 455 BLAKE2B 787c03ead028ff9e7980deb7eb4e2439864a1307e60dfa34b3e7c18d9f2b753016aa79208651624f10cebdfd89b672eb03097a8c7482389e7bb128bb16189e58 SHA512 b0589d51b4d5c7c51754752c7159e501620d782916fcea8aeb7d3eb8b33121372517be4babce48c90e5abd2e1fde9d3663deb66a8d2065e8cdbfedbf938b7a6d DIST signon-oauth2-0.25.tar.gz 41090 BLAKE2B d14cde073cf834427e337f94345b719ad1af38a285587f987f6ed42f96e8aecfcf63720e42b7f86f2018565c198e1f31b7b75da74c86db3e8a15680da70d3f9e SHA512 721cd514ee0a1175e3b1bbaa78dc1a87fd382327bcbee8356de040f04455f7cc80ed173e3f33a6acf4c0d679847063a25282e9d5c9a9be99f730bec41be96451 +DIST signon-oauth2-0.25_p20210102.tar.bz2 34873 BLAKE2B 4e53f6d19cf0e9c8513afef44ab640dcd3ed811a9830acff65abd997691926388015b35e6f010c6a0bc25cc257e22a4b8e359ec690bbc35182cd1cf87c716b85 SHA512 5b371e6230c9ed4352ff151626dfaf40d2ecb41e389ee3a753fc41be3937191d416b864d555fd85cecbfe1615233a063db881adae3ea29aefb652a36d46633b5 EBUILD signon-oauth2-0.25.ebuild 1151 BLAKE2B 754e64ec51bdc35ffa5b5a65373ecf19ac79e080d2874127881ebb9d05bb2286861a5cd3d32b02214ac28fd011b954b1800c5437f3224511a39240cf4b922d70 SHA512 d5262a193c7ef6ac34e3c43c5b5260a668eb42045dbc62ee87ad87e02ba95e903e50803614dfa71e16f3c8c1ea836c9ceb649d1167d3257c470c2f1f3777b5cf -MISC metadata.xml 250 BLAKE2B f3e9395137ebb9adf46cd35c1b6156f82c04cfa94f964f6da24fe71eb560cf51b4f70ebfa10daaa4884400ec22782d819ab794dfd29e7a47559f07208397195d SHA512 78c4ff15eed76ba883b457be95dabd41e928a0e64a42b758b5eab4d8a95afca27d5ea6a7cfe0948de578b169153a05f08aadfce1ddd41a88732212a1e76e565f +EBUILD signon-oauth2-0.25_p20210102.ebuild 2398 BLAKE2B 031eb2f1e69a5f4bd9e082fe54bdca4b34d43e3048f864a0ce878a5cf4564c9a065ffd8790f624602f7b5ee1f8d2e614a226c645523fcf6b152e7232171350ad SHA512 b9751f7f7c6fb01858246d34859b450e5b44d91435b935f227ac7a097591c8d17f1801ea1b674923bd119eeaddcbc3fc759db9d1ccfc21aa11f8ba8c338c99a5 +MISC metadata.xml 348 BLAKE2B 223f85a8556cf010e028dcfe0fffc9d524d38f591aa07af45cb992f9095651113deeb18bb5a2a90b363b4dc62307a19e410c9ccc51b6d87de1b98a1e457ab8b7 SHA512 00f32e7e48f5bd2cad3286636d35f6d328a100eb555fed58b2ce49447a14a0fcc20a087f3fb0227e56669bd5873551532b4e3d36772fd5fae7f4d11dc0c84f68 diff --git a/net-libs/signon-oauth2/files/0001-Port-QSignalSpys-to-PMF-syntax.patch b/net-libs/signon-oauth2/files/0001-Port-QSignalSpys-to-PMF-syntax.patch new file mode 100644 index 000000000000..96b6d0af77f3 --- /dev/null +++ b/net-libs/signon-oauth2/files/0001-Port-QSignalSpys-to-PMF-syntax.patch @@ -0,0 +1,200 @@ +From d3ba6d4c19ca0b1081fbafc757d3c496cc21ada2 Mon Sep 17 00:00:00 2001 +From: Nicolas Fella <nicolas.fella@gmx.de> +Date: Sun, 15 Oct 2023 18:34:07 +0200 +Subject: [PATCH 01/10] Port QSignalSpys to PMF syntax + +--- + tests/oauth2plugintest.cpp | 86 ++++++++++++++++---------------------- + 1 file changed, 37 insertions(+), 49 deletions(-) + +diff --git a/tests/oauth2plugintest.cpp b/tests/oauth2plugintest.cpp +index 94e5c43..b257dc7 100644 +--- a/tests/oauth2plugintest.cpp ++++ b/tests/oauth2plugintest.cpp +@@ -244,7 +244,7 @@ void OAuth2PluginTest::testPluginCancel() + m_testPlugin->cancel(); + + //then real cancel +- QSignalSpy pluginError(m_testPlugin, SIGNAL(error(const SignOn::Error &))); ++ QSignalSpy pluginError(m_testPlugin, &Plugin::error); + + OAuth2PluginData userAgentData; + userAgentData.setHost("https://localhost"); +@@ -435,11 +435,10 @@ void OAuth2PluginTest::testPluginProcess() + QFETCH(QVariantMap, response); + QFETCH(QVariantMap, stored); + +- QSignalSpy result(m_testPlugin, SIGNAL(result(const SignOn::SessionData&))); +- QSignalSpy error(m_testPlugin, SIGNAL(error(const SignOn::Error &))); +- QSignalSpy userActionRequired(m_testPlugin, +- SIGNAL(userActionRequired(const SignOn::UiSessionData&))); +- QSignalSpy store(m_testPlugin, SIGNAL(store(const SignOn::SessionData&))); ++ QSignalSpy result(m_testPlugin, &Plugin::result); ++ QSignalSpy error(m_testPlugin, &Plugin::error); ++ QSignalSpy userActionRequired(m_testPlugin, &Plugin::userActionRequired); ++ QSignalSpy store(m_testPlugin, &Plugin::store); + + m_testPlugin->process(sessionData, mechanism); + if (errorCode < 0) { +@@ -696,11 +695,10 @@ void OAuth2PluginTest::testPluginHmacSha1Process() + QFETCH(QVariantMap, response); + QFETCH(QVariantMap, stored); + +- QSignalSpy result(m_testPlugin, SIGNAL(result(const SignOn::SessionData&))); +- QSignalSpy error(m_testPlugin, SIGNAL(error(const SignOn::Error &))); +- QSignalSpy userActionRequired(m_testPlugin, +- SIGNAL(userActionRequired(const SignOn::UiSessionData&))); +- QSignalSpy store(m_testPlugin, SIGNAL(store(const SignOn::SessionData&))); ++ QSignalSpy result(m_testPlugin, &Plugin::result); ++ QSignalSpy error(m_testPlugin, &Plugin::error); ++ QSignalSpy userActionRequired(m_testPlugin, &Plugin::userActionRequired); ++ QSignalSpy store(m_testPlugin, &Plugin::store); + + TestNetworkAccessManager *nam = new TestNetworkAccessManager; + m_testPlugin->m_networkAccessManager = nam; +@@ -777,11 +775,10 @@ void OAuth2PluginTest::testPluginUseragentUserActionFinished() + QStringList scopes = QStringList() << "scope1" << "scope2"; + data.setScope(scopes); + +- QSignalSpy resultSpy(m_testPlugin, SIGNAL(result(const SignOn::SessionData&))); +- QSignalSpy error(m_testPlugin, SIGNAL(error(const SignOn::Error &))); +- QSignalSpy userActionRequired(m_testPlugin, +- SIGNAL(userActionRequired(const SignOn::UiSessionData&))); +- QSignalSpy store(m_testPlugin, SIGNAL(store(const SignOn::SessionData&))); ++ QSignalSpy resultSpy(m_testPlugin, &Plugin::result); ++ QSignalSpy error(m_testPlugin, &Plugin::error); ++ QSignalSpy userActionRequired(m_testPlugin, &Plugin::userActionRequired); ++ QSignalSpy store(m_testPlugin, &Plugin::store); + + m_testPlugin->process(data, QString("user_agent")); + +@@ -1286,10 +1283,9 @@ void OAuth2PluginTest::testPluginWebserverUserActionFinished() + data.setScope(QStringList() << "one" << "two" << "three"); + data.setDisableStateParameter(disableStateParameter); + +- QSignalSpy result(m_testPlugin, SIGNAL(result(const SignOn::SessionData&))); +- QSignalSpy error(m_testPlugin, SIGNAL(error(const SignOn::Error &))); +- QSignalSpy userActionRequired(m_testPlugin, +- SIGNAL(userActionRequired(const SignOn::UiSessionData&))); ++ QSignalSpy result(m_testPlugin, &Plugin::result); ++ QSignalSpy error(m_testPlugin, &Plugin::error); ++ QSignalSpy userActionRequired(m_testPlugin, &Plugin::userActionRequired); + + TestNetworkAccessManager *nam = new TestNetworkAccessManager; + m_testPlugin->m_networkAccessManager = nam; +@@ -1362,9 +1358,8 @@ void OAuth2PluginTest::testUserActionFinishedErrors() + data.setClientSecret("fa28f40b5a1f8c1d5628963d880636fbkjkjkj"); + data.setRedirectUri("http://localhost/resp.html"); + +- QSignalSpy error(m_testPlugin, SIGNAL(error(const SignOn::Error &))); +- QSignalSpy userActionRequired(m_testPlugin, +- SIGNAL(userActionRequired(const SignOn::UiSessionData&))); ++ QSignalSpy error(m_testPlugin, &Plugin::error); ++ QSignalSpy userActionRequired(m_testPlugin, &Plugin::userActionRequired); + + m_testPlugin->process(data, QString("web_server")); + QTRY_COMPARE(userActionRequired.count(), 1); +@@ -1486,10 +1481,9 @@ void OAuth2PluginTest::testOauth1UserActionFinished() + data.setConsumerSecret("fa28f40b5a1f8c1d5628963d880636fbkjkjkj"); + data.setRealm("MyHost"); + +- QSignalSpy result(m_testPlugin, SIGNAL(result(const SignOn::SessionData&))); +- QSignalSpy error(m_testPlugin, SIGNAL(error(const SignOn::Error &))); +- QSignalSpy userActionRequired(m_testPlugin, +- SIGNAL(userActionRequired(const SignOn::UiSessionData&))); ++ QSignalSpy result(m_testPlugin, &Plugin::result); ++ QSignalSpy error(m_testPlugin, &Plugin::error); ++ QSignalSpy userActionRequired(m_testPlugin, &Plugin::userActionRequired); + + TestNetworkAccessManager *nam = new TestNetworkAccessManager; + m_testPlugin->m_networkAccessManager = nam; +@@ -1610,9 +1604,8 @@ void OAuth2PluginTest::testOAuth2Errors() + data.setClientSecret("fa28f40b5a1f8c1d5628963d880636fbkjkjkj"); + data.setRedirectUri("http://localhost/resp.html"); + +- QSignalSpy error(m_testPlugin, SIGNAL(error(const SignOn::Error &))); +- QSignalSpy userActionRequired(m_testPlugin, +- SIGNAL(userActionRequired(const SignOn::UiSessionData&))); ++ QSignalSpy error(m_testPlugin, &Plugin::error); ++ QSignalSpy userActionRequired(m_testPlugin, &Plugin::userActionRequired); + + TestNetworkAccessManager *nam = new TestNetworkAccessManager; + m_testPlugin->m_networkAccessManager = nam; +@@ -1683,8 +1676,8 @@ void OAuth2PluginTest::testRefreshToken() + + SignOn::UiSessionData info; + +- QSignalSpy result(m_testPlugin, SIGNAL(result(const SignOn::SessionData&))); +- QSignalSpy error(m_testPlugin, SIGNAL(error(const SignOn::Error &))); ++ QSignalSpy result(m_testPlugin, &Plugin::result); ++ QSignalSpy error(m_testPlugin, &Plugin::error); + + TestNetworkAccessManager *nam = new TestNetworkAccessManager; + m_testPlugin->m_networkAccessManager = nam; +@@ -1766,9 +1759,8 @@ void OAuth2PluginTest::testRefreshTokenError() + + SignOn::UiSessionData info; + +- QSignalSpy error(m_testPlugin, SIGNAL(error(const SignOn::Error &))); +- QSignalSpy userActionRequired(m_testPlugin, +- SIGNAL(userActionRequired(const SignOn::UiSessionData&))); ++ QSignalSpy error(m_testPlugin, &Plugin::error); ++ QSignalSpy userActionRequired(m_testPlugin, &Plugin::userActionRequired); + + TestNetworkAccessManager *nam = new TestNetworkAccessManager; + m_testPlugin->m_networkAccessManager = nam; +@@ -1842,10 +1834,9 @@ void OAuth2PluginTest::testClientAuthentication() + data.setRedirectUri("http://localhost/resp.html"); + data.setForceClientAuthViaRequestBody(forceAuthViaRequestBody); + +- QSignalSpy result(m_testPlugin, SIGNAL(result(const SignOn::SessionData&))); +- QSignalSpy error(m_testPlugin, SIGNAL(error(const SignOn::Error &))); +- QSignalSpy userActionRequired(m_testPlugin, +- SIGNAL(userActionRequired(const SignOn::UiSessionData&))); ++ QSignalSpy result(m_testPlugin, &Plugin::result); ++ QSignalSpy error(m_testPlugin, &Plugin::error); ++ QSignalSpy userActionRequired(m_testPlugin, &Plugin::userActionRequired); + + TestNetworkAccessManager *nam = new TestNetworkAccessManager; + m_testPlugin->m_networkAccessManager = nam; +@@ -1908,10 +1899,9 @@ void OAuth2PluginTest::testTokenPath() + data.setClientId("104660106251471"); + data.setRedirectUri("http://localhost/resp.html"); + +- QSignalSpy result(m_testPlugin, SIGNAL(result(const SignOn::SessionData&))); +- QSignalSpy error(m_testPlugin, SIGNAL(error(const SignOn::Error &))); +- QSignalSpy userActionRequired(m_testPlugin, +- SIGNAL(userActionRequired(const SignOn::UiSessionData&))); ++ QSignalSpy result(m_testPlugin, &Plugin::result); ++ QSignalSpy error(m_testPlugin, &Plugin::error); ++ QSignalSpy userActionRequired(m_testPlugin, &Plugin::userActionRequired); + + TestNetworkAccessManager *nam = new TestNetworkAccessManager; + m_testPlugin->m_networkAccessManager = nam; +@@ -1995,10 +1985,9 @@ void OAuth2PluginTest::testTokenQuery() + data.setClientId("104660106251471"); + data.setRedirectUri("http://localhost/resp.html"); + +- QSignalSpy result(m_testPlugin, SIGNAL(result(const SignOn::SessionData&))); +- QSignalSpy error(m_testPlugin, SIGNAL(error(const SignOn::Error &))); +- QSignalSpy userActionRequired(m_testPlugin, +- SIGNAL(userActionRequired(const SignOn::UiSessionData&))); ++ QSignalSpy result(m_testPlugin, &Plugin::result); ++ QSignalSpy error(m_testPlugin, &Plugin::error); ++ QSignalSpy userActionRequired(m_testPlugin, &Plugin::userActionRequired); + + QScopedPointer<TestNetworkAccessManager> nam(new TestNetworkAccessManager); + m_testPlugin->m_networkAccessManager = nam.data(); +@@ -2062,8 +2051,7 @@ void OAuth2PluginTest::testOAuth2AuthRequestUri() + QFETCH(QVariantMap, sessionData); + QFETCH(QString, expectedUri); + +- QSignalSpy userActionRequired(m_testPlugin, +- SIGNAL(userActionRequired(const SignOn::UiSessionData&))); ++ QSignalSpy userActionRequired(m_testPlugin, &Plugin::userActionRequired); + + m_testPlugin->process(sessionData, mechanism); + QCOMPARE(userActionRequired.count(), 1); +-- +2.43.0 + diff --git a/net-libs/signon-oauth2/files/0002-Port-to-new-connection-syntax.patch b/net-libs/signon-oauth2/files/0002-Port-to-new-connection-syntax.patch new file mode 100644 index 000000000000..f97e0041698a --- /dev/null +++ b/net-libs/signon-oauth2/files/0002-Port-to-new-connection-syntax.patch @@ -0,0 +1,101 @@ +From a0b372dfb6d37d0a81a545239128fec5ee94283c Mon Sep 17 00:00:00 2001 +From: Nicolas Fella <nicolas.fella@gmx.de> +Date: Sun, 15 Oct 2023 18:51:29 +0200 +Subject: [PATCH 02/10] Port to new connection syntax + +--- + example/oauthclient.cpp | 8 ++++---- + src/base-plugin.cpp | 12 ++++++------ + src/plugin.cpp | 18 ++++++------------ + tests/oauth2plugintest.cpp | 4 ++-- + 4 files changed, 18 insertions(+), 24 deletions(-) + +diff --git a/example/oauthclient.cpp b/example/oauthclient.cpp +index adfcabf..328e8b7 100644 +--- a/example/oauthclient.cpp ++++ b/example/oauthclient.cpp +@@ -47,10 +47,10 @@ OAuthClient::~OAuthClient() + void OAuthClient::authenticate() + { + SignOn::AuthSession *m_session = m_identity->createSession("oauth2"); +- QObject::connect(m_session, SIGNAL(response(const SignOn::SessionData &)), +- this, SLOT(onResponse(const SignOn::SessionData &))); +- QObject::connect(m_session, SIGNAL(error(const SignOn::Error &)), +- this, SLOT(onError(const SignOn::Error &))); ++ QObject::connect(m_session, &SignOn::AuthSession::response, ++ this, &OAuthClient::onResponse); ++ QObject::connect(m_session, &SignOn::AuthSession::error, ++ this, &OAuthClient::onError); + + OAuth2PluginData data; + data.setHost("www.facebook.com"); +diff --git a/src/base-plugin.cpp b/src/base-plugin.cpp +index aa2d639..d5ce81c 100644 +--- a/src/base-plugin.cpp ++++ b/src/base-plugin.cpp +@@ -124,12 +124,12 @@ void BasePlugin::postRequest(const QNetworkRequest &request, + Q_D(BasePlugin); + + d->m_reply = d->m_networkAccessManager->post(request, data); +- connect(d->m_reply, SIGNAL(finished()), +- this, SLOT(onPostFinished())); +- connect(d->m_reply, SIGNAL(error(QNetworkReply::NetworkError)), +- this, SLOT(onNetworkError(QNetworkReply::NetworkError))); +- connect(d->m_reply, SIGNAL(sslErrors(QList<QSslError>)), +- this, SLOT(handleSslErrors(QList<QSslError>))); ++ connect(d->m_reply, &QNetworkReply::finished, ++ this, &BasePlugin::onPostFinished); ++ connect(d->m_reply, &QNetworkReply::error, ++ this, &BasePlugin::onNetworkError); ++ connect(d->m_reply, &QNetworkReply::sslErrors, ++ this, &BasePlugin::handleSslErrors); + } + + void BasePlugin::serverReply(QNetworkReply *reply) +diff --git a/src/plugin.cpp b/src/plugin.cpp +index e6af807..c764609 100644 +--- a/src/plugin.cpp ++++ b/src/plugin.cpp +@@ -107,18 +107,12 @@ void Plugin::process(const SignOn::SessionData &inData, + impl->setNetworkAccessManager(m_networkAccessManager); + + // Forward the signals from the implementation +- connect(impl, SIGNAL(result(const SignOn::SessionData &)), +- SIGNAL(result(const SignOn::SessionData &))); +- connect(impl, SIGNAL(store(const SignOn::SessionData &)), +- SIGNAL(store(const SignOn::SessionData &))); +- connect(impl, SIGNAL(error(const SignOn::Error &)), +- SIGNAL(error(const SignOn::Error &))); +- connect(impl, SIGNAL(userActionRequired(const SignOn::UiSessionData &)), +- SIGNAL(userActionRequired(const SignOn::UiSessionData &))); +- connect(impl, SIGNAL(refreshed(const SignOn::UiSessionData &)), +- SIGNAL(refreshed(const SignOn::UiSessionData &))); +- connect(impl, SIGNAL(statusChanged(const AuthPluginState, const QString&)), +- SIGNAL(statusChanged(const AuthPluginState, const QString&))); ++ connect(impl, &BasePlugin::result, this, &Plugin::result); ++ connect(impl, &BasePlugin::store, this, &Plugin::store); ++ connect(impl, &BasePlugin::error, this, &Plugin::error); ++ connect(impl, &BasePlugin::userActionRequired, this, &Plugin::userActionRequired); ++ connect(impl, &BasePlugin::refreshed, this, &Plugin::refreshed); ++ connect(impl, &BasePlugin::statusChanged, this, &Plugin::statusChanged); + + impl->process(inData, mechanism); + } +diff --git a/tests/oauth2plugintest.cpp b/tests/oauth2plugintest.cpp +index b257dc7..9e16950 100644 +--- a/tests/oauth2plugintest.cpp ++++ b/tests/oauth2plugintest.cpp +@@ -142,8 +142,8 @@ public: + open(ReadOnly | Unbuffered); + setHeader(QNetworkRequest::ContentLengthHeader, QVariant(content.size())); + +- QTimer::singleShot(0, this, SIGNAL(readyRead())); +- QTimer::singleShot(10, this, SLOT(finish())); ++ QTimer::singleShot(0, this, &TestNetworkReply::readyRead); ++ QTimer::singleShot(10, this, &TestNetworkReply::finish); + } + + public Q_SLOTS: +-- +2.43.0 + diff --git a/net-libs/signon-oauth2/files/0003-Port-away-from-deprecated-error-signal.patch b/net-libs/signon-oauth2/files/0003-Port-away-from-deprecated-error-signal.patch new file mode 100644 index 000000000000..5c7979b7e754 --- /dev/null +++ b/net-libs/signon-oauth2/files/0003-Port-away-from-deprecated-error-signal.patch @@ -0,0 +1,51 @@ +From 8211fd4a3ca31370069c6953db1589c1110dca90 Mon Sep 17 00:00:00 2001 +From: Nicolas Fella <nicolas.fella@gmx.de> +Date: Sun, 15 Oct 2023 18:59:12 +0200 +Subject: [PATCH 03/10] Port away from deprecated error() signal + +--- + src/base-plugin.cpp | 7 ++++++- + tests/oauth2plugintest.cpp | 8 +++++++- + 2 files changed, 13 insertions(+), 2 deletions(-) + +diff --git a/src/base-plugin.cpp b/src/base-plugin.cpp +index d5ce81c..ffc8ad5 100644 +--- a/src/base-plugin.cpp ++++ b/src/base-plugin.cpp +@@ -126,8 +126,13 @@ void BasePlugin::postRequest(const QNetworkRequest &request, + d->m_reply = d->m_networkAccessManager->post(request, data); + connect(d->m_reply, &QNetworkReply::finished, + this, &BasePlugin::onPostFinished); +- connect(d->m_reply, &QNetworkReply::error, ++#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) ++ connect(d->m_reply, static_cast<void (QNetworkReply::*)(QNetworkReply::NetworkError)>(&QNetworkReply::error), + this, &BasePlugin::onNetworkError); ++#else ++ connect(d->m_reply, &QNetworkReply::errorOccurred, ++ this, &BasePlugin::onNetworkError); ++#endif + connect(d->m_reply, &QNetworkReply::sslErrors, + this, &BasePlugin::handleSslErrors); + } +diff --git a/tests/oauth2plugintest.cpp b/tests/oauth2plugintest.cpp +index 9e16950..f5221cc 100644 +--- a/tests/oauth2plugintest.cpp ++++ b/tests/oauth2plugintest.cpp +@@ -148,7 +148,13 @@ public: + + public Q_SLOTS: + void finish() { setFinished(true); Q_EMIT finished(); } +- void fail() { Q_EMIT error(error()); } ++ void fail() { ++#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) ++ Q_EMIT error(error()); ++#else ++ Q_EMIT errorOccurred(error()); ++#endif ++ } + + protected: + void abort() Q_DECL_OVERRIDE {} +-- +2.43.0 + diff --git a/net-libs/signon-oauth2/files/0004-Port-away-from-deprecated-qrand.patch b/net-libs/signon-oauth2/files/0004-Port-away-from-deprecated-qrand.patch new file mode 100644 index 000000000000..ef7804995346 --- /dev/null +++ b/net-libs/signon-oauth2/files/0004-Port-away-from-deprecated-qrand.patch @@ -0,0 +1,69 @@ +From 039dab8db2e16d02872c6e12c698157e05dc43e2 Mon Sep 17 00:00:00 2001 +From: Nicolas Fella <nicolas.fella@gmx.de> +Date: Sun, 15 Oct 2023 19:02:04 +0200 +Subject: [PATCH 04/10] Port away from deprecated qrand + +--- + src/oauth1plugin.cpp | 7 +++++++ + src/oauth2plugin.cpp | 6 ++++++ + 2 files changed, 13 insertions(+) + +diff --git a/src/oauth1plugin.cpp b/src/oauth1plugin.cpp +index 8ec7645..6c38cbb 100644 +--- a/src/oauth1plugin.cpp ++++ b/src/oauth1plugin.cpp +@@ -94,8 +94,10 @@ public: + { + TRACE(); + ++#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) + // Initialize randomizer + qsrand(QTime::currentTime().msec()); ++#endif + } + + ~OAuth1PluginPrivate() +@@ -437,8 +439,13 @@ QString OAuth1Plugin::createOAuth1Header(const QString &aUrl, + .arg(urlEncode(inData.ConsumerKey()))); + authHeader.append(DELIMITER); + // Nonce ++#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) + unsigned long nonce1 = (unsigned long) qrand(); + unsigned long nonce2 = (unsigned long) qrand(); ++#else ++ unsigned long nonce1 = QRandomGenerator::global()->generate64(); ++ unsigned long nonce2 = QRandomGenerator::global()->generate64(); ++#endif + QString oauthNonce = QString("%1%2").arg(nonce1).arg(nonce2); + authHeader.append(EQUAL_WITH_QUOTES.arg(OAUTH_NONCE) + .arg(urlEncode(oauthNonce))); +diff --git a/src/oauth2plugin.cpp b/src/oauth2plugin.cpp +index 418e7db..8763f00 100644 +--- a/src/oauth2plugin.cpp ++++ b/src/oauth2plugin.cpp +@@ -84,8 +84,10 @@ public: + { + TRACE(); + ++#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) + // Initialize randomizer + qsrand(QTime::currentTime().msec()); ++#endif + } + + ~OAuth2PluginPrivate() +@@ -180,7 +182,11 @@ void OAuth2Plugin::sendOAuth2AuthRequest() + QString redirectUri = d->m_oauth2Data.RedirectUri(); + query.addQueryItem(REDIRECT_URI, QUrl::toPercentEncoding(redirectUri)); + if (!d->m_oauth2Data.DisableStateParameter()) { ++#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) + d->m_state = QString::number(qrand()); ++#else ++ d->m_state = QString::number(QRandomGenerator::global()->generate()); ++#endif + query.addQueryItem(STATE, d->m_state); + } + QStringList responseType = d->m_oauth2Data.ResponseType(); +-- +2.43.0 + diff --git a/net-libs/signon-oauth2/files/0005-Fix-string-concatenation-in-Qt6.patch b/net-libs/signon-oauth2/files/0005-Fix-string-concatenation-in-Qt6.patch new file mode 100644 index 000000000000..daadd43423e8 --- /dev/null +++ b/net-libs/signon-oauth2/files/0005-Fix-string-concatenation-in-Qt6.patch @@ -0,0 +1,181 @@ +From 47ff5a950e54ae2a570183be21312bcaa5271396 Mon Sep 17 00:00:00 2001 +From: Nicolas Fella <nicolas.fella@gmx.de> +Date: Sun, 15 Oct 2023 19:04:44 +0200 +Subject: [PATCH 05/10] Fix string concatenation in Qt6 + +--- + src/oauth1plugin.cpp | 33 ++++++++++++++++----------------- + src/oauth1plugin.h | 2 +- + src/oauth2plugin.cpp | 4 ++-- + src/oauth2plugin.h | 2 +- + 4 files changed, 20 insertions(+), 21 deletions(-) + +diff --git a/src/oauth1plugin.cpp b/src/oauth1plugin.cpp +index 6c38cbb..3a1bbd5 100644 +--- a/src/oauth1plugin.cpp ++++ b/src/oauth1plugin.cpp +@@ -60,7 +60,6 @@ const QString TIMESTAMP = QString("timestamp"); + const QString AUTH_ERROR = QString("error"); + + const QString EQUAL = QString("="); +-const QString AMPERSAND = QString("&"); + const QString EQUAL_WITH_QUOTES = QString("%1=\"%2\""); + const QString DELIMITER = QString(", "); + const QString SPACE = QString(" "); +@@ -321,7 +320,7 @@ void OAuth1Plugin::process(const SignOn::SessionData &inData, + sendOAuth1PostRequest(); + } + +-QString OAuth1Plugin::urlEncode(QString strData) ++QByteArray OAuth1Plugin::urlEncode(QString strData) + { + return QUrl::toPercentEncoding(strData).constData(); + } +@@ -399,7 +398,7 @@ QByteArray OAuth1Plugin::constructSignatureBaseString(const QString &aUrl, + bool first = true; + for (i = oAuthHeaderMap.begin(); i != oAuthHeaderMap.end(); ++i) { + if(!first) { +- oAuthHeaderString.append(AMPERSAND); ++ oAuthHeaderString.append(QLatin1Char('&')); + } else { + first = false; + } +@@ -411,9 +410,9 @@ QByteArray OAuth1Plugin::constructSignatureBaseString(const QString &aUrl, + + QByteArray signatureBase; + signatureBase.append("POST"); +- signatureBase.append(AMPERSAND); ++ signatureBase.append('&'); + signatureBase.append(urlEncode(urlWithHostAndPath)); +- signatureBase.append(AMPERSAND); ++ signatureBase.append('&'); + signatureBase.append(urlEncode(oAuthHeaderString)); + return signatureBase; + } +@@ -427,16 +426,16 @@ QString OAuth1Plugin::createOAuth1Header(const QString &aUrl, + QString authHeader = OAUTH + SPACE; + if (!inData.Realm().isEmpty()) { + authHeader.append(EQUAL_WITH_QUOTES.arg(OAUTH_REALM) +- .arg(urlEncode(inData.Realm()))); ++ .arg(urlEncode(inData.Realm()).constData())); + authHeader.append(DELIMITER); + } + if (!inData.Callback().isEmpty()) { + authHeader.append(EQUAL_WITH_QUOTES.arg(OAUTH_CALLBACK) +- .arg(urlEncode(inData.Callback()))); ++ .arg(urlEncode(inData.Callback()).constData())); + authHeader.append(DELIMITER); + } + authHeader.append(EQUAL_WITH_QUOTES.arg(OAUTH_CONSUMERKEY) +- .arg(urlEncode(inData.ConsumerKey()))); ++ .arg(urlEncode(inData.ConsumerKey()).constData())); + authHeader.append(DELIMITER); + // Nonce + #if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) +@@ -448,32 +447,32 @@ QString OAuth1Plugin::createOAuth1Header(const QString &aUrl, + #endif + QString oauthNonce = QString("%1%2").arg(nonce1).arg(nonce2); + authHeader.append(EQUAL_WITH_QUOTES.arg(OAUTH_NONCE) +- .arg(urlEncode(oauthNonce))); ++ .arg(urlEncode(oauthNonce).constData())); + authHeader.append(DELIMITER); + // Timestamp + QString oauthTimestamp = + QString("%1").arg(QDateTime::currentDateTime().toSecsSinceEpoch()); + authHeader.append(EQUAL_WITH_QUOTES.arg(OAUTH_TIMESTAMP) +- .arg(urlEncode(oauthTimestamp))); ++ .arg(urlEncode(oauthTimestamp).constData())); + authHeader.append(DELIMITER); + if (!d->m_oauth1Token.isEmpty()) { + authHeader.append(EQUAL_WITH_QUOTES.arg(OAUTH_TOKEN) +- .arg(urlEncode(d->m_oauth1Token))); ++ .arg(urlEncode(d->m_oauth1Token).constData())); + authHeader.append(DELIMITER); + } + + authHeader.append(EQUAL_WITH_QUOTES.arg(OAUTH_SIGNATURE_METHOD) +- .arg(urlEncode(d->m_mechanism))); ++ .arg(urlEncode(d->m_mechanism).constData())); + authHeader.append(DELIMITER); + // Creating the signature + // PLAINTEXT signature method + QByteArray secretKey; +- secretKey.append(urlEncode(inData.ConsumerSecret()) + AMPERSAND + ++ secretKey.append(urlEncode(inData.ConsumerSecret()) + '&' + + urlEncode(d->m_oauth1TokenSecret)); + if (d->m_mechanism == PLAINTEXT) { + TRACE() << "Signature = " << secretKey; + authHeader.append(EQUAL_WITH_QUOTES.arg(OAUTH_SIGNATURE) +- .arg(urlEncode(secretKey))); ++ .arg(urlEncode(secretKey).constData())); + authHeader.append(DELIMITER); + } + // HMAC-SHA1 signature method +@@ -484,7 +483,7 @@ QString OAuth1Plugin::createOAuth1Header(const QString &aUrl, + QByteArray signature = hashHMACSHA1(secretKey, signatureBase); + TRACE() << "Signature = " << signature; + authHeader.append(EQUAL_WITH_QUOTES.arg(OAUTH_SIGNATURE) +- .arg(urlEncode(signature.toBase64()))); ++ .arg(urlEncode(signature.toBase64()).constData())); + authHeader.append(DELIMITER); + } + // TODO: RSA-SHA1 signature method should be implemented +@@ -494,11 +493,11 @@ QString OAuth1Plugin::createOAuth1Header(const QString &aUrl, + + if (!d->m_oauth1TokenVerifier.isEmpty()) { + authHeader.append(EQUAL_WITH_QUOTES.arg(OAUTH_VERIFIER) +- .arg(urlEncode(d->m_oauth1TokenVerifier))); ++ .arg(urlEncode(d->m_oauth1TokenVerifier).constData())); + authHeader.append(DELIMITER); + } + authHeader.append(EQUAL_WITH_QUOTES.arg(OAUTH_VERSION) +- .arg(urlEncode(OAUTH_VERSION_1))); ++ .arg(urlEncode(OAUTH_VERSION_1).constData())); + + return authHeader; + } +diff --git a/src/oauth1plugin.h b/src/oauth1plugin.h +index 3ff227a..aa37e26 100644 +--- a/src/oauth1plugin.h ++++ b/src/oauth1plugin.h +@@ -65,7 +65,7 @@ private: + const OAuth1PluginData &inData, + const QString ×tamp, + const QString &nonce); +- QString urlEncode(QString strData); ++ QByteArray urlEncode(QString strData); + QString createOAuth1Header(const QString &aUrl, OAuth1PluginData inData); + QByteArray hashHMACSHA1(const QByteArray &keyForHash ,const QByteArray &secret); + OAuth1PluginTokenData oauth1responseFromMap(const QVariantMap &map); +diff --git a/src/oauth2plugin.cpp b/src/oauth2plugin.cpp +index 8763f00..c7f7f84 100644 +--- a/src/oauth2plugin.cpp ++++ b/src/oauth2plugin.cpp +@@ -393,9 +393,9 @@ void OAuth2Plugin::process(const SignOn::SessionData &inData, + } + } + +-QString OAuth2Plugin::urlEncode(QString strData) ++QByteArray OAuth2Plugin::urlEncode(QString strData) + { +- return QUrl::toPercentEncoding(strData).constData(); ++ return QUrl::toPercentEncoding(strData); + } + + void OAuth2Plugin::userActionFinished(const SignOn::UiSessionData &data) +diff --git a/src/oauth2plugin.h b/src/oauth2plugin.h +index a16c316..389d3c3 100644 +--- a/src/oauth2plugin.h ++++ b/src/oauth2plugin.h +@@ -84,7 +84,7 @@ private: + QVariantMap parseJSONReply(const QByteArray &reply); + QVariantMap parseTextReply(const QByteArray &reply); + void handleOAuth2Error(const QByteArray &reply); +- QString urlEncode(QString strData); ++ QByteArray urlEncode(QString strData); + QUrl getAuthUrl(); + QUrl getTokenUrl(); + +-- +2.43.0 + diff --git a/net-libs/signon-oauth2/files/0006-Port-away-from-deprecated-QRegExp.patch b/net-libs/signon-oauth2/files/0006-Port-away-from-deprecated-QRegExp.patch new file mode 100644 index 000000000000..dc2ab505552d --- /dev/null +++ b/net-libs/signon-oauth2/files/0006-Port-away-from-deprecated-QRegExp.patch @@ -0,0 +1,43 @@ +From bef68f45e80c13501f836ec9d14aa3df682748e8 Mon Sep 17 00:00:00 2001 +From: Nicolas Fella <nicolas.fella@gmx.de> +Date: Sun, 15 Oct 2023 19:05:13 +0200 +Subject: [PATCH 06/10] Port away from deprecated QRegExp + +--- + tests/oauth2plugintest.cpp | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/tests/oauth2plugintest.cpp b/tests/oauth2plugintest.cpp +index f5221cc..5cbbab2 100644 +--- a/tests/oauth2plugintest.cpp ++++ b/tests/oauth2plugintest.cpp +@@ -26,7 +26,7 @@ + #include <QNetworkAccessManager> + #include <QNetworkReply> + #include <QPointer> +-#include <QRegExp> ++#include <QRegularExpression> + #include <QScopedPointer> + #include <QSignalSpy> + #include <QTimer> +@@ -749,7 +749,7 @@ void OAuth2PluginTest::testPluginHmacSha1Process() + QString authorizationHeader = + QString::fromUtf8(nam->m_lastRequest.rawHeader("Authorization")); + QStringList authorizationHeaderParts = +- authorizationHeader.split(QRegExp(",?\\s+")); ++ authorizationHeader.split(QRegularExpression(",?\\s+")); + QCOMPARE(authorizationHeaderParts[0], QString("OAuth")); + + /* The rest of the header should be a mapping, let's parse it */ +@@ -1535,7 +1535,7 @@ void OAuth2PluginTest::testOauth1UserActionFinished() + QString authorizationHeader = + QString::fromUtf8(nam->m_lastRequest.rawHeader("Authorization")); + QStringList authorizationHeaderParts = +- authorizationHeader.split(QRegExp(",?\\s+")); ++ authorizationHeader.split(QRegularExpression(",?\\s+")); + QCOMPARE(authorizationHeaderParts[0], QString("OAuth")); + + /* The rest of the header should be a mapping, let's parse it */ +-- +2.43.0 + diff --git a/net-libs/signon-oauth2/files/0007-Build-with-C-17.patch b/net-libs/signon-oauth2/files/0007-Build-with-C-17.patch new file mode 100644 index 000000000000..193923a6612a --- /dev/null +++ b/net-libs/signon-oauth2/files/0007-Build-with-C-17.patch @@ -0,0 +1,26 @@ +From e9d3bdbd4eb8331a03b0c49d6b3a6c020db11c7f Mon Sep 17 00:00:00 2001 +From: Nicolas Fella <nicolas.fella@gmx.de> +Date: Sun, 15 Oct 2023 19:06:05 +0200 +Subject: [PATCH 07/10] Build with C++17 + +Needed for Qt6 +--- + common-project-config.pri | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/common-project-config.pri b/common-project-config.pri +index 1d5cdc6..dc9b95d 100644 +--- a/common-project-config.pri ++++ b/common-project-config.pri +@@ -8,7 +8,7 @@ + #----------------------------------------------------------------------------- + + CONFIG += \ +- c++11 \ ++ c++17 \ + link_pkgconfig + #MOC_DIR = .moc + #OBJECTS_DIR = .obj +-- +2.43.0 + diff --git a/net-libs/signon-oauth2/files/0008-Use-correct-signon-in-example.patch b/net-libs/signon-oauth2/files/0008-Use-correct-signon-in-example.patch new file mode 100644 index 000000000000..50635d936909 --- /dev/null +++ b/net-libs/signon-oauth2/files/0008-Use-correct-signon-in-example.patch @@ -0,0 +1,29 @@ +From a275d6eacc71a1c0ac6a95e2c77a29b13e6c189e Mon Sep 17 00:00:00 2001 +From: Nicolas Fella <nicolas.fella@gmx.de> +Date: Sun, 15 Oct 2023 19:10:17 +0200 +Subject: [PATCH 08/10] Use correct signon in example + +--- + example/example.pro | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/example/example.pro b/example/example.pro +index 9b8ec65..1b2c6a8 100644 +--- a/example/example.pro ++++ b/example/example.pro +@@ -11,11 +11,7 @@ CONFIG += \ + link_pkgconfig + QT -= gui + +-lessThan(QT_MAJOR_VERSION, 5) { +- PKGCONFIG += libsignon-qt +-} else { +- PKGCONFIG += libsignon-qt5 +-} ++PKGCONFIG += libsignon-qt$$QT_MAJOR_VERSION + + HEADERS += \ + oauthclient.h +-- +2.43.0 + diff --git a/net-libs/signon-oauth2/files/0009-Port-away-from-deprecated-QString-SplitBehavior.patch b/net-libs/signon-oauth2/files/0009-Port-away-from-deprecated-QString-SplitBehavior.patch new file mode 100644 index 000000000000..67e4b07abc6d --- /dev/null +++ b/net-libs/signon-oauth2/files/0009-Port-away-from-deprecated-QString-SplitBehavior.patch @@ -0,0 +1,40 @@ +From 3ead61662e9b931ff2487869904c9be33cf97a85 Mon Sep 17 00:00:00 2001 +From: Nicolas Fella <nicolas.fella@gmx.de> +Date: Sun, 15 Oct 2023 19:13:10 +0200 +Subject: [PATCH 09/10] Port away from deprecated QString::SplitBehavior + +--- + src/oauth2plugin.cpp | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/src/oauth2plugin.cpp b/src/oauth2plugin.cpp +index c7f7f84..45510ad 100644 +--- a/src/oauth2plugin.cpp ++++ b/src/oauth2plugin.cpp +@@ -436,7 +436,11 @@ void OAuth2Plugin::userActionFinished(const SignOn::UiSessionData &data) + } else if (pair.first == STATE) { + state = pair.second; + } else if (pair.first == SCOPE) { ++#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) + respData.setScope(pair.second.split(' ', QString::SkipEmptyParts)); ++#else ++ respData.setScope(pair.second.split(' ', Qt::SkipEmptyParts)); ++#endif + } else { + extraFields.insert(pair.first, pair.second); + } +@@ -587,7 +591,11 @@ void OAuth2Plugin::serverReply(QNetworkReply *reply) + QStringList scope; + if (map.contains(SCOPE)) { + QString rawScope = QString::fromUtf8(map.take(SCOPE).toByteArray()); ++#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) + scope = rawScope.split(' ', QString::SkipEmptyParts); ++#else ++ scope = rawScope.split(' ', Qt::SkipEmptyParts); ++#endif + } else { + scope = d->m_oauth2Data.Scope(); + } +-- +2.43.0 + diff --git a/net-libs/signon-oauth2/files/0010-Port-away-from-deprecated-QList-toSet.patch b/net-libs/signon-oauth2/files/0010-Port-away-from-deprecated-QList-toSet.patch new file mode 100644 index 000000000000..59b3dd3700e4 --- /dev/null +++ b/net-libs/signon-oauth2/files/0010-Port-away-from-deprecated-QList-toSet.patch @@ -0,0 +1,34 @@ +From fab698862466994a8fdc9aa335c87b4f05430ce6 Mon Sep 17 00:00:00 2001 +From: Nicolas Fella <nicolas.fella@gmx.de> +Date: Sun, 15 Oct 2023 19:15:56 +0200 +Subject: [PATCH 10/10] Port away from deprecated QList::toSet + +--- + src/oauth2plugin.cpp | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/src/oauth2plugin.cpp b/src/oauth2plugin.cpp +index 45510ad..0c23b99 100644 +--- a/src/oauth2plugin.cpp ++++ b/src/oauth2plugin.cpp +@@ -256,9 +256,15 @@ bool OAuth2Plugin::respondWithStoredToken(const QVariantMap &token, + * we cannot use it now */ + if (!scopes.isEmpty()) { + if (!token.contains(SCOPES)) return false; +- QSet<QString> cachedScopes = +- token.value(SCOPES).toStringList().toSet(); ++ ++ QStringList scopesList = token.value(SCOPES).toStringList(); ++#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) ++ QSet<QString> cachedScopes = scopesList.toSet(); + if (!cachedScopes.contains(scopes.toSet())) return false; ++#else ++ QSet<QString> cachedScopes(scopesList.begin(), scopesList.end()); ++ if (!cachedScopes.contains(QSet(scopes.begin(), scopes.end()))) return false; ++#endif + } + + if (token.contains(TOKEN)) { +-- +2.43.0 + diff --git a/net-libs/signon-oauth2/files/signon-oauth2-0.25-drop-fno-rtti.patch b/net-libs/signon-oauth2/files/signon-oauth2-0.25-drop-fno-rtti.patch new file mode 100644 index 000000000000..04aad5416941 --- /dev/null +++ b/net-libs/signon-oauth2/files/signon-oauth2-0.25-drop-fno-rtti.patch @@ -0,0 +1,26 @@ +From 94e7cdbe1b15455e932a2272fdf2284fecfb9204 Mon Sep 17 00:00:00 2001 +From: Andreas Sturmlechner <asturm@gentoo.org> +Date: Wed, 11 Nov 2020 22:35:06 +0100 +Subject: [PATCH] Disable -fno-rtti + +Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org> +--- + common-project-config.pri | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/common-project-config.pri b/common-project-config.pri +index e149d90..9c7801a 100644 +--- a/common-project-config.pri ++++ b/common-project-config.pri +@@ -17,8 +17,7 @@ + UI_HEADERS_DIR = ui/include + UI_SOURCES_DIR = ui/src + +-QMAKE_CXXFLAGS += -fno-exceptions \ +- -fno-rtti ++QMAKE_CXXFLAGS += -fno-exceptions + + TOP_SRC_DIR = $$PWD + +-- +2.29.2 diff --git a/net-libs/signon-oauth2/metadata.xml b/net-libs/signon-oauth2/metadata.xml index 8641e5bdd399..ff21736a4492 100644 --- a/net-libs/signon-oauth2/metadata.xml +++ b/net-libs/signon-oauth2/metadata.xml @@ -5,4 +5,7 @@ <email>kde@gentoo.org</email> <name>Gentoo KDE Project</name> </maintainer> + <upstream> + <remote-id type="gitlab">accounts-sso/signon-plugin-oauth2</remote-id> + </upstream> </pkgmetadata> diff --git a/net-libs/signon-oauth2/signon-oauth2-0.25_p20210102.ebuild b/net-libs/signon-oauth2/signon-oauth2-0.25_p20210102.ebuild new file mode 100644 index 000000000000..dd60c8ff1151 --- /dev/null +++ b/net-libs/signon-oauth2/signon-oauth2-0.25_p20210102.ebuild @@ -0,0 +1,89 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +MY_PN=signon-plugin-oauth2 +MY_PV=VERSION_${PV} +MY_P=${MY_PN}-${MY_PV} +inherit qmake-utils + +if [[ ${PV} = *9999* ]] ; then + EGIT_REPO_URI="https://gitlab.com/nicolasfella/${MY_PN}.git/" + EGIT_BRANCH="qt6" + inherit git-r3 +else + COMMIT=d759439066f0a34e5ad352ebab0b3bb2790d429e + if [[ -n ${COMMIT} ]] ; then + SRC_URI="https://gitlab.com/accounts-sso/${MY_PN}/-/archive/${COMMIT}/${MY_PN}-${COMMIT}.tar.bz2 -> ${P}.tar.bz2" + S="${WORKDIR}/${MY_PN}-${COMMIT}" + else + SRC_URI="https://gitlab.com/accounts-sso/${MY_PN}/-/archive/${MY_PV}/${MY_P}.tar.bz2 -> ${P}.tar.bz2" + S="${WORKDIR}/${MY_P}" + fi + KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86" +fi + +DESCRIPTION="OAuth2 plugin for Signon daemon" +HOMEPAGE="https://gitlab.com/accounts-sso/signon-plugin-oauth2" + +LICENSE="LGPL-2.1" +SLOT="0" +# TODO: drop USE=qt5 and just have USE=qt6 to control which qt? +IUSE="+qt5 qt6 test" +REQUIRED_USE="|| ( qt5 qt6 )" +RESTRICT="!test? ( test )" + +RDEPEND=" + qt5? ( + dev-qt/qtcore:5 + dev-qt/qtnetwork:5[ssl] + ) + qt6? ( dev-qt/qtbase:6[network,ssl] ) + >=net-libs/signond-8.61-r100[qt5=,qt6=] +" +DEPEND=" + ${RDEPEND} + test? ( + qt5? ( dev-qt/qttest:5 ) + ) +" + +PATCHES=( + "${FILESDIR}"/0001-Port-QSignalSpys-to-PMF-syntax.patch + "${FILESDIR}"/0002-Port-to-new-connection-syntax.patch + "${FILESDIR}"/0003-Port-away-from-deprecated-error-signal.patch + "${FILESDIR}"/0004-Port-away-from-deprecated-qrand.patch + "${FILESDIR}"/0005-Fix-string-concatenation-in-Qt6.patch + "${FILESDIR}"/0006-Port-away-from-deprecated-QRegExp.patch + "${FILESDIR}"/0007-Build-with-C-17.patch + "${FILESDIR}"/0008-Use-correct-signon-in-example.patch + "${FILESDIR}"/0009-Port-away-from-deprecated-QString-SplitBehavior.patch + "${FILESDIR}"/0010-Port-away-from-deprecated-QList-toSet.patch + # downstream patches + "${FILESDIR}/${PN}-0.24-dont-install-tests.patch" + "${FILESDIR}/${PN}-0.25-pkgconfig-libdir.patch" + "${FILESDIR}/${PN}-0.25-drop-fno-rtti.patch" +) + +src_prepare() { + default + sed -i "s|@LIBDIR@|$(get_libdir)|g" src/signon-oauth2plugin.pc || die +} + +src_configure() { + local myqmakeargs=( + LIBDIR=/usr/$(get_libdir) + ) + use test || myqmakeargs+=( CONFIG+=nomake_tests ) + + if use qt6 ; then + eqmake6 "${myqmakeargs[@]}" + else + eqmake5 "${myqmakeargs[@]}" + fi +} + +src_install() { + emake INSTALL_ROOT="${D}" install +} |