guix-env.scm: Remove python-paste and python-pastescript, add python-chardet
[mediagoblin.git] / guix-env.scm
CommitLineData
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>
4;;;
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.
9;;;
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.
14;;;
15;;; ========================================
16;;;
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.
20;;;
21;;; ========================================
22;;;
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.
26;;;
27;;; Ok, here's how to use this thing! First, install Guix.
28;;; Then do:
29;;; guix environment -l guix-env.scm --pure
30;;;
31;;; And the first time you use it:
32;;; ./bootstrap.sh
33;;; ./configure --with-python3 --without-virtualenv
34;;; make
35;;; virtualenv . && ./bin/python setup.py develop --no-deps
36;;;
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.
43;;;
44;;; So anyway, now you can do:
45;;; PYTHONPATH="${PYTHONPATH}:$(pwd)" ./runtests.sh
46;;;
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.
50;;;
51;;; Have fun!
52
53(use-modules (ice-9 match)
54 (srfi srfi-1)
55 (guix packages)
56 (guix licenses)
57 (guix download)
58 (guix git-download)
59 (guix build-system gnu)
60 (guix build-system python)
61 (gnu packages)
62 (gnu packages autotools)
63 (gnu packages base)
64 (gnu packages python)
65 (gnu packages gstreamer)
66 (gnu packages glib)
67 (gnu packages version-control)
68 ((guix licenses) #:select (expat zlib) #:prefix license:))
69
70;; =================================================================
71;; These packages are on their way into Guix proper but haven't made
3d78038a
CAW
72;; it in yet... or they're old versions of packages we're pinning
73;; ourselves to...
d0a09479
CAW
74;; =================================================================
75
d0a09479
CAW
76(define python-sqlalchemy-0.9.10
77 (package
78 (inherit python-sqlalchemy)
79 (version "0.9.10")
80 (source
81 (origin
82 (method url-fetch)
83 (uri (string-append "https://pypi.python.org/packages/source/S/"
84 "SQLAlchemy/SQLAlchemy-" version ".tar.gz"))
85 (sha256
86 (base32
87 "0fqnssf7pxvc7dvd5l83vnqz2wfvpq7y01kcl1537f9nbqnvlp24"))))
88
89 ;; Temporarily skipping tests. It's the stuff that got fixed in
90 ;; the recent sqlalchemy release we struggled with on-list. The
91 ;; patch would have to be backported here to 0.9.10.
92 (arguments
93 '(#:tests? #f))))
94
95(define python-alembic-0.6.6
96 (package
97 (inherit python-alembic)
98 (version "0.6.6")
99 (source
100 (origin
101 (method url-fetch)
102 (uri (pypi-uri "alembic" version))
103 (sha256
104 (base32
105 "0i3nic56blq079vj1iskkmllwjp980vnvvx898d3bm5qa416crcn"))))
106 (native-inputs
107 `(("python-nose" ,python-nose)
108 ,@(package-native-inputs python-alembic)))
109 (propagated-inputs
110 `(("python-sqlalchemy" ,python-sqlalchemy-0.9.10)
111 ("python-mako" ,python-mako)
112 ("python-editor" ,python-editor)))))
113
3d78038a
CAW
114(define python-chardet
115 (package
116 (name "python-chardet")
117 (version "2.3.0")
118 (source
119 (origin
120 (method url-fetch)
121 (uri (pypi-uri "chardet" version))
122 (sha256
123 (base32
124 "1ak87ikcw34fivcgiz2xvi938dmclh078az65l9x3rmgljrkhgp5"))))
125 (build-system python-build-system)
126 (inputs
127 `(("python-setuptools" ,python-setuptools)))
128 (home-page "https://github.com/chardet/chardet")
129 (synopsis
130 "Universal encoding detector for Python 2 and 3")
131 (description
132 "Character encoding auto-detection in Python. Effectively determines what
133character set to use for input with a high degree of accuracy.")
134 (license lgpl2.1+)))
135
d0a09479
CAW
136;; =================================================================
137
138(define mediagoblin
139 (package
140 (name "mediagoblin")
141 (version "0.8.1")
142 (source
143 (origin
144 (method url-fetch)
145 (uri (pypi-uri "mediagoblin" version))
146 (sha256
147 (base32
148 "0p2gj4z351166d1zqmmd8wc9bzb69w0fjm8qq1fs8dw2yhcg2wwv"))))
149 (build-system python-build-system)
150 (native-inputs
151 `(("python-pytest" ,python-pytest)))
152 (propagated-inputs
153 `(("python-alembic" ,python-alembic-0.6.6)
154 ("python-pytest-xdist" ,python-pytest-xdist)
155 ("python-celery" ,python-celery)
156 ("python-kombu" ,python-kombu)
157 ("python-webtest" ,python-webtest)
158 ("python-pastedeploy" ,python-pastedeploy)
159 ("python-paste" ,python-paste)
160 ("python-pastescript" ,python-pastescript)
161 ("python-translitcodec" ,python-translitcodec)
162 ("python-babel" ,python-babel)
163 ("python-configobj" ,python-configobj)
164 ("python-dateutil-2" ,python-dateutil-2)
165 ("python-itsdangerous" ,python-itsdangerous)
166 ("python-jinja2" ,python-jinja2)
167 ("python-jsonschema" ,python-jsonschema)
168 ("python-lxml" ,python-lxml)
169 ("python-markdown" ,python-markdown)
170 ("python-oauthlib" ,python-oauthlib)
171 ("python-pillow" ,python-pillow)
172 ("python-py-bcrypt" ,python-py-bcrypt)
173 ("python-pyld" ,python-pyld)
174 ("python-pytz" ,python-pytz)
175 ("python-requests" ,python-requests)
176 ("python-setuptools" ,python-setuptools)
177 ("python-six" ,python-six)
178 ("python-sphinx" ,python-sphinx)
179 ("python-docutils" ,python-docutils)
180 ("python-sqlalchemy" ,python-sqlalchemy-0.9.10)
181 ("python-unidecode" ,python-unidecode)
182 ("python-werkzeug" ,python-werkzeug)
183 ("python-exif-read" ,python-exif-read)
184 ("python-wtforms" ,python-wtforms)))
185 (home-page "http://mediagoblin.org/")
186 (synopsis "Web application for media publishing")
187 (description "MediaGoblin is a web application for publishing all kinds of
188media.")
189 (license agpl3+)))
190
191(package
192 (inherit mediagoblin)
193 (name "mediagoblin-hackenv")
194 (version "git")
195 (inputs
196 `(;;; audio/video stuff
197 ("gstreamer" ,gstreamer)
198 ("gst-plugins-base" ,gst-plugins-base)
199 ("gst-plugins-good" ,gst-plugins-good)
200 ("gst-plugins-ugly" ,gst-plugins-ugly)
201 ("gobject-introspection" ,gobject-introspection)
202 ;; useful to have!
203 ("coreutils" ,coreutils)
204 ;; used by runtests.sh!
205 ("which" ,which)
206 ("git" ,git)
207 ("automake" ,automake)
208 ("autoconf" ,(autoconf-wrapper))
209 ,@(package-inputs mediagoblin)))
210 (propagated-inputs
211 `(("python" ,python)
212 ("python-virtualenv" ,python-virtualenv)
213 ("python-pygobject" ,python-pygobject)
214 ;; Needs python-gst in order for all tests to pass
215 ("python-numpy" ,python-numpy)
3d78038a
CAW
216 ("python-chardet", python-chardet)
217 ("python-psycopg2" ,python-psycopg2)
d0a09479 218 ,@(package-propagated-inputs mediagoblin))))