[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#986929: unblock/tpu: nheko/0.7.2-3+deb11u1



Andreas, thank you for preparing the patch.

As mentioned in
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=986519#47 I have an
alternative patch that removes the code that caused the ICE by removing
the dependency on tweeny.  This patch comes from upstream and is part of
their latest release.  This change is quite a bit bigger than Andreas'
patch, but I hope that it is considered "minimal" enough to be applied.
If not, then I have no objections to Andreas' patch being used instead.

Again, this needs to go through tpu since sid has a newer version (which
was blocked from migrating to testing when it was uploaded due to the
ICE).

Alternatively, I could upload the latest upstream version of nheko to
sid, which as I mentioned removes the code that causes the ICE.  But I
suppose that would be asking for too much. ;)

Thanks

commit a3100e993bc526e365d3f6fab3d07b159ed5b6a6
Author: Hubert Chathi <uhoreg@debian.org>
Date:   Thu Apr 15 17:45:24 2021 -0400

    apply upstream patch to not use tweeny

diff --git a/debian/changelog b/debian/changelog
index 3530c57f..b46c707c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+nheko (0.7.2-3+deb11u1) bullseye; urgency=medium
+
+  * debian/control, patches/no_tweeny:
+    * Don't use tweeny, to avoid a compiler error in gcc-10. (Closes: #986519)
+
+ -- Hubert Chathi <uhoreg@debian.org>  Thu, 15 Apr 2021 17:10:18 -0400
+
 nheko (0.7.2-3) unstable; urgency=medium
 
   * debian/control:
diff --git a/debian/control b/debian/control
index 0121dc83..ad7f9d47 100644
--- a/debian/control
+++ b/debian/control
@@ -22,7 +22,6 @@ Build-Depends: cmake (>= 3.15)
  , libspdlog-dev (>= 1.5.0+ds-4)
  , libsodium-dev
  , libssl-dev
- , libtweeny-dev
  , nlohmann-json3-dev (>= 3.7.0-2~)
  , qtbase5-dev (>= 5.10)
  , qtdeclarative5-dev
diff --git a/debian/patches/no_find_tweeny b/debian/patches/no_find_tweeny
deleted file mode 100644
index ac7f8cdc..00000000
--- a/debian/patches/no_find_tweeny
+++ /dev/null
@@ -1,18 +0,0 @@
-Description: Don't use cmake to find tweeny
- Hardcode the path to tweeny.
-Author: Hubert Chathi <uhoreg@debian.org>
-
-Last-Update: 2020-04-22
-
---- nheko-0.7.0.orig/CMakeLists.txt
-+++ nheko-0.7.0/CMakeLists.txt
-@@ -418,7 +418,8 @@ if(USE_BUNDLED_TWEENY)
- 		)
- 	FetchContent_MakeAvailable(Tweeny)
- else()
--	find_package(Tweeny REQUIRED)
-+	add_library(tweeny INTERFACE)
-+	target_include_directories(tweeny INTERFACE /usr/include/tweeny)
- endif()
- 
- # single instance functionality
diff --git a/debian/patches/no_tweeny b/debian/patches/no_tweeny
new file mode 100644
index 00000000..004c5b97
--- /dev/null
+++ b/debian/patches/no_tweeny
@@ -0,0 +1,167 @@
+Description: Remove tweeny
+Author: Nicolas Werner <nicolas.werner@hotmail.de>
+
+---
+Origin: upstream
+Bug-Debian: https://bugs.debian.org/986519
+Forwarded: not-needed
+Last-Update: 2021-04-15
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 1a4c4b70..42a2b387 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -39,8 +39,6 @@ option(USE_BUNDLED_LMDB "Use the bundled version of lmdb."
+ 	${HUNTER_ENABLED})
+ option(USE_BUNDLED_LMDBXX "Use the bundled version of lmdb++."
+ 	${HUNTER_ENABLED})
+-option(USE_BUNDLED_TWEENY "Use the bundled version of tweeny."
+-	${HUNTER_ENABLED})
+ 
+ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
+ 
+@@ -446,18 +444,6 @@ else()
+ 	add_library(lmdbxx::lmdbxx ALIAS lmdbxx)
+ endif()
+ 
+-if(USE_BUNDLED_TWEENY)
+-	include(FetchContent)
+-	FetchContent_Declare(
+-		Tweeny
+-		GIT_REPOSITORY https://github.com/mobius3/tweeny.git
+-		GIT_TAG        6a5033372fe53c4c731c66c8a2d56261746cd85c #v3 <- v3 has unfixed warnings
+-		)
+-	FetchContent_MakeAvailable(Tweeny)
+-else()
+-	find_package(Tweeny REQUIRED)
+-endif()
+-
+ # single instance functionality
+ set(QAPPLICATION_CLASS QApplication CACHE STRING "Inheritance class for SingleApplication")
+ add_subdirectory(third_party/SingleApplication-3.1.3.1/)
+@@ -643,7 +629,6 @@ target_link_libraries(nheko PRIVATE
+ 	nlohmann_json::nlohmann_json
+ 	lmdbxx::lmdbxx
+ 	liblmdb::lmdb
+-	tweeny
+ 	SingleApplication::SingleApplication)
+ 
+ if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16.0")
+diff --git a/src/ui/SnackBar.cpp b/src/ui/SnackBar.cpp
+index 03609802..2453369d 100644
+--- a/src/ui/SnackBar.cpp
++++ b/src/ui/SnackBar.cpp
+@@ -1,7 +1,5 @@
+ #include <QPainter>
+ 
+-#include <tweeny.h>
+-
+ #include "SnackBar.h"
+ 
+ constexpr int STARTING_OFFSET         = 1;
+@@ -16,6 +14,7 @@ constexpr double MIN_WIDTH_PERCENTAGE = 0.3;
+ 
+ SnackBar::SnackBar(QWidget *parent)
+   : OverlayWidget(parent)
++  , offset_anim(this, "offset", this)
+ {
+         QFont font;
+         font.setPointSizeF(font.pointSizeF() * 1.2);
+@@ -28,17 +27,16 @@ SnackBar::SnackBar(QWidget *parent)
+ 
+         hideTimer_.setSingleShot(true);
+ 
+-        auto offset_anim = tweeny::from(1.0f).to(0.0f).during(100).via(tweeny::easing::cubicOut);
+-        connect(&showTimer_, &QTimer::timeout, this, [this, offset_anim]() mutable {
+-                if (offset_anim.progress() < 1.0f) {
+-                        offset_ = offset_anim.step(0.07f);
++        offset_anim.setStartValue(1.0);
++        offset_anim.setEndValue(0.0);
++        offset_anim.setDuration(100);
++        offset_anim.setEasingCurve(QEasingCurve::OutCubic);
++
++        connect(this, &SnackBar::offsetChanged, this, [this]() mutable {
+                         repaint();
+-                } else {
+-                        showTimer_.stop();
+-                        hideTimer_.start(ANIMATION_DURATION);
+-                        offset_anim.seek(0.0f);
+-                }
+         });
++        connect(
++          &offset_anim, &QPropertyAnimation::finished, this, [this]() { hideTimer_.start(10000); });
+ 
+         connect(&hideTimer_, SIGNAL(timeout()), this, SLOT(hideMessage()));
+ 
+@@ -54,7 +52,7 @@ SnackBar::start()
+         show();
+         raise();
+ 
+-        showTimer_.start(10);
++        offset_anim.start();
+ }
+ 
+ void
+@@ -77,7 +75,6 @@ SnackBar::hideMessage()
+ void
+ SnackBar::stopTimers()
+ {
+-        showTimer_.stop();
+         hideTimer_.stop();
+ }
+ 
+diff --git a/src/ui/SnackBar.h b/src/ui/SnackBar.h
+index 5459159e..8d127933 100644
+--- a/src/ui/SnackBar.h
++++ b/src/ui/SnackBar.h
+@@ -6,6 +6,7 @@
+ 
+ #include <QCoreApplication>
+ #include <QPaintEvent>
++#include <QPropertyAnimation>
+ #include <QTimer>
+ #include <deque>
+ 
+@@ -23,6 +24,7 @@ class SnackBar : public OverlayWidget
+ 
+         Q_PROPERTY(QColor bgColor READ backgroundColor WRITE setBackgroundColor)
+         Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor)
++        Q_PROPERTY(double offset READ offset WRITE setOffset NOTIFY offsetChanged)
+ 
+ public:
+         explicit SnackBar(QWidget *parent);
+@@ -46,9 +48,21 @@ public:
+                 update();
+         }
+ 
++        double offset() { return offset_; }
++        void setOffset(double offset)
++        {
++                if (offset != offset_) {
++                        offset_ = offset;
++                        emit offsetChanged();
++                }
++        }
++
+ public slots:
+         void showMessage(const QString &msg);
+ 
++signals:
++        void offsetChanged();
++
+ protected:
+         void paintEvent(QPaintEvent *event) override;
+         void mousePressEvent(QMouseEvent *event) override;
+@@ -68,10 +82,11 @@ private:
+ 
+         std::deque<QString> messages_;
+ 
+-        QTimer showTimer_;
+         QTimer hideTimer_;
+ 
+         double boxHeight_;
+ 
++        QPropertyAnimation offset_anim;
++
+         SnackBarPosition position_;
+ };
diff --git a/debian/patches/series b/debian/patches/series
index c1f79000..00886dd7 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,2 @@
-no_find_tweeny
+no_tweeny
 no_compile_qml

Reply to: