From e2505001b626fe69cc53b02336fc4be78ff1fa73 Mon Sep 17 00:00:00 2001 From: Luca Weiss Date: Mon, 29 Nov 2021 23:26:19 +0100 Subject: community/presage: fix incompatibility with C++17 --- community/presage/APKBUILD | 10 +- community/presage/gcc11.patch | 265 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 272 insertions(+), 3 deletions(-) create mode 100644 community/presage/gcc11.patch (limited to 'community') diff --git a/community/presage/APKBUILD b/community/presage/APKBUILD index 8fcca16e8bf..f09abf3f102 100644 --- a/community/presage/APKBUILD +++ b/community/presage/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Bart Ribbers pkgname=presage pkgver=0.9.1 -pkgrel=1 +pkgrel=2 pkgdesc="An intelligent predictive text entry system" url="https://presage.sourceforge.io/" arch="all" @@ -22,6 +22,7 @@ makedepends="$depends_dev subpackages="$pkgname-static $pkgname-dev $pkgname-doc" source="https://downloads.sourceforge.net/project/presage/presage/$pkgver/presage-$pkgver.tar.gz gcc6.patch + gcc11.patch " prepare() { @@ -50,5 +51,8 @@ package() { DESTDIR="$pkgdir" make install } -sha512sums="46d7151a80e376d9a8a018be985b2c88a070a6f6555bf3d9b1f50aa41ea8e861c8e26ed3c25a5833855ae01004ecbd36408711e40baf4f072599c240f6c721b1 presage-0.9.1.tar.gz -276907303156d9262c3520ec912f0d984c31bb27a9d1c14132a9abc012cdff855d8272d4f163b42062369e30bf5cfaa1c149ff3551167694cb7220231aa37b5a gcc6.patch" +sha512sums=" +46d7151a80e376d9a8a018be985b2c88a070a6f6555bf3d9b1f50aa41ea8e861c8e26ed3c25a5833855ae01004ecbd36408711e40baf4f072599c240f6c721b1 presage-0.9.1.tar.gz +276907303156d9262c3520ec912f0d984c31bb27a9d1c14132a9abc012cdff855d8272d4f163b42062369e30bf5cfaa1c149ff3551167694cb7220231aa37b5a gcc6.patch +bfd6656b1bbab07363f72dc0f6af12818468b1e4372be683c5d678875f26374968775abdebbf9255becee535f4b70ede869f556897ea7349df169c8ce02511ec gcc11.patch +" diff --git a/community/presage/gcc11.patch b/community/presage/gcc11.patch new file mode 100644 index 00000000000..ad819751050 --- /dev/null +++ b/community/presage/gcc11.patch @@ -0,0 +1,265 @@ +Taken from openSUSE and fixes incompatibility with C++17 +https://build.opensuse.org/package/view_file/openSUSE:Factory/presage/presage-0.9.1-gcc11.patch?expand=1 + +Index: presage-0.9.1/src/lib/presage.cpp +=================================================================== +--- presage-0.9.1.orig/src/lib/presage.cpp ++++ presage-0.9.1/src/lib/presage.cpp +@@ -31,7 +31,7 @@ + #include "core/predictorActivator.h" + + Presage::Presage (PresageCallback* callback) +- throw (PresageException) ++ EXCEPT (PresageException) + { + profileManager = new ProfileManager(); + configuration = profileManager->get_configuration(); +@@ -42,7 +42,7 @@ Presage::Presage (PresageCallback* callb + } + + Presage::Presage (PresageCallback* callback, const std::string config_filename) +- throw (PresageException) ++ EXCEPT (PresageException) + { + profileManager = new ProfileManager(config_filename); + configuration = profileManager->get_configuration(); +@@ -62,7 +62,7 @@ Presage::~Presage() + } + + std::vector Presage::predict () +- throw (PresageException) ++ EXCEPT (PresageException) + { + std::vector result; + +@@ -88,7 +88,7 @@ std::vector Presage::predic + } + + std::multimap Presage::predict (std::vector filter) +- throw (PresageException) ++ EXCEPT (PresageException) + { + std::multimap result; + +@@ -137,20 +137,20 @@ std::multimap Presa + } + + void Presage::learn(const std::string text) const +- throw (PresageException) ++ EXCEPT (PresageException) + { + contextTracker->learn(text); // TODO: can pass additional param to + // learn to specify offline learning + } + + PresageCallback* Presage::callback (PresageCallback* callback) +- throw (PresageException) ++ EXCEPT (PresageException) + { + return const_cast(contextTracker->callback(callback)); + } + + std::string Presage::completion (const std::string str) +- throw (PresageException) ++ EXCEPT (PresageException) + { + // There are two types of completions: normal and erasing. + // normal_completion = prefix + remainder +@@ -198,37 +198,37 @@ std::string Presage::completion (const s + } + + std::string Presage::context () const +- throw (PresageException) ++ EXCEPT (PresageException) + { + return contextTracker->getPastStream(); + } + + bool Presage::context_change () const +- throw (PresageException) ++ EXCEPT (PresageException) + { + return contextTracker->contextChange(); + } + + std::string Presage::prefix () const +- throw (PresageException) ++ EXCEPT (PresageException) + { + return contextTracker->getPrefix(); + } + + std::string Presage::config (const std::string variable) const +- throw (PresageException) ++ EXCEPT (PresageException) + { + return configuration->find (variable)->get_value (); + } + + void Presage::config (const std::string variable, const std::string value) const +- throw (PresageException) ++ EXCEPT (PresageException) + { + configuration->insert (variable, value); + } + + void Presage::save_config () const +- throw (PresageException) ++ EXCEPT (PresageException) + { + profileManager->save_profile (); + } +Index: presage-0.9.1/src/lib/presage.h +=================================================================== +--- presage-0.9.1.orig/src/lib/presage.h ++++ presage-0.9.1/src/lib/presage.h +@@ -28,6 +28,12 @@ + #include "presageException.h" + #include "presageCallback.h" + ++#if __cplusplus >= 201103L ++#define EXCEPT(...) noexcept(false) ++#else ++#define EXCEPT(...) throw(__VA_ARGS__) ++#endif ++ + /** \mainpage + + \section intro_section Introduction +@@ -112,7 +118,7 @@ public: + * + * Presage does not take ownership of the callback object. + */ +- Presage(PresageCallback* callback) throw (PresageException); ++ Presage(PresageCallback* callback) EXCEPT(PresageException); + + + /** Creates and initializes presage with supplied configuration. +@@ -122,7 +128,7 @@ public: + * + * Presage does not take ownership of the callback object. + */ +- Presage(PresageCallback* callback, const std::string config) throw (PresageException); ++ Presage(PresageCallback* callback, const std::string config) EXCEPT(PresageException); + + + /** Destroys presage. +@@ -138,7 +144,7 @@ public: + * context. + * + */ +- std::vector predict() throw (PresageException); ++ std::vector predict() EXCEPT(PresageException); + + /** \brief Obtain a prediction that matches the supplied token + * filter. +@@ -153,7 +159,7 @@ public: + * of the filter tokens. + * + */ +- std::multimap predict(std::vector filter) throw (PresageException); ++ std::multimap predict(std::vector filter) EXCEPT(PresageException); + + /** \brief Learn from text offline. + * +@@ -167,7 +173,7 @@ public: + * \param text a text string to learn from. + * + */ +- void learn(const std::string text) const throw (PresageException); ++ void learn(const std::string text) const EXCEPT(PresageException); + + /** \brief Callback getter/setter. + * +@@ -176,7 +182,7 @@ public: + * + * \return pointer to previously used callback + */ +- PresageCallback* callback(PresageCallback* callback) throw (PresageException); ++ PresageCallback* callback(PresageCallback* callback) EXCEPT(PresageException); + + /** \brief Request presage to return the completion string for the given predicted token. + * +@@ -190,26 +196,26 @@ public: + * + * \return completion string + */ +- std::string completion(std::string str) throw (PresageException); ++ std::string completion(std::string str) EXCEPT(PresageException); + + /** \brief Returns the text entered so far. + * + * \return context, text entered so far. + */ +- std::string context() const throw (PresageException); ++ std::string context() const EXCEPT(PresageException); + + /** \brief Returns true if a context change occured. + * + * \return true if a context change occured after the last update + * or predict calls, or false otherwise. + */ +- bool context_change() const throw (PresageException); ++ bool context_change() const EXCEPT(PresageException); + + /** \brief Returns the current prefix. + * + * \return prefix + */ +- std::string prefix() const throw (PresageException); ++ std::string prefix() const EXCEPT(PresageException); + + /** \brief Gets the value of specified configuration variable. + * +@@ -218,7 +224,7 @@ public: + * + * \return value assigned to configuration variable. + */ +- std::string config(const std::string variable) const throw (PresageException); ++ std::string config(const std::string variable) const EXCEPT(PresageException); + + /** \brief Sets the value of specified configuration variable. + * +@@ -227,7 +233,7 @@ public: + * from the configuration file in use. + * + */ +- void config(const std::string variable, const std::string value) const throw (PresageException); ++ void config(const std::string variable, const std::string value) const EXCEPT(PresageException); + + /** \brief Save current configuration to file. + * +@@ -236,7 +242,7 @@ public: + * active XML profile. + * + */ +- void save_config() const throw (PresageException); ++ void save_config() const EXCEPT(PresageException); + + /* + * Presage public API ends here +From e9faf7fa918e75bdf26f3068794c97b34d14b406 Mon Sep 17 00:00:00 2001 +From: Martin Liska +Date: Wed, 12 May 2021 14:13:23 +0200 +Subject: [PATCH] Fix GCC 11 warning. + +--- + apps/gtk/gprompter/scintilla/gtk/ScintillaGTK.cxx | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/apps/gtk/gprompter/scintilla/gtk/ScintillaGTK.cxx b/apps/gtk/gprompter/scintilla/gtk/ScintillaGTK.cxx +index 926457b..8f4816d 100644 +--- a/apps/gtk/gprompter/scintilla/gtk/ScintillaGTK.cxx ++++ b/apps/gtk/gprompter/scintilla/gtk/ScintillaGTK.cxx +@@ -1626,7 +1626,7 @@ void ScintillaGTK::ReceivedDrop(GtkSelectionData *selection_data) { + drop.push_back('\0'); + NotifyURIDropped(&drop[0]); + } else if ((TypeOfGSD(selection_data) == GDK_TARGET_STRING) || (TypeOfGSD(selection_data) == atomUTF8)) { +- if (TypeOfGSD(selection_data) > 0) { ++ if (TypeOfGSD(selection_data) != NULL) { + SelectionText selText; + GetGtkSelectionText(selection_data, selText); + DropAt(posDrop, selText.Data(), selText.Length(), false, selText.rectangular); +-- +2.31.1 + -- cgit v1.2.3