You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

175 lines
7.0 KiB

;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2016 Jan Nieuwenhuizen <>
;;; Copyright © 2020 Pierre Neidhardt <>
;;; This file is part of GNU Guix.
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; GNU General Public License for more details.
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix. If not, see <>.
(define-module (gnu packages mono)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (gnu packages fontutils)
#:use-module (gnu packages gettext)
#:use-module (gnu packages glib)
#:use-module (gnu packages gtk)
#:use-module (gnu packages image)
#:use-module (gnu packages perl)
#:use-module (gnu packages photo)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
#:use-module (gnu packages xml)
#:use-module (gnu packages)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module (guix build-system gnu))
(define-public mono
(name "mono")
(version "")
(source (origin
(method url-fetch)
(uri (string-append
name "-" version
(patches (search-patches "mono-mdoc-timestamping.patch"))))
(build-system gnu-build-system)
`(("gettext" ,gettext-minimal)
("glib" ,glib)
("libxslt" ,libxslt)
("perl" ,perl)
("python" ,python-2)))
(modify-phases %standard-phases
(add-after 'unpack 'make-reproducible
(lambda _
(substitute* "mono/mini/"
(("build_date = [^;]*;")
"build_date = (void*) 0;"))
(add-after 'unpack 'set-env
(lambda _ ;;* (#:key inputs #:allow-other-keys)
;; all tests under mcs/class fail trying to access $HOME
(setenv "HOME" "/tmp")
;; ZIP files have "DOS time" which starts in Jan 1980.
(setenv "SOURCE_DATE_EPOCH" "315532800")
(add-after 'unpack 'fix-includes
(lambda _
;; makedev is in <sys/sysmacros.h> now. Include it.
(substitute* "mono/io-layer/processes.c"
(("#ifdef HAVE_SYS_MKDEV_H") "#if 1")
(("sys/mkdev.h") "sys/sysmacros.h"))
(add-after 'unpack 'patch-tests
(lambda _ ;;* (#:key inputs #:allow-other-keys)
(substitute* "mono/tests/"
;; does not build: no rule to make unhandled-exception-*
(("@test-unhandled-exception-2:" all)
(string-append all "#")))
(substitute* "mcs/tools/mono-symbolicate/Makefile"
;; does not build: Source file `Test/StackTraceDumper.cs'
;; could not be found
(("^check: test-local") "check:\ntest-local:")
(("^test-local: all") "disabled-test-local:"))
(substitute* "mono/unit-tests/"
;; test fails
;; tests fail, trying to access $HOME
(substitute* "mcs/class/Makefile"
(("^include ../build/rules.make" all)
"\nrun-test-recursive:\n\t@echo skipping tests\n")))
;; tests fail, trying to access $HOME
(substitute* "mcs/class/Microsoft.Build.Tasks/Makefile"
(("^include ../../build/rules.make" all)
"\nrun-test-recursive:\n\t@echo skipping tests\n")))
(substitute* '("mcs/tools/mono-shlib-cop/Makefile"
(("^run-test-local:" all)
(string-append "#" all)))
(substitute* "mcs/tools/sqlmetal/Makefile"
(("^include ../../build/rules.make" all)
"\nrun-test-lib:\n\t@echo skipping test\n"))))))
;; these 4 tests fail
#:make-flags `(,(string-append "PLATFORM_DISABLED_TESTS="
" appdomain-unload.exe"
" delegate2.exe"
" finally_guard.exe"
" remoting4.exe"))
;; running tests in parallel fails
#:parallel-tests? #f))
(synopsis "Compiler and libraries for the C# programming language")
(description "Mono is a compiler, vm, debugger and set of libraries for
C#, a C-style programming language from Microsoft that is very similar to
(home-page "")
(license license:x11)))
(define-public libgdiplus
(name "libgdiplus")
(version "6.0.4")
(method url-fetch)
(uri (string-append
(build-system gnu-build-system)
`(("pkg-config" ,pkg-config)))
`(("glib" ,glib)
("cairo" ,cairo)
("fontconfig" ,fontconfig)
("libtiff" ,libtiff)
("libjpeg" ,libjpeg-turbo)
("libexif" ,libexif)
("libungif" ,libungif)))
(modify-phases %standard-phases
;; TODO: See with upstream why they fail.
(add-before 'configure 'remove-buggy-tests
(lambda _
(substitute* "tests/"
(("testicocodec\\$\\(EXEEXT\\) ") " ")
(("testfont\\$\\(EXEEXT\\) ") " "))
(home-page "")
(synopsis "Mono library that provides a GDI+-compatible API")
(description "Libgdiplus is the Mono library that provides a
GDI+-compatible API on non-Windows operating systems. The implementation uses
Cairo to do most of the heavy lifting.")
(license license:gpl3+)))