| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 |
|
| 37 | (define-module (gnu packages ruby)
|
| 38 | #:use-module ((guix licenses) #:prefix license:)
|
| 39 | #:use-module (gnu packages)
|
| 40 | #:use-module (gnu packages base)
|
| 41 | #:use-module (gnu packages bison)
|
| 42 | #:use-module (gnu packages c)
|
| 43 | #:use-module (gnu packages check)
|
| 44 | #:use-module (gnu packages compression)
|
| 45 | #:use-module (gnu packages crypto)
|
| 46 | #:use-module (gnu packages curl)
|
| 47 | #:use-module (gnu packages databases)
|
| 48 | #:use-module (gnu packages dbm)
|
| 49 | #:use-module (gnu packages freedesktop)
|
| 50 | #:use-module (gnu packages rails)
|
| 51 | #:use-module (gnu packages readline)
|
| 52 | #:use-module (gnu packages autotools)
|
| 53 | #:use-module (gnu packages graphviz)
|
| 54 | #:use-module (gnu packages haskell-xyz)
|
| 55 | #:use-module (gnu packages java)
|
| 56 | #:use-module (gnu packages libffi)
|
| 57 | #:use-module (gnu packages libidn)
|
| 58 | #:use-module (gnu packages linux)
|
| 59 | #:use-module (gnu packages lsof)
|
| 60 | #:use-module (gnu packages man)
|
| 61 | #:use-module (gnu packages maths)
|
| 62 | #:use-module (gnu packages multiprecision)
|
| 63 | #:use-module (gnu packages ncurses)
|
| 64 | #:use-module (gnu packages networking)
|
| 65 | #:use-module (gnu packages node)
|
| 66 | #:use-module (gnu packages perl)
|
| 67 | #:use-module (gnu packages pkg-config)
|
| 68 | #:use-module (gnu packages protobuf)
|
| 69 | #:use-module (gnu packages python)
|
| 70 | #:use-module (gnu packages python-xyz)
|
| 71 | #:use-module (gnu packages ragel)
|
| 72 | #:use-module (gnu packages rsync)
|
| 73 | #:use-module (gnu packages rust)
|
| 74 | #:use-module (gnu packages sqlite)
|
| 75 | #:use-module (gnu packages tls)
|
| 76 | #:use-module (gnu packages valgrind)
|
| 77 | #:use-module (gnu packages version-control)
|
| 78 | #:use-module (gnu packages virtualization)
|
| 79 | #:use-module (gnu packages web-browsers)
|
| 80 | #:use-module (gnu packages serialization)
|
| 81 | #:use-module (guix packages)
|
| 82 | #:use-module (guix download)
|
| 83 | #:use-module (guix git-download)
|
| 84 | #:use-module (guix gexp)
|
| 85 | #:use-module (guix modules)
|
| 86 | #:use-module (guix utils)
|
| 87 | #:use-module (guix build-system gnu)
|
| 88 | #:use-module (gnu packages xml)
|
| 89 | #:use-module (gnu packages web)
|
| 90 | #:use-module (guix build-system ruby))
|
| 91 |
|
| 92 | (define-public ruby-4.0
|
| 93 | (package
|
| 94 | (name "ruby")
|
| 95 | (version "4.0.5")
|
| 96 | (source
|
| 97 | (origin
|
| 98 | (method url-fetch)
|
| 99 | (uri (string-append "http://cache.ruby-lang.org/pub/ruby/"
|
| 100 | (version-major+minor version) "/ruby-" version
|
| 101 | ".tar.xz"))
|
| 102 | (sha256
|
| 103 | (base32 "1rcm13iib4ypmsclrh315r47pch4807ml6qbq5n6wwjcllg55iax"))))
|
| 104 | (build-system gnu-build-system)
|
| 105 | (arguments
|
| 106 | (list
|
| 107 | #:test-target "test"
|
| 108 | #:configure-flags (if (%current-target-system)
|
| 109 | #~(list (string-append "LDFLAGS=-Wl,-rpath="
|
| 110 | (assoc-ref %outputs "out")
|
| 111 | "/lib") "--enable-shared")
|
| 112 | #~'("--enable-shared")) |
| 113 | #:phases
|
| 114 | #~(modify-phases %standard-phases
|
| 115 | (add-before 'configure 'replace-bin-sh-and-remove-libffi
|
| 116 | (lambda _
|
| 117 | (substitute* '("configure.ac" "template/Makefile.in"
|
| 118 | "lib/rubygems/installer.rb"
|
| 119 | "ext/pty/pty.c"
|
| 120 | "io.c"
|
| 121 | "lib/mkmf.rb"
|
| 122 | "process.c"
|
| 123 | "test/rubygems/test_gem_ext_configure_builder.rb"
|
| 124 | "test/ruby/test_rubyoptions.rb"
|
| 125 | "test/ruby/test_process.rb"
|
| 126 | "test/ruby/test_system.rb"
|
| 127 | "tool/rbinstall.rb")
|
| 128 | (("/bin/sh")
|
| 129 | (which "sh")))))
|
| 130 | #$@(if (system-hurd?)
|
| 131 | '((add-after 'unpack 'skip-tests
|
| 132 | (lambda _
|
| 133 | (delete-file "bootstraptest/test_ractor.rb"))))
|
| 134 | '())
|
| 135 | (add-after 'install 'delete-mkmf.log
|
| 136 | (lambda _
|
| 137 | |
| 138 | |
| 139 | |
| 140 | (for-each delete-file
|
| 141 | (find-files #$output "^mkmf\\.log$")))))))
|
| 142 | (native-inputs (append (if (%current-target-system)
|
| 143 | (list this-package)
|
| 144 | '())
|
| 145 | (list autoconf libyaml)))
|
| 146 | (inputs (append (list readline openssl libffi |
| 147 | gmp) |
| 148 | (if (supported-package? rust)
|
| 149 | (list rust) |
| 150 | '())))
|
| 151 | (propagated-inputs (list zlib))
|
| 152 | (native-search-paths
|
| 153 | (list (search-path-specification
|
| 154 | (variable "GEM_PATH")
|
| 155 | (files (list (string-append "lib/ruby/vendor_ruby"))))))
|
| 156 | (synopsis "Programming language interpreter")
|
| 157 | (description "Ruby is a dynamic object-oriented programming language with
|
| 158 | a focus on simplicity and productivity.")
|
| 159 | (home-page "https://www.ruby-lang.org")
|
| 160 | (license license:ruby)))
|
| 161 |
|
| 162 | (define-public ruby-3.4
|
| 163 | (package
|
| 164 | (name "ruby")
|
| 165 | (version "3.4.7")
|
| 166 | (source
|
| 167 | (origin
|
| 168 | (method url-fetch)
|
| 169 | (uri (string-append "http://cache.ruby-lang.org/pub/ruby/"
|
| 170 | (version-major+minor version)
|
| 171 | "/ruby-" version ".tar.xz"))
|
| 172 | (sha256
|
| 173 | (base32
|
| 174 | "1irh0l7g75p0arnah58ismzixa80qxn99x3qfnalcxg0ys35lhnv"))))
|
| 175 | (build-system gnu-build-system)
|
| 176 | (arguments
|
| 177 | `(#:test-target "test"
|
| 178 | #:configure-flags
|
| 179 | ,(if (%current-target-system)
|
| 180 | '(list (string-append
|
| 181 | "LDFLAGS=-Wl,-rpath="
|
| 182 | (assoc-ref %outputs "out") "/lib")
|
| 183 | "--enable-shared")
|
| 184 | ''("--enable-shared")) |
| 185 | #:phases
|
| 186 | (modify-phases %standard-phases
|
| 187 | (add-before 'configure 'replace-bin-sh-and-remove-libffi
|
| 188 | (lambda _
|
| 189 | (substitute* '("configure.ac"
|
| 190 | "template/Makefile.in"
|
| 191 | "lib/rubygems/installer.rb"
|
| 192 | "ext/pty/pty.c"
|
| 193 | "io.c"
|
| 194 | "lib/mkmf.rb"
|
| 195 | "process.c"
|
| 196 | "test/rubygems/test_gem_ext_configure_builder.rb"
|
| 197 | "test/rdoc/rdoc_parser_test.rb"
|
| 198 | "test/ruby/test_rubyoptions.rb"
|
| 199 | "test/ruby/test_process.rb"
|
| 200 | "test/ruby/test_system.rb"
|
| 201 | "tool/rbinstall.rb")
|
| 202 | (("/bin/sh") (which "sh")))))
|
| 203 | ,@(if (system-hurd?)
|
| 204 | '((add-after 'unpack 'skip-tests
|
| 205 | (lambda _
|
| 206 | (delete-file "bootstraptest/test_ractor.rb"))))
|
| 207 | '()))))
|
| 208 | (native-inputs
|
| 209 | (append (if (%current-target-system)
|
| 210 | (list this-package)
|
| 211 | '())
|
| 212 | (list autoconf libyaml)))
|
| 213 | (inputs
|
| 214 | (list readline openssl-1.1 libffi gdbm))
|
| 215 | (propagated-inputs
|
| 216 | (list zlib))
|
| 217 | (native-search-paths
|
| 218 | (list (search-path-specification
|
| 219 | (variable "GEM_PATH")
|
| 220 | (files (list (string-append "lib/ruby/vendor_ruby"))))))
|
| 221 | (synopsis "Programming language interpreter")
|
| 222 | (description "Ruby is a dynamic object-oriented programming language with
|
| 223 | a focus on simplicity and productivity.")
|
| 224 | (home-page "https://www.ruby-lang.org")
|
| 225 | (license license:ruby)))
|
| 226 |
|
| 227 | (define-public ruby-3.3
|
| 228 | (package
|
| 229 | (name "ruby")
|
| 230 | (version "3.3.9")
|
| 231 | (source
|
| 232 | (origin
|
| 233 | (method url-fetch)
|
| 234 | (uri (string-append "http://cache.ruby-lang.org/pub/ruby/"
|
| 235 | (version-major+minor version)
|
| 236 | "/ruby-" version ".tar.xz"))
|
| 237 | (sha256
|
| 238 | (base32
|
| 239 | "1fvng8x44x90pn8nl4sxa5nzb34jwq0is6l5k7066zrg18ca491b"))))
|
| 240 | (build-system gnu-build-system)
|
| 241 | (arguments
|
| 242 | `(#:test-target "test"
|
| 243 | #:configure-flags
|
| 244 | ,(if (%current-target-system)
|
| 245 | '(list (string-append
|
| 246 | "LDFLAGS=-Wl,-rpath="
|
| 247 | (assoc-ref %outputs "out") "/lib")
|
| 248 | "--enable-shared")
|
| 249 | ''("--enable-shared")) |
| 250 | #:phases
|
| 251 | (modify-phases %standard-phases
|
| 252 | (add-before 'configure 'replace-bin-sh-and-remove-libffi
|
| 253 | (lambda _
|
| 254 | (substitute* '("configure.ac"
|
| 255 | "template/Makefile.in"
|
| 256 | "lib/rubygems/installer.rb"
|
| 257 | "ext/pty/pty.c"
|
| 258 | "io.c"
|
| 259 | "lib/mkmf.rb"
|
| 260 | "process.c"
|
| 261 | "test/rubygems/test_gem_ext_configure_builder.rb"
|
| 262 | "test/rdoc/test_rdoc_parser.rb"
|
| 263 | "test/ruby/test_rubyoptions.rb"
|
| 264 | "test/ruby/test_process.rb"
|
| 265 | "test/ruby/test_system.rb"
|
| 266 | "tool/rbinstall.rb")
|
| 267 | (("/bin/sh") (which "sh"))))))))
|
| 268 | (native-inputs
|
| 269 | (append (if (%current-target-system)
|
| 270 | (list this-package)
|
| 271 | '())
|
| 272 | (list autoconf libyaml)))
|
| 273 | (inputs
|
| 274 | (list readline openssl-1.1 libffi gdbm))
|
| 275 | (propagated-inputs
|
| 276 | (list zlib))
|
| 277 | (native-search-paths
|
| 278 | (list (search-path-specification
|
| 279 | (variable "GEM_PATH")
|
| 280 | (files (list (string-append "lib/ruby/vendor_ruby"))))))
|
| 281 | (synopsis "Programming language interpreter")
|
| 282 | (description "Ruby is a dynamic object-oriented programming language with
|
| 283 | a focus on simplicity and productivity.")
|
| 284 | (home-page "https://www.ruby-lang.org")
|
| 285 | (license license:ruby)))
|
| 286 |
|
| 287 | (define-public ruby-2.7
|
| 288 | (package
|
| 289 | (name "ruby")
|
| 290 | (version "2.7.8")
|
| 291 | (source
|
| 292 | (origin
|
| 293 | (method url-fetch)
|
| 294 | (uri (string-append "https://cache.ruby-lang.org/pub/ruby/"
|
| 295 | (version-major+minor version)
|
| 296 | "/ruby-" version ".tar.gz"))
|
| 297 | (sha256
|
| 298 | (base32
|
| 299 | "182vni66djmiqagwzfsd0za7x9k3zag43b88c590aalgphybdnn2"))
|
| 300 | (modules '((guix build utils)))
|
| 301 | (snippet `(begin
|
| 302 | |
| 303 | (delete-file-recursively "ext/fiddle/libffi-3.2.1")
|
| 304 | #t))))
|
| 305 | (build-system gnu-build-system)
|
| 306 | (arguments
|
| 307 | `(#:test-target "test"
|
| 308 | #:configure-flags
|
| 309 | ,(if (%current-target-system)
|
| 310 | '(list (string-append
|
| 311 | "LDFLAGS=-Wl,-rpath="
|
| 312 | (assoc-ref %outputs "out") "/lib")
|
| 313 | "--enable-shared")
|
| 314 | ''("--enable-shared")) |
| 315 | #:phases
|
| 316 | (modify-phases %standard-phases
|
| 317 | (add-before 'configure 'replace-bin-sh-and-remove-libffi
|
| 318 | (lambda _
|
| 319 | (substitute* '("configure.ac"
|
| 320 | "template/Makefile.in"
|
| 321 | "lib/rubygems/installer.rb"
|
| 322 | "ext/pty/pty.c"
|
| 323 | "io.c"
|
| 324 | "lib/mkmf.rb"
|
| 325 | "process.c"
|
| 326 | "test/rubygems/test_gem_ext_configure_builder.rb"
|
| 327 | "test/rdoc/test_rdoc_parser.rb"
|
| 328 | "test/ruby/test_rubyoptions.rb"
|
| 329 | "test/ruby/test_process.rb"
|
| 330 | "test/ruby/test_system.rb"
|
| 331 | "tool/rbinstall.rb")
|
| 332 | (("/bin/sh") (which "sh")))
|
| 333 | #t))
|
| 334 | ,@(if (system-hurd?)
|
| 335 | '((add-after 'unpack 'skip-tests
|
| 336 | (lambda _
|
| 337 | (delete-file "bootstraptest/test_io.rb")
|
| 338 | (delete-file "test/ruby/test_io.rb"))))
|
| 339 | '()))))
|
| 340 | (native-inputs
|
| 341 | (append (if (%current-target-system)
|
| 342 | (list this-package)
|
| 343 | '())
|
| 344 | (list autoconf)))
|
| 345 | (inputs
|
| 346 | (list readline openssl-1.1 libffi gdbm))
|
| 347 | (propagated-inputs
|
| 348 | (list zlib))
|
| 349 | (native-search-paths
|
| 350 | (list (search-path-specification
|
| 351 | (variable "GEM_PATH")
|
| 352 | (files (list (string-append "lib/ruby/vendor_ruby"))))))
|
| 353 | (synopsis "Programming language interpreter")
|
| 354 | (description "Ruby is a dynamic object-oriented programming language with
|
| 355 | a focus on simplicity and productivity.")
|
| 356 | (home-page "https://www.ruby-lang.org")
|
| 357 | (license license:ruby)))
|
| 358 |
|
| 359 | (define-public ruby ruby-3.3)
|
| 360 |
|
| 361 | (define-public mruby
|
| 362 | (package
|
| 363 | (name "mruby")
|
| 364 | (version "3.3.0")
|
| 365 | (source
|
| 366 | (origin
|
| 367 | (method git-fetch)
|
| 368 | (uri (git-reference
|
| 369 | (url "https://github.com/mruby/mruby")
|
| 370 | (commit version)))
|
| 371 | (file-name (git-file-name name version))
|
| 372 | (sha256
|
| 373 | (base32
|
| 374 | "0zynr6dk0zxdip53il0qr0rhyzmjicpkxs63l77acpx8b05h8amc"))))
|
| 375 | (build-system gnu-build-system)
|
| 376 | (arguments
|
| 377 | `(#:test-target "test"
|
| 378 | #:phases
|
| 379 | (modify-phases %standard-phases
|
| 380 | (delete 'configure)
|
| 381 | (add-after 'unpack 'enable-verbose-tests
|
| 382 | (lambda _
|
| 383 | (substitute* "Makefile"
|
| 384 | (("ruby ./minirake" m)
|
| 385 | (string-append m " --verbose")))))
|
| 386 | (add-after 'unpack 'disable-broken-tests
|
| 387 | (lambda _
|
| 388 | (substitute* "mrbgems/mruby-io/test/io.rb"
|
| 389 | (("assert\\('IO.popen.+$" m)
|
| 390 | (string-append m "skip \"Hangs in the Guix build environment\"\n"))
|
| 391 | |
| 392 | (("assert\\('`cmd`.*" m)
|
| 393 | (string-append m "skip \"Disable for Guix\"\n")))))
|
| 394 | |
| 395 | (replace 'install
|
| 396 | (lambda* (#:key outputs #:allow-other-keys)
|
| 397 | (let* ((out (assoc-ref outputs "out"))
|
| 398 | (bin (string-append out "/bin"))
|
| 399 | (lib (string-append out "/lib"))
|
| 400 | (inc (string-append out "/include")))
|
| 401 | (mkdir-p bin)
|
| 402 | (copy-recursively "build/host/bin" bin)
|
| 403 | (mkdir-p lib)
|
| 404 | (copy-recursively "build/host/lib" lib)
|
| 405 | (mkdir-p inc)
|
| 406 | (copy-recursively "include" inc)))))))
|
| 407 | (native-inputs
|
| 408 | (list ruby bison))
|
| 409 | (home-page "https://github.com/mruby/mruby")
|
| 410 | (synopsis "Lightweight Ruby")
|
| 411 | (description "mruby is the lightweight implementation of the Ruby
|
| 412 | language. Its syntax is Ruby 3.x compatible except for pattern
|
| 413 | matching. mruby can be linked and embedded within your application.")
|
| 414 | (license license:expat)))
|
| 415 |
|
| 416 | |
| 417 | |
| 418 | |
| 419 | |
| 420 | |