forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net-im/yowsup: add python3.7 support
Also switch from dev-python/pycrpto to dev-python/pycrptodome, as it's more modern. Besides, renamed six patch, to have a proper file name. Package-Manager: Portage-2.3.52, Repoman-2.3.12 Signed-off-by: Conrad Kostecki <[email protected]> Signed-off-by: Patrice Clement <[email protected]>
- Loading branch information
Showing
5 changed files
with
116 additions
and
1 deletion.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
net-im/yowsup/files/yowsup-2.5.7-add-python3.7-support.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
Description: Fix compatibility with Python 3.7 since async has become a reserved word | ||
Author: Josue Ortega <[email protected]> | ||
Last-Update: 2018-07-29 | ||
|
||
--- a/yowsup/demos/cli/layer.py | ||
+++ b/yowsup/demos/cli/layer.py | ||
@@ -559,7 +559,7 @@ | ||
mediaUploader = MediaUploader(jid, self.getOwnJid(), filePath, | ||
resultRequestUploadIqProtocolEntity.getUrl(), | ||
resultRequestUploadIqProtocolEntity.getResumeOffset(), | ||
- successFn, self.onUploadError, self.onUploadProgress, async=False) | ||
+ successFn, self.onUploadError, self.onUploadProgress, asyncronous=False) | ||
mediaUploader.start() | ||
|
||
def onRequestUploadError(self, jid, path, errorRequestUploadIqProtocolEntity, requestUploadIqProtocolEntity): | ||
--- a/yowsup/layers/interface/interface.py | ||
+++ b/yowsup/layers/interface/interface.py | ||
@@ -125,7 +125,7 @@ | ||
mediaUploader = MediaUploader(builder.jid, self.getOwnJid(), builder.getFilepath(), | ||
resultRequestUploadIqProtocolEntity.getUrl(), | ||
resultRequestUploadIqProtocolEntity.getResumeOffset(), | ||
- successFn, errorFn, progress, async=True) | ||
+ successFn, errorFn, progress, asyncronous=True) | ||
mediaUploader.start() | ||
|
||
def __onRequestUploadError(self, errorEntity, requestUploadEntity, builder, error = None): | ||
--- a/yowsup/layers/protocol_media/mediauploader.py | ||
+++ b/yowsup/layers/protocol_media/mediauploader.py | ||
@@ -9,10 +9,11 @@ | ||
logger = logging.getLogger(__name__) | ||
|
||
class MediaUploader(WARequest, threading.Thread): | ||
- def __init__(self, jid, accountJid, sourcePath, uploadUrl, resumeOffset = 0, successClbk = None, errorClbk = None, progressCallback = None, async = True): | ||
+ def __init__(self, jid, accountJid, sourcePath, uploadUrl, resumeOffset=0, successClbk=None, | ||
+ errorClbk=None, progressCallback=None, asyncronous=True): | ||
WARequest.__init__(self) | ||
|
||
- self.async = async | ||
+ self.asyncronous = asyncronous | ||
self.jid = jid | ||
self.accountJid = accountJid | ||
self.sourcePath = sourcePath | ||
@@ -30,7 +31,7 @@ | ||
self.sock = socket.socket() | ||
|
||
def start(self): | ||
- if self.async: | ||
+ if self.asyncronous: | ||
threading.Thread.__init__(self) | ||
super(MediaUploader, self).start() | ||
else: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Description: Fixes wrong installation of mime.types file. | ||
Author: Josue Ortega <[email protected]> | ||
Last-Update: 2016-09-04 | ||
|
||
--- a/setup.py | ||
+++ b/setup.py | ||
@@ -33,7 +33,7 @@ | ||
#long_description=long_description, | ||
packages= find_packages(), | ||
include_package_data=True, | ||
- data_files = [('yowsup/common', ['yowsup/common/mime.types'])], | ||
+ #data_files = [('yowsup/common', ['yowsup/common/mime.types'])], | ||
platforms='any', | ||
#test_suite='', | ||
classifiers = [ | ||
--- a/yowsup/common/tools.py | ||
+++ b/yowsup/common/tools.py | ||
@@ -150,7 +150,9 @@ | ||
return preview | ||
|
||
class MimeTools: | ||
- MIME_FILE = os.path.join(os.path.dirname(__file__), 'mime.types') | ||
+ # Replaces mime.types path for the debian path installation | ||
+ # MIME_FILE = os.path.join(os.path.dirname(__file__), 'mime.types') | ||
+ MIME_FILE = os.path.join('/usr/share/yowsup/common', 'mime.types') | ||
mimetypes.init() # Load default mime.types | ||
try: | ||
mimetypes.init([MIME_FILE]) # Append whatsapp mime.types |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Copyright 1999-2018 Gentoo Authors | ||
# Distributed under the terms of the GNU General Public License v2 | ||
|
||
EAPI=7 | ||
|
||
PYTHON_COMPAT=( python2_7 python3_{4,5,6,7} ) | ||
PYTHON_REQ_USE="readline" | ||
|
||
inherit distutils-r1 | ||
|
||
DESCRIPTION="A library that enables you to build applications which use the WhatsApp service" | ||
HOMEPAGE="https://github.com/tgalal/yowsup" | ||
SRC_URI="https://github.com/tgalal/yowsup/archive/v${PV}.tar.gz -> ${P}.tar.gz" | ||
|
||
LICENSE="GPL-3" | ||
SLOT="0" | ||
KEYWORDS="~amd64 ~x86" | ||
|
||
RDEPEND=" | ||
dev-python/configargparse[${PYTHON_USEDEP}] | ||
dev-python/pillow[${PYTHON_USEDEP}] | ||
dev-python/protobuf-python[${PYTHON_USEDEP}] | ||
dev-python/pycryptodome[${PYTHON_USEDEP}] | ||
dev-python/python-axolotl-curve25519[${PYTHON_USEDEP}] | ||
dev-python/python-dateutil[${PYTHON_USEDEP}] | ||
" | ||
|
||
DEPEND="${RDEPEND}" | ||
|
||
BDEPEND="dev-python/setuptools[${PYTHON_USEDEP}]" | ||
|
||
PATCHES=( | ||
"${FILESDIR}/${P}-add-python3.7-support.patch" | ||
"${FILESDIR}/${P}-fix-install-path.patch" | ||
"${FILESDIR}/${P}-fix-newer-six.patch" | ||
) |