summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Candau2023-10-14 20:49:44 +0200
committerRobin Candau2023-10-14 20:49:44 +0200
commit319b53fa9b926c8c9ab9ce1f0a73f645764b4a54 (patch)
treef610cfa87d9a2f9f8e7243f40d887fb81236bf6e
parent52c4cf6f8f4fe0684b9f2a84f59d98628c39d247 (diff)
downloadaur-319b53fa9b926c8c9ab9ce1f0a73f645764b4a54.tar.gz
Add temporary patch to fix string_view errors
https://github.com/Slackadays/Clipboard/issues/168 https://github.com/Slackadays/Clipboard/commit/ac5982df045034f60e73d0ef81a3fe9ed3225c6b
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD19
-rw-r--r--fix_string_view_error.patch23
3 files changed, 41 insertions, 5 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 3601c5f5c3c5..a46c7be9089b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = clipboard
pkgdesc = Cut, copy, and paste anything in your terminal.
pkgver = 0.8.3
- pkgrel = 1
+ pkgrel = 2
url = https://getclipboard.app
arch = x86_64
arch = aarch64
@@ -16,6 +16,8 @@ pkgbase = clipboard
optdepends = wayland: Wayland support
optdepends = wayland-protocols: Wayland support
source = clipboard-0.8.3.tar.gz::https://github.com/Slackadays/Clipboard/archive/0.8.3.tar.gz
+ source = fix_string_view_error.patch
sha256sums = d2f13e66e4b45d2084e2f88b992b36f07faf649fa1a1c5e0acfca303270a988c
+ sha256sums = f9a5852ac44058644816214ba4a294b728c0415054e7dd3e9079e364f2e7c2cd
pkgname = clipboard
diff --git a/PKGBUILD b/PKGBUILD
index a062093a0ed1..71d44cc98b1e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
pkgname=clipboard
_pkgname=Clipboard
pkgver=0.8.3
-pkgrel=1
+pkgrel=2
pkgdesc="Cut, copy, and paste anything in your terminal."
arch=('x86_64' 'aarch64' 'riscv64')
url="https://getclipboard.app"
@@ -13,10 +13,21 @@ makedepends=('cmake' 'libx11' 'wayland' 'wayland-protocols')
optdepends=('libx11: X11 support'
'wayland: Wayland support'
'wayland-protocols: Wayland support')
-source=("${pkgname}-${pkgver}.tar.gz::https://github.com/Slackadays/Clipboard/archive/${pkgver}.tar.gz")
-sha256sums=('d2f13e66e4b45d2084e2f88b992b36f07faf649fa1a1c5e0acfca303270a988c')
+source=("${pkgname}-${pkgver}.tar.gz::https://github.com/Slackadays/Clipboard/archive/${pkgver}.tar.gz"
+ "fix_string_view_error.patch")
+sha256sums=('d2f13e66e4b45d2084e2f88b992b36f07faf649fa1a1c5e0acfca303270a988c'
+ 'f9a5852ac44058644816214ba4a294b728c0415054e7dd3e9079e364f2e7c2cd')
-build () {
+prepare() {
+ cd "${_pkgname}-${pkgver}"
+
+ # Temporary patch to fix build
+ # https://github.com/Slackadays/Clipboard/issues/168
+ # https://github.com/Slackadays/Clipboard/commit/ac5982df045034f60e73d0ef81a3fe9ed3225c6b
+ patch -Np1 < "${srcdir}/fix_string_view_error.patch"
+}
+
+build() {
export CFLAGS="${CFLAGS} -DNDEBUG"
export CXXFLAGS="${CXXFLAGS} -DNDEBUG"
diff --git a/fix_string_view_error.patch b/fix_string_view_error.patch
new file mode 100644
index 000000000000..fd931dce9489
--- /dev/null
+++ b/fix_string_view_error.patch
@@ -0,0 +1,23 @@
+diff --git a/src/cb/src/utils.cpp b/src/cb/src/utils.cpp
+index ad65095..807a1ae 100644
+--- a/src/cb/src/utils.cpp
++++ b/src/cb/src/utils.cpp
+@@ -165,14 +165,16 @@ std::string formatColors(const std::string_view& oldStr, bool colorful) {
+ std::string newStr;
+ newStr.reserve(oldStr.size());
+ for (size_t i = 0, lastAddedi = 0; i < oldStr.size(); i++) {
+- while (oldStr[i] != '[' && i < oldStr.size())
++ while (i < oldStr.size() && oldStr[i] != '[')
+ i++;
+
+ newStr += oldStr.substr(lastAddedi, i - lastAddedi);
+
++ if (i == oldStr.size()) break;
++
+ auto j = oldStr.find(']', i + 1);
+ if (j == std::string::npos) {
+- newStr += oldStr[i]; // no match, so just add the bracket
++ newStr += '['; // no match, so just add the bracket
+ break;
+ }
+