From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hartmut Goebel Subject: [PATCH 4/4 v2] gnu: Add bpython. Date: Mon, 2 Jan 2017 17:33:58 +0100 Message-ID: <1483374838-18929-1-git-send-email-h.goebel@crazy-compilers.com> References: <1483192922-21411-1-git-send-email-h.goebel@crazy-compilers.com> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52380) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cO5Ym-0004sb-S0 for guix-devel@gnu.org; Mon, 02 Jan 2017 11:34:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cO5Yj-0002dP-Ol for guix-devel@gnu.org; Mon, 02 Jan 2017 11:34:08 -0500 Received: from mail-out.m-online.net ([212.18.0.9]:57939) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cO5Yj-0002by-Et for guix-devel@gnu.org; Mon, 02 Jan 2017 11:34:05 -0500 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3tsjMF5Z5Mz3hjRp for ; Mon, 2 Jan 2017 17:34:01 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 3tsjMF4W8vzvkDF for ; Mon, 2 Jan 2017 17:34:01 +0100 (CET) Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavisd-new, port 10024) with ESMTP id G8ZusTC-0PWR for ; Mon, 2 Jan 2017 17:34:00 +0100 (CET) Received: from hermia.goebel-consult.de (ppp-46-244-155-98.dynamic.mnet-online.de [46.244.155.98]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS for ; Mon, 2 Jan 2017 17:34:00 +0100 (CET) Received: from thisbe.goebel-consult.de.fritz.box (thisbe.fritz.box [192.168.110.23]) by hermia.goebel-consult.de (Postfix) with ESMTP id B49F460B33 for ; Mon, 2 Jan 2017 17:33:58 +0100 (CET) In-Reply-To: <1483192922-21411-1-git-send-email-h.goebel@crazy-compilers.com> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org * gnu/packages/python.scm (bpython, bpython2): New variables. --- gnu/packages/python.scm | 72 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 04f7a66..56ed7f8 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -12392,3 +12392,75 @@ fullscreen terminal rendering, and keyboard input event reporting.") (define-public python2-curtsies-0.1 (package-with-python2 python-curtsies-0.1)) + +(define-public bpython + (package + (name "bpython") + (version "0.16") + (source + (origin + (method url-fetch) + (uri (pypi-uri "bpython" version)) + (sha256 + (base32 + "0pv5dy84idh0l8kxy01ipkpxrf9kcfb7h5q16gqxg2mx0bvdvwzs")) + (file-name (string-append name "-" version ".tar.gz")))) + (build-system python-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'install 'add-aliases + ;; for symetry to bpython2, add symlinks bypthon3, bpdb3, etc. + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (for-each + (lambda (old new) + (symlink (string-append out "/bin/" old) + (string-append out "/bin/" new))) + '("bpython" "bpython-curses" "bpython-urwid" "bpdb") + '("bpython3" "bpython3-curses" "bpython3-urwid" "bpdb3")))))))) + (propagated-inputs + `(("python-pygments" ,python-pygments) + ("python-requests", python-requests) + ("python-babel" ,python-babel) ;; optional, for internationalization + ("python-curtsies" ,python-curtsies-0.1) ;; >= 0.1.18,< 0.2 + ("python-greenlet" ,python-greenlet) + ("python-urwid" ,python-urwid) ;; for bpython-urwid only + ("python-six" ,python-six))) + (native-inputs + `(("python-sphinx" ,python-sphinx) + ("python-mock" ,python-mock))) + (home-page "https://bpython-interpreter.org/") + (synopsis "Fancy interface to the Python interpreter") + (description "Bpython is a fancy interface to the Python +interpreter. bpython's main features are + +@enumerate +@item in-line syntax highlighting, +@item readline-like autocomplete with suggestions displayed as you type, +@item expected parameter list for any Python function, +@item \"rewind\" function to pop the last line of code from memory and + re-evaluate, +@item send the code you've entered off to a pastebin, +@item save the code you've entered to a file, and +@item auto-indentation. +@end enumerate") + (license license:expat))) + +(define-public bpython2 + (let ((base (package-with-python2 + (strip-python2-variant bpython)))) + (package (inherit base) + (name "bpython2") + (arguments + `(#:phases + (modify-phases %standard-phases + (add-before 'build 'rename-scripts + ;; rename the scripts to bypthon2, bpdb2, etc. + (lambda _ + (substitute* "setup.py" + (("^(\\s+'bpdb)(\\s+=.*',?)\\s*?$" _ name rest) + (string-append name "2" rest "\n")) + (("^(\\s+'bpython)(-\\S+)?(\\s+=.*',?)\\s*?$" _ name sub rest) + (string-append name "2" (or sub "") rest "\n"))) + #t)))))))) -- 2.7.4