Merge branch 'staging' into core-updates
[jackhill/guix/guix.git] / gnu / packages / mono.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
3 ;;;
4 ;;; This file is part of GNU Guix.
5 ;;;
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.
10 ;;;
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.
15 ;;;
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/>.
18
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))
31
32 (define-public mono
33 (package
34 (name "mono")
35 (version "4.4.1.0")
36 (source (origin
37 (method url-fetch)
38 (uri (string-append
39 "http://download.mono-project.com/sources/mono/"
40 name "-" version
41 ".tar.bz2"))
42 (sha256
43 (base32
44 "0jibyvyv2jy8dq5ij0j00iq3v74r0y90dcjc3dkspcfbnn37cphn"))
45 (patches (search-patches "mono-mdoc-timestamping.patch"))))
46 (build-system gnu-build-system)
47 (native-inputs
48 `(("gettext" ,gettext-minimal)
49 ("glib" ,glib)
50 ("libxslt" ,libxslt)
51 ("perl" ,perl)
52 ("python" ,python-2)))
53 (arguments
54 `(#:phases
55 (modify-phases %standard-phases
56 (add-after 'unpack 'make-reproducible
57 (lambda _
58 (substitute* "mono/mini/Makefile.in"
59 (("build_date = [^;]*;")
60 "build_date = (void*) 0;"))
61 #t))
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")
68 #t))
69 (add-after 'unpack 'fix-includes
70 (lambda _
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"))
75 #t))
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'
84 ;; could not be found
85 (("^check: test-local") "check:\ntest-local:")
86 (("^test-local: all") "disabled-test-local:"))
87 (substitute* "mono/unit-tests/Makefile.in"
88 ;; test fails
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)
94 (string-append
95 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)
100 (string-append
101 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)
109 (string-append
110 "NO_TEST:=true\n"
111 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"
116 " delegate2.exe"
117 " finally_guard.exe"
118 " remoting4.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
124 Java.")
125 (home-page "https://www.mono-project.com/")
126 (license license:x11)))