From patchwork Sun Oct 28 09:26:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Baines X-Patchwork-Id: 38 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 A5DE116753; Sun, 28 Oct 2018 09:28:27 +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 616A71672F for ; Sun, 28 Oct 2018 09:28:27 +0000 (GMT) Received: from localhost ([::1]:39410 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGhMw-0005tH-Ki for patchwork@mira.cbaines.net; Sun, 28 Oct 2018 05:28:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49237) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGhMh-0005jw-GT for guix-patches@gnu.org; Sun, 28 Oct 2018 05:28:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gGhMd-0004gh-Ku for guix-patches@gnu.org; Sun, 28 Oct 2018 05:28:11 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:42444) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gGhMY-0004dt-SL for guix-patches@gnu.org; Sun, 28 Oct 2018 05:28:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gGhMY-0000au-Iv for guix-patches@gnu.org; Sun, 28 Oct 2018 05:28:02 -0400 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, 28 Oct 2018 09:28: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.15407188252170 (code B ref 33185); Sun, 28 Oct 2018 09:28:02 +0000 Received: (at 33185) by debbugs.gnu.org; 28 Oct 2018 09:27:05 +0000 Received: from localhost ([127.0.0.1]:46690 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGhLd-0000Yq-9F for submit@debbugs.gnu.org; Sun, 28 Oct 2018 05:27:05 -0400 Received: from li622-129.members.linode.com ([212.71.249.129]:44440 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGhLb-0000YG-Jn for 33185@debbugs.gnu.org; Sun, 28 Oct 2018 05:27:04 -0400 Received: by mira.cbaines.net (Postfix, from userid 113) id E673A1672F; Sun, 28 Oct 2018 09:27:02 +0000 (GMT) Received: from localhost (127.103.9.51.dyn.plus.net [51.9.103.127]) by mira.cbaines.net (Postfix) with ESMTPSA id 9AA2E1672F for <33185@debbugs.gnu.org>; Sun, 28 Oct 2018 09:27:02 +0000 (GMT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id fe756f41 for <33185@debbugs.gnu.org>; Sun, 28 Oct 2018 09:27:02 +0000 (UTC) From: Christopher Baines Date: Sun, 28 Oct 2018 09:26:56 +0000 Message-Id: <20181028092702.22549-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 f8052458a..c00992c71 100644 --- a/gnu/packages/python-web.scm +++ b/gnu/packages/python-web.scm @@ -2130,6 +2130,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 Oct 28 09:26:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Baines X-Patchwork-Id: 37 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 85BB416753; Sun, 28 Oct 2018 09:28:23 +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 3DD781672F for ; Sun, 28 Oct 2018 09:28:23 +0000 (GMT) Received: from localhost ([::1]:39407 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGhMs-0005kc-Fy for patchwork@mira.cbaines.net; Sun, 28 Oct 2018 05:28:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49234) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGhMh-0005jt-GR for guix-patches@gnu.org; Sun, 28 Oct 2018 05:28:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gGhMd-0004gi-Kr for guix-patches@gnu.org; Sun, 28 Oct 2018 05:28:11 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:42445) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gGhMZ-0004eA-4p for guix-patches@gnu.org; Sun, 28 Oct 2018 05:28:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gGhMZ-0000b1-10 for guix-patches@gnu.org; Sun, 28 Oct 2018 05:28:03 -0400 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, 28 Oct 2018 09:28: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.15407188262183 (code B ref 33185); Sun, 28 Oct 2018 09:28:02 +0000 Received: (at 33185) by debbugs.gnu.org; 28 Oct 2018 09:27:06 +0000 Received: from localhost ([127.0.0.1]:46692 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGhLd-0000Yx-IP for submit@debbugs.gnu.org; Sun, 28 Oct 2018 05:27:05 -0400 Received: from li622-129.members.linode.com ([212.71.249.129]:44444 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGhLb-0000YH-K2 for 33185@debbugs.gnu.org; Sun, 28 Oct 2018 05:27:04 -0400 Received: by mira.cbaines.net (Postfix, from userid 113) id 02C2116759; Sun, 28 Oct 2018 09:27:03 +0000 (GMT) Received: from localhost (127.103.9.51.dyn.plus.net [51.9.103.127]) by mira.cbaines.net (Postfix) with ESMTPSA id AF9DA16750 for <33185@debbugs.gnu.org>; Sun, 28 Oct 2018 09:27:02 +0000 (GMT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id bf8d0fc4 for <33185@debbugs.gnu.org>; Sun, 28 Oct 2018 09:27:02 +0000 (UTC) From: Christopher Baines Date: Sun, 28 Oct 2018 09:26:57 +0000 Message-Id: <20181028092702.22549-2-mail@cbaines.net> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20181028092702.22549-1-mail@cbaines.net> References: <20181028092702.22549-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 c00992c71..a7af71bd5 100644 --- a/gnu/packages/python-web.scm +++ b/gnu/packages/python-web.scm @@ -1945,6 +1945,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 Oct 28 09:26:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Baines X-Patchwork-Id: 35 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 51AF216754; Sun, 28 Oct 2018 09:28:18 +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 E9A581672F for ; Sun, 28 Oct 2018 09:28:17 +0000 (GMT) Received: from localhost ([::1]:39405 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGhMn-0005kS-2n for patchwork@mira.cbaines.net; Sun, 28 Oct 2018 05:28:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49238) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGhMh-0005jx-GY for guix-patches@gnu.org; Sun, 28 Oct 2018 05:28:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gGhMd-0004hD-Me for guix-patches@gnu.org; Sun, 28 Oct 2018 05:28:11 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:42448) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gGhMa-0004f2-JE for guix-patches@gnu.org; Sun, 28 Oct 2018 05:28:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gGhMa-0000bN-F5 for guix-patches@gnu.org; Sun, 28 Oct 2018 05:28:04 -0400 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, 28 Oct 2018 09:28: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.15407188312209 (code B ref 33185); Sun, 28 Oct 2018 09:28:04 +0000 Received: (at 33185) by debbugs.gnu.org; 28 Oct 2018 09:27:11 +0000 Received: from localhost ([127.0.0.1]:46698 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGhLj-0000ZT-IE for submit@debbugs.gnu.org; Sun, 28 Oct 2018 05:27:11 -0400 Received: from li622-129.members.linode.com ([212.71.249.129]:44456 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGhLc-0000Yd-PG for 33185@debbugs.gnu.org; Sun, 28 Oct 2018 05:27:05 -0400 Received: by mira.cbaines.net (Postfix, from userid 113) id 4957616750; Sun, 28 Oct 2018 09:27:04 +0000 (GMT) Received: from localhost (127.103.9.51.dyn.plus.net [51.9.103.127]) by mira.cbaines.net (Postfix) with ESMTPSA id C49CF16753 for <33185@debbugs.gnu.org>; Sun, 28 Oct 2018 09:27:02 +0000 (GMT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id cc9cd7b9 for <33185@debbugs.gnu.org>; Sun, 28 Oct 2018 09:27:02 +0000 (UTC) From: Christopher Baines Date: Sun, 28 Oct 2018 09:26:58 +0000 Message-Id: <20181028092702.22549-3-mail@cbaines.net> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20181028092702.22549-1-mail@cbaines.net> References: <20181028092702.22549-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 Oct 28 09:26:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Baines X-Patchwork-Id: 39 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 E885A16753; Sun, 28 Oct 2018 09:28:30 +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 9BFB716750 for ; Sun, 28 Oct 2018 09:28:30 +0000 (GMT) Received: from localhost ([::1]:39408 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGhMz-0005so-Sk for patchwork@mira.cbaines.net; Sun, 28 Oct 2018 05:28:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49239) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGhMh-0005jy-Gc for guix-patches@gnu.org; Sun, 28 Oct 2018 05:28:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gGhMd-0004gp-Ko for guix-patches@gnu.org; Sun, 28 Oct 2018 05:28:11 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:42447) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gGhMa-0004el-3V for guix-patches@gnu.org; Sun, 28 Oct 2018 05:28:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gGhMZ-0000bG-Ux for guix-patches@gnu.org; Sun, 28 Oct 2018 05:28:03 -0400 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, 28 Oct 2018 09:28: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.15407188312202 (code B ref 33185); Sun, 28 Oct 2018 09:28:03 +0000 Received: (at 33185) by debbugs.gnu.org; 28 Oct 2018 09:27:11 +0000 Received: from localhost ([127.0.0.1]:46696 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGhLj-0000ZR-8a for submit@debbugs.gnu.org; Sun, 28 Oct 2018 05:27:11 -0400 Received: from li622-129.members.linode.com ([212.71.249.129]:44454 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGhLc-0000YL-3Z for 33185@debbugs.gnu.org; Sun, 28 Oct 2018 05:27:04 -0400 Received: by mira.cbaines.net (Postfix, from userid 113) id A0F051675D; Sun, 28 Oct 2018 09:27:03 +0000 (GMT) Received: from localhost (127.103.9.51.dyn.plus.net [51.9.103.127]) by mira.cbaines.net (Postfix) with ESMTPSA id D7CD616754 for <33185@debbugs.gnu.org>; Sun, 28 Oct 2018 09:27:02 +0000 (GMT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 39bb4704 for <33185@debbugs.gnu.org>; Sun, 28 Oct 2018 09:27:02 +0000 (UTC) From: Christopher Baines Date: Sun, 28 Oct 2018 09:26:59 +0000 Message-Id: <20181028092702.22549-4-mail@cbaines.net> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20181028092702.22549-1-mail@cbaines.net> References: <20181028092702.22549-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 Oct 28 09:27:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Baines X-Patchwork-Id: 36 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 7061216753; Sun, 28 Oct 2018 09:28:18 +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 272C316750 for ; Sun, 28 Oct 2018 09:28:18 +0000 (GMT) Received: from localhost ([::1]:39406 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGhMn-0005kX-BU for patchwork@mira.cbaines.net; Sun, 28 Oct 2018 05:28:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49236) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGhMh-0005jv-GU for guix-patches@gnu.org; Sun, 28 Oct 2018 05:28:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gGhMd-0004gj-Kv for guix-patches@gnu.org; Sun, 28 Oct 2018 05:28:11 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:42446) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gGhMZ-0004eQ-K2 for guix-patches@gnu.org; Sun, 28 Oct 2018 05:28:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gGhMZ-0000b9-Fg for guix-patches@gnu.org; Sun, 28 Oct 2018 05:28:03 -0400 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, 28 Oct 2018 09:28: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.15407188262189 (code B ref 33185); Sun, 28 Oct 2018 09:28:03 +0000 Received: (at 33185) by debbugs.gnu.org; 28 Oct 2018 09:27:06 +0000 Received: from localhost ([127.0.0.1]:46694 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGhLd-0000ZA-V8 for submit@debbugs.gnu.org; Sun, 28 Oct 2018 05:27:06 -0400 Received: from li622-129.members.linode.com ([212.71.249.129]:44450 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGhLb-0000YK-Qh for 33185@debbugs.gnu.org; Sun, 28 Oct 2018 05:27:04 -0400 Received: by mira.cbaines.net (Postfix, from userid 113) id 63BE21675E; Sun, 28 Oct 2018 09:27:03 +0000 (GMT) Received: from localhost (127.103.9.51.dyn.plus.net [51.9.103.127]) by mira.cbaines.net (Postfix) with ESMTPSA id 1569F16750 for <33185@debbugs.gnu.org>; Sun, 28 Oct 2018 09:27:03 +0000 (GMT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id b01b9af8 for <33185@debbugs.gnu.org>; Sun, 28 Oct 2018 09:27:02 +0000 (UTC) From: Christopher Baines Date: Sun, 28 Oct 2018 09:27:00 +0000 Message-Id: <20181028092702.22549-5-mail@cbaines.net> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20181028092702.22549-1-mail@cbaines.net> References: <20181028092702.22549-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 Oct 28 09:27:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Baines X-Patchwork-Id: 40 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 CA5E41672F; Sun, 28 Oct 2018 09:28:40 +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 6A07D1672F for ; Sun, 28 Oct 2018 09:28:40 +0000 (GMT) Received: from localhost ([::1]:39411 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGhN9-0005yP-Nm for patchwork@mira.cbaines.net; Sun, 28 Oct 2018 05:28:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49245) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGhMh-0005jz-Gv for guix-patches@gnu.org; Sun, 28 Oct 2018 05:28:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gGhMd-0004h2-NI for guix-patches@gnu.org; Sun, 28 Oct 2018 05:28:11 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:42449) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gGhMb-0004fG-1S for guix-patches@gnu.org; Sun, 28 Oct 2018 05:28:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gGhMa-0000bW-U2 for guix-patches@gnu.org; Sun, 28 Oct 2018 05:28:04 -0400 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, 28 Oct 2018 09:28: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.15407188322217 (code B ref 33185); Sun, 28 Oct 2018 09:28:04 +0000 Received: (at 33185) by debbugs.gnu.org; 28 Oct 2018 09:27:12 +0000 Received: from localhost ([127.0.0.1]:46700 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGhLj-0000Za-SU for submit@debbugs.gnu.org; Sun, 28 Oct 2018 05:27:12 -0400 Received: from li622-129.members.linode.com ([212.71.249.129]:44458 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGhLc-0000Ye-Pi for 33185@debbugs.gnu.org; Sun, 28 Oct 2018 05:27:05 -0400 Received: by mira.cbaines.net (Postfix, from userid 113) id 6319016753; Sun, 28 Oct 2018 09:27:04 +0000 (GMT) Received: from localhost (127.103.9.51.dyn.plus.net [51.9.103.127]) by mira.cbaines.net (Postfix) with ESMTPSA id 355A416758 for <33185@debbugs.gnu.org>; Sun, 28 Oct 2018 09:27:03 +0000 (GMT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 07d34f8f for <33185@debbugs.gnu.org>; Sun, 28 Oct 2018 09:27:02 +0000 (UTC) From: Christopher Baines Date: Sun, 28 Oct 2018 09:27:01 +0000 Message-Id: <20181028092702.22549-6-mail@cbaines.net> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20181028092702.22549-1-mail@cbaines.net> References: <20181028092702.22549-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 | 95 +++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/gnu/packages/patchutils.scm b/gnu/packages/patchutils.scm index 688e62cdc..7dabda9ee 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,96 @@ 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")) + (copy-recursively "htdocs" + (string-append + out "/share/patchwork/htdocs")) + (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-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 Oct 28 09:27:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Baines X-Patchwork-Id: 41 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 5BAA516753; Sun, 28 Oct 2018 09:28:43 +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 A1B771672F for ; Sun, 28 Oct 2018 09:28:42 +0000 (GMT) Received: from localhost ([::1]:39412 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGhNB-00060r-VQ for patchwork@mira.cbaines.net; Sun, 28 Oct 2018 05:28:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49235) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGhMh-0005ju-GS for guix-patches@gnu.org; Sun, 28 Oct 2018 05:28:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gGhMd-0004h9-NI for guix-patches@gnu.org; Sun, 28 Oct 2018 05:28:11 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:42450) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gGhMb-0004fZ-Gx for guix-patches@gnu.org; Sun, 28 Oct 2018 05:28:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gGhMb-0000bd-DM for guix-patches@gnu.org; Sun, 28 Oct 2018 05:28:05 -0400 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, 28 Oct 2018 09:28: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.15407188322223 (code B ref 33185); Sun, 28 Oct 2018 09:28:05 +0000 Received: (at 33185) by debbugs.gnu.org; 28 Oct 2018 09:27:12 +0000 Received: from localhost ([127.0.0.1]:46702 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGhLk-0000Zh-7A for submit@debbugs.gnu.org; Sun, 28 Oct 2018 05:27:12 -0400 Received: from li622-129.members.linode.com ([212.71.249.129]:44460 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGhLc-0000Yf-T8 for 33185@debbugs.gnu.org; Sun, 28 Oct 2018 05:27:05 -0400 Received: by mira.cbaines.net (Postfix, from userid 113) id 7B22716754; Sun, 28 Oct 2018 09:27:04 +0000 (GMT) Received: from localhost (127.103.9.51.dyn.plus.net [51.9.103.127]) by mira.cbaines.net (Postfix) with ESMTPSA id 564061675C for <33185@debbugs.gnu.org>; Sun, 28 Oct 2018 09:27:03 +0000 (GMT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 686f03d0 for <33185@debbugs.gnu.org>; Sun, 28 Oct 2018 09:27:02 +0000 (UTC) From: Christopher Baines Date: Sun, 28 Oct 2018 09:27:02 +0000 Message-Id: <20181028092702.22549-7-mail@cbaines.net> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20181028092702.22549-1-mail@cbaines.net> References: <20181028092702.22549-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 | 291 ++++++++++++++++++++++++++++++++++++++++++- gnu/tests/web.scm | 104 +++++++++++++++- 2 files changed, 393 insertions(+), 2 deletions(-) diff --git a/gnu/services/web.scm b/gnu/services/web.scm index 1edb1f4d3..6d0bfee94 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)) @@ -205,7 +209,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: ;;; @@ -1256,3 +1294,254 @@ 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") " + +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 + + + 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))))