Skip to content

Instantly share code, notes, and snippets.

@mercutiodesign
Created April 29, 2020 10:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mercutiodesign/8b341a5ca955d62bcb69ce21274f9e23 to your computer and use it in GitHub Desktop.
Save mercutiodesign/8b341a5ca955d62bcb69ce21274f9e23 to your computer and use it in GitHub Desktop.
From 3f3b14c29d764be488275df1ee734441444bfc8e Mon Sep 17 00:00:00 2001
From: Martin Dreher <martin@thinkpad>
Date: Wed, 29 Apr 2020 12:27:55 +0200
Subject: [PATCH] allow prompt_toolkit 3
---
PKGBUILD | 15 +++++++++++----
allow-prompt_toolkit3.patch | 11 +++++++++++
2 files changed, 22 insertions(+), 4 deletions(-)
create mode 100644 allow-prompt_toolkit3.patch
diff --git a/PKGBUILD b/PKGBUILD
index dce9a0c..0e4a421 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@
pkgname=mycli
pkgver=1.21.1
-pkgrel=1
+pkgrel=2
pkgdesc='A Terminal Client for MySQL with AutoCompletion and Syntax Highlighting'
arch=('any')
url='https://github.com/dbcli/mycli'
@@ -15,7 +15,6 @@ depends=(
'python-configobj'
'python-cryptography'
'python-prompt_toolkit>=2.0.6'
- 'python-prompt_toolkit<3.0.0'
'python-pygments'
'python-pymysql'
'python-sqlparse'
@@ -25,8 +24,16 @@ makedepends=('python-setuptools')
optdepends=('python-paramiko: SSH support')
options=(!emptydirs)
-source=("$pkgname-$pkgver.tar.gz::https://github.com/dbcli/mycli/archive/v${pkgver}.tar.gz")
-sha256sums=('89592e9e3f73044b75324c0dac2fd47e0c867ed8f9562cd4af5050a3b9c44177')
+source=("$pkgname-$pkgver.tar.gz::https://github.com/dbcli/mycli/archive/v${pkgver}.tar.gz"
+ "allow-prompt_toolkit3.patch")
+sha256sums=('89592e9e3f73044b75324c0dac2fd47e0c867ed8f9562cd4af5050a3b9c44177'
+ 'e58825972f37efa9ec2cf04171ef6ba025fe5045db18cb7210f7a9a6b9254e34')
+
+prepare() {
+ cd "$pkgname-$pkgver"
+ patch -p1 -i "$srcdir/allow-prompt_toolkit3.patch"
+}
+
build() {
cd "$srcdir/$pkgname-$pkgver"
diff --git a/allow-prompt_toolkit3.patch b/allow-prompt_toolkit3.patch
new file mode 100644
index 0000000..87bf7d5
--- /dev/null
+++ b/allow-prompt_toolkit3.patch
@@ -0,0 +1,11 @@
+--- a/setup.py 2020-04-29 12:31:09.566373724 +0200
++++ b/setup.py 2020-04-29 12:31:22.369228947 +0200
+@@ -19,7 +19,7 @@
+ install_requirements = [
+ 'click >= 7.0',
+ 'Pygments >= 1.6',
+- 'prompt_toolkit>=2.0.6,<3.0.0',
++ 'prompt_toolkit>=2.0.6',
+ 'PyMySQL >= 0.9.2',
+ 'sqlparse>=0.3.0,<0.4.0',
+ 'configobj >= 5.0.5',
--
2.26.2
@ArafatRakib
Copy link

thanks for your work. Can you please tell me how can i apply this patch?
I am new to this type of things.
Thanks in advance.

@ArafatRakib
Copy link

I tried using patch setup.py -i 0001-allow-prompt_toolkit-3.patch which failed showing these
patching file setup.py Hunk #1 FAILED at 4. Hunk #2 FAILED at 15. Hunk #3 FAILED at 25. 3 out of 3 hunks FAILED -- saving rejects to file setup.py.rej The next patch would create the file setup.py, which already exists! Assume -R? [n] Apply anyway? [n] Skipping patch. 1 out of 1 hunk ignored

@pengux
Copy link

pengux commented May 2, 2020

@ArafatRakib This is to patch the PKGBUILD file actually, not the setup.py. For example:

  1. Download this patch into tmp.patch
  2. In the package snapshot folder (where the PKGBUILD file is), run:
    patch --forward --strip=1 --input="tmp.patch"
  3. Run makepkg -s

@mercutiodesign
Copy link
Author

@ArafatRakib yes, like pengux mentioned, this is an update to the PKGBUILD and it also contains a patch to the setup.py.
If you have it downloaded to 0001-allow-prompt_toolkit-3.patch then you can apply it with

patch -i 0001-allow-prompt_toolkit-3.patch

@ArafatRakib
Copy link

@pengux thanks a lot. 🙏🏼
@mercutiodesign thaks a lot.🙏🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment