From patchwork Sun Nov 4 10:44:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Baines X-Patchwork-Id: 87 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 8283A16561; Sun, 4 Nov 2018 10:45:11 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) by mira.cbaines.net (Postfix) with ESMTPS id 2A67A16753 for ; Sun, 4 Nov 2018 10:45:11 +0000 (GMT) Received: from localhost ([::1]:58337 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJFu2-0008D4-6n for patchwork@mira.cbaines.net; Sun, 04 Nov 2018 05:45:10 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56116) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJFtz-0008Au-SE for guix-patches@gnu.org; Sun, 04 Nov 2018 05:45:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJFtu-0002Qc-Oi for guix-patches@gnu.org; Sun, 04 Nov 2018 05:45:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:57341) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gJFtu-0002Q6-K4 for guix-patches@gnu.org; Sun, 04 Nov 2018 05:45:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gJFtu-0004Nj-Au for guix-patches@gnu.org; Sun, 04 Nov 2018 05:45:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#33185] [PATCH 1/7] gnu: Add python-jsmin. References: <87y3aie8a1.fsf@cbaines.net> In-Reply-To: <87y3aie8a1.fsf@cbaines.net> Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 04 Nov 2018 10:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33185 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 33185@debbugs.gnu.org Received: via spool by 33185-submit@debbugs.gnu.org id=B33185.154132829816784 (code B ref 33185); Sun, 04 Nov 2018 10:45:02 +0000 Received: (at 33185) by debbugs.gnu.org; 4 Nov 2018 10:44:58 +0000 Received: from localhost ([127.0.0.1]:33355 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJFtq-0004Md-H9 for submit@debbugs.gnu.org; Sun, 04 Nov 2018 05:44:58 -0500 Received: from li622-129.members.linode.com ([212.71.249.129]:51524 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJFto-0004Ly-PW for 33185@debbugs.gnu.org; Sun, 04 Nov 2018 05:44:57 -0500 Received: by mira.cbaines.net (Postfix, from userid 113) id 2A1E716561; Sun, 4 Nov 2018 10:44:56 +0000 (GMT) Received: from localhost (unknown [185.80.85.115]) by mira.cbaines.net (Postfix) with ESMTPSA id E8E8416561 for <33185@debbugs.gnu.org>; Sun, 4 Nov 2018 10:44:55 +0000 (GMT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id aa066143 for <33185@debbugs.gnu.org>; Sun, 4 Nov 2018 10:44:55 +0000 (UTC) From: Christopher Baines Date: Sun, 4 Nov 2018 10:44:49 +0000 Message-Id: <20181104104455.3527-1-mail@cbaines.net> X-Mailer: git-send-email 2.18.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/python-web.scm (python-jsmin, python2-jsmin): New variables. --- gnu/packages/python-web.scm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm index eda796e01..3671454c2 100644 --- a/gnu/packages/python-web.scm +++ b/gnu/packages/python-web.scm @@ -2168,6 +2168,28 @@ It comes with safe defaults and easily configurable options.") (define-public python2-flask-htmlmin (package-with-python2 python-flask-htmlmin)) +(define-public python-jsmin + (package + (name "python-jsmin") + (version "2.2.2") + (source + (origin + (method url-fetch) + (uri (pypi-uri "jsmin" version)) + (sha256 + (base32 + "0fsmqbjvpxvff0984x7c0y8xmf49ax9mncz48b9xjx8wrnr9kpxn")))) + (build-system python-build-system) + (home-page "https://github.com/tikitu/jsmin/") + (synopsis "Python JavaScript minifier") + (description + "@code{jsmin} is a JavaScript minifier, usable from both Python code and +on the command line.") + (license license:expat))) + +(define-public python2-jsmin + (package-with-python2 python-jsmin)) + (define-public python-flask-login (package (name "python-flask-login") From patchwork Sun Nov 4 10:44:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Baines X-Patchwork-Id: 91 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id D948116754; Sun, 4 Nov 2018 10:45:47 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) by mira.cbaines.net (Postfix) with ESMTPS id 9FF9216561 for ; Sun, 4 Nov 2018 10:45:47 +0000 (GMT) Received: from localhost ([::1]:58345 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJFuc-0000CT-V2 for patchwork@mira.cbaines.net; Sun, 04 Nov 2018 05:45:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56115) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJFtz-0008At-Rs for guix-patches@gnu.org; Sun, 04 Nov 2018 05:45:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJFtv-0002RN-4g for guix-patches@gnu.org; Sun, 04 Nov 2018 05:45:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:57343) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gJFtu-0002Qo-WC for guix-patches@gnu.org; Sun, 04 Nov 2018 05:45:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gJFtu-0004Ny-St for guix-patches@gnu.org; Sun, 04 Nov 2018 05:45:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#33185] [PATCH 2/7] gnu: Add python-slimit. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 04 Nov 2018 10:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33185 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 33185@debbugs.gnu.org Received: via spool by 33185-submit@debbugs.gnu.org id=B33185.154132829916796 (code B ref 33185); Sun, 04 Nov 2018 10:45:02 +0000 Received: (at 33185) by debbugs.gnu.org; 4 Nov 2018 10:44:59 +0000 Received: from localhost ([127.0.0.1]:33357 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJFtq-0004Mf-RE for submit@debbugs.gnu.org; Sun, 04 Nov 2018 05:44:59 -0500 Received: from li622-129.members.linode.com ([212.71.249.129]:51528 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJFto-0004Lz-Pu for 33185@debbugs.gnu.org; Sun, 04 Nov 2018 05:44:57 -0500 Received: by mira.cbaines.net (Postfix, from userid 113) id 43E22167A7; Sun, 4 Nov 2018 10:44:56 +0000 (GMT) Received: from localhost (unknown [185.80.85.115]) by mira.cbaines.net (Postfix) with ESMTPSA id 05E9A16753 for <33185@debbugs.gnu.org>; Sun, 4 Nov 2018 10:44:56 +0000 (GMT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id a50460cc for <33185@debbugs.gnu.org>; Sun, 4 Nov 2018 10:44:55 +0000 (UTC) From: Christopher Baines Date: Sun, 4 Nov 2018 10:44:50 +0000 Message-Id: <20181104104455.3527-2-mail@cbaines.net> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20181104104455.3527-1-mail@cbaines.net> References: <20181104104455.3527-1-mail@cbaines.net> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/python-web.scm (python-slimit, python2-slimit): New variables. --- gnu/packages/python-web.scm | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm index 3671454c2..26134e808 100644 --- a/gnu/packages/python-web.scm +++ b/gnu/packages/python-web.scm @@ -1983,6 +1983,34 @@ transfers.") `(("python2-futures" ,python2-futures) ,@(package-native-inputs base)))))) +(define-public python-slimit + (package + (name "python-slimit") + (version "0.8.1") + (source + (origin + (method url-fetch) + (uri (pypi-uri "slimit" version ".zip")) + (sha256 + (base32 + "02vj2x728rs1127q2nc27frrqra4fczivnb7gch6n5lzi7pxqczl")))) + (build-system python-build-system) + (native-inputs + `(("unzip" ,unzip))) + (propagated-inputs + `(("python-ply" ,python-ply))) + (home-page "https://slimit.readthedocs.io/") + (synopsis "JavaScript minifier, parser and lexer written in Python") + (description + "@code{SlimIt} is a JavaScript minifier written in Python. It compiles +JavaScript into more compact code so that it downloads and runs faster. +SlimIt also provides a library that includes a JavaScript parser, lexer, +pretty printer and a tree visitor.") + (license license:expat))) + +(define-public python2-slimit + (package-with-python2 python-slimit)) + (define-public python-flask-restful (package (name "python-flask-restful") From patchwork Sun Nov 4 10:44:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Baines X-Patchwork-Id: 88 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id B20D7167A1; Sun, 4 Nov 2018 10:45:24 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) by mira.cbaines.net (Postfix) with ESMTPS id B273716561 for ; Sun, 4 Nov 2018 10:45:23 +0000 (GMT) Received: from localhost ([::1]:58340 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJFuF-0008On-0A for patchwork@mira.cbaines.net; Sun, 04 Nov 2018 05:45:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56122) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJFtz-0008Ay-Sp for guix-patches@gnu.org; Sun, 04 Nov 2018 05:45:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJFtv-0002Sj-MC for guix-patches@gnu.org; Sun, 04 Nov 2018 05:45:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:57344) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gJFtv-0002SQ-Hr for guix-patches@gnu.org; Sun, 04 Nov 2018 05:45:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gJFtv-0004OB-Eg for guix-patches@gnu.org; Sun, 04 Nov 2018 05:45:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#33185] [PATCH 3/7] gnu: Add python-django-pipeline. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 04 Nov 2018 10:45:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33185 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 33185@debbugs.gnu.org Received: via spool by 33185-submit@debbugs.gnu.org id=B33185.154132829916804 (code B ref 33185); Sun, 04 Nov 2018 10:45:03 +0000 Received: (at 33185) by debbugs.gnu.org; 4 Nov 2018 10:44:59 +0000 Received: from localhost ([127.0.0.1]:33359 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJFtr-0004Mr-5G for submit@debbugs.gnu.org; Sun, 04 Nov 2018 05:44:59 -0500 Received: from li622-129.members.linode.com ([212.71.249.129]:51534 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJFto-0004M0-UT for 33185@debbugs.gnu.org; Sun, 04 Nov 2018 05:44:57 -0500 Received: by mira.cbaines.net (Postfix, from userid 113) id 7377D167AA; Sun, 4 Nov 2018 10:44:56 +0000 (GMT) Received: from localhost (unknown [185.80.85.115]) by mira.cbaines.net (Postfix) with ESMTPSA id 15A3A16754 for <33185@debbugs.gnu.org>; Sun, 4 Nov 2018 10:44:56 +0000 (GMT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id b78d51e2 for <33185@debbugs.gnu.org>; Sun, 4 Nov 2018 10:44:55 +0000 (UTC) From: Christopher Baines Date: Sun, 4 Nov 2018 10:44:51 +0000 Message-Id: <20181104104455.3527-3-mail@cbaines.net> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20181104104455.3527-1-mail@cbaines.net> References: <20181104104455.3527-1-mail@cbaines.net> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/django.scm (python-django-pipeline, python2-django-pipeline): New variables. --- gnu/packages/django.scm | 43 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/gnu/packages/django.scm b/gnu/packages/django.scm index dea925e56..589ba282e 100644 --- a/gnu/packages/django.scm +++ b/gnu/packages/django.scm @@ -518,6 +518,49 @@ project.") (define-public python2-django-overextends (package-with-python2 python-django-overextends)) +(define-public python-django-pipeline + (package + (name "python-django-pipeline") + (version "1.6.14") + (source + (origin + (method url-fetch) + (uri (pypi-uri "django-pipeline" version)) + (sha256 + (base32 + "1a207y71r7za033ira0qmh2yrgp5rq0l04gw2fg9b8jri7sslrzg")))) + (build-system python-build-system) + (arguments + '(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-source + (lambda _ + (substitute* "tests/tests/test_compiler.py" + (("\\/usr\\/bin\\/env") + (which "env"))))) + (replace 'check + (lambda*(#:key tests? #:allow-other-keys) + (or + (not tests?) + (begin + (setenv "DJANGO_SETTINGS_MODULE" "tests.settings") + (invoke "django-admin" "test" "tests")))))))) + (propagated-inputs + `(("python-django" ,python-django) + ("python-slimit" ,python-slimit) + ("python-jsmin" ,python-jsmin))) + (home-page + "https://github.com/jazzband/django-pipeline") + (synopsis "Asset packaging library for Django") + (description + "Pipeline is an asset packaging library for Django, providing both CSS +and JavaScript concatenation and compression, built-in JavaScript template +support, and optional data-URI image and font embedding.") + (license license:expat))) + +(define-public python2-django-pipeline + (package-with-python2 python-django-pipeline)) + (define-public python-django-redis (package (name "python-django-redis") From patchwork Sun Nov 4 10:44:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Baines X-Patchwork-Id: 86 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 80E47167A6; Sun, 4 Nov 2018 10:45:11 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) by mira.cbaines.net (Postfix) with ESMTPS id 22C6916561 for ; Sun, 4 Nov 2018 10:45:11 +0000 (GMT) Received: from localhost ([::1]:58335 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJFu2-0008Cl-3j for patchwork@mira.cbaines.net; Sun, 04 Nov 2018 05:45:10 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56119) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJFtz-0008Aw-SV for guix-patches@gnu.org; Sun, 04 Nov 2018 05:45:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJFtw-0002Vr-NJ for guix-patches@gnu.org; Sun, 04 Nov 2018 05:45:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:57346) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gJFtw-0002VC-Iw for guix-patches@gnu.org; Sun, 04 Nov 2018 05:45:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gJFtw-0004OS-Ex for guix-patches@gnu.org; Sun, 04 Nov 2018 05:45:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#33185] [PATCH 4/7] gnu: Add python-django-jinja. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 04 Nov 2018 10:45:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33185 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 33185@debbugs.gnu.org Received: via spool by 33185-submit@debbugs.gnu.org id=B33185.154132830016818 (code B ref 33185); Sun, 04 Nov 2018 10:45:04 +0000 Received: (at 33185) by debbugs.gnu.org; 4 Nov 2018 10:45:00 +0000 Received: from localhost ([127.0.0.1]:33363 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJFtr-0004N6-Nm for submit@debbugs.gnu.org; Sun, 04 Nov 2018 05:45:00 -0500 Received: from li622-129.members.linode.com ([212.71.249.129]:51540 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJFtp-0004M2-6P for 33185@debbugs.gnu.org; Sun, 04 Nov 2018 05:44:58 -0500 Received: by mira.cbaines.net (Postfix, from userid 113) id B0B7116754; Sun, 4 Nov 2018 10:44:56 +0000 (GMT) Received: from localhost (unknown [185.80.85.115]) by mira.cbaines.net (Postfix) with ESMTPSA id 3175C167A1 for <33185@debbugs.gnu.org>; Sun, 4 Nov 2018 10:44:56 +0000 (GMT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id df16d4e5 for <33185@debbugs.gnu.org>; Sun, 4 Nov 2018 10:44:55 +0000 (UTC) From: Christopher Baines Date: Sun, 4 Nov 2018 10:44:52 +0000 Message-Id: <20181104104455.3527-4-mail@cbaines.net> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20181104104455.3527-1-mail@cbaines.net> References: <20181104104455.3527-1-mail@cbaines.net> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/django.scm (python-django-jinja, python2-django-jinja): New variables. --- gnu/packages/django.scm | 49 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/gnu/packages/django.scm b/gnu/packages/django.scm index 589ba282e..48f36835d 100644 --- a/gnu/packages/django.scm +++ b/gnu/packages/django.scm @@ -338,6 +338,55 @@ merging, minifying and compiling CSS and Javascript files.") (define-public python2-django-assets (package-with-python2 python-django-assets)) +(define-public python-django-jinja + (package + (name "python-django-jinja") + (version "2.4.1") + (source + (origin + (method url-fetch) + (uri (string-append + "https://github.com/niwinz/django-jinja/archive/" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "0bzrb4m6wx9ph5cpvz7wpvg5k6ksvj0dnxlg0nhhqskhvp46brs1")))) + (build-system python-build-system) + (propagated-inputs + `(("python-django" ,python-django) + ("python-jinja2" ,python-jinja2) + ("python-pytz" ,python-pytz) + ("python-django-pipeline" ,python-django-pipeline))) + (arguments + '(;; TODO Tests currently fail due to issues with the configuration for + ;; django-pipeline + #:tests? #f + #:phases + (modify-phases %standard-phases + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (or + (not tests?) + (with-directory-excursion "testing" + (invoke "python" "runtests.py")))))))) + (home-page + "https://niwinz.github.io/django-jinja/latest/") + (synopsis "Simple and nonobstructive jinja2 backend for Django") + (description + "Jinja2 provides certain advantages over the native system of Django, for +example, explicit calls to callable from templates and better performance. +@code{django-jinja} is a alternative to the jinja2 backend built in to Django.") + (license license:bsd-3))) + +(define-public python2-django-jinja + (let ((base (package-with-python2 (strip-python2-variant python-django-jinja)))) + (package + (inherit base) + (native-inputs + `(("python2-mock" ,python2-mock) + ,@(package-native-inputs base)))))) + (define-public python-django-jsonfield (package (name "python-django-jsonfield") From patchwork Sun Nov 4 10:44:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Baines X-Patchwork-Id: 90 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id E25A816754; Sun, 4 Nov 2018 10:45:42 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) by mira.cbaines.net (Postfix) with ESMTPS id 9A25F16561 for ; Sun, 4 Nov 2018 10:45:42 +0000 (GMT) Received: from localhost ([::1]:58344 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJFuY-00009N-01 for patchwork@mira.cbaines.net; Sun, 04 Nov 2018 05:45:42 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56118) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJFtz-0008Av-SS for guix-patches@gnu.org; Sun, 04 Nov 2018 05:45:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJFtw-0002Tt-6H for guix-patches@gnu.org; Sun, 04 Nov 2018 05:45:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:57345) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gJFtw-0002TL-1w for guix-patches@gnu.org; Sun, 04 Nov 2018 05:45:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gJFtv-0004OK-Ve for guix-patches@gnu.org; Sun, 04 Nov 2018 05:45:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#33185] [PATCH 5/7] gnu: Add python-django-debug-toolbar. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 04 Nov 2018 10:45:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33185 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 33185@debbugs.gnu.org Received: via spool by 33185-submit@debbugs.gnu.org id=B33185.154132829916811 (code B ref 33185); Sun, 04 Nov 2018 10:45:03 +0000 Received: (at 33185) by debbugs.gnu.org; 4 Nov 2018 10:44:59 +0000 Received: from localhost ([127.0.0.1]:33361 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJFtr-0004Mz-Ej for submit@debbugs.gnu.org; Sun, 04 Nov 2018 05:44:59 -0500 Received: from li622-129.members.linode.com ([212.71.249.129]:51538 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJFtp-0004M1-1L for 33185@debbugs.gnu.org; Sun, 04 Nov 2018 05:44:57 -0500 Received: by mira.cbaines.net (Postfix, from userid 113) id 89942167A9; Sun, 4 Nov 2018 10:44:56 +0000 (GMT) Received: from localhost (unknown [185.80.85.115]) by mira.cbaines.net (Postfix) with ESMTPSA id 4D29A16753 for <33185@debbugs.gnu.org>; Sun, 4 Nov 2018 10:44:56 +0000 (GMT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 8bb7a928 for <33185@debbugs.gnu.org>; Sun, 4 Nov 2018 10:44:55 +0000 (UTC) From: Christopher Baines Date: Sun, 4 Nov 2018 10:44:53 +0000 Message-Id: <20181104104455.3527-5-mail@cbaines.net> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20181104104455.3527-1-mail@cbaines.net> References: <20181104104455.3527-1-mail@cbaines.net> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/django.scm (python-django-debug-toolbar, python2-django-debug-toolbar): New variables. --- gnu/packages/django.scm | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/gnu/packages/django.scm b/gnu/packages/django.scm index 48f36835d..3a761bf60 100644 --- a/gnu/packages/django.scm +++ b/gnu/packages/django.scm @@ -265,6 +265,44 @@ account authentication.") (define-public python2-django-allauth (package-with-python2 python-django-allauth)) +(define-public python-django-debug-toolbar + (package + (name "python-django-debug-toolbar") + (version "1.10.1") + (source + (origin + (method url-fetch) + (uri (string-append + "https://github.com/jazzband/django-debug-toolbar/archive/" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "1rww056hyzks8spbgf4h7kf6ybxlc5p08a2b6gn1nqrrzs4yx9sy")))) + (build-system python-build-system) + (propagated-inputs + `(("python-sqlparse" ,python-sqlparse) + ("python-django" ,python-django))) + (native-inputs + `(("python-django-jinja" ,python-django-jinja) + ("python-html5lib" ,python-html5lib))) + (arguments + '(#:phases + (modify-phases %standard-phases + (replace 'check + (lambda _ + (invoke "make" "test")))))) + (home-page + "https://github.com/jazzband/django-debug-toolbar") + (synopsis "Toolbar to help with developing Django applications") + (description + "A configurable set of panels that display various debug information +about the current request/response.") + (license license:bsd-3))) + +(define-public python2-django-debug-toolbar + (package-with-python2 python-django-debug-toolbar)) + (define-public python-django-gravatar2 (package (name "python-django-gravatar2") From patchwork Sun Nov 4 10:44:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Baines X-Patchwork-Id: 92 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id ABCFB16754; Sun, 4 Nov 2018 10:45:52 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) by mira.cbaines.net (Postfix) with ESMTPS id 206A116561 for ; Sun, 4 Nov 2018 10:45:52 +0000 (GMT) Received: from localhost ([::1]:58346 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJFuh-0000FE-DH for patchwork@mira.cbaines.net; Sun, 04 Nov 2018 05:45:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56120) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJFtz-0008Ax-SZ for guix-patches@gnu.org; Sun, 04 Nov 2018 05:45:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJFtx-0002Xl-Au for guix-patches@gnu.org; Sun, 04 Nov 2018 05:45:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:57347) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gJFtx-0002Wi-65 for guix-patches@gnu.org; Sun, 04 Nov 2018 05:45:05 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gJFtx-0004Oc-0R for guix-patches@gnu.org; Sun, 04 Nov 2018 05:45:05 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#33185] [PATCH 6/7] gnu: Add patchwork. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 04 Nov 2018 10:45:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33185 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 33185@debbugs.gnu.org Received: via spool by 33185-submit@debbugs.gnu.org id=B33185.154132830016825 (code B ref 33185); Sun, 04 Nov 2018 10:45:04 +0000 Received: (at 33185) by debbugs.gnu.org; 4 Nov 2018 10:45:00 +0000 Received: from localhost ([127.0.0.1]:33365 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJFts-0004ND-45 for submit@debbugs.gnu.org; Sun, 04 Nov 2018 05:45:00 -0500 Received: from li622-129.members.linode.com ([212.71.249.129]:51542 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJFtp-0004MG-SK for 33185@debbugs.gnu.org; Sun, 04 Nov 2018 05:44:58 -0500 Received: by mira.cbaines.net (Postfix, from userid 113) id 6C69116753; Sun, 4 Nov 2018 10:44:57 +0000 (GMT) Received: from localhost (unknown [185.80.85.115]) by mira.cbaines.net (Postfix) with ESMTPSA id 5D20F167A6 for <33185@debbugs.gnu.org>; Sun, 4 Nov 2018 10:44:56 +0000 (GMT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id c52e51ea for <33185@debbugs.gnu.org>; Sun, 4 Nov 2018 10:44:55 +0000 (UTC) From: Christopher Baines Date: Sun, 4 Nov 2018 10:44:54 +0000 Message-Id: <20181104104455.3527-6-mail@cbaines.net> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20181104104455.3527-1-mail@cbaines.net> References: <20181104104455.3527-1-mail@cbaines.net> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches --- gnu/packages/patchutils.scm | 103 ++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/gnu/packages/patchutils.scm b/gnu/packages/patchutils.scm index 688e62cdc..0981cbc08 100644 --- a/gnu/packages/patchutils.scm +++ b/gnu/packages/patchutils.scm @@ -29,6 +29,8 @@ #:use-module (gnu packages ed) #:use-module (gnu packages base) #:use-module (gnu packages bash) + #:use-module (gnu packages databases) + #:use-module (gnu packages django) #:use-module (gnu packages file) #:use-module (gnu packages gawk) #:use-module (gnu packages gettext) @@ -240,3 +242,104 @@ hexadecimal and ASCII (or EBCDIC). It can also display two files at once, and highlight the differences between them. It works well with large files (up to 4 GiB).") (license gpl2+))) + +(define-public patchwork + (package + (name "patchwork") + (version "2.1.1") + (source (origin + (method url-fetch) + (uri (string-append + "https://github.com/getpatchwork/patchwork/archive/v" + version ".tar.gz")) + (sha256 + (base32 + "1q4i46gwwxvr8gjj983r8aacfsssp062dzi29ha7zba380fsxayy")) + (file-name (string-append name "-" version)))) + (build-system python-build-system) + (arguments + `(;; TODO: Tests require a running database + #:tests? #f + #:phases + (modify-phases %standard-phases + (delete 'configure) + (delete 'build) + (add-after 'unpack 'patch-wsgi.py + (lambda* (#:key inputs outputs #:allow-other-keys) + (substitute* "patchwork/wsgi.py" + (("import os") + (string-append + "import os, sys + +sys.path.extend('" (string-append (getenv "PYTHONPATH") ":" (site-packages inputs outputs)) "'.split(':'))")) + (("'patchwork\\.settings\\.production'") + "os.getenv('DJANGO_SETTINGS_MODULE', 'guix.patchwork.settings')")))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (or (not tests?) + (begin + (setenv "DJANGO_SETTINGS_MODULE" "patchwork.settings.dev") + (invoke + "python" "-Wonce" "./manage.py" "test" "--noinput") + #t)))) + (replace 'install + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (for-each (lambda (directory) + (copy-recursively + directory + (string-append (site-packages inputs outputs) + "/" directory))) + '("patchwork" + "templates")) + (delete-file-recursively (string-append + (site-packages inputs outputs) + "patchwork/tests")) + (let ((static-root + (string-append out "/share/patchwork/htdocs"))) + (mkdir-p static-root) + (copy-file "patchwork/settings/production.example.py" + "patchwork/settings/assets.py") + (setenv "DJANGO_SECRET_KEY" "dummyvalue") + (setenv "DJANGO_SETTINGS_MODULE" "patchwork.settings.assets") + (setenv "STATIC_ROOT" static-root) + (invoke "./manage.py" "collectstatic" "--no-input")) + + (copy-recursively "lib" + (string-append + out "/share/doc/" ,name "-" ,version))) + #t)) + (add-after 'install 'install-patchwork-admin + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out"))) + (mkdir-p (string-append out "/bin")) + (call-with-output-file (string-append out "/bin/patchwork-admin") + (lambda (port) + (display "#!/usr/bin/env python3 +import os, sys + +if __name__ == \"__main__\": + os.environ.setdefault( + \"DJANGO_SETTINGS_MODULE\", + \"guix.patchwork.settings\" + ) + + from django.core.management import execute_from_command_line + + execute_from_command_line(sys.argv)" port))) + (chmod (string-append out "/bin/patchwork-admin") #o555)) + #t))))) + (inputs + `(("python-wrapper" ,python-wrapper))) + (propagated-inputs + `(("python-django" ,python-django) + ;; TODO: Make this configurable + ("python-psycopg2" ,python-psycopg2) + ("python-mysqlclient" ,python-mysqlclient) + ("python-django-filter" ,python-django-filter) + ("python-djangorestframework" ,python-djangorestframework) + ("python-django-debug-toolbar" ,python-django-debug-toolbar))) + (synopsis "") + (description "") + (home-page "") + (license ""))) From patchwork Sun Nov 4 10:44:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Baines X-Patchwork-Id: 89 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id ED63A16754; Sun, 4 Nov 2018 10:45:24 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) by mira.cbaines.net (Postfix) with ESMTPS id 381B216753 for ; Sun, 4 Nov 2018 10:45:24 +0000 (GMT) Received: from localhost ([::1]:58341 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJFuF-0008P5-Aj for patchwork@mira.cbaines.net; Sun, 04 Nov 2018 05:45:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56127) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJFu0-0008Az-0b for guix-patches@gnu.org; Sun, 04 Nov 2018 05:45:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJFtx-0002as-Ve for guix-patches@gnu.org; Sun, 04 Nov 2018 05:45:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:57348) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gJFtx-0002a1-Nd for guix-patches@gnu.org; Sun, 04 Nov 2018 05:45:05 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gJFtx-0004Oj-KK for guix-patches@gnu.org; Sun, 04 Nov 2018 05:45:05 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#33185] [PATCH 7/7] services: Add patchwork. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 04 Nov 2018 10:45:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33185 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 33185@debbugs.gnu.org Received: via spool by 33185-submit@debbugs.gnu.org id=B33185.154132830316872 (code B ref 33185); Sun, 04 Nov 2018 10:45:05 +0000 Received: (at 33185) by debbugs.gnu.org; 4 Nov 2018 10:45:03 +0000 Received: from localhost ([127.0.0.1]:33367 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJFtu-0004Nr-I3 for submit@debbugs.gnu.org; Sun, 04 Nov 2018 05:45:03 -0500 Received: from li622-129.members.linode.com ([212.71.249.129]:51544 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJFtq-0004MI-2e for 33185@debbugs.gnu.org; Sun, 04 Nov 2018 05:44:58 -0500 Received: by mira.cbaines.net (Postfix, from userid 113) id 9C13C167A1; Sun, 4 Nov 2018 10:44:57 +0000 (GMT) Received: from localhost (unknown [185.80.85.115]) by mira.cbaines.net (Postfix) with ESMTPSA id 718AC167A8 for <33185@debbugs.gnu.org>; Sun, 4 Nov 2018 10:44:56 +0000 (GMT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 57eb208c for <33185@debbugs.gnu.org>; Sun, 4 Nov 2018 10:44:55 +0000 (UTC) From: Christopher Baines Date: Sun, 4 Nov 2018 10:44:55 +0000 Message-Id: <20181104104455.3527-7-mail@cbaines.net> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20181104104455.3527-1-mail@cbaines.net> References: <20181104104455.3527-1-mail@cbaines.net> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches --- gnu/services/web.scm | 297 ++++++++++++++++++++++++++++++++++++++++++- gnu/tests/web.scm | 104 ++++++++++++++- 2 files changed, 399 insertions(+), 2 deletions(-) diff --git a/gnu/services/web.scm b/gnu/services/web.scm index fcf453c24..41db75153 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -32,12 +32,16 @@ #:use-module (gnu system pam) #:use-module (gnu system shadow) #:use-module (gnu packages admin) + #:use-module (gnu packages databases) #:use-module (gnu packages web) + #:use-module (gnu packages patchutils) #:use-module (gnu packages php) + #:use-module (gnu packages python) #:use-module (gnu packages guile) #:use-module (gnu packages logging) #:use-module (guix records) #:use-module (guix modules) + #:use-module (guix utils) #:use-module (guix gexp) #:use-module ((guix store) #:select (text-file)) #:use-module ((guix utils) #:select (version-major)) @@ -210,7 +214,41 @@ varnish-configuration-parameters varnish-configuration-extra-options - varnish-service-type)) + varnish-service-type + + + patchwork-database-configuration + patchwork-database-configuration? + patchwork-database-configuration-engine + patchwork-database-configuration-name + patchwork-database-configuration-user + patchwork-database-configuration-password + patchwork-database-configuration-host + patchwork-database-configuration-port + + + patchwork-settings-module + patchwork-settings-module? + patchwork-settings-module-database-configuration + patchwork-settings-module-secret-key + patchwork-settings-module-allowed-hosts + patchwork-settings-module-default-from-email + patchwork-settings-module-static-url + patchwork-settings-module-admins + patchwork-settings-module-debug? + patchwork-settings-module-enable-rest-api? + patchwork-settings-module-enable-xmlrpc? + patchwork-settings-module-force-https-links? + patchwork-settings-module-extra-settings + + + patchwork-configuration + patchwork-configuration? + patchwork-configuration-patchwork + patchwork-configuration-settings-module + patchwork-configuration-domain + + patchwork-service-type)) ;;; Commentary: ;;; @@ -1261,3 +1299,260 @@ files.") varnish-shepherd-service))) (default-value (varnish-configuration)))) + + +;;; +;;; Patchwork +;;; + +(define-record-type* + patchwork-database-configuration make-patchwork-database-configuration + patchwork-database-configuration? + (engine patchwork-database-configuration-engine + (default "django.db.backends.postgresql_psycopg2")) + (name patchwork-database-configuration-name + (default "patchwork")) + (user patchwork-database-configuration-user + (default "")) + (password patchwork-database-configuration-password + (default "")) + (host patchwork-database-configuration-host + (default "")) + (port patchwork-database-configuration-port + (default ""))) + +(define-record-type* + patchwork-settings-module make-patchwork-settings-module + patchwork-settings-module? + (database-configuration patchwork-settings-module-database-configuration + (default (patchwork-database-configuration))) + (secret-key patchwork-settings-module-secret-key) + (allowed-hosts patchwork-settings-module-allowed-hosts) + (default-from-email patchwork-settings-module-default-from-email) + (static-url patchwork-settings-module-static-url + (default "/static/")) + (admins patchwork-settings-module-admins + (default '())) + (debug? patchwork-settings-module-debug? + (default #f)) + (enable-rest-api? patchwork-settings-module-enable-rest-api? + (default #t)) + (enable-xmlrpc? patchwork-settings-module-enable-xmlrpc? + (default #t)) + (force-https-links? patchwork-settings-module-force-https-links? + (default #t)) + (extra-settings patchwork-settings-module-extra-settings + (default ""))) + +(define-record-type* + patchwork-configuration make-patchwork-configuration + patckwork-configuration? + (patchwork patchwork-configuration-patchwork + (default patchwork)) + (settings-module patchwork-configuration-settings-module) + (domain patchwork-configuration-domain)) + +(define-gexp-compiler (patchwork-settings-module-compiler + (file ) system target) + (match file + (($ database-configuration secret-key + allowed-hosts default-from-email + static-url admins debug? enable-rest-api? + enable-xmlrpc? force-https-links? + extra-configuration) + (gexp->derivation + "patchwork-settings" + (with-imported-modules '((guix build utils)) + #~(let ((output #$output)) + (define (create-__init__.py filename) + (call-with-output-file filename + (lambda (port) (display "" port)))) + + (use-modules (guix build utils) + (srfi srfi-1)) + + (mkdir-p (string-append output "/guix/patchwork")) + (create-__init__.py + (string-append output "/guix/__init__.py")) + (create-__init__.py + (string-append output "/guix/patchwork/__init__.py")) + + (call-with-output-file + (string-append output "/guix/patchwork/settings.py") + (lambda (port) + (display + (string-append "from patchwork.settings.base import * + +# Configuration from Guix +SECRET_KEY = '" #$secret-key "' + +ALLOWED_HOSTS = [ +" #$(string-concatenate + (map (lambda (allowed-host) + (string-append " '" allowed-host "'\n")) + allowed-hosts)) +"] + +DEBUG = " #$(if debug? "True" "False") " + +ENABLE_REST_API = " #$(if enable-xmlrpc? "True" "False") " +ENABLE_XMLRPC = " #$(if enable-xmlrpc? "True" "False") " + +FORCE_HTTPS_LINKS = " #$(if force-https-links? "True" "False") " + +DATABASES = { + 'default': { +" #$(match database-configuration + (($ + engine name user password host port) + (string-append + " 'ENGINE': '" engine "',\n" + " 'NAME': '" name "',\n" + " 'USER': '" user "',\n" + " 'PASSWORD': '" password "',\n" + " 'HOST': '" host "',\n" + " 'PORT': '" port "',\n"))) " + }, +} + +" #$(if debug? + #~(string-append "STATIC_ROOT = '" #$(file-append patchwork "/share/patchwork/htdocs") "'") + #~(string-append "STATIC_URL = '" #$static-url "'")) " + +STATICFILES_STORAGE = ( + 'django.contrib.staticfiles.storage.StaticFilesStorage' +) + +# Guix Extra Configuration +" #$extra-configuration " +") port))) + #t)) + #:local-build? #t)))) + +(define (patchwork-wsgi-wrapper patchwork) + (define patchwork-wsgi.py + (file-append patchwork + (string-append + "/lib/python" + (version-major+minor + (package-version python)) + "/site-packages/patchwork/wsgi.py"))) + + (mixed-text-file + "patchwork-wsgi.py" + "import os\n" + "\n" + "exec(open(\"" patchwork-wsgi.py "\").read())\n")) + +(define patchwork-httpd-configuration + (match-lambda + (($ patchwork settings-module + domain) + + (define wsgi.py (patchwork-wsgi-wrapper patchwork)) + + (list "WSGISocketPrefix /var/run/mod_wsgi" + (list "LoadModule wsgi_module " + (file-append mod-wsgi "/modules/mod_wsgi.so")) + (httpd-virtualhost + "*:8080" + `("ServerAdmin admin@example.com +ServerName " ,domain " + +LogFormat \"%v %h %l %u %t \\\"%r\\\" %>s %b \\\"%{Referer}i\\\" \\\"%{User-Agent}i\\\"\" customformat +LogLevel info +CustomLog \"/var/log/httpd/" ,domain "-access_log\" customformat + +ErrorLog /var/log/httpd/error.log + +WSGIScriptAlias / " ,wsgi.py " +WSGIDaemonProcess patchwork user=httpd group=httpd processes=1 threads=2 display-name=%{GROUP} lang='en_US.UTF-8' locale='en_US.UTF-8' python-path=" ,settings-module " +WSGIProcessGroup patchwork +WSGIPassAuthorization On + + + Require all granted + + +Alias /static " ,patchwork "/share/patchwork/htdocs + + AllowOverride None + Options MultiViews Indexes SymlinksIfOwnerMatch IncludesNoExec + Require method GET POST OPTIONS +")))))) + +(define (patchwork-setup-gexp settings-module) + (with-imported-modules (source-module-closure + '((guix build utils))) + #~(lambda () + (catch #t + (lambda () + (let ((pid (primitive-fork)) + (user (getpwnam "postgres"))) + (if (eq? pid 0) + (dynamic-wind + (const #t) + (lambda () + (setgid (passwd:gid user)) + (setuid (passwd:uid user)) + (primitive-exit + (if (and + (zero? + (system* #$(file-append postgresql "/bin/createuser") + "httpd")) + (zero? + (system* #$(file-append postgresql "/bin/createdb") + "-O" "httpd" "patchwork"))) + 0 + 1))) + (lambda () + (primitive-exit 1))) + (zero? (cdr (waitpid pid))))) + (let ((pid (primitive-fork)) + (user (getpwnam "httpd"))) + (if (eq? pid 0) + (dynamic-wind + (const #t) + (lambda () + (setgid (passwd:gid user)) + (setuid (passwd:uid user)) + ;; TODO Extract + (setenv "DJANGO_SECRET_KEY" "testsecretkey") + (setenv "DATABASE_NAME" "patchwork") + (setenv "PYTHONPATH" #$settings-module) + (primitive-exit + (if (and + (zero? + (system* #$(file-append patchwork + "/bin/patchwork-admin") + "migrate"))) + 0 + 1))) + (lambda () + (primitive-exit 1))) + (zero? (cdr (waitpid pid)))))) + (lambda (key . parameters) + (format (current-error-port) + "Uncaught throw to '~a: ~a\n" key parameters) + #f))))) + +(define patchwork-service-type + (service-type + (name 'patchwork-setup) + (extensions + (list (service-extension httpd-service-type + patchwork-httpd-configuration) + (service-extension + shepherd-root-service-type + (match-lambda + (($ patchwork settings-module + domain) + (list (shepherd-service + (requirement '(postgres)) + (provision '(patchwork-setup)) + (start (patchwork-setup-gexp settings-module)) + (stop #~(const #f)) + (respawn? #f) + (documentation "Setup patchwork.")))))))) + (description + "patchwork"))) diff --git a/gnu/tests/web.scm b/gnu/tests/web.scm index 319655396..fbdf78a03 100644 --- a/gnu/tests/web.scm +++ b/gnu/tests/web.scm @@ -28,15 +28,27 @@ #:use-module (gnu system vm) #:use-module (gnu services) #:use-module (gnu services web) + #:use-module (gnu services databases) #:use-module (gnu services networking) + #:use-module (gnu services shepherd) + #:use-module (gnu packages databases) + #:use-module (gnu packages patchutils) + #:use-module (gnu packages python) + #:use-module (gnu packages web) + #:use-module (guix packages) + #:use-module (guix modules) + #:use-module (guix records) #:use-module (guix gexp) #:use-module (guix store) + #:use-module (guix utils) + #:use-module (ice-9 match) #:export (%test-httpd %test-nginx %test-varnish %test-php-fpm %test-hpcguix-web - %test-tailon)) + %test-tailon + %test-patchwork)) (define %index.html-contents ;; Contents of the /index.html file. @@ -498,3 +510,93 @@ HTTP-PORT." (name "tailon") (description "Connect to a running Tailon server.") (value (run-tailon-test)))) + + +;;; +;;; Patchwork +;;; + +(define %patchwork-os + (simple-operating-system + (service dhcp-client-service-type) + (service httpd-service-type + (httpd-configuration + (config + (httpd-config-file + (listen '("8080")))))) + (service postgresql-service-type) + (service patchwork-service-type + (patchwork-configuration + (settings-module + (patchwork-settings-module + (secret-key "00000") + (allowed-hosts '("*")) + (default-from-email "") + (debug? #t))) + (domain "localhost"))))) + +(define* (run-patchwork-test) + "Run tests in %NGINX-OS, which has nginx running and listening on +HTTP-PORT." + (define os + (marionette-operating-system + %patchwork-os + #:imported-modules '((gnu services herd) + (guix combinators)))) + + (define forwarded-port 8080) + + (define vm + (virtual-machine + (operating-system os) + (port-forwardings `((8080 . ,forwarded-port))))) + + (define test + (with-imported-modules '((gnu build marionette)) + #~(begin + (use-modules (srfi srfi-11) (srfi srfi-64) + (gnu build marionette) + (web uri) + (web client) + (web response)) + + (define marionette + (make-marionette (list #$vm))) + + (mkdir #$output) + (chdir #$output) + + (test-begin "patchwork") + + (test-assert "httpd service running" + (marionette-eval + '(begin + (use-modules (gnu services herd)) + (match (start-service 'httpd) + (#f #f) + (('service response-parts ...) + (match (assq-ref response-parts 'running) + ((#t) #t) + ((pid) (number? pid)))))) + marionette)) + + ;; Retrieve the index.html file we put in /srv. + (test-equal "http-get" + 200 + (let-values + (((response text) + (http-get #$(simple-format + #f "http://localhost:~A/" forwarded-port) + #:decode-body? #t))) + (response-code response))) + + (test-end) + (exit (= (test-runner-fail-count (test-runner-current)) 0))))) + + (gexp->derivation "patchwork-test" test)) + +(define %test-patchwork + (system-test + (name "patchwork") + (description "") + (value (run-patchwork-test))))