metadata_display: Refine spacing.
[mediagoblin.git] / guix-env.scm
1 ;;; GNU MediaGoblin -- federated, autonomous media hosting
2 ;;; Copyright © 2015, 2016 David Thompson <davet@gnu.org>
3 ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
4 ;;; Copyright © 2019 Ben Sturmfels <ben@sturm.com.au>
5 ;;;
6 ;;; This program is free software: you can redistribute it and/or modify
7 ;;; it under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation, either version 3 of the License, or
9 ;;; (at your option) any later version.
10 ;;;
11 ;;; This program is distributed in the hope that it will be useful,
12 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
15 ;;;
16 ;;; ========================================
17 ;;;
18 ;;; ... This file is also part of GNU MediaGoblin, but we're leaving it
19 ;;; under GPLv3 for easy merge back and forth between Guix proper. It
20 ;;; also borrows some code directly from Guix.
21 ;;;
22 ;;; ========================================
23 ;;;
24 ;;; With `guix environment' you can use guix as kind of a universal
25 ;;; virtualenv, except a universal virtualenv with magical time traveling
26 ;;; properties and also, not just for Python.
27 ;;;
28 ;;; Ok, here's how to use this thing! First, install Guix.
29 ;;; Then do:
30 ;;; guix environment -l guix-env.scm --pure
31 ;;;
32 ;;; And the first time you use it:
33 ;;; git submodule init
34 ;;; git submodule update
35 ;;; ./bootstrap.sh
36 ;;; ./configure --with-python3 --without-virtualenv
37 ;;; make
38 ;;; python3 -m venv --system-site-packages . && bin/python setup.py develop --no-deps
39 ;;;
40 ;;; ... wait whaaat, what's that last line! I thought you said this
41 ;;; was a reasonable virtualenv replacement! Well it is and it will
42 ;;; be, but there's a catch, and the catch is that Guix doesn't know
43 ;;; about this directory and "setup.py dist" is technically necessary
44 ;;; for certain things to run, so we have a virtualenv with nothing
45 ;;; in it but this project itself.
46 ;;;
47 ;;; The devtools/update_extlib.sh script won't run on Guix due to missing
48 ;;; "/usr/bin/env", so then run:
49 ;;; node node_modules/.bin/bower install
50 ;;; ./devtools/update_extlib.sh
51 ;;; bin/gmg dbupdate
52 ;;; bin/gmg adduser --username admin --password a --email admin@example.com
53 ;;; ./lazyserver.sh
54 ;;;
55 ;;; So anyway, now you can do:
56 ;;; PYTHONPATH="${PYTHONPATH}:$(pwd)" ./runtests.sh
57 ;;;
58 ;;; Now notably this is goofier looking than running a virtualenv,
59 ;;; but soon I'll do something truly evil (I hope) that will make
60 ;;; the virtualenv and path-hacking stuff unnecessary.
61 ;;;
62 ;;; Have fun!
63 ;;;
64 ;;; Known issues:
65 ;;; - currently fails to upload h264 source video: "GStreamer: missing H.264 decoder"
66
67 (use-modules (ice-9 match)
68 (srfi srfi-1)
69 (guix packages)
70 (guix licenses)
71 (guix download)
72 (guix git-download)
73 (guix build-system gnu)
74 (guix build-system python)
75 (gnu packages)
76 (gnu packages autotools)
77 (gnu packages base)
78 (gnu packages certs)
79 (gnu packages check)
80 (gnu packages databases)
81 (gnu packages python)
82 (gnu packages python-crypto)
83 (gnu packages python-web)
84 (gnu packages python-xyz)
85 (gnu packages sphinx)
86 (gnu packages gstreamer)
87 (gnu packages glib)
88 (gnu packages rsync)
89 (gnu packages ssh)
90 (gnu packages time)
91 (gnu packages version-control)
92 ((guix licenses) #:select (expat zlib) #:prefix license:))
93
94 ;; =================================================================
95 ;; These packages are on their way into Guix proper but haven't made
96 ;; it in yet... or they're old versions of packages we're pinning
97 ;; ourselves to...
98 ;; =================================================================
99
100 (define python-pytest-forked
101 (package
102 (name "python-pytest-forked")
103 (version "1.0.2")
104 (source
105 (origin
106 (method url-fetch)
107 (uri (pypi-uri "pytest-forked" version))
108 (sha256
109 (base32
110 "0f4y1jhcg70xhm220pdb8r24n01knhn749aqlr14vmgbsb7allnk"))))
111 (build-system python-build-system)
112 (propagated-inputs
113 `(("python-pytest" ,python-pytest)
114 ("python-setuptools-scm" ,python-setuptools-scm)))
115 (home-page
116 "https://github.com/pytest-dev/pytest-forked")
117 (synopsis
118 "run tests in isolated forked subprocesses")
119 (description
120 "run tests in isolated forked subprocesses")
121 (license license:expat)))
122
123 ;; =================================================================
124
125 (define mediagoblin
126 (package
127 (name "mediagoblin")
128 (version "0.8.1")
129 (source
130 (origin
131 (method url-fetch)
132 (uri (pypi-uri "mediagoblin" version))
133 (sha256
134 (base32
135 "0p2gj4z351166d1zqmmd8wc9bzb69w0fjm8qq1fs8dw2yhcg2wwv"))))
136 (build-system python-build-system)
137 (arguments
138 ;; Complains about missing gunicorn. Not sure where that comes from.
139 '(#:tests? #f))
140 (native-inputs
141 `(("python-pytest" ,python-pytest)
142 ("nss-certs" ,nss-certs)))
143 (propagated-inputs
144 `(("python-alembic" ,python-alembic)
145 ("python-pytest-xdist" ,python-pytest-xdist)
146 ("python-pytest-forked" ,python-pytest-forked)
147 ("python-celery" ,python-celery)
148 ("python-kombu" ,python-kombu)
149 ("python-webtest" ,python-webtest)
150 ("python-pastedeploy" ,python-pastedeploy)
151 ("python-paste" ,python-paste)
152 ("python-pastescript" ,python-pastescript)
153 ("python-translitcodec" ,python-translitcodec)
154 ("python-babel" ,python-babel)
155 ("python-configobj" ,python-configobj)
156 ("python-dateutil" ,python-dateutil)
157 ("python-itsdangerous" ,python-itsdangerous)
158 ("python-jinja2" ,python-jinja2)
159 ("python-jsonschema" ,python-jsonschema)
160 ("python-lxml" ,python-lxml)
161 ("python-markdown" ,python-markdown)
162 ("python-oauthlib" ,python-oauthlib)
163 ("python-pillow" ,python-pillow)
164 ("python-py-bcrypt" ,python-py-bcrypt)
165 ("python-pyld" ,python-pyld)
166 ("python-pytz" ,python-pytz)
167 ("python-requests" ,python-requests)
168 ("python-setuptools" ,python-setuptools)
169 ("python-six" ,python-six)
170 ("python-sphinx" ,python-sphinx)
171 ("python-docutils" ,python-docutils)
172 ("python-sqlalchemy" ,python-sqlalchemy)
173 ("python-unidecode" ,python-unidecode)
174 ("python-werkzeug" ,python-werkzeug)
175 ("python-exif-read" ,python-exif-read)
176 ("python-wtforms" ,python-wtforms)))
177 (home-page "http://mediagoblin.org/")
178 (synopsis "Web application for media publishing")
179 (description "MediaGoblin is a web application for publishing all kinds of
180 media.")
181 (license agpl3+)))
182
183 (package
184 (inherit mediagoblin)
185 (name "mediagoblin-hackenv")
186 (version "git")
187 (inputs
188 `(;;; audio/video stuff
189 ("gstreamer" ,gstreamer)
190 ("gst-plugins-base" ,gst-plugins-base)
191 ("gst-plugins-good" ,gst-plugins-good)
192 ("gst-plugins-ugly" ,gst-plugins-ugly)
193 ("gobject-introspection" ,gobject-introspection)
194 ;; useful to have!
195 ("coreutils" ,coreutils)
196 ;; used by runtests.sh!
197 ("which" ,which)
198 ("git" ,git)
199 ("automake" ,automake)
200 ("autoconf" ,autoconf)
201 ,@(package-inputs mediagoblin)))
202 (propagated-inputs
203 `(("python" ,python)
204 ("python-virtualenv" ,python-virtualenv)
205 ("python-pygobject" ,python-pygobject)
206 ("python-gst" ,python-gst)
207 ;; Needs python-gst in order for all tests to pass
208 ("python-numpy" ,python-numpy) ; this pulls in texlive...
209 ; and texlive-texmf is very large...
210 ("python-chardet", python-chardet)
211 ("python-psycopg2" ,python-psycopg2)
212 ;; For developing
213 ("openssh" ,openssh)
214 ("git" ,git)
215 ("rsync" ,rsync)
216 ,@(package-propagated-inputs mediagoblin))))