1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
3 ;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
5 ;;; This file is part of GNU Guix.
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.
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.
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/>.
20 (define-module (gnu packages mono)
21 #:use-module ((guix licenses) #:prefix license:)
22 #:use-module (gnu packages fontutils)
23 #:use-module (gnu packages gettext)
24 #:use-module (gnu packages glib)
25 #:use-module (gnu packages gtk)
26 #:use-module (gnu packages image)
27 #:use-module (gnu packages perl)
28 #:use-module (gnu packages photo)
29 #:use-module (gnu packages pkg-config)
30 #:use-module (gnu packages python)
31 #:use-module (gnu packages xml)
32 #:use-module (gnu packages)
33 #:use-module (guix packages)
34 #:use-module (guix download)
35 #:use-module (guix git-download)
36 #:use-module (guix build-system gnu))
45 "http://download.mono-project.com/sources/mono/"
50 "0jibyvyv2jy8dq5ij0j00iq3v74r0y90dcjc3dkspcfbnn37cphn"))
51 (patches (search-patches "mono-mdoc-timestamping.patch"))))
52 (build-system gnu-build-system)
54 `(("gettext" ,gettext-minimal)
58 ("python" ,python-2)))
61 (modify-phases %standard-phases
62 (add-after 'unpack 'make-reproducible
64 (substitute* "mono/mini/Makefile.in"
65 (("build_date = [^;]*;")
66 "build_date = (void*) 0;"))
68 (add-after 'unpack 'set-env
69 (lambda _ ;;* (#:key inputs #:allow-other-keys)
70 ;; all tests under mcs/class fail trying to access $HOME
71 (setenv "HOME" "/tmp")
72 ;; ZIP files have "DOS time" which starts in Jan 1980.
73 (setenv "SOURCE_DATE_EPOCH" "315532800")
75 (add-after 'unpack 'fix-includes
77 ;; makedev is in <sys/sysmacros.h> now. Include it.
78 (substitute* "mono/io-layer/processes.c"
79 (("#ifdef HAVE_SYS_MKDEV_H") "#if 1")
80 (("sys/mkdev.h") "sys/sysmacros.h"))
82 (add-after 'unpack 'patch-tests
83 (lambda _ ;;* (#:key inputs #:allow-other-keys)
84 (substitute* "mono/tests/Makefile.in"
85 ;; does not build: no rule to make unhandled-exception-*
86 (("@test-unhandled-exception-2:" all)
87 (string-append all "#")))
88 (substitute* "mcs/tools/mono-symbolicate/Makefile"
89 ;; does not build: Source file `Test/StackTraceDumper.cs'
91 (("^check: test-local") "check:\ntest-local:")
92 (("^test-local: all") "disabled-test-local:"))
93 (substitute* "mono/unit-tests/Makefile.in"
95 (("^test-sgen-qsort.log:")
96 "disabled-test-sgen-qsort.log:\ntest-sgen-qsort.log:"))
97 ;; tests fail, trying to access $HOME
98 (substitute* "mcs/class/Makefile"
99 (("^include ../build/rules.make" all)
102 "\nrun-test-recursive:\n\t@echo skipping tests\n")))
103 ;; tests fail, trying to access $HOME
104 (substitute* "mcs/class/Microsoft.Build.Tasks/Makefile"
105 (("^include ../../build/rules.make" all)
108 "\nrun-test-recursive:\n\t@echo skipping tests\n")))
109 (substitute* '("mcs/tools/mono-shlib-cop/Makefile"
110 "mcs/tools/mdoc/Makefile")
111 (("^run-test-local:" all)
112 (string-append "#" all)))
113 (substitute* "mcs/tools/sqlmetal/Makefile"
114 (("^include ../../build/rules.make" all)
118 "\nrun-test-lib:\n\t@echo skipping test\n"))))))
119 ;; these 4 tests fail
120 #:make-flags `(,(string-append "PLATFORM_DISABLED_TESTS="
121 " appdomain-unload.exe"
125 ;; running tests in parallel fails
126 #:parallel-tests? #f))
127 (synopsis "Compiler and libraries for the C# programming language")
128 (description "Mono is a compiler, vm, debugger and set of libraries for
129 C#, a C-style programming language from Microsoft that is very similar to
131 (home-page "https://www.mono-project.com/")
132 (license license:x11)))
134 (define-public libgdiplus
142 "http://download.mono-project.com/sources/libgdiplus/libgdiplus-"
147 "0adz5813f881z65lpyf0g0w9hcn7d7qkai6sncpkwnsxfv4khp5p"))))
148 (build-system gnu-build-system)
150 `(("pkg-config" ,pkg-config)))
154 ("fontconfig" ,fontconfig)
156 ("libjpeg" ,libjpeg-turbo)
158 ("libungif" ,libungif)))
161 (modify-phases %standard-phases
162 ;; TODO: See with upstream why they fail.
163 ;; https://github.com/mono/mono/issues/18934
164 (add-before 'configure 'remove-buggy-tests
166 (substitute* "tests/Makefile.in"
167 (("testicocodec\\$\\(EXEEXT\\) ") " ")
168 (("testfont\\$\\(EXEEXT\\) ") " "))
170 (home-page "https://www.mono-project.com/docs/gui/libgdiplus/")
171 (synopsis "Mono library that provides a GDI+-compatible API")
172 (description "Libgdiplus is the Mono library that provides a
173 GDI+-compatible API on non-Windows operating systems. The implementation uses
174 Cairo to do most of the heavy lifting.")
175 (license license:gpl3+)))