Commit | Line | Data |
---|---|---|
90322fdb MJ |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2016 Matthew Jordan <matthewjordandevops@yandex.com> | |
9923d5a4 | 3 | ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr> |
90322fdb MJ |
4 | ;;; |
5 | ;;; This file is part of GNU Guix. | |
6 | ;;; | |
7 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
8 | ;;; under the terms of the GNU General Public License as published by | |
9 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
10 | ;;; your option) any later version. | |
11 | ;;; | |
12 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
13 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | ;;; GNU General Public License for more details. | |
16 | ;;; | |
17 | ;;; You should have received a copy of the GNU General Public License | |
18 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
19 | ||
20 | (define-module (gnu packages rails) | |
21 | #:use-module ((guix licenses) #:prefix license:) | |
22 | #:use-module (guix download) | |
24412de4 | 23 | #:use-module (guix git-download) |
90322fdb MJ |
24 | #:use-module (guix packages) |
25 | #:use-module (gnu packages ruby) | |
26 | #:use-module (guix build-system ruby)) | |
27 | ||
3aeb6e1d MJ |
28 | (define-public ruby-spring |
29 | (package | |
30 | (name "ruby-spring") | |
29f49403 | 31 | (version "1.7.2") |
3aeb6e1d MJ |
32 | (source |
33 | (origin | |
34 | (method url-fetch) | |
35 | (uri | |
36 | (string-append "https://github.com/rails/spring/archive/v" | |
37 | version ".tar.gz")) | |
38 | (file-name (string-append name "-" version ".tar.gz")) | |
39 | (sha256 | |
40 | (base32 | |
29f49403 | 41 | "1dd58y0cpsm2izj74yscn0ybfygmgcbbfdw1891g7cq41aai4b35")))) |
3aeb6e1d MJ |
42 | (build-system ruby-build-system) |
43 | (arguments | |
44 | `(#:test-target "test:unit" | |
45 | #:phases | |
46 | (modify-phases %standard-phases | |
47 | (add-before 'check 'remove-bump | |
48 | (lambda _ | |
49 | (substitute* "spring.gemspec" | |
29f49403 BW |
50 | (("gem.add_development_dependency 'bump'") "") |
51 | (("gem.add_development_dependency 'activesupport'.*") | |
52 | "gem.add_development_dependency 'activesupport'\n")) | |
3aeb6e1d MJ |
53 | (substitute* "Rakefile" |
54 | (("require \\\"bump/tasks\\\"") "")) | |
55 | #t))))) | |
56 | (native-inputs | |
57 | `(("bundler" ,bundler) | |
58 | ("ruby-activesupport" ,ruby-activesupport))) | |
59 | (synopsis "Ruby on Rails application preloader") | |
60 | (description | |
61 | "Spring is a Ruby on Rails application preloader. It speeds up | |
62 | development by keeping your application running in the background so the | |
63 | application does need to boot it every time you run a test, rake task or | |
64 | migration.") | |
65 | (home-page "https://github.com/rails/spring") | |
66 | (license license:expat))) | |
67 | ||
90322fdb MJ |
68 | (define-public ruby-debug-inspector |
69 | (package | |
70 | (name "ruby-debug-inspector") | |
eec0c587 | 71 | (version "0.0.3") |
90322fdb MJ |
72 | (source |
73 | (origin | |
74 | (method url-fetch) | |
75 | (uri (rubygems-uri "debug_inspector" version)) | |
76 | (sha256 | |
77 | (base32 | |
eec0c587 | 78 | "0vxr0xa1mfbkfcrn71n7c4f2dj7la5hvphn904vh20j3x4j5lrx0")))) |
90322fdb MJ |
79 | (build-system ruby-build-system) |
80 | (arguments | |
81 | `(#:phases | |
82 | (modify-phases %standard-phases | |
83 | (replace 'check | |
84 | (lambda _ | |
9923d5a4 TGR |
85 | (invoke "rake" "compile") |
86 | (invoke "ruby" "-Ilib" "-e" | |
87 | (string-append | |
88 | "require 'debug_inspector'; RubyVM::DebugInspector." | |
89 | "open{|dc| p dc.backtrace_locations}"))))))) | |
90322fdb MJ |
90 | (synopsis "Ruby wrapper for the MRI 2.0 debug_inspector API") |
91 | (description | |
92 | "This package provides a Ruby wrapper for the MRI 2.0 debug_inspector | |
93 | API.") | |
94 | (home-page | |
95 | "https://github.com/banister/debug_inspector") | |
96 | (license license:expat))) | |
29fa6d84 CB |
97 | |
98 | (define-public ruby-activemodel | |
99 | (package | |
100 | (name "ruby-activemodel") | |
101 | (version "5.2.2") | |
102 | (source | |
103 | (origin | |
104 | (method url-fetch) | |
105 | (uri (rubygems-uri "activemodel" version)) | |
106 | (sha256 | |
107 | (base32 | |
108 | "1xmwi3mw8g4shbjvkhk72ra3r5jccbdsd4piphqka2y1h8s7sxvi")))) | |
109 | (build-system ruby-build-system) | |
110 | (arguments | |
111 | '(;; No included tests | |
112 | #:tests? #f)) | |
113 | (propagated-inputs | |
114 | `(("ruby-activesupport" ,ruby-activesupport))) | |
115 | (synopsis "Toolkit for building modeling frameworks like Active Record") | |
116 | (description | |
117 | "This package provides a toolkit for building modeling frameworks like | |
118 | Active Record. ActiveSupport handles attributes, callbacks, validations, | |
119 | serialization, internationalization, and testing.") | |
120 | (home-page "https://rubyonrails.org/") | |
121 | (license license:expat))) | |
13cf6aee CB |
122 | |
123 | (define-public ruby-activerecord | |
124 | (package | |
125 | (name "ruby-activerecord") | |
126 | (version "5.2.2") | |
127 | (source | |
128 | (origin | |
129 | (method url-fetch) | |
130 | (uri (rubygems-uri "activerecord" version)) | |
131 | (sha256 | |
132 | (base32 | |
133 | "19a0sns6a5wz2wym25lb1dv4lbrrl5sd1n15s5ky2636znmhz30y")))) | |
134 | (build-system ruby-build-system) | |
135 | (arguments | |
136 | '(;; No included tests | |
137 | #:tests? #f)) | |
138 | (propagated-inputs | |
139 | `(("ruby-activemodel" ,ruby-activemodel) | |
140 | ("ruby-activesupport" ,ruby-activesupport) | |
141 | ("ruby-arel" ,ruby-arel))) | |
142 | (synopsis "Ruby library to connect to relational databases") | |
143 | (description | |
144 | "Active Record connects classes to relational database table to establish | |
145 | an almost zero-configuration persistence layer for applications.") | |
146 | (home-page "https://rubyonrails.org") | |
147 | (license license:expat))) | |
ab654da5 CB |
148 | |
149 | (define-public ruby-rails-html-sanitizer | |
150 | (package | |
151 | (name "ruby-rails-html-sanitizer") | |
152 | (version "1.0.4") | |
153 | (source | |
154 | (origin | |
155 | (method url-fetch) | |
156 | (uri (rubygems-uri "rails-html-sanitizer" version)) | |
157 | (sha256 | |
158 | (base32 | |
159 | "1gv7vr5d9g2xmgpjfq4nxsqr70r9pr042r9ycqqnfvw5cz9c7jwr")))) | |
160 | (build-system ruby-build-system) | |
161 | (arguments | |
162 | '(;; No included tests | |
163 | #:tests? #f)) | |
164 | (propagated-inputs | |
165 | `(("ruby-loofah" ,ruby-loofah))) | |
166 | (synopsis "HTML sanitization for Rails applications") | |
167 | (description | |
168 | "This gem is used to handle HTML sanitization in Rails applications. If | |
169 | you need similar functionality in non Rails apps consider using Loofah | |
170 | directly.") | |
171 | (home-page "https://github.com/rails/rails-html-sanitizer") | |
172 | (license license:expat))) | |
24412de4 CB |
173 | |
174 | (define-public ruby-rails-dom-testing | |
175 | (package | |
176 | (name "ruby-rails-dom-testing") | |
177 | (version "2.0.2") | |
178 | (source | |
179 | (origin | |
180 | (method git-fetch) | |
181 | (uri (git-reference | |
182 | (url "https://github.com/rails/rails-dom-testing.git") | |
183 | (commit (string-append "v" version)))) | |
184 | (file-name (git-file-name name version)) | |
185 | (sha256 | |
186 | (base32 | |
187 | "0zrg6x1w3wjgklbhcphjmggl11jx5s8cl21qjqij7wknm412i5wl")))) | |
188 | (build-system ruby-build-system) | |
189 | (native-inputs | |
190 | `(("bundler" ,bundler))) | |
191 | (propagated-inputs | |
192 | `(("ruby-activesupport" ,ruby-activesupport) | |
193 | ("ruby-nokogiri" ,ruby-nokogiri))) | |
194 | (synopsis "Compare HTML DOMs and assert certain elements exists") | |
195 | (description | |
196 | "This gem can compare HTML and assert certain elements exists. This is | |
197 | useful when writing tests.") | |
198 | (home-page "https://github.com/rails/rails-dom-testing") | |
199 | (license license:expat))) | |
1c48c539 CB |
200 | |
201 | (define-public ruby-actionview | |
202 | (package | |
203 | (name "ruby-actionview") | |
204 | (version "5.2.2") | |
205 | (source | |
206 | (origin | |
207 | (method url-fetch) | |
208 | (uri (rubygems-uri "actionview" version)) | |
209 | (sha256 | |
210 | (base32 | |
211 | "1lz04drbi1z0xhvb8jnr14pbf505lilr02arahxq7y3mxiz0rs8z")))) | |
212 | (build-system ruby-build-system) | |
213 | (arguments | |
214 | '(;; No included tests | |
215 | #:tests? #f)) | |
216 | (propagated-inputs | |
217 | `(("ruby-activesupport" ,ruby-activesupport) | |
218 | ("ruby-builder" ,ruby-builder) | |
219 | ("ruby-erubi" ,ruby-erubi) | |
220 | ("ruby-rails-dom-testing" ,ruby-rails-dom-testing) | |
221 | ("ruby-rails-html-sanitizer" ,ruby-rails-html-sanitizer))) | |
222 | (synopsis "Conventions and helpers for building web pages") | |
223 | (description | |
224 | "ActionView provides conventions and helpers for building web pages in | |
225 | Ruby.") | |
226 | (home-page "https://rubyonrails.org/") | |
227 | (license license:expat))) | |
7b062e98 CB |
228 | |
229 | (define-public ruby-actionpack | |
230 | (package | |
231 | (name "ruby-actionpack") | |
232 | (version "5.2.2") | |
233 | (source | |
234 | (origin | |
235 | (method url-fetch) | |
236 | (uri (rubygems-uri "actionpack" version)) | |
237 | (sha256 | |
238 | (base32 | |
239 | "0iwhbqqn0cm39dq040iwq8cfyclqk3kyzwlp5k3j5cz8k2668wws")))) | |
240 | (build-system ruby-build-system) | |
241 | (arguments | |
242 | '(;; No included tests | |
243 | #:tests? #f)) | |
244 | (propagated-inputs | |
245 | `(("ruby-actionview" ,ruby-actionview) | |
246 | ("ruby-activesupport" ,ruby-activesupport) | |
247 | ("ruby-rack" ,ruby-rack) | |
248 | ("ruby-rack-test" ,ruby-rack-test) | |
249 | ("ruby-rails-dom-testing" ,ruby-rails-dom-testing) | |
250 | ("ruby-rails-html-sanitizer" ,ruby-rails-html-sanitizer))) | |
251 | (synopsis "Conventions for building and testing MVC web applications") | |
252 | (description | |
253 | "ActionPack provides conventions for building and testing MVC web | |
254 | applications. These work with any Rack-compatible server.") | |
255 | (home-page "https://rubyonrails.org/") | |
256 | (license license:expat))) | |
937c8862 CB |
257 | |
258 | (define-public ruby-actioncable | |
259 | (package | |
260 | (name "ruby-actioncable") | |
261 | (version "5.2.2") | |
262 | (source | |
263 | (origin | |
264 | (method url-fetch) | |
265 | (uri (rubygems-uri "actioncable" version)) | |
266 | (sha256 | |
267 | (base32 | |
268 | "0826k5ch0l03f9yrkxy69aiv039z4qi00lnahw2rzywd2iz6r68x")))) | |
269 | (build-system ruby-build-system) | |
270 | (arguments | |
271 | '(;; No included tests | |
272 | #:tests? #f)) | |
273 | (propagated-inputs | |
274 | `(("ruby-actionpack" ,ruby-actionpack) | |
275 | ("ruby-nio4r" ,ruby-nio4r) | |
276 | ("ruby-websocket-driver" ,ruby-websocket-driver))) | |
277 | (synopsis "Integrate integrates WebSockets with Rails applications") | |
278 | (description | |
279 | "Action Cable integrates WebSockets with Rails applications. Through | |
280 | WebSockets it allows for real-time features in web applications.") | |
281 | (home-page "https://rubyonrails.org/") | |
282 | (license license:expat))) | |
ca09c4b5 CB |
283 | |
284 | (define-public ruby-activejob | |
285 | (package | |
286 | (name "ruby-activejob") | |
287 | (version "5.2.2") | |
288 | (source | |
289 | (origin | |
290 | (method url-fetch) | |
291 | (uri (rubygems-uri "activejob" version)) | |
292 | (sha256 | |
293 | (base32 | |
294 | "1jjkl62x2aprg55x9rpm0h2c82vr2qr989hg3l9r21l01q4822ir")))) | |
295 | (build-system ruby-build-system) | |
296 | (arguments | |
297 | '(;; No included tests | |
298 | #:tests? #f)) | |
299 | (propagated-inputs | |
300 | `(("ruby-activesupport" ,ruby-activesupport) | |
301 | ("ruby-globalid" ,ruby-globalid))) | |
302 | (synopsis "Declare job classes for multiple backends") | |
303 | (description | |
304 | "ActiveJob allows declaring job classes in a common way across Rails | |
305 | applications.") | |
306 | (home-page "https://rubyonrails.org/") | |
307 | (license license:expat))) | |
0fc30899 | 308 | |
07884945 CB |
309 | (define-public ruby-activestorage |
310 | (package | |
311 | (name "ruby-activestorage") | |
312 | (version "5.2.2") | |
313 | (source | |
314 | (origin | |
315 | (method url-fetch) | |
316 | (uri (rubygems-uri "activestorage" version)) | |
317 | (sha256 | |
318 | (base32 | |
319 | "0c72837098sw384vk6dmrb2p7q3wx4swnibk6sw9dp4hn1vc4p31")))) | |
320 | (build-system ruby-build-system) | |
321 | (arguments | |
322 | '(;; No included tests | |
323 | #:tests? #f)) | |
324 | (propagated-inputs | |
325 | `(("ruby-actionpack" ,ruby-actionpack) | |
326 | ("ruby-activerecord" ,ruby-activerecord) | |
327 | ("ruby-marcel" ,ruby-marcel))) | |
328 | (synopsis "Integrate file storage services in to Rails applications") | |
329 | (description | |
330 | "ActiveStorage integrates file storage services with Rails applications, | |
331 | allowing files to be attached to ActiveRecord models..") | |
332 | (home-page "https://rubyonrails.org/") | |
333 | (license license:expat))) | |
334 | ||
0fc30899 CB |
335 | (define-public ruby-actionmailer |
336 | (package | |
337 | (name "ruby-actionmailer") | |
338 | (version "5.2.2") | |
339 | (source | |
340 | (origin | |
341 | (method url-fetch) | |
342 | (uri (rubygems-uri "actionmailer" version)) | |
343 | (sha256 | |
344 | (base32 | |
345 | "0sfpb8s95cmkpp9ybyp2c88r55r5llscmmnkfwcwgasz9ncjiq5n")))) | |
346 | (build-system ruby-build-system) | |
347 | (arguments | |
348 | '(;; No included tests | |
349 | #:tests? #f)) | |
350 | (propagated-inputs | |
351 | `(("ruby-actionpack" ,ruby-actionpack) | |
352 | ("ruby-actionview" ,ruby-actionview) | |
353 | ("ruby-activejob" ,ruby-activejob) | |
354 | ("ruby-mail" ,ruby-mail) | |
355 | ("ruby-rails-dom-testing" ,ruby-rails-dom-testing))) | |
356 | (synopsis "Work with emails using the controller/view pattern") | |
357 | (description | |
358 | "Compose, deliver, receive, and test emails using the controller/view | |
359 | pattern. Including support for multipart email and attachments.") | |
360 | (home-page "https://rubyonrails.org/") | |
361 | (license license:expat))) | |
c8f079ca CB |
362 | |
363 | (define-public ruby-railties | |
364 | (package | |
365 | (name "ruby-railties") | |
366 | (version "5.2.2") | |
367 | (source | |
368 | (origin | |
369 | (method url-fetch) | |
370 | (uri (rubygems-uri "railties" version)) | |
371 | (sha256 | |
372 | (base32 | |
373 | "00pnylmbz4c46mxw5lhxi8h39lndfg6fs1hpd0qd6swnjhkqsr1l")))) | |
374 | (build-system ruby-build-system) | |
375 | (arguments | |
376 | '(;; No included tests | |
377 | #:tests? #f)) | |
378 | (propagated-inputs | |
379 | `(("ruby-actionpack" ,ruby-actionpack) | |
380 | ("ruby-activesupport" ,ruby-activesupport) | |
381 | ("ruby-method-source" ,ruby-method-source) | |
382 | ("ruby-thor" ,ruby-thor))) | |
383 | (synopsis "Rails internals, including application bootup and generators") | |
384 | (description | |
385 | "@code{railties} provides the core Rails internals including handling | |
386 | application bootup, plugins, generators, and Rake tasks.") | |
387 | (home-page "https://rubyonrails.org/") | |
388 | (license license:expat))) | |
80c4bfa6 CB |
389 | |
390 | (define-public ruby-sprockets-rails | |
391 | (package | |
392 | (name "ruby-sprockets-rails") | |
393 | (version "3.2.1") | |
394 | (source | |
395 | (origin | |
396 | (method url-fetch) | |
397 | (uri (rubygems-uri "sprockets-rails" version)) | |
398 | (sha256 | |
399 | (base32 | |
400 | "0ab42pm8p5zxpv3sfraq45b9lj39cz9mrpdirm30vywzrwwkm5p1")))) | |
401 | (build-system ruby-build-system) | |
402 | (arguments | |
403 | '(;; No included tests | |
404 | #:tests? #f)) | |
405 | (propagated-inputs | |
406 | `(("ruby-actionpack" ,ruby-actionpack) | |
407 | ("ruby-activesupport" ,ruby-activesupport) | |
408 | ("ruby-sprockets" ,ruby-sprockets))) | |
409 | (synopsis "Sprockets Rails integration") | |
410 | (description | |
411 | "Provides Sprockets implementation for the Rails Asset Pipeline.") | |
412 | (home-page | |
413 | "https://github.com/rails/sprockets-rails") | |
414 | (license license:expat))) | |
a3dbfbbd | 415 | |
ad6471d4 CB |
416 | (define-public ruby-with-advisory-lock |
417 | (package | |
418 | (name "ruby-with-advisory-lock") | |
419 | (version "4.0.0") | |
420 | (source | |
421 | (origin | |
422 | (method url-fetch) | |
423 | (uri (rubygems-uri "with_advisory_lock" version)) | |
424 | (sha256 | |
425 | (base32 | |
426 | "1k37hxgmaqgsd54gplm5xim9nw3ghvqsbzaw7q4q64ha1nbd9a41")))) | |
427 | (build-system ruby-build-system) | |
428 | (arguments | |
429 | '(#:tests? #f)) ; TODO Tests require a running MySQL service | |
430 | (propagated-inputs | |
431 | `(("ruby-activerecord" ,ruby-activerecord))) | |
432 | (native-inputs | |
433 | `(("bundler" ,bundler) | |
434 | ("ruby-yard" ,ruby-yard) | |
435 | ("ruby-mysql2" ,ruby-mysql2))) | |
436 | (synopsis "Advisory locking for ActiveRecord") | |
437 | (description | |
438 | "The With advisory lock gem adds advisory locking to ActiveRecord for | |
439 | PostgreSQL and MySQL. SQLite is also supported, but this uses the filesystem | |
440 | for locks.") | |
441 | (home-page "https://closuretree.github.io/with_advisory_lock/") | |
442 | (license license:expat))) | |
443 | ||
a3dbfbbd CB |
444 | (define-public ruby-rails |
445 | (package | |
446 | (name "ruby-rails") | |
447 | (version "5.2.2") | |
448 | (source | |
449 | (origin | |
450 | (method url-fetch) | |
451 | (uri (rubygems-uri "rails" version)) | |
452 | (sha256 | |
453 | (base32 | |
454 | "1m9cszds68dsiycciiayd3c9g90s2yzn1izkr3gpgqkfw6dmvzyr")))) | |
455 | (build-system ruby-build-system) | |
456 | (arguments | |
457 | '(#:phases | |
458 | (modify-phases %standard-phases | |
459 | ;; This gem acts as glue between the gems that actually make up | |
460 | ;; Rails. The important thing to check is that the gemspec matches up | |
461 | ;; with the Guix packages and Rubygems can successfully activate the | |
462 | ;; Rails gem. | |
463 | ;; | |
464 | ;; The following check phase tests this. | |
465 | (delete 'check) | |
466 | (add-after 'install 'check | |
467 | (lambda* (#:key tests? outputs #:allow-other-keys) | |
468 | (setenv "GEM_PATH" | |
469 | (string-append | |
470 | (getenv "GEM_PATH") | |
471 | ":" | |
472 | (assoc-ref outputs "out") "/lib/ruby/vendor_ruby")) | |
473 | (when tests? | |
474 | (invoke "ruby" "-e" "gem 'rails'")) | |
475 | #t))))) | |
476 | (propagated-inputs | |
477 | `(("ruby-activesupport" ,ruby-activesupport) | |
478 | ("ruby-actionpack" ,ruby-actionpack) | |
479 | ("ruby-actionview" ,ruby-actionview) | |
480 | ("ruby-activemodel" ,ruby-activemodel) | |
481 | ("ruby-activerecord" ,ruby-activerecord) | |
482 | ("ruby-actionmailer" ,ruby-actionmailer) | |
483 | ("ruby-activejob" ,ruby-activejob) | |
484 | ("ruby-actioncable" ,ruby-actioncable) | |
485 | ("ruby-activestorage" ,ruby-activestorage) | |
486 | ("ruby-railties" ,ruby-railties) | |
487 | ("bundler" ,bundler) | |
488 | ("ruby-sprockets-rails" ,ruby-sprockets-rails))) | |
489 | (synopsis "Full-stack web framework optimized for programmer happiness") | |
490 | (description | |
491 | "Ruby on Rails is a full-stack web framework optimized for programmer | |
492 | happiness and sustainable productivity. It encourages beautiful code by | |
493 | favoring convention over configuration.") | |
494 | (home-page "https://rubyonrails.org/") | |
495 | (license license:expat))) |