From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hartmut Goebel Subject: [PATCH 1/2] gnu: Add gunicorn and gunicorn-python2. Date: Thu, 15 Sep 2016 12:54:52 +0200 Message-ID: <1473936893-20306-2-git-send-email-h.goebel@crazy-compilers.com> References: <1473936893-20306-1-git-send-email-h.goebel@crazy-compilers.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49922) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkUJt-00006f-Ht for guix-devel@gnu.org; Thu, 15 Sep 2016 06:55:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkUJp-0007Hv-1V for guix-devel@gnu.org; Thu, 15 Sep 2016 06:55:04 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:35206) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkUJo-0007Hc-NC for guix-devel@gnu.org; Thu, 15 Sep 2016 06:55:00 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3sZb0N11p8z3hjX9 for ; Thu, 15 Sep 2016 12:55:00 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 3sZb0N0tSYzvlkc for ; Thu, 15 Sep 2016 12:55:00 +0200 (CEST) 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 grdiChfTq9hv for ; Thu, 15 Sep 2016 12:54:56 +0200 (CEST) Received: from hermia.goebel-consult.de (ppp-188-174-139-162.dynamic.mnet-online.de [188.174.139.162]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS for ; Thu, 15 Sep 2016 12:54:55 +0200 (CEST) Received: from lenashee.goebel-consult.de (lenashee.goebel-consult.de [192.168.110.2]) by hermia.goebel-consult.de (Postfix) with ESMTP id CD44C6064A for ; Thu, 15 Sep 2016 12:54:53 +0200 (CEST) In-Reply-To: <1473936893-20306-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/web.scm (gunicorn, gunicorn-python2): New variables. --- gnu/packages/web.scm | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index b9c201d..3841c6b 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -14,6 +14,7 @@ ;;; Copyright © 2016 Ben Woodcroft ;;; Copyright © 2016 Clément Lassieur ;;; Copyright © 2016 ng0 +;;; Copyright © 2016 Hartmut Goebel ;;; ;;; This file is part of GNU Guix. ;;; @@ -41,6 +42,7 @@ #:use-module (guix build-system gnu) #:use-module (guix build-system glib-or-gtk) #:use-module (guix build-system perl) + #:use-module (guix build-system python) #:use-module (guix build-system cmake) #:use-module (guix build-system r) #:use-module (guix build-system trivial) @@ -3633,3 +3635,56 @@ provides a unix command line interface to a variety of popular www search engine and similar services.") (home-page "https://surfraw.alioth.debian.org/") (license l:public-domain))) + +(define-public gunicorn + (package + (name "gunicorn") + (version "19.6.0") + (source + (origin + (method url-fetch) + (uri (pypi-uri "gunicorn" version)) + (sha256 + (base32 + "065n5z91607q4l8wncqkz297cdcb60cz8wnyxy88wk4as4b6jgw1")))) + (build-system python-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-before 'check 'remove-requirements + ; setup.py reads test-requirements from a file which is + ; pinning to other versions then guix provides. This also + ; enforces optional packages like pytst-cov. So clean the + ; list. + (lambda _ + (substitute* "requirements_test.txt" + ((".*") ""))))))) + (native-inputs + `(("python-setuptools" ,python-setuptools) + ; optional test-requirement pytest-cov used only when running + ; setup.y with `test --cov` + ("python-pytest" ,python-pytest))) + (home-page "http://gunicorn.org/") + (synopsis "Python WSGI HTTP Server for UNIX") + (description "Gunicorn ‘Green Unicorn’ is a Python WSGI HTTP +Server for UNIX. It’s a pre-fork worker model ported from Ruby’s +Unicorn project. The Gunicorn server is broadly compatible with +various web frameworks, simply implemented, light on server resources, +and fairly speedy.") + (license l:expat) + (properties `((python2-variant . ,(delay gunicorn-python2)))))) + +(define-public gunicorn-python2 + (let ((base (package-with-python2 + (strip-python2-variant gunicorn)))) + ; Note: byte-compiling gunicorn/workers/_gaiohttp.py with Python 2 raises + ; a syntax error, since this is a Python-3-only module. This does not + ; matter since that module is not imported in Python 2 anyway. + (package + (inherit base) + (name "gunicorn-python2") + (description (string-append (package-description base) " + +Use this package if your application is implemented in Python 2.")) + (native-inputs `(("python2-mock" ,python2-mock) + ,@(package-native-inputs base)))))) -- 2.7.4