GNU bug report logs -
#33185
[PATCH 0/7] Add patchwork package and service.
Previous Next
Reported by: Christopher Baines <mail <at> cbaines.net>
Date: Sun, 28 Oct 2018 09:22:01 UTC
Severity: normal
Tags: patch
Done: Christopher Baines <mail <at> cbaines.net>
Bug is archived. No further changes may be made.
Full log
Message #71 received at 33185 <at> debbugs.gnu.org (full text, mbox):
Christopher Baines <mail <at> cbaines.net> skribis:
> ---
> gnu/packages/patchutils.scm | 103 ++++++++++++++++++++++++++++++++++++
> 1 file changed, 103 insertions(+)
[...]
> + (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)))))
IMO these phases would be less intimidating with a few comments
explaining what’s going on. :-)
> + (synopsis "")
> + (description "")
> + (home-page "")
> + (license "")))
As swedebugia noted, you’re missing a few things here and in the commit
log. :-)
With these things fixed it should be good!
Thanks,
Ludo’.
This bug report was last modified 6 years and 26 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.