guix-env.scm 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  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. (use-modules (ice-9 match)
  53. (srfi srfi-1)
  54. (guix packages)
  55. (guix licenses)
  56. (guix download)
  57. (guix git-download)
  58. (guix build-system gnu)
  59. (guix build-system python)
  60. (gnu packages)
  61. (gnu packages autotools)
  62. (gnu packages base)
  63. (gnu packages python)
  64. (gnu packages gstreamer)
  65. (gnu packages glib)
  66. (gnu packages version-control)
  67. ((guix licenses) #:select (expat zlib) #:prefix license:))
  68. ;; =================================================================
  69. ;; These packages are on their way into Guix proper but haven't made
  70. ;; it in yet... or they're old versions of packages we're pinning
  71. ;; ourselves to...
  72. ;; =================================================================
  73. (define python-sqlalchemy-0.9.10
  74. (package
  75. (inherit python-sqlalchemy)
  76. (version "0.9.10")
  77. (source
  78. (origin
  79. (method url-fetch)
  80. (uri (string-append "https://pypi.python.org/packages/source/S/"
  81. "SQLAlchemy/SQLAlchemy-" version ".tar.gz"))
  82. (sha256
  83. (base32
  84. "0fqnssf7pxvc7dvd5l83vnqz2wfvpq7y01kcl1537f9nbqnvlp24"))))
  85. ;; Temporarily skipping tests. It's the stuff that got fixed in
  86. ;; the recent sqlalchemy release we struggled with on-list. The
  87. ;; patch would have to be backported here to 0.9.10.
  88. (arguments
  89. '(#:tests? #f))))
  90. (define python-alembic-0.6.6
  91. (package
  92. (inherit python-alembic)
  93. (version "0.6.6")
  94. (source
  95. (origin
  96. (method url-fetch)
  97. (uri (pypi-uri "alembic" version))
  98. (sha256
  99. (base32
  100. "0i3nic56blq079vj1iskkmllwjp980vnvvx898d3bm5qa416crcn"))))
  101. (native-inputs
  102. `(("python-nose" ,python-nose)
  103. ,@(package-native-inputs python-alembic)))
  104. (propagated-inputs
  105. `(("python-sqlalchemy" ,python-sqlalchemy-0.9.10)
  106. ("python-mako" ,python-mako)
  107. ("python-editor" ,python-editor)))))
  108. ;; =================================================================
  109. (define mediagoblin
  110. (package
  111. (name "mediagoblin")
  112. (version "0.8.1")
  113. (source
  114. (origin
  115. (method url-fetch)
  116. (uri (pypi-uri "mediagoblin" version))
  117. (sha256
  118. (base32
  119. "0p2gj4z351166d1zqmmd8wc9bzb69w0fjm8qq1fs8dw2yhcg2wwv"))))
  120. (build-system python-build-system)
  121. (native-inputs
  122. `(("python-pytest" ,python-pytest)))
  123. (propagated-inputs
  124. `(("python-alembic" ,python-alembic-0.6.6)
  125. ("python-pytest-xdist" ,python-pytest-xdist)
  126. ("python-celery" ,python-celery)
  127. ("python-kombu" ,python-kombu)
  128. ("python-webtest" ,python-webtest)
  129. ("python-pastedeploy" ,python-pastedeploy)
  130. ("python-paste" ,python-paste)
  131. ("python-pastescript" ,python-pastescript)
  132. ("python-translitcodec" ,python-translitcodec)
  133. ("python-babel" ,python-babel)
  134. ("python-configobj" ,python-configobj)
  135. ("python-dateutil-2" ,python-dateutil-2)
  136. ("python-itsdangerous" ,python-itsdangerous)
  137. ("python-jinja2" ,python-jinja2)
  138. ("python-jsonschema" ,python-jsonschema)
  139. ("python-lxml" ,python-lxml)
  140. ("python-markdown" ,python-markdown)
  141. ("python-oauthlib" ,python-oauthlib)
  142. ("python-pillow" ,python-pillow)
  143. ("python-py-bcrypt" ,python-py-bcrypt)
  144. ("python-pyld" ,python-pyld)
  145. ("python-pytz" ,python-pytz)
  146. ("python-requests" ,python-requests)
  147. ("python-setuptools" ,python-setuptools)
  148. ("python-six" ,python-six)
  149. ("python-sphinx" ,python-sphinx)
  150. ("python-docutils" ,python-docutils)
  151. ("python-sqlalchemy" ,python-sqlalchemy-0.9.10)
  152. ("python-unidecode" ,python-unidecode)
  153. ("python-werkzeug" ,python-werkzeug)
  154. ("python-exif-read" ,python-exif-read)
  155. ("python-wtforms" ,python-wtforms)))
  156. (home-page "http://mediagoblin.org/")
  157. (synopsis "Web application for media publishing")
  158. (description "MediaGoblin is a web application for publishing all kinds of
  159. media.")
  160. (license agpl3+)))
  161. (package
  162. (inherit mediagoblin)
  163. (name "mediagoblin-hackenv")
  164. (version "git")
  165. (inputs
  166. `(;;; audio/video stuff
  167. ("gstreamer" ,gstreamer)
  168. ("gst-plugins-base" ,gst-plugins-base)
  169. ("gst-plugins-good" ,gst-plugins-good)
  170. ("gst-plugins-ugly" ,gst-plugins-ugly)
  171. ("gobject-introspection" ,gobject-introspection)
  172. ;; useful to have!
  173. ("coreutils" ,coreutils)
  174. ;; used by runtests.sh!
  175. ("which" ,which)
  176. ("git" ,git)
  177. ("automake" ,automake)
  178. ("autoconf" ,(autoconf-wrapper))
  179. ,@(package-inputs mediagoblin)))
  180. (propagated-inputs
  181. `(("python" ,python)
  182. ("python-virtualenv" ,python-virtualenv)
  183. ("python-pygobject" ,python-pygobject)
  184. ;; Needs python-gst in order for all tests to pass
  185. ("python-numpy" ,python-numpy)
  186. ("python-chardet", python-chardet)
  187. ("python-psycopg2" ,python-psycopg2)
  188. ,@(package-propagated-inputs mediagoblin))))