aboutsummaryrefslogtreecommitdiffstats
path: root/www/grail
diff options
context:
space:
mode:
authorperky <perky@FreeBSD.org>2003-11-19 17:36:42 +0800
committerperky <perky@FreeBSD.org>2003-11-19 17:36:42 +0800
commit8f34ac6daf876be8dc5cd5d1ca8591396228702f (patch)
tree62cc9f25d9b8f6230472129375ff23d094928a34 /www/grail
parent6a5efa047a7ac79631a39ae403000183510f5767 (diff)
downloadfreebsd-ports-gnome-8f34ac6daf876be8dc5cd5d1ca8591396228702f.tar.gz
freebsd-ports-gnome-8f34ac6daf876be8dc5cd5d1ca8591396228702f.tar.zst
freebsd-ports-gnome-8f34ac6daf876be8dc5cd5d1ca8591396228702f.zip
Port to Python 2.x (up to 2.2 yet)
PR: 50230 Submitted by: thinker@branda.to
Diffstat (limited to 'www/grail')
-rw-r--r--www/grail/Makefile11
-rw-r--r--www/grail/files/grail2
-rw-r--r--www/grail/files/patch-ab24
-rw-r--r--www/grail/files/patch-ac63
4 files changed, 93 insertions, 7 deletions
diff --git a/www/grail/Makefile b/www/grail/Makefile
index 09b13f1a5613..42fa48e9d186 100644
--- a/www/grail/Makefile
+++ b/www/grail/Makefile
@@ -7,20 +7,18 @@
PORTNAME= grail
PORTVERSION= 0.6
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= www python
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR=grail
EXTRACT_SUFX= .tgz
-MAINTAINER= ports@freebsd.org
+MAINTAINER= ports@FreeBSD.org
COMMENT= An extensible Internet browser written entirely in Python
RUN_DEPENDS= ${PYTHON_SITELIBDIR}/_tkinter.so:${PORTSDIR}/x11-toolkits/py-tkinter
-IGNORE= "Doesn\'t seem to work with Python 2.x"
-
-USE_PYTHON= yes
+USE_PYTHON= -2.2
GRAILSUBDIR= share/grail
GRAILDIR= ${PREFIX}/${GRAILSUBDIR}
DIRS_CMD= ${SED} -e '/^@dirrm/bok' -e 'D' -e ':ok' -e 's,@dirrm ,,' < ${PLIST}
@@ -43,7 +41,8 @@ do-install:
${INSTALL_DATA} ${WRKSRC}/$$file ${GRAILDIR}/$$file; \
done
@${ECHO_MSG} === Installing grail script...
- @${SED} 's,%%GRAILDIR%%,${GRAILDIR},g' <${FILESDIR}/grail > \
+ @${SED} -e 's,%%GRAILDIR%%,${GRAILDIR},g' \
+ -e 's,%%PYTHON_CMD%%,${PYTHON_CMD},g' <${FILESDIR}/grail > \
${WRKDIR}/grail.tmp
@${INSTALL_SCRIPT} ${WRKDIR}/grail.tmp ${PREFIX}/bin/grail
@${RM} ${WRKDIR}/grail.tmp
diff --git a/www/grail/files/grail b/www/grail/files/grail
index a5d15c492798..5d6569cda1b7 100644
--- a/www/grail/files/grail
+++ b/www/grail/files/grail
@@ -1,2 +1,2 @@
#!/bin/sh
-exec python %%GRAILDIR%%/grail.py ${1+"$@"}
+exec %%PYTHON_CMD%% %%GRAILDIR%%/grail.py ${1+"$@"}
diff --git a/www/grail/files/patch-ab b/www/grail/files/patch-ab
new file mode 100644
index 000000000000..0aa59d7cac8d
--- /dev/null
+++ b/www/grail/files/patch-ab
@@ -0,0 +1,24 @@
+--- grailbase/app.py.orig Wed Mar 24 23:11:52 1999
++++ grailbase/app.py Mon Mar 24 10:48:37 2003
+@@ -3,10 +3,10 @@
+
+ import os
+ import mimetypes
+-import regex
++import re
+ import string
+ import utils
+-
++regex = re
+
+ class Application:
+ def __init__(self, prefs=None):
+@@ -51,7 +51,7 @@
+
+
+ __data_scheme_re = regex.compile(
+- "data:\([^,;]*\)\(;\([^,]*\)\|\),", regex.casefold)
++ "data:\([^,;]*\)\(;\([^,]*\)\|\),")
+
+ def guess_type(self, url):
+ """Guess the type of a file based on its URL.
diff --git a/www/grail/files/patch-ac b/www/grail/files/patch-ac
new file mode 100644
index 000000000000..11c43fb9e296
--- /dev/null
+++ b/www/grail/files/patch-ac
@@ -0,0 +1,63 @@
+--- protocols/httpAPI.py.orig Sat Mar 6 06:05:19 1999
++++ protocols/httpAPI.py Mon Mar 24 10:47:50 2003
+@@ -52,9 +52,14 @@
+
+ class MyHTTP(httplib.HTTP):
+
++ def __init__(self, host='', port=None, strict=None):
++ httplib.HTTP.__init__(self, host, port, strict)
++ self.putrequest_bk = self.putrequest
++ self.putrequest = lambda r,s: MyHTTP.putrequest(self, r, s)
++
+ def putrequest(self, request, selector):
+ self.selector = selector
+- httplib.HTTP.putrequest(self, request, selector)
++ self.putrequest_bk(request, selector)
+
+ def getreply(self, file):
+ self.file = file
+@@ -81,14 +86,14 @@
+ def close(self):
+ if self.file:
+ self.file.close()
+- if self.sock:
++ if self._conn.sock:
+ try:
+- self.sock.close()
++ self._conn.sock.close()
+ except socket.error:
+ # What can you do? :-)
+ pass
+ self.file = None
+- self.sock = None
++ self._conn.sock = None
+
+
+ class http_access:
+@@ -168,7 +173,7 @@
+ def pollmeta(self, timeout=0):
+ Assert(self.state == META)
+
+- sock = self.h.sock
++ sock = self.h._conn.sock
+ try:
+ if not select.select([sock], [], [], timeout)[0]:
+ return "waiting for server response", 0
+@@ -222,7 +227,7 @@
+ self.readahead = self.readahead[maxbytes:]
+ return data
+ try:
+- data = self.h.sock.recv(maxbytes)
++ data = self.h._conn.sock.recv(maxbytes)
+ except socket.error, msg:
+ raise IOError, msg, sys.exc_traceback
+ if not data:
+@@ -231,7 +236,7 @@
+ return data
+
+ def fileno(self):
+- return self.h.sock.fileno()
++ return self.h._conn.sock.fileno()
+
+
+ # To test this, use ProtocolAPI.test()