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