| 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 | |
| 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)) |
| 37 | |
| 38 | (define-public mono |
| 39 | (package |
| 40 | (name "mono") |
| 41 | (version "4.4.1.0") |
| 42 | (source (origin |
| 43 | (method url-fetch) |
| 44 | (uri (string-append |
| 45 | "http://download.mono-project.com/sources/mono/" |
| 46 | name "-" version |
| 47 | ".tar.bz2")) |
| 48 | (sha256 |
| 49 | (base32 |
| 50 | "0jibyvyv2jy8dq5ij0j00iq3v74r0y90dcjc3dkspcfbnn37cphn")) |
| 51 | (patches (search-patches "mono-mdoc-timestamping.patch")))) |
| 52 | (build-system gnu-build-system) |
| 53 | (native-inputs |
| 54 | `(("gettext" ,gettext-minimal) |
| 55 | ("glib" ,glib) |
| 56 | ("libxslt" ,libxslt) |
| 57 | ("perl" ,perl) |
| 58 | ("python" ,python-2))) |
| 59 | (arguments |
| 60 | `(#:phases |
| 61 | (modify-phases %standard-phases |
| 62 | (add-after 'unpack 'make-reproducible |
| 63 | (lambda _ |
| 64 | (substitute* "mono/mini/Makefile.in" |
| 65 | (("build_date = [^;]*;") |
| 66 | "build_date = (void*) 0;")) |
| 67 | #t)) |
| 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") |
| 74 | #t)) |
| 75 | (add-after 'unpack 'fix-includes |
| 76 | (lambda _ |
| 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")) |
| 81 | #t)) |
| 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' |
| 90 | ;; could not be found |
| 91 | (("^check: test-local") "check:\ntest-local:") |
| 92 | (("^test-local: all") "disabled-test-local:")) |
| 93 | (substitute* "mono/unit-tests/Makefile.in" |
| 94 | ;; test fails |
| 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) |
| 100 | (string-append |
| 101 | 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) |
| 106 | (string-append |
| 107 | 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) |
| 115 | (string-append |
| 116 | "NO_TEST:=true\n" |
| 117 | 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" |
| 122 | " delegate2.exe" |
| 123 | " finally_guard.exe" |
| 124 | " remoting4.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 |
| 130 | Java.") |
| 131 | (home-page "https://www.mono-project.com/") |
| 132 | (license license:x11))) |
| 133 | |
| 134 | (define-public libgdiplus |
| 135 | (package |
| 136 | (name "libgdiplus") |
| 137 | (version "6.0.5") |
| 138 | (source |
| 139 | (origin |
| 140 | (method url-fetch) |
| 141 | (uri (string-append |
| 142 | "http://download.mono-project.com/sources/libgdiplus/libgdiplus-" |
| 143 | version |
| 144 | ".tar.gz")) |
| 145 | (sha256 |
| 146 | (base32 |
| 147 | "1vr5l09i5i91n9qzky7ab9wwvgdidvrbw26y8llip0z4qdf4w7mq")))) |
| 148 | (build-system gnu-build-system) |
| 149 | (native-inputs |
| 150 | `(("pkg-config" ,pkg-config))) |
| 151 | (inputs |
| 152 | `(("glib" ,glib) |
| 153 | ("cairo" ,cairo) |
| 154 | ("fontconfig" ,fontconfig) |
| 155 | ("libtiff" ,libtiff) |
| 156 | ("libjpeg" ,libjpeg-turbo) |
| 157 | ("libexif" ,libexif) |
| 158 | ("libungif" ,libungif))) |
| 159 | (arguments |
| 160 | `(#:phases |
| 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 |
| 165 | (lambda _ |
| 166 | (substitute* "tests/Makefile.in" |
| 167 | (("testicocodec\\$\\(EXEEXT\\) ") " ") |
| 168 | (("testfont\\$\\(EXEEXT\\) ") " ")) |
| 169 | #t))))) |
| 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+))) |