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 | ;;; | |
32 | ;;; And the first time you use it: | |
f0a09ae0 BS |
33 | ;;; git submodule init |
34 | ;;; git submodule update | |
d0a09479 CAW |
35 | ;;; ./bootstrap.sh |
36 | ;;; ./configure --with-python3 --without-virtualenv | |
37 | ;;; make | |
27649346 | 38 | ;;; python3 -m venv . && bin/python setup.py develop --no-deps |
d0a09479 CAW |
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 | ;;; | |
27649346 BS |
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 | |
f0a09ae0 BS |
50 | ;;; bin/gmg dbupdate |
51 | ;;; bin/gmg adduser --username admin --password a --email admin@example.com | |
52 | ;;; ./lazyserver.sh | |
53 | ;;; | |
d0a09479 CAW |
54 | ;;; So anyway, now you can do: |
55 | ;;; PYTHONPATH="${PYTHONPATH}:$(pwd)" ./runtests.sh | |
56 | ;;; | |
57 | ;;; Now notably this is goofier looking than running a virtualenv, | |
58 | ;;; but soon I'll do something truly evil (I hope) that will make | |
59 | ;;; the virtualenv and path-hacking stuff unnecessary. | |
60 | ;;; | |
61 | ;;; Have fun! | |
45400905 BS |
62 | ;;; |
63 | ;;; Known issues: | |
64 | ;;; - currently fails to upload h264 source video: "GStreamer: missing H.264 decoder" | |
d0a09479 CAW |
65 | |
66 | (use-modules (ice-9 match) | |
67 | (srfi srfi-1) | |
68 | (guix packages) | |
69 | (guix licenses) | |
70 | (guix download) | |
71 | (guix git-download) | |
72 | (guix build-system gnu) | |
73 | (guix build-system python) | |
74 | (gnu packages) | |
75 | (gnu packages autotools) | |
76 | (gnu packages base) | |
27649346 | 77 | (gnu packages certs) |
f0a09ae0 BS |
78 | (gnu packages check) |
79 | (gnu packages databases) | |
d0a09479 | 80 | (gnu packages python) |
f0a09ae0 BS |
81 | (gnu packages python-crypto) |
82 | (gnu packages python-web) | |
83 | (gnu packages python-xyz) | |
84 | (gnu packages sphinx) | |
d0a09479 CAW |
85 | (gnu packages gstreamer) |
86 | (gnu packages glib) | |
1c6c97c5 CAW |
87 | (gnu packages rsync) |
88 | (gnu packages ssh) | |
f0a09ae0 | 89 | (gnu packages time) |
d0a09479 CAW |
90 | (gnu packages version-control) |
91 | ((guix licenses) #:select (expat zlib) #:prefix license:)) | |
92 | ||
93 | ;; ================================================================= | |
94 | ;; These packages are on their way into Guix proper but haven't made | |
3d78038a CAW |
95 | ;; it in yet... or they're old versions of packages we're pinning |
96 | ;; ourselves to... | |
d0a09479 CAW |
97 | ;; ================================================================= |
98 | ||
f0a09ae0 | 99 | (define python-pytest-forked |
d0a09479 | 100 | (package |
f0a09ae0 BS |
101 | (name "python-pytest-forked") |
102 | (version "1.0.2") | |
103 | (source | |
104 | (origin | |
105 | (method url-fetch) | |
106 | (uri (pypi-uri "pytest-forked" version)) | |
107 | (sha256 | |
108 | (base32 | |
109 | "0f4y1jhcg70xhm220pdb8r24n01knhn749aqlr14vmgbsb7allnk")))) | |
110 | (build-system python-build-system) | |
111 | (propagated-inputs | |
112 | `(("python-pytest" ,python-pytest) | |
113 | ("python-setuptools-scm" ,python-setuptools-scm))) | |
114 | (home-page | |
115 | "https://github.com/pytest-dev/pytest-forked") | |
116 | (synopsis | |
117 | "run tests in isolated forked subprocesses") | |
118 | (description | |
119 | "run tests in isolated forked subprocesses") | |
120 | (license license:expat))) | |
d0a09479 CAW |
121 | |
122 | ;; ================================================================= | |
123 | ||
124 | (define mediagoblin | |
125 | (package | |
126 | (name "mediagoblin") | |
127 | (version "0.8.1") | |
128 | (source | |
129 | (origin | |
130 | (method url-fetch) | |
131 | (uri (pypi-uri "mediagoblin" version)) | |
132 | (sha256 | |
133 | (base32 | |
134 | "0p2gj4z351166d1zqmmd8wc9bzb69w0fjm8qq1fs8dw2yhcg2wwv")))) | |
135 | (build-system python-build-system) | |
f0a09ae0 BS |
136 | (arguments |
137 | ;; Complains about missing gunicorn. Not sure where that comes from. | |
138 | '(#:tests? #f)) | |
d0a09479 | 139 | (native-inputs |
27649346 BS |
140 | `(("python-pytest" ,python-pytest) |
141 | ("nss-certs" ,nss-certs))) | |
d0a09479 | 142 | (propagated-inputs |
0c9c5cab | 143 | `(("python-alembic" ,python-alembic) |
d0a09479 | 144 | ("python-pytest-xdist" ,python-pytest-xdist) |
f0a09ae0 | 145 | ("python-pytest-forked" ,python-pytest-forked) |
d0a09479 CAW |
146 | ("python-celery" ,python-celery) |
147 | ("python-kombu" ,python-kombu) | |
148 | ("python-webtest" ,python-webtest) | |
149 | ("python-pastedeploy" ,python-pastedeploy) | |
150 | ("python-paste" ,python-paste) | |
151 | ("python-pastescript" ,python-pastescript) | |
152 | ("python-translitcodec" ,python-translitcodec) | |
153 | ("python-babel" ,python-babel) | |
154 | ("python-configobj" ,python-configobj) | |
f0a09ae0 | 155 | ("python-dateutil" ,python-dateutil) |
d0a09479 CAW |
156 | ("python-itsdangerous" ,python-itsdangerous) |
157 | ("python-jinja2" ,python-jinja2) | |
158 | ("python-jsonschema" ,python-jsonschema) | |
159 | ("python-lxml" ,python-lxml) | |
160 | ("python-markdown" ,python-markdown) | |
161 | ("python-oauthlib" ,python-oauthlib) | |
162 | ("python-pillow" ,python-pillow) | |
163 | ("python-py-bcrypt" ,python-py-bcrypt) | |
164 | ("python-pyld" ,python-pyld) | |
165 | ("python-pytz" ,python-pytz) | |
166 | ("python-requests" ,python-requests) | |
167 | ("python-setuptools" ,python-setuptools) | |
168 | ("python-six" ,python-six) | |
169 | ("python-sphinx" ,python-sphinx) | |
170 | ("python-docutils" ,python-docutils) | |
0c9c5cab | 171 | ("python-sqlalchemy" ,python-sqlalchemy) |
d0a09479 CAW |
172 | ("python-unidecode" ,python-unidecode) |
173 | ("python-werkzeug" ,python-werkzeug) | |
174 | ("python-exif-read" ,python-exif-read) | |
175 | ("python-wtforms" ,python-wtforms))) | |
176 | (home-page "http://mediagoblin.org/") | |
177 | (synopsis "Web application for media publishing") | |
178 | (description "MediaGoblin is a web application for publishing all kinds of | |
179 | media.") | |
180 | (license agpl3+))) | |
181 | ||
182 | (package | |
183 | (inherit mediagoblin) | |
184 | (name "mediagoblin-hackenv") | |
185 | (version "git") | |
186 | (inputs | |
187 | `(;;; audio/video stuff | |
188 | ("gstreamer" ,gstreamer) | |
189 | ("gst-plugins-base" ,gst-plugins-base) | |
190 | ("gst-plugins-good" ,gst-plugins-good) | |
191 | ("gst-plugins-ugly" ,gst-plugins-ugly) | |
192 | ("gobject-introspection" ,gobject-introspection) | |
193 | ;; useful to have! | |
194 | ("coreutils" ,coreutils) | |
195 | ;; used by runtests.sh! | |
196 | ("which" ,which) | |
197 | ("git" ,git) | |
198 | ("automake" ,automake) | |
f0a09ae0 | 199 | ("autoconf" ,autoconf) |
d0a09479 CAW |
200 | ,@(package-inputs mediagoblin))) |
201 | (propagated-inputs | |
202 | `(("python" ,python) | |
203 | ("python-virtualenv" ,python-virtualenv) | |
204 | ("python-pygobject" ,python-pygobject) | |
f0346c7a | 205 | ("python-gst" ,python-gst) |
d0a09479 | 206 | ;; Needs python-gst in order for all tests to pass |
3f08f780 CAW |
207 | ("python-numpy" ,python-numpy) ; this pulls in texlive... |
208 | ; and texlive-texmf is very large... | |
3d78038a CAW |
209 | ("python-chardet", python-chardet) |
210 | ("python-psycopg2" ,python-psycopg2) | |
1c6c97c5 CAW |
211 | ;; For developing |
212 | ("openssh" ,openssh) | |
213 | ("git" ,git) | |
214 | ("rsync" ,rsync) | |
d0a09479 | 215 | ,@(package-propagated-inputs mediagoblin)))) |