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 ;;; Copyright © 2019 Ben Sturmfels <ben@sturm.com.au>
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.
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.
16 ;;; ========================================
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.
22 ;;; ========================================
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.
28 ;;; Ok, here's how to use this thing! First, install Guix.
30 ;;; guix environment -l guix-env.scm --pure
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.
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:
41 ;;; use guix -l guix-env.scm
43 ;;; To set things up for the first time, you'll also need to run:
44 ;;; git submodule init
45 ;;; git submodule update
47 ;;; ./configure --with-python3 --without-virtualenv
49 ;;; python3 -m venv --system-site-packages . && bin/python setup.py develop --no-deps
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.
58 ;;; The devtools/update_extlib.sh script won't run on Guix due to missing
59 ;;; "/usr/bin/env", so then run:
60 ;;; node node_modules/.bin/bower install
61 ;;; ./devtools/update_extlib.sh
63 ;;; bin/gmg adduser --username admin --password a --email admin@example.com
66 ;;; So anyway, now you can do:
67 ;;; PYTHONPATH="${PYTHONPATH}:$(pwd)" ./runtests.sh
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.
76 ;;; - currently fails to upload h264 source video: "GStreamer: missing H.264 decoder"
78 (use-modules (ice-9 match)
84 (guix build-system gnu)
85 (guix build-system python)
87 (gnu packages autotools)
91 (gnu packages databases)
93 (gnu packages python-crypto)
94 (gnu packages python-web)
95 (gnu packages python-xyz)
97 (gnu packages gstreamer)
102 (gnu packages version-control)
104 ((guix licenses) #:select (expat zlib) #:prefix license:))
106 ;; =================================================================
107 ;; These packages are on their way into Guix proper but haven't made
108 ;; it in yet... or they're old versions of packages we're pinning
110 ;; =================================================================
112 (define python-pytest-forked
114 (name "python-pytest-forked")
119 (uri (pypi-uri "pytest-forked" version))
122 "0f4y1jhcg70xhm220pdb8r24n01knhn749aqlr14vmgbsb7allnk"))))
123 (build-system python-build-system)
125 `(("python-pytest" ,python-pytest)
126 ("python-setuptools-scm" ,python-setuptools-scm)))
128 "https://github.com/pytest-dev/pytest-forked")
130 "run tests in isolated forked subprocesses")
132 "run tests in isolated forked subprocesses")
133 (license license:expat)))
135 ;; =================================================================
144 (uri (pypi-uri "mediagoblin" version))
147 "0p2gj4z351166d1zqmmd8wc9bzb69w0fjm8qq1fs8dw2yhcg2wwv"))))
148 (build-system python-build-system)
150 ;; Complains about missing gunicorn. Not sure where that comes from.
153 `(("python-pytest" ,python-pytest)
154 ("nss-certs" ,nss-certs)))
156 `(("python-alembic" ,python-alembic)
157 ("python-pytest-xdist" ,python-pytest-xdist)
158 ("python-pytest-forked" ,python-pytest-forked)
159 ("python-celery" ,python-celery)
160 ("python-kombu" ,python-kombu)
161 ("python-webtest" ,python-webtest)
162 ("python-pastedeploy" ,python-pastedeploy)
163 ("python-paste" ,python-paste)
164 ("python-pastescript" ,python-pastescript)
165 ("python-translitcodec" ,python-translitcodec)
166 ("python-babel" ,python-babel)
167 ("python-configobj" ,python-configobj)
168 ("python-dateutil" ,python-dateutil)
169 ("python-itsdangerous" ,python-itsdangerous)
170 ("python-jinja2" ,python-jinja2)
171 ("python-jsonschema" ,python-jsonschema)
172 ("python-lxml" ,python-lxml)
173 ("python-markdown" ,python-markdown)
174 ("python-oauthlib" ,python-oauthlib)
175 ("python-pillow" ,python-pillow)
176 ("python-py-bcrypt" ,python-py-bcrypt)
177 ("python-pyld" ,python-pyld)
178 ("python-pytz" ,python-pytz)
179 ("python-requests" ,python-requests)
180 ("python-setuptools" ,python-setuptools)
181 ("python-six" ,python-six)
182 ("python-sphinx" ,python-sphinx)
183 ("python-docutils" ,python-docutils)
184 ("python-sqlalchemy" ,python-sqlalchemy)
185 ("python-unidecode" ,python-unidecode)
186 ("python-werkzeug" ,python-werkzeug) ; Broken due to missing werkzeug.contrib.atom in 1.0.0.
187 ("python-exif-read" ,python-exif-read)
188 ("python-wtforms" ,python-wtforms)))
189 (home-page "http://mediagoblin.org/")
190 (synopsis "Web application for media publishing")
191 (description "MediaGoblin is a web application for publishing all kinds of
196 (inherit mediagoblin)
197 (name "mediagoblin-hackenv")
200 `(;;; audio/video stuff
201 ("gstreamer" ,gstreamer)
202 ("gst-libav" ,gst-plugins-base)
203 ("gst-plugins-base" ,gst-plugins-base)
204 ("gst-plugins-good" ,gst-plugins-good)
205 ("gst-plugins-bad" ,gst-plugins-bad)
206 ("gst-plugins-ugly" ,gst-plugins-ugly)
207 ("gobject-introspection" ,gobject-introspection)
209 ("coreutils" ,coreutils)
210 ;; used by runtests.sh!
213 ("automake" ,automake)
214 ("autoconf" ,autoconf)
215 ,@(package-inputs mediagoblin)))
218 ("python-virtualenv" ,python-virtualenv)
219 ("python-pygobject" ,python-pygobject)
220 ("python-gst" ,python-gst)
221 ;; Needs python-gst in order for all tests to pass
222 ("python-numpy" ,python-numpy) ; this pulls in texlive...
223 ; and texlive-texmf is very large...
224 ("python-chardet", python-chardet)
225 ("python-psycopg2" ,python-psycopg2)
230 ,@(package-propagated-inputs mediagoblin))))