aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2018-11-09 20:35:57 +0000
committerChristopher Baines <mail@cbaines.net>2019-03-01 07:11:44 +0000
commit7183a6aa54605b59e100b716426cabedf8e2c806 (patch)
tree7c9e3528aae8cc855702b7c9bfc59c58181aed96
parent99dc4cc5383a5841ee1767dca05b04a6a90525f7 (diff)
downloadguix-7183a6aa54605b59e100b716426cabedf8e2c806.tar
guix-7183a6aa54605b59e100b716426cabedf8e2c806.tar.gz
Replace rather than patching patchwork wsgi
This is clearer, as well as supporting the patchwork-fdo codebase.
-rw-r--r--gnu/packages/patchutils.scm21
1 files changed, 13 insertions, 8 deletions
diff --git a/gnu/packages/patchutils.scm b/gnu/packages/patchutils.scm
index f20eb9df3c..8766c73e23 100644
--- a/gnu/packages/patchutils.scm
+++ b/gnu/packages/patchutils.scm
@@ -329,16 +329,21 @@ you to figure out what is going on in that merge you keep avoiding.")
(modify-phases %standard-phases
(delete 'configure)
(delete 'build)
- (add-after 'unpack 'patch-wsgi.py
+ (add-after 'unpack 'replace-wsgi.py
(lambda* (#:key inputs outputs #:allow-other-keys)
- (substitute* "patchwork/wsgi.py"
- (("import os")
- (string-append
- "import os, sys
+ (call-with-output-file "patchwork/wsgi.py"
+ (lambda (port)
+ (display
+ (string-append "
+import os, sys
+
+sys.path.extend('" (string-append (getenv "PYTHONPATH") ":" (site-packages inputs outputs)) "'.split(':'))
+
+from django.core.wsgi import get_wsgi_application
+
+os.environ['DJANGO_SETTINGS_MODULE'] = os.getenv('DJANGO_SETTINGS_MODULE', 'guix.patchwork.settings')
-sys.path.extend('" (string-append (getenv "PYTHONPATH") ":" (site-packages inputs outputs)) "'.split(':'))"))
- (("'patchwork\\.settings\\.production'")
- "os.getenv('DJANGO_SETTINGS_MODULE', 'guix.patchwork.settings')"))))
+application = get_wsgi_application()\n") port)))))
(replace 'check
(lambda* (#:key tests? #:allow-other-keys)
(or (not tests?)