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>
5 ;;; This program is free software: you can redistribute it and/or modify
6 ;;; it under the terms of the GNU General Public License as published by
7 ;;; the Free Software Foundation, either version 3 of the License, or
8 ;;; (at your option) any later version.
10 ;;; This program is distributed in the hope that it will be useful,
11 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ;;; GNU General Public License for more details.
15 ;;; ========================================
17 ;;; ... This file is also part of GNU MediaGoblin, but we're leaving it
18 ;;; under GPLv3 for easy merge back and forth between Guix proper. It
19 ;;; also borrows some code directly from Guix.
21 ;;; ========================================
23 ;;; With `guix environment' you can use guix as kind of a universal
24 ;;; virtualenv, except a universal virtualenv with magical time traveling
25 ;;; properties and also, not just for Python.
27 ;;; Ok, here's how to use this thing! First, install Guix.
29 ;;; guix environment -l guix-env.scm --pure
31 ;;; And the first time you use it:
33 ;;; ./configure --with-python3 --without-virtualenv
35 ;;; virtualenv . && ./bin/python setup.py develop --no-deps
37 ;;; ... wait whaaat, what's that last line! I thought you said this
38 ;;; was a reasonable virtualenv replacement! Well it is and it will
39 ;;; be, but there's a catch, and the catch is that Guix doesn't know
40 ;;; about this directory and "setup.py dist" is technically necessary
41 ;;; for certain things to run, so we have a virtualenv with nothing
42 ;;; in it but this project itself.
44 ;;; So anyway, now you can do:
45 ;;; PYTHONPATH="${PYTHONPATH}:$(pwd)" ./runtests.sh
47 ;;; Now notably this is goofier looking than running a virtualenv,
48 ;;; but soon I'll do something truly evil (I hope) that will make
49 ;;; the virtualenv and path-hacking stuff unnecessary.
53 (use-modules (ice-9 match)
59 (guix build-system gnu)
60 (guix build-system python)
62 (gnu packages autotools)
65 (gnu packages gstreamer)
67 (gnu packages version-control)
68 ((guix licenses) #:select (expat zlib) #:prefix license:))
70 ;; =================================================================
71 ;; These packages are on their way into Guix proper but haven't made
73 ;; =================================================================
75 (define-public python-paste
82 (uri (pypi-uri "Paste" version))
85 "16dsv9qi0r4qsrsb6dilpq2rx0fnglvh36flzywcdnm2jg43mb5d"))
86 ;;; We patch away certain tests in Guix proper, but for here we'll
87 ;;; just comment out the patches and not run the tests
88 ;; (patches (list (search-patch
89 ;; "python-paste-remove-website-test.patch")
91 ;; "python-paste-remove-timing-test.patch")))
93 (build-system python-build-system)
95 `(("python-nose" ,python-nose)))
97 `(;; Uses pkg_resources provided by setuptools internally.
98 ("python-setuptools" ,python-setuptools)
99 ("python-six" ,python-six)))
101 '(;; Tests don't pass on Python 3, but work fine on Python 2.
102 ;; (As of 2.0.2, Python 3 support in Paste is presently a bit broken,
103 ;; but is usable enough for the minimal amount it's used in MediaGoblin
104 ;; still... things should be better by the next Paste release.)
106 (home-page "http://pythonpaste.org")
108 "Python web development tools, focusing on WSGI")
110 "Paste provides a variety of web development tools and middleware which
111 can be nested together to build web applications. Paste's design closely
112 follows ideas flowing from WSGI (Web Standard Gateway Interface).")
113 (license license:expat)))
115 (define-public python-pastescript
117 (name "python-pastescript")
122 (uri (pypi-uri "PasteScript" version))
125 "1h3nnhn45kf4pbcv669ik4faw04j58k8vbj1hwrc532k0nc28gy0"))))
126 (build-system python-build-system)
128 `(("python-nose" ,python-nose)))
130 `(;; Uses pkg_resources provided by setuptools internally.
131 ("python-setuptools" ,python-setuptools)
132 ("python-paste" ,python-paste)
133 ("python-pastedeploy" ,python-pastedeploy)))
134 (home-page "http://pythonpaste.org/script/")
136 '(;; Unfortunately, this requires the latest unittest2,
137 ;; but that requires traceback2 which requires linecache2 which requires
138 ;; unittest2. So we're skipping tests for now.
139 ;; (Note: Apparently linetest2 only needs unittest2 for its tests,
140 ;; so in theory we could get around this situation somehow.)
143 "Pluggable command line tool for serving web applications and more")
145 "PasteScript is an extensible command line tool which provides a variety
146 of features, from launching web applications to bootstrapping project layouts.")
147 (license license:expat)))
149 (define python-sqlalchemy-0.9.10
151 (inherit python-sqlalchemy)
156 (uri (string-append "https://pypi.python.org/packages/source/S/"
157 "SQLAlchemy/SQLAlchemy-" version ".tar.gz"))
160 "0fqnssf7pxvc7dvd5l83vnqz2wfvpq7y01kcl1537f9nbqnvlp24"))))
162 ;; Temporarily skipping tests. It's the stuff that got fixed in
163 ;; the recent sqlalchemy release we struggled with on-list. The
164 ;; patch would have to be backported here to 0.9.10.
168 (define python-alembic-0.6.6
170 (inherit python-alembic)
175 (uri (pypi-uri "alembic" version))
178 "0i3nic56blq079vj1iskkmllwjp980vnvvx898d3bm5qa416crcn"))))
180 `(("python-nose" ,python-nose)
181 ,@(package-native-inputs python-alembic)))
183 `(("python-sqlalchemy" ,python-sqlalchemy-0.9.10)
184 ("python-mako" ,python-mako)
185 ("python-editor" ,python-editor)))))
187 ;; =================================================================
196 (uri (pypi-uri "mediagoblin" version))
199 "0p2gj4z351166d1zqmmd8wc9bzb69w0fjm8qq1fs8dw2yhcg2wwv"))))
200 (build-system python-build-system)
202 `(("python-pytest" ,python-pytest)))
204 `(("python-alembic" ,python-alembic-0.6.6)
205 ("python-pytest-xdist" ,python-pytest-xdist)
206 ("python-celery" ,python-celery)
207 ("python-kombu" ,python-kombu)
208 ("python-webtest" ,python-webtest)
209 ("python-pastedeploy" ,python-pastedeploy)
210 ("python-paste" ,python-paste)
211 ("python-pastescript" ,python-pastescript)
212 ("python-translitcodec" ,python-translitcodec)
213 ("python-babel" ,python-babel)
214 ("python-configobj" ,python-configobj)
215 ("python-dateutil-2" ,python-dateutil-2)
216 ("python-itsdangerous" ,python-itsdangerous)
217 ("python-jinja2" ,python-jinja2)
218 ("python-jsonschema" ,python-jsonschema)
219 ("python-lxml" ,python-lxml)
220 ("python-markdown" ,python-markdown)
221 ("python-oauthlib" ,python-oauthlib)
222 ("python-pillow" ,python-pillow)
223 ("python-py-bcrypt" ,python-py-bcrypt)
224 ("python-pyld" ,python-pyld)
225 ("python-pytz" ,python-pytz)
226 ("python-requests" ,python-requests)
227 ("python-setuptools" ,python-setuptools)
228 ("python-six" ,python-six)
229 ("python-sphinx" ,python-sphinx)
230 ("python-docutils" ,python-docutils)
231 ("python-sqlalchemy" ,python-sqlalchemy-0.9.10)
232 ("python-unidecode" ,python-unidecode)
233 ("python-werkzeug" ,python-werkzeug)
234 ("python-exif-read" ,python-exif-read)
235 ("python-wtforms" ,python-wtforms)))
236 (home-page "http://mediagoblin.org/")
237 (synopsis "Web application for media publishing")
238 (description "MediaGoblin is a web application for publishing all kinds of
243 (inherit mediagoblin)
244 (name "mediagoblin-hackenv")
247 `(;;; audio/video stuff
248 ("gstreamer" ,gstreamer)
249 ("gst-plugins-base" ,gst-plugins-base)
250 ("gst-plugins-good" ,gst-plugins-good)
251 ("gst-plugins-ugly" ,gst-plugins-ugly)
252 ("gobject-introspection" ,gobject-introspection)
254 ("coreutils" ,coreutils)
255 ;; used by runtests.sh!
258 ("automake" ,automake)
259 ("autoconf" ,(autoconf-wrapper))
260 ,@(package-inputs mediagoblin)))
263 ("python-virtualenv" ,python-virtualenv)
264 ("python-pygobject" ,python-pygobject)
265 ;; Needs python-gst in order for all tests to pass
266 ("python-numpy" ,python-numpy)
267 ,@(package-propagated-inputs mediagoblin))))