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