1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
4 ;;; This file is part of GNU Guix.
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; 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 gettext)
22 #:use-module (gnu packages glib)
23 #:use-module (gnu packages perl)
24 #:use-module (gnu packages python)
25 #:use-module (gnu packages xml)
26 #:use-module (gnu packages)
27 #:use-module (guix packages)
28 #:use-module (guix download)
29 #:use-module (guix git-download)
30 #:use-module (guix build-system gnu))
39 "http://download.mono-project.com/sources/mono/"
44 "0jibyvyv2jy8dq5ij0j00iq3v74r0y90dcjc3dkspcfbnn37cphn"))
45 (patches (search-patches "mono-mdoc-timestamping.patch"))))
46 (build-system gnu-build-system)
48 `(("gettext" ,gettext-minimal)
52 ("python" ,python-2)))
55 (modify-phases %standard-phases
56 (add-after 'unpack 'make-reproducible
58 (substitute* "mono/mini/Makefile.in"
59 (("build_date = [^;]*;")
60 "build_date = (void*) 0;"))
62 (add-after 'unpack 'set-env
63 (lambda _ ;;* (#:key inputs #:allow-other-keys)
64 ;; all tests under mcs/class fail trying to access $HOME
65 (setenv "HOME" "/tmp")
66 ;; ZIP files have "DOS time" which starts in Jan 1980.
67 (setenv "SOURCE_DATE_EPOCH" "315532800")
69 (add-after 'unpack 'fix-includes
71 ;; makedev is in <sys/sysmacros.h> now. Include it.
72 (substitute* "mono/io-layer/processes.c"
73 (("#ifdef HAVE_SYS_MKDEV_H") "#if 1")
74 (("sys/mkdev.h") "sys/sysmacros.h"))
76 (add-after 'unpack 'patch-tests
77 (lambda _ ;;* (#:key inputs #:allow-other-keys)
78 (substitute* "mono/tests/Makefile.in"
79 ;; does not build: no rule to make unhandled-exception-*
80 (("@test-unhandled-exception-2:" all)
81 (string-append all "#")))
82 (substitute* "mcs/tools/mono-symbolicate/Makefile"
83 ;; does not build: Source file `Test/StackTraceDumper.cs'
85 (("^check: test-local") "check:\ntest-local:")
86 (("^test-local: all") "disabled-test-local:"))
87 (substitute* "mono/unit-tests/Makefile.in"
89 (("^test-sgen-qsort.log:")
90 "disabled-test-sgen-qsort.log:\ntest-sgen-qsort.log:"))
91 ;; tests fail, trying to access $HOME
92 (substitute* "mcs/class/Makefile"
93 (("^include ../build/rules.make" all)
96 "\nrun-test-recursive:\n\t@echo skipping tests\n")))
97 ;; tests fail, trying to access $HOME
98 (substitute* "mcs/class/Microsoft.Build.Tasks/Makefile"
99 (("^include ../../build/rules.make" all)
102 "\nrun-test-recursive:\n\t@echo skipping tests\n")))
103 (substitute* '("mcs/tools/mono-shlib-cop/Makefile"
104 "mcs/tools/mdoc/Makefile")
105 (("^run-test-local:" all)
106 (string-append "#" all)))
107 (substitute* "mcs/tools/sqlmetal/Makefile"
108 (("^include ../../build/rules.make" all)
112 "\nrun-test-lib:\n\t@echo skipping test\n"))))))
113 ;; these 4 tests fail
114 #:make-flags `(,(string-append "PLATFORM_DISABLED_TESTS="
115 " appdomain-unload.exe"
119 ;; running tests in parallel fails
120 #:parallel-tests? #f))
121 (synopsis "Compiler and libraries for the C# programming language")
122 (description "Mono is a compiler, vm, debugger and set of libraries for
123 C#, a C-style programming language from Microsoft that is very similar to
125 (home-page "https://www.mono-project.com/")
126 (license license:x11)))