mono.scm 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
  3. ;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
  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. (define-module (gnu packages mono)
  20. #:use-module ((guix licenses) #:prefix license:)
  21. #:use-module (gnu packages fontutils)
  22. #:use-module (gnu packages gettext)
  23. #:use-module (gnu packages glib)
  24. #:use-module (gnu packages gtk)
  25. #:use-module (gnu packages image)
  26. #:use-module (gnu packages perl)
  27. #:use-module (gnu packages photo)
  28. #:use-module (gnu packages pkg-config)
  29. #:use-module (gnu packages python)
  30. #:use-module (gnu packages xml)
  31. #:use-module (gnu packages)
  32. #:use-module (guix packages)
  33. #:use-module (guix download)
  34. #:use-module (guix git-download)
  35. #:use-module (guix build-system gnu))
  36. (define-public mono
  37. (package
  38. (name "mono")
  39. (version "4.4.1.0")
  40. (source (origin
  41. (method url-fetch)
  42. (uri (string-append
  43. "http://download.mono-project.com/sources/mono/"
  44. name "-" version
  45. ".tar.bz2"))
  46. (sha256
  47. (base32
  48. "0jibyvyv2jy8dq5ij0j00iq3v74r0y90dcjc3dkspcfbnn37cphn"))
  49. (patches (search-patches "mono-mdoc-timestamping.patch"))))
  50. (build-system gnu-build-system)
  51. (native-inputs
  52. `(("gettext" ,gettext-minimal)
  53. ("glib" ,glib)
  54. ("libxslt" ,libxslt)
  55. ("perl" ,perl)
  56. ("python" ,python-2)))
  57. (arguments
  58. `(#:phases
  59. (modify-phases %standard-phases
  60. (add-after 'unpack 'make-reproducible
  61. (lambda _
  62. (substitute* "mono/mini/Makefile.in"
  63. (("build_date = [^;]*;")
  64. "build_date = (void*) 0;"))
  65. #t))
  66. (add-after 'unpack 'set-env
  67. (lambda _ ;;* (#:key inputs #:allow-other-keys)
  68. ;; all tests under mcs/class fail trying to access $HOME
  69. (setenv "HOME" "/tmp")
  70. ;; ZIP files have "DOS time" which starts in Jan 1980.
  71. (setenv "SOURCE_DATE_EPOCH" "315532800")
  72. #t))
  73. (add-after 'unpack 'fix-includes
  74. (lambda _
  75. ;; makedev is in <sys/sysmacros.h> now. Include it.
  76. (substitute* "mono/io-layer/processes.c"
  77. (("#ifdef HAVE_SYS_MKDEV_H") "#if 1")
  78. (("sys/mkdev.h") "sys/sysmacros.h"))
  79. #t))
  80. (add-after 'unpack 'patch-tests
  81. (lambda _ ;;* (#:key inputs #:allow-other-keys)
  82. (substitute* "mono/tests/Makefile.in"
  83. ;; does not build: no rule to make unhandled-exception-*
  84. (("@test-unhandled-exception-2:" all)
  85. (string-append all "#")))
  86. (substitute* "mcs/tools/mono-symbolicate/Makefile"
  87. ;; does not build: Source file `Test/StackTraceDumper.cs'
  88. ;; could not be found
  89. (("^check: test-local") "check:\ntest-local:")
  90. (("^test-local: all") "disabled-test-local:"))
  91. (substitute* "mono/unit-tests/Makefile.in"
  92. ;; test fails
  93. (("^test-sgen-qsort.log:")
  94. "disabled-test-sgen-qsort.log:\ntest-sgen-qsort.log:"))
  95. ;; tests fail, trying to access $HOME
  96. (substitute* "mcs/class/Makefile"
  97. (("^include ../build/rules.make" all)
  98. (string-append
  99. all
  100. "\nrun-test-recursive:\n\t@echo skipping tests\n")))
  101. ;; tests fail, trying to access $HOME
  102. (substitute* "mcs/class/Microsoft.Build.Tasks/Makefile"
  103. (("^include ../../build/rules.make" all)
  104. (string-append
  105. all
  106. "\nrun-test-recursive:\n\t@echo skipping tests\n")))
  107. (substitute* '("mcs/tools/mono-shlib-cop/Makefile"
  108. "mcs/tools/mdoc/Makefile")
  109. (("^run-test-local:" all)
  110. (string-append "#" all)))
  111. (substitute* "mcs/tools/sqlmetal/Makefile"
  112. (("^include ../../build/rules.make" all)
  113. (string-append
  114. "NO_TEST:=true\n"
  115. all
  116. "\nrun-test-lib:\n\t@echo skipping test\n"))))))
  117. ;; these 4 tests fail
  118. #:make-flags `(,(string-append "PLATFORM_DISABLED_TESTS="
  119. " appdomain-unload.exe"
  120. " delegate2.exe"
  121. " finally_guard.exe"
  122. " remoting4.exe"))
  123. ;; running tests in parallel fails
  124. #:parallel-tests? #f))
  125. (synopsis "Compiler and libraries for the C# programming language")
  126. (description "Mono is a compiler, vm, debugger and set of libraries for
  127. C#, a C-style programming language from Microsoft that is very similar to
  128. Java.")
  129. (home-page "https://www.mono-project.com/")
  130. (license license:x11)))
  131. (define-public libgdiplus
  132. (package
  133. (name "libgdiplus")
  134. (version "6.0.5")
  135. (source
  136. (origin
  137. (method url-fetch)
  138. (uri (string-append
  139. "http://download.mono-project.com/sources/libgdiplus/libgdiplus-"
  140. version
  141. ".tar.gz"))
  142. (sha256
  143. (base32
  144. "1vr5l09i5i91n9qzky7ab9wwvgdidvrbw26y8llip0z4qdf4w7mq"))))
  145. (build-system gnu-build-system)
  146. (native-inputs
  147. (list pkg-config))
  148. (inputs
  149. `(("glib" ,glib)
  150. ("cairo" ,cairo)
  151. ("fontconfig" ,fontconfig)
  152. ("libtiff" ,libtiff)
  153. ("libjpeg" ,libjpeg-turbo)
  154. ("libexif" ,libexif)
  155. ("libungif" ,libungif)))
  156. (arguments
  157. `(#:phases
  158. (modify-phases %standard-phases
  159. ;; TODO: See with upstream why they fail.
  160. ;; https://github.com/mono/mono/issues/18934
  161. (add-before 'configure 'remove-buggy-tests
  162. (lambda _
  163. (substitute* "tests/Makefile.in"
  164. (("testicocodec\\$\\(EXEEXT\\) ") " ")
  165. (("testfont\\$\\(EXEEXT\\) ") " "))
  166. #t)))))
  167. (home-page "https://www.mono-project.com/docs/gui/libgdiplus/")
  168. (synopsis "Mono library that provides a GDI+-compatible API")
  169. (description "Libgdiplus is the Mono library that provides a
  170. GDI+-compatible API on non-Windows operating systems. The implementation uses
  171. Cairo to do most of the heavy lifting.")
  172. (license license:gpl3+)))