aboutsummaryrefslogtreecommitdiffstats
path: root/deskutils/gcalcli
diff options
context:
space:
mode:
authorkoobs <koobs@FreeBSD.org>2016-07-30 18:51:46 +0800
committerkoobs <koobs@FreeBSD.org>2016-07-30 18:51:46 +0800
commit8aa1b7e57b7ca4f62f4b79c008ace45652a9030d (patch)
treeafd8639050d0568359f087f8849e7c74557c2cee /deskutils/gcalcli
parent40485136c58e2dcb1a3075220eaca6747751637a (diff)
downloadfreebsd-ports-gnome-8aa1b7e57b7ca4f62f4b79c008ace45652a9030d.tar.gz
freebsd-ports-gnome-8aa1b7e57b7ca4f62f4b79c008ace45652a9030d.tar.zst
freebsd-ports-gnome-8aa1b7e57b7ca4f62f4b79c008ace45652a9030d.zip
deskutils/gcalcli: Fix for oauth2client > 1.4.12
gcalcli requires a dependency on oauth2client <= 1.4.12 to work correctly, as higher versions replaced the run() method with run_flow(). The version of oauth2client in ports is 2.2.0 at the time of writing. Fixes for the issue [1][2][3] have been submitted upstream in multiple cases, although upstream has closed them as duplicates of a refactor issue [4] that is yet to be committed/resolved. This commit commits the proposed change in issue #229 [2]. While I'm here: * Explicitly specify (and limit) supported Python versions to -2.x * Add python to CATEGORIES * Group, re-order and sort USE{s}, NO_* and files/plist sections * Capitalize OPTIONS descriptions [1] https://github.com/insanum/gcalcli/pull/211 [2] https://github.com/insanum/gcalcli/issues/229 [3] https://github.com/insanum/gcalcli/issues/244 [4] https://github.com/insanum/gcalcli/issues/165 PR: 206045 Submitted by: Lawrence Chen <beastie tardisi com> Approved by: portmgr (maintainer timeout, 6+ months) MFH: 2016Q3
Diffstat (limited to 'deskutils/gcalcli')
-rw-r--r--deskutils/gcalcli/Makefile26
-rw-r--r--deskutils/gcalcli/files/patch-gcalcli33
2 files changed, 46 insertions, 13 deletions
diff --git a/deskutils/gcalcli/Makefile b/deskutils/gcalcli/Makefile
index 4c7901fcd371..1bc97bfce453 100644
--- a/deskutils/gcalcli/Makefile
+++ b/deskutils/gcalcli/Makefile
@@ -4,7 +4,8 @@
PORTNAME= gcalcli
PORTVERSION= 3.2
DISTVERSIONPREFIX= v
-CATEGORIES= deskutils
+PORTREVISION= 1
+CATEGORIES= deskutils python
MAINTAINER= ports@thelanman.net
COMMENT= Google Calendar Command Line Interface
@@ -17,29 +18,28 @@ RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}dateutil>=0:devel/py-dateutil \
${PYTHON_SITELIBDIR}/apiclient/__init__.py:www/py-google-api-python-client \
${PYTHON_SITELIBDIR}/httplib2/__init__.py:www/py-httplib2
+USES= python:-2.7
USE_GITHUB= yes
-GH_ACCOUNT= insanum
-
-USES= python
-
-NO_BUILD= yes
-NO_ARCH= yes
-
-PORTDOCS= README.md gcalcli_?.png
-PLIST_FILES= bin/gcalcli
+GH_ACCOUNT= insanum
OPTIONS_DEFINE= DOCS FUZZYDATES ICS_VCAL SIMPLEJSON
OPTIONS_DEFAULT= ICS_VCAL
-ICS_VCAL_DESC= enable importing of ics/vcal files
-SIMPLEJSON_DESC= use simplejson for url shortening
-FUZZYDATES_DESC= use parsedatetime for fuzzy date parsing
+ICS_VCAL_DESC= Enable importing of ics/vcal files
+SIMPLEJSON_DESC= Use simplejson for url shortening
+FUZZYDATES_DESC= Use parsedatetime for fuzzy date parsing
ICS_VCAL_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}vobject>=0.4.8:deskutils/py-vobject
SIMPLEJSON_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}simplejson>=0:devel/py-simplejson
FUZZYDATES_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}parsedatetime>=0:devel/py-parsedatetime
+NO_BUILD= yes
+NO_ARCH= yes
+
+PORTDOCS= README.md gcalcli_?.png
+PLIST_FILES= bin/gcalcli
+
do-install:
${MKDIR} ${STAGEDIR}${PREFIX}/bin
${INSTALL_SCRIPT} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
diff --git a/deskutils/gcalcli/files/patch-gcalcli b/deskutils/gcalcli/files/patch-gcalcli
new file mode 100644
index 000000000000..46f21639c191
--- /dev/null
+++ b/deskutils/gcalcli/files/patch-gcalcli
@@ -0,0 +1,33 @@
+# ERROR: Missing module - cannot import name run (revisit #204)
+# https://github.com/insanum/gcalcli/issues/229
+
+--- gcalcli.orig 2014-12-17 01:50:24 UTC
++++ gcalcli
+@@ -185,7 +185,8 @@ try:
+ from apiclient.discovery import build
+ from oauth2client.file import Storage
+ from oauth2client.client import OAuth2WebServerFlow
+- from oauth2client.tools import run
++ from oauth2client.tools import run_flow
++ from oauth2client.tools import argparser
+ except ImportError as e:
+ print "ERROR: Missing module - %s" % e.args[0]
+ sys.exit(1)
+@@ -627,14 +628,15 @@ class gcalcli:
+ credentials = storage.get()
+
+ if credentials is None or credentials.invalid:
+- credentials = run(
++ args, unknown = argparser.parse_known_args(sys.argv)
++ credentials = run_flow(
+ OAuth2WebServerFlow(
+ client_id=self.client_id,
+ client_secret=self.client_secret,
+ scope=['https://www.googleapis.com/auth/calendar',
+ 'https://www.googleapis.com/auth/urlshortener'],
+ user_agent=__program__+'/'+__version__),
+- storage)
++ storage, args)
+
+ self.authHttp = credentials.authorize(httplib2.Http())
+