Commit | Line | Data |
---|---|---|
d0a09479 CAW |
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> | |
f0a09ae0 | 4 | ;;; Copyright © 2019 Ben Sturmfels <ben@sturm.com.au> |
d0a09479 CAW |
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 | ;;; ======================================== | |
f0a09ae0 | 23 | ;;; |
d0a09479 CAW |
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 | ;;; | |
b8922642 BS |
32 | ;;; While using --pure is a robust way to ensure that other environment |
33 | ;;; variables don't cause unexpected behaviour, it may trip up aspects of your | |
34 | ;;; development tools, such as removing reference to $EDITOR. Feel free to | |
35 | ;;; remove the --pure. | |
36 | ;;; | |
d20e307a BS |
37 | ;;; You'll need to run the above command every time you close your terminal or |
38 | ;;; restart your system, so a handy way to save having to remember is to install | |
39 | ;;; "direnv" an then create a ".envrc" file in your current directory containing | |
40 | ;;; the following and then run "direnv allow" when prompted: | |
b8922642 | 41 | ;;; use guix -l guix-env.scm |
d20e307a BS |
42 | ;;; |
43 | ;;; To set things up for the first time, you'll also need to run: | |
f0a09ae0 BS |
44 | ;;; git submodule init |
45 | ;;; git submodule update | |
d0a09479 CAW |
46 | ;;; ./bootstrap.sh |
47 | ;;; ./configure --with-python3 --without-virtualenv | |
48 | ;;; make | |
ad14aed0 | 49 | ;;; python3 -m venv --system-site-packages . && bin/python setup.py develop --no-deps |
16fbe852 BS |
50 | ;;; bin/python -m pip install --force-reinstall PasteScript # workaround |
51 | ;;; bin/python -m pip install 'werkzeug<1.0.0' # workaround | |
d0a09479 | 52 | ;;; |
16fbe852 | 53 | ;;; ... wait whaaat, what's that venv line?! I thought you said this |
d0a09479 CAW |
54 | ;;; was a reasonable virtualenv replacement! Well it is and it will |
55 | ;;; be, but there's a catch, and the catch is that Guix doesn't know | |
56 | ;;; about this directory and "setup.py dist" is technically necessary | |
57 | ;;; for certain things to run, so we have a virtualenv with nothing | |
58 | ;;; in it but this project itself. | |
59 | ;;; | |
27649346 BS |
60 | ;;; The devtools/update_extlib.sh script won't run on Guix due to missing |
61 | ;;; "/usr/bin/env", so then run: | |
ad14aed0 BS |
62 | ;;; node node_modules/.bin/bower install |
63 | ;;; ./devtools/update_extlib.sh | |
f0a09ae0 BS |
64 | ;;; bin/gmg dbupdate |
65 | ;;; bin/gmg adduser --username admin --password a --email admin@example.com | |
16fbe852 BS |
66 | ;;; ./lazyserver.sh <-- won't work |
67 | ;;; CELERY_ALWAYS_EAGER=true ./bin/paster serve paste.ini --reload | |
f0a09ae0 | 68 | ;;; |
d0a09479 CAW |
69 | ;;; So anyway, now you can do: |
70 | ;;; PYTHONPATH="${PYTHONPATH}:$(pwd)" ./runtests.sh | |
16fbe852 BS |
71 | ;;; or: |
72 | ;;; bin/python -m pytest ./mediagoblin/tests --boxed | |
d0a09479 CAW |
73 | ;;; |
74 | ;;; Now notably this is goofier looking than running a virtualenv, | |
75 | ;;; but soon I'll do something truly evil (I hope) that will make | |
76 | ;;; the virtualenv and path-hacking stuff unnecessary. | |
77 | ;;; | |
78 | ;;; Have fun! | |
45400905 BS |
79 | ;;; |
80 | ;;; Known issues: | |
81 | ;;; - currently fails to upload h264 source video: "GStreamer: missing H.264 decoder" | |
16fbe852 BS |
82 | ;; |
83 | ;; TODO: Add PDF support. | |
d0a09479 CAW |
84 | |
85 | (use-modules (ice-9 match) | |
86 | (srfi srfi-1) | |
87 | (guix packages) | |
88 | (guix licenses) | |
89 | (guix download) | |
90 | (guix git-download) | |
91 | (guix build-system gnu) | |
92 | (guix build-system python) | |
93 | (gnu packages) | |
94 | (gnu packages autotools) | |
95 | (gnu packages base) | |
27649346 | 96 | (gnu packages certs) |
f0a09ae0 BS |
97 | (gnu packages check) |
98 | (gnu packages databases) | |
d0a09479 | 99 | (gnu packages python) |
f0a09ae0 BS |
100 | (gnu packages python-crypto) |
101 | (gnu packages python-web) | |
102 | (gnu packages python-xyz) | |
103 | (gnu packages sphinx) | |
d0a09479 CAW |
104 | (gnu packages gstreamer) |
105 | (gnu packages glib) | |
1c6c97c5 CAW |
106 | (gnu packages rsync) |
107 | (gnu packages ssh) | |
f0a09ae0 | 108 | (gnu packages time) |
d0a09479 | 109 | (gnu packages version-control) |
dee31a39 | 110 | (gnu packages xml) |
d0a09479 CAW |
111 | ((guix licenses) #:select (expat zlib) #:prefix license:)) |
112 | ||
113 | ;; ================================================================= | |
114 | ;; These packages are on their way into Guix proper but haven't made | |
3d78038a CAW |
115 | ;; it in yet... or they're old versions of packages we're pinning |
116 | ;; ourselves to... | |
d0a09479 CAW |
117 | ;; ================================================================= |
118 | ||
f0a09ae0 | 119 | (define python-pytest-forked |
d0a09479 | 120 | (package |
f0a09ae0 BS |
121 | (name "python-pytest-forked") |
122 | (version "1.0.2") | |
123 | (source | |
124 | (origin | |
125 | (method url-fetch) | |
126 | (uri (pypi-uri "pytest-forked" version)) | |
127 | (sha256 | |
128 | (base32 | |
129 | "0f4y1jhcg70xhm220pdb8r24n01knhn749aqlr14vmgbsb7allnk")))) | |
130 | (build-system python-build-system) | |
131 | (propagated-inputs | |
132 | `(("python-pytest" ,python-pytest) | |
133 | ("python-setuptools-scm" ,python-setuptools-scm))) | |
134 | (home-page | |
135 | "https://github.com/pytest-dev/pytest-forked") | |
136 | (synopsis | |
137 | "run tests in isolated forked subprocesses") | |
138 | (description | |
139 | "run tests in isolated forked subprocesses") | |
140 | (license license:expat))) | |
d0a09479 CAW |
141 | |
142 | ;; ================================================================= | |
143 | ||
144 | (define mediagoblin | |
145 | (package | |
146 | (name "mediagoblin") | |
147 | (version "0.8.1") | |
148 | (source | |
149 | (origin | |
150 | (method url-fetch) | |
151 | (uri (pypi-uri "mediagoblin" version)) | |
152 | (sha256 | |
153 | (base32 | |
154 | "0p2gj4z351166d1zqmmd8wc9bzb69w0fjm8qq1fs8dw2yhcg2wwv")))) | |
155 | (build-system python-build-system) | |
f0a09ae0 BS |
156 | (arguments |
157 | ;; Complains about missing gunicorn. Not sure where that comes from. | |
158 | '(#:tests? #f)) | |
d0a09479 | 159 | (native-inputs |
27649346 BS |
160 | `(("python-pytest" ,python-pytest) |
161 | ("nss-certs" ,nss-certs))) | |
d0a09479 | 162 | (propagated-inputs |
0c9c5cab | 163 | `(("python-alembic" ,python-alembic) |
d0a09479 | 164 | ("python-pytest-xdist" ,python-pytest-xdist) |
f0a09ae0 | 165 | ("python-pytest-forked" ,python-pytest-forked) |
d0a09479 CAW |
166 | ("python-celery" ,python-celery) |
167 | ("python-kombu" ,python-kombu) | |
168 | ("python-webtest" ,python-webtest) | |
169 | ("python-pastedeploy" ,python-pastedeploy) | |
170 | ("python-paste" ,python-paste) | |
171 | ("python-pastescript" ,python-pastescript) | |
172 | ("python-translitcodec" ,python-translitcodec) | |
173 | ("python-babel" ,python-babel) | |
174 | ("python-configobj" ,python-configobj) | |
f0a09ae0 | 175 | ("python-dateutil" ,python-dateutil) |
d0a09479 CAW |
176 | ("python-itsdangerous" ,python-itsdangerous) |
177 | ("python-jinja2" ,python-jinja2) | |
178 | ("python-jsonschema" ,python-jsonschema) | |
179 | ("python-lxml" ,python-lxml) | |
180 | ("python-markdown" ,python-markdown) | |
181 | ("python-oauthlib" ,python-oauthlib) | |
182 | ("python-pillow" ,python-pillow) | |
183 | ("python-py-bcrypt" ,python-py-bcrypt) | |
184 | ("python-pyld" ,python-pyld) | |
185 | ("python-pytz" ,python-pytz) | |
186 | ("python-requests" ,python-requests) | |
187 | ("python-setuptools" ,python-setuptools) | |
188 | ("python-six" ,python-six) | |
189 | ("python-sphinx" ,python-sphinx) | |
190 | ("python-docutils" ,python-docutils) | |
0c9c5cab | 191 | ("python-sqlalchemy" ,python-sqlalchemy) |
d0a09479 | 192 | ("python-unidecode" ,python-unidecode) |
16fbe852 | 193 | ;; ("python-werkzeug" ,python-werkzeug) ; Broken due to missing werkzeug.contrib.atom in 1.0.0. |
d0a09479 CAW |
194 | ("python-exif-read" ,python-exif-read) |
195 | ("python-wtforms" ,python-wtforms))) | |
196 | (home-page "http://mediagoblin.org/") | |
197 | (synopsis "Web application for media publishing") | |
198 | (description "MediaGoblin is a web application for publishing all kinds of | |
199 | media.") | |
200 | (license agpl3+))) | |
201 | ||
202 | (package | |
203 | (inherit mediagoblin) | |
204 | (name "mediagoblin-hackenv") | |
205 | (version "git") | |
206 | (inputs | |
207 | `(;;; audio/video stuff | |
208 | ("gstreamer" ,gstreamer) | |
d20e307a | 209 | ("gst-libav" ,gst-plugins-base) |
d0a09479 CAW |
210 | ("gst-plugins-base" ,gst-plugins-base) |
211 | ("gst-plugins-good" ,gst-plugins-good) | |
d20e307a | 212 | ("gst-plugins-bad" ,gst-plugins-bad) |
d0a09479 CAW |
213 | ("gst-plugins-ugly" ,gst-plugins-ugly) |
214 | ("gobject-introspection" ,gobject-introspection) | |
215 | ;; useful to have! | |
216 | ("coreutils" ,coreutils) | |
217 | ;; used by runtests.sh! | |
218 | ("which" ,which) | |
219 | ("git" ,git) | |
220 | ("automake" ,automake) | |
f0a09ae0 | 221 | ("autoconf" ,autoconf) |
d0a09479 CAW |
222 | ,@(package-inputs mediagoblin))) |
223 | (propagated-inputs | |
224 | `(("python" ,python) | |
225 | ("python-virtualenv" ,python-virtualenv) | |
226 | ("python-pygobject" ,python-pygobject) | |
f0346c7a | 227 | ("python-gst" ,python-gst) |
d0a09479 | 228 | ;; Needs python-gst in order for all tests to pass |
3f08f780 CAW |
229 | ("python-numpy" ,python-numpy) ; this pulls in texlive... |
230 | ; and texlive-texmf is very large... | |
3d78038a CAW |
231 | ("python-chardet", python-chardet) |
232 | ("python-psycopg2" ,python-psycopg2) | |
1c6c97c5 CAW |
233 | ;; For developing |
234 | ("openssh" ,openssh) | |
235 | ("git" ,git) | |
236 | ("rsync" ,rsync) | |
d0a09479 | 237 | ,@(package-propagated-inputs mediagoblin)))) |