From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60247) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gOmmk-0001hH-TE for guix-patches@gnu.org; Mon, 19 Nov 2018 11:52:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gOmYl-00026s-Au for guix-patches@gnu.org; Mon, 19 Nov 2018 11:38:04 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:56900) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gOmYl-00026W-1K for guix-patches@gnu.org; Mon, 19 Nov 2018 11:38:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gOmYk-00087u-7k for guix-patches@gnu.org; Mon, 19 Nov 2018 11:38:02 -0500 Subject: [bug#33185] [PATCH 6/7] gnu: Add patchwork. Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20181104104455.3527-1-mail@cbaines.net> <20181104104455.3527-6-mail@cbaines.net> Date: Mon, 19 Nov 2018 17:37:43 +0100 In-Reply-To: <20181104104455.3527-6-mail@cbaines.net> (Christopher Baines's message of "Sun, 4 Nov 2018 10:44:54 +0000") Message-ID: <87h8gdxbu0.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Christopher Baines Cc: 33185@debbugs.gnu.org Christopher Baines 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-packag= es inputs outputs)) "'.split(':'))")) > + (("'patchwork\\.settings\\.production'") > + "os.getenv('DJANGO_SETTINGS_MODULE', 'guix.patchwork.set= tings')")))) > + (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.as= sets") > + (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__ =3D=3D \"__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=E2=80=99s going on. :-) > + (synopsis "") > + (description "") > + (home-page "") > + (license ""))) As swedebugia noted, you=E2=80=99re missing a few things here and in the co= mmit log. :-) With these things fixed it should be good! Thanks, Ludo=E2=80=99.