summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Neidhardt <mail@ambrevar.xyz>2020-02-27 12:01:20 +0100
committerPierre Neidhardt <mail@ambrevar.xyz>2020-02-27 12:09:12 +0100
commit0dd7fd26928bcd0284655a206bc1df4b86c6087d (patch)
tree75a14242b9084c328c27e25366a529cd9cd79bbe
parentf90808eb21948fe4910e52677b57470e769cff28 (diff)
gnu: Add mono-6.
* nongnu/packages/mono.scm (mono-6): New variable.
-rw-r--r--nongnu/packages/mono.scm116
-rw-r--r--nongnu/packages/patches/mono-mdoc-timestamping.patch15
-rw-r--r--nongnu/packages/patches/mono-pkgconfig-before-gac.patch65
3 files changed, 196 insertions, 0 deletions
diff --git a/nongnu/packages/mono.scm b/nongnu/packages/mono.scm
new file mode 100644
index 0000000..db34d08
--- /dev/null
+++ b/nongnu/packages/mono.scm
@@ -0,0 +1,116 @@
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
3;;;
4;;; This file is not 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 (nongnu packages mono)
20 #:use-module ((guix licenses) #:prefix license:)
21 #:use-module (gnu packages base)
22 #:use-module (gnu packages cmake)
23 #:use-module (gnu packages gettext)
24 #:use-module (gnu packages glib)
25 #:use-module (gnu packages mono)
26 #:use-module (gnu packages perl)
27 #:use-module (gnu packages python)
28 #:use-module (gnu packages xml)
29 #:use-module (gnu packages xorg)
30 #:use-module (gnu packages)
31 #:use-module (guix packages)
32 #:use-module (guix download)
33 #:use-module (guix build-system gnu))
34
35;; TODO: This can probably be upstreamed since only the check phase doesn't
36;; pass (even if most of the tests succeed).
37(define-public mono-6
38 (package
39 (name "mono")
40 (version "6.8.0.105")
41 (source (origin
42 (method url-fetch)
43 (uri (string-append
44 "https://download.mono-project.com/sources/mono/"
45 name "-" version ".tar.xz"))
46 (sha256
47 (base32
48 "0y11c7w6r96laqckfxnk1ya42hx2c1nfqvdgbpmsk1iw9k29k1sp"))
49 (patches
50 (parameterize
51 ((%patch-path
52 (map (lambda (directory)
53 (string-append directory "/nongnu/packages/patches"))
54 %load-path)))
55 (search-patches "mono-pkgconfig-before-gac.patch"
56 "mono-mdoc-timestamping.patch")))))
57 (build-system gnu-build-system)
58 (native-inputs
59 `(("gettext" ,gettext-minimal)
60 ("glib" ,glib)
61 ("libxslt" ,libxslt)
62 ("perl" ,perl)
63 ("python" ,python-2)
64 ("cmake" ,cmake)
65 ("which" ,which)
66 ("libgdiplus" ,libgdiplus)
67 ("libx11" ,libx11)))
68 (arguments
69 `(#:phases
70 (modify-phases %standard-phases
71 (add-after 'unpack 'make-reproducible
72 (lambda _
73 (substitute* "mono/mini/Makefile.in"
74 (("build_date = [^;]*;")
75 "build_date = (void*) 0;"))
76 #t))
77 ;; TODO: Update Mono certs. We need a certificate bundle, which nss-certs does not have.
78 ;; (add-after 'install 'update-mono-key-store
79 ;; (lambda* (#:key outputs inputs #:allow-other-keys)
80 ;; (let* ((out (assoc-ref outputs "out"))
81 ;; (ca (assoc-ref inputs "nss-certs"))
82 ;; (cert-sync (string-append out "/bin/cert-sync"))))
83 ;; (invoke cert-sync (string-append ca "/etc/ssl/certs/ca-bundle.crt")
84 (add-after 'install 'install-gmcs
85 (lambda* (#:key outputs #:allow-other-keys)
86 (let* ((out (assoc-ref outputs "out")))
87 (symlink (string-append out "/bin/mcs")
88 (string-append out "/bin/gmcs")))
89 #t))
90 (add-after 'unpack 'set-env
91 (lambda _ ;;* (#:key inputs #:allow-other-keys)
92 ;; all tests under mcs/class fail trying to access $HOME
93 (setenv "HOME" "/tmp")
94 ;; ZIP files have "DOS time" which starts in Jan 1980.
95 (setenv "SOURCE_DATE_EPOCH" "315532800")
96 #t)))
97 #:configure-flags (list
98 (string-append "--x-includes="
99 (assoc-ref %build-inputs "libx11")
100 "/include")
101 (string-append "--x-libraries="
102 (assoc-ref %build-inputs "libx11")
103 "/lib")
104 (string-append "--with-libgdiplus="
105 (assoc-ref %build-inputs "libgdiplus")
106 "/lib/libgdiplus.so"))
107 ;; TODO: Most tests pass but something fails. See bug#39695 and
108 ;; https://github.com/mono/mono/issues/18979.
109 #:tests? #f))
110 (synopsis "Compiler and libraries for the C# programming language")
111 (description "Mono is a compiler, vm, debugger and set of libraries for
112C#, a C-style programming language from Microsoft that is very similar to
113Java.")
114 (home-page "https://www.mono-project.com/")
115 ;; TODO: Still x11?
116 (license license:x11)))
diff --git a/nongnu/packages/patches/mono-mdoc-timestamping.patch b/nongnu/packages/patches/mono-mdoc-timestamping.patch
new file mode 100644
index 0000000..f7ae99a
--- /dev/null
+++ b/nongnu/packages/patches/mono-mdoc-timestamping.patch
@@ -0,0 +1,15 @@
1--- mono-4.4.1/external/api-doc-tools/monodoc/Monodoc/storage/ZipStorage.cs.orig 2018-11-26 22:16:25.008879747 +0100
2+++ mono-4.4.1/external/api-doc-tools/monodoc/Monodoc/storage/ZipStorage.cs 2018-11-26 22:21:53.969770985 +0100
3@@ -74,6 +74,12 @@
4 id = GetNewCode ();
5
6 ZipEntry entry = new ZipEntry (id);
7+ var SOURCE_DATE_EPOCH_string = Environment.GetEnvironmentVariable("SOURCE_DATE_EPOCH");
8+ if (SOURCE_DATE_EPOCH_string != null)
9+ {
10+ var SOURCE_DATE_EPOCH = Convert.ToInt64(SOURCE_DATE_EPOCH_string);
11+ entry.DateTime = new DateTime(SOURCE_DATE_EPOCH, DateTimeKind.Utc);
12+ }
13 zipOutput.PutNextEntry (entry);
14 }
15
diff --git a/nongnu/packages/patches/mono-pkgconfig-before-gac.patch b/nongnu/packages/patches/mono-pkgconfig-before-gac.patch
new file mode 100644
index 0000000..7632d85
--- /dev/null
+++ b/nongnu/packages/patches/mono-pkgconfig-before-gac.patch
@@ -0,0 +1,65 @@
1diff -Naur mono-4.0.1.old/mcs/tools/xbuild/data/12.0/Microsoft.Common.targets mono-4.0.1/mcs/tools/xbuild/data/12.0/Microsoft.Common.targets
2--- mono-4.0.1.old/mcs/tools/xbuild/data/12.0/Microsoft.Common.targets 2015-04-24 02:26:18.000000000 +0100
3+++ mono-4.0.1/mcs/tools/xbuild/data/12.0/Microsoft.Common.targets 2015-05-26 00:52:33.997847464 +0100
4@@ -229,8 +229,8 @@
5 $(ReferencePath);
6 @(AdditionalReferencePath);
7 {HintPathFromItem};
8- {TargetFrameworkDirectory};
9 {PkgConfig};
10+ {TargetFrameworkDirectory};
11 {GAC};
12 {RawFileName};
13 $(OutDir)
14diff -Naur mono-4.0.1.old/mcs/tools/xbuild/data/14.0/Microsoft.Common.targets mono-4.0.1/mcs/tools/xbuild/data/14.0/Microsoft.Common.targets
15--- mono-4.0.1.old/mcs/tools/xbuild/data/14.0/Microsoft.Common.targets 2015-04-24 02:26:18.000000000 +0100
16+++ mono-4.0.1/mcs/tools/xbuild/data/14.0/Microsoft.Common.targets 2015-05-26 00:52:41.832612748 +0100
17@@ -214,8 +214,8 @@
18 $(ReferencePath);
19 @(AdditionalReferencePath);
20 {HintPathFromItem};
21- {TargetFrameworkDirectory};
22 {PkgConfig};
23+ {TargetFrameworkDirectory};
24 {GAC};
25 {RawFileName};
26 $(OutDir)
27diff -Naur mono-4.0.1.old/mcs/tools/xbuild/data/2.0/Microsoft.Common.targets mono-4.0.1/mcs/tools/xbuild/data/2.0/Microsoft.Common.targets
28--- mono-4.0.1.old/mcs/tools/xbuild/data/2.0/Microsoft.Common.targets 2015-04-24 02:26:18.000000000 +0100
29+++ mono-4.0.1/mcs/tools/xbuild/data/2.0/Microsoft.Common.targets 2015-05-26 00:52:46.298478961 +0100
30@@ -139,8 +139,8 @@
31 $(ReferencePath);
32 @(AdditionalReferencePath);
33 {HintPathFromItem};
34- {TargetFrameworkDirectory};
35 {PkgConfig};
36+ {TargetFrameworkDirectory};
37 {GAC};
38 {RawFileName};
39 $(OutDir)
40diff -Naur mono-4.0.1.old/mcs/tools/xbuild/data/3.5/Microsoft.Common.targets mono-4.0.1/mcs/tools/xbuild/data/3.5/Microsoft.Common.targets
41--- mono-4.0.1.old/mcs/tools/xbuild/data/3.5/Microsoft.Common.targets 2015-04-24 02:26:18.000000000 +0100
42+++ mono-4.0.1/mcs/tools/xbuild/data/3.5/Microsoft.Common.targets 2015-05-26 00:52:52.119304583 +0100
43@@ -167,8 +167,8 @@
44 $(ReferencePath);
45 @(AdditionalReferencePath);
46 {HintPathFromItem};
47- {TargetFrameworkDirectory};
48 {PkgConfig};
49+ {TargetFrameworkDirectory};
50 {GAC};
51 {RawFileName};
52 $(OutDir)
53diff -Naur mono-4.0.1.old/mcs/tools/xbuild/data/4.0/Microsoft.Common.targets mono-4.0.1/mcs/tools/xbuild/data/4.0/Microsoft.Common.targets
54--- mono-4.0.1.old/mcs/tools/xbuild/data/4.0/Microsoft.Common.targets 2015-04-24 02:26:18.000000000 +0100
55+++ mono-4.0.1/mcs/tools/xbuild/data/4.0/Microsoft.Common.targets 2015-05-26 00:52:56.519172776 +0100
56@@ -229,8 +229,8 @@
57 $(ReferencePath);
58 @(AdditionalReferencePath);
59 {HintPathFromItem};
60- {TargetFrameworkDirectory};
61 {PkgConfig};
62+ {TargetFrameworkDirectory};
63 {GAC};
64 {RawFileName};
65 $(OutDir)