summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorunmush <unmush@hashbang.sh>2024-11-26 12:59:49 +0200
committerEfraim Flashner <efraim@flashner.co.il>2024-12-22 15:37:34 +0200
commit893bd4a8ef39f33ba5c2cf74a750370ee43c9735 (patch)
treef5dd66a33867969a27a18689bbb6c689678305ed /gnu
parent7d96fa640a6b71af444493f745a93837a7ea3e70 (diff)
gnu: Add mono-1.9.1.
* gnu/packages/dotnet.scm (mono-1.9.1): New variable. * gnu/packages/patches/mono-1.9.1-add-MONO_CREATE_IMAGE_VERSION.patch: New patch. * gnu/packages/patches/mono-1.9.1-fixes.patch: New patch. * gnu/local.mk (dist_patch_DATA): Register new patches. Signed-off-by: Efraim Flashner <efraim@flashner.co.il> Change-Id: I013646625b9e5dbc1cd68ecaf8cf4b591dc016a0
Diffstat (limited to 'gnu')
-rw-r--r--gnu/local.mk2
-rw-r--r--gnu/packages/dotnet.scm58
-rw-r--r--gnu/packages/patches/mono-1.9.1-add-MONO_CREATE_IMAGE_VERSION.patch14
-rw-r--r--gnu/packages/patches/mono-1.9.1-fixes.patch59
4 files changed, 133 insertions, 0 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 04d75c63e51..f3767853e05 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1828,6 +1828,8 @@ dist_patch_DATA = \
1828 %D%/packages/patches/module-init-tools-moduledir.patch \ 1828 %D%/packages/patches/module-init-tools-moduledir.patch \
1829 %D%/packages/patches/monero-use-system-miniupnpc.patch \ 1829 %D%/packages/patches/monero-use-system-miniupnpc.patch \
1830 %D%/packages/patches/mono-1.2.6-bootstrap.patch \ 1830 %D%/packages/patches/mono-1.2.6-bootstrap.patch \
1831 %D%/packages/patches/mono-1.9.1-add-MONO_CREATE_IMAGE_VERSION.patch \
1832 %D%/packages/patches/mono-1.9.1-fixes.patch \
1831 %D%/packages/patches/mosaicatcher-unbundle-htslib.patch \ 1833 %D%/packages/patches/mosaicatcher-unbundle-htslib.patch \
1832 %D%/packages/patches/mrrescue-support-love-11.patch \ 1834 %D%/packages/patches/mrrescue-support-love-11.patch \
1833 %D%/packages/patches/mtools-mformat-uninitialized.patch \ 1835 %D%/packages/patches/mtools-mformat-uninitialized.patch \
diff --git a/gnu/packages/dotnet.scm b/gnu/packages/dotnet.scm
index 427ae286764..1eaa89dfd9c 100644
--- a/gnu/packages/dotnet.scm
+++ b/gnu/packages/dotnet.scm
@@ -397,3 +397,61 @@ a C-style programming language from Microsoft that is very similar to Java.")
397 license:lgpl2.0+ ;; note: ./mcs/LICENSE.LGPL specifies no version 397 license:lgpl2.0+ ;; note: ./mcs/LICENSE.LGPL specifies no version
398 ;; mcs/jay 398 ;; mcs/jay
399 license:bsd-4)))) 399 license:bsd-4))))
400
401(define-public mono-1.9.1
402 (package
403 (inherit mono-1.2.6)
404 (version "1.9.1")
405 (name "mono")
406 (source (origin
407 (method git-fetch)
408 (uri (git-reference
409 (url "https://gitlab.winehq.org/mono/mono.git")
410 (commit "mono-1.9.1.1")))
411 (file-name (git-file-name name version))
412 (sha256
413 (base32
414 "0s1n3zdhc2alk9smxfdl1kjz7lz2p19gs0ks4hgr864jlmf13bws"))
415 (modules '((guix build utils)
416 (ice-9 string-fun)))
417 (snippet prepare-mono-source)
418 (patches (search-patches
419 "mono-1.9.1-fixes.patch"
420 "mono-1.9.1-add-MONO_CREATE_IMAGE_VERSION.patch"))))
421 (native-inputs
422 (modify-inputs (package-native-inputs mono-1.2.6)
423 (delete "pnet-git")
424 (delete "pnetlib-git")
425 (prepend mono-1.2.6)
426 (append which)
427 ;; needed for tests
428 (append perl)))
429 (arguments
430 (substitute-keyword-arguments (package-arguments mono-1.2.6)
431 ((#:make-flags _ #f)
432 #~(list #$(string-append "CC=" (cc-for-target)) "V=1"))
433 ((#:phases phases #~%standard-phases)
434 #~(modify-phases #$phases
435 (add-before 'configure 'set-cflags
436 (lambda _
437 ;; apparently can't be set via make flags in this version
438 (let ((original (getenv "CFLAGS")))
439 (setenv "CFLAGS" (string-append (or original "")
440 (if original " " "")
441 "-DARG_MAX=500")))))
442 (add-before 'configure 'set-create-image-version
443 (lambda _
444 ;; pnet produces v2.x assemblies. Mono does this weird thing
445 ;; where it always produces assemblies of the same version as
446 ;; the runtime that is running it, which is based on the
447 ;; version of the assembly that it loaded, which is based on
448 ;; what it decided for the previous compiler... on and on all
449 ;; the way back to pnet. This breaks that chain, because
450 ;; otherwise it ends up compiling the initial mcs against .NET
451 ;; 2.0 libraries and then running with .NET 1.0 libraries.
452 (setenv "MONO_CREATE_IMAGE_VERSION" "v1.1.4322")))
453 (add-after 'unpack 'patch-test-driver-shebang
454 (lambda _
455 (patch-shebang "mono/tests/test-driver")))))
456 ((#:tests? _ #f) #f)
457 ((#:parallel-tests? _ #f) #f)))))
diff --git a/gnu/packages/patches/mono-1.9.1-add-MONO_CREATE_IMAGE_VERSION.patch b/gnu/packages/patches/mono-1.9.1-add-MONO_CREATE_IMAGE_VERSION.patch
new file mode 100644
index 00000000000..1eef0548ca1
--- /dev/null
+++ b/gnu/packages/patches/mono-1.9.1-add-MONO_CREATE_IMAGE_VERSION.patch
@@ -0,0 +1,14 @@
1diff --git a/mono/metadata/reflection.c b/mono/metadata/reflection.c
2index ce053b0ef49..7c51f20c4cf 100644
3--- a/mono/metadata/reflection.c
4+++ b/mono/metadata/reflection.c
5@@ -4336,6 +4336,9 @@ create_dynamic_mono_image (MonoDynamicAssembly *assembly, char *assembly_name, c
6
7 const char *version = mono_get_runtime_info ()->runtime_version;
8
9+ char *env_ver = getenv("MONO_CREATE_IMAGE_VERSION");
10+ if (env_ver) version = env_ver;
11+
12 #if HAVE_BOEHM_GC
13 image = GC_MALLOC (sizeof (MonoDynamicImage));
14 #else
diff --git a/gnu/packages/patches/mono-1.9.1-fixes.patch b/gnu/packages/patches/mono-1.9.1-fixes.patch
new file mode 100644
index 00000000000..16353ea741e
--- /dev/null
+++ b/gnu/packages/patches/mono-1.9.1-fixes.patch
@@ -0,0 +1,59 @@
1diff --git a/data/mono.pc.in b/data/mono.pc.in
2index 6da0960db2d..d43bb187218 100644
3--- a/data/mono.pc.in
4+++ b/data/mono.pc.in
5@@ -7,6 +7,6 @@ sysconfdir=@sysconfdir@
6 Name: Mono
7 Description: Mono Runtime
8 Version: @VERSION@
9-Requires: glib-2.0 gthread-2.0
10+Requires: glib-2.0 gthread-2.0 bdw-gc
11 Libs: -L${libdir} @export_ldflags@ -lmono @libmono_ldflags@
12 Cflags: -I${includedir} @libmono_cflags@
13diff --git a/mono-uninstalled.pc.in b/mono-uninstalled.pc.in
14index 7fa3f12dc91..2a0734362fd 100644
15--- a/mono-uninstalled.pc.in
16+++ b/mono-uninstalled.pc.in
17@@ -1,6 +1,6 @@
18 Name: Mono
19 Description: Mono Runtime
20 Version: @VERSION@
21-Requires: glib-2.0 gthread-2.0
22+Requires: glib-2.0 gthread-2.0 bdw-gc
23 Libs: -L@mono_build_root@/mono/mini/.libs @export_ldflags@ -lmono @libmono_ldflags@
24 Cflags: -I@abs_top_srcdir@ -I@abs_top_srcdir@/mono @libmono_cflags@
25diff --git a/mono/metadata/Makefile.am b/mono/metadata/Makefile.am
26index 2e480190c8c..90d0f619959 100644
27--- a/mono/metadata/Makefile.am
28+++ b/mono/metadata/Makefile.am
29@@ -157,7 +157,6 @@ libmonoruntimeinclude_HEADERS = \
30 object.h \
31 exception.h \
32 profiler.h \
33- appdomain.h \
34 mono-config.h \
35 debug-helpers.h \
36 mempool.h
37diff --git a/mono/mini/driver.c b/mono/mini/driver.c
38index ffa4b5e5e69..85a954960eb 100644
39--- a/mono/mini/driver.c
40+++ b/mono/mini/driver.c
41@@ -1033,6 +1033,7 @@ mono_main (int argc, char* argv[])
42 #endif
43 if (!g_thread_supported ())
44 g_thread_init (NULL);
45+ GC_allow_register_threads();
46
47 if (mono_running_on_valgrind () && getenv ("MONO_VALGRIND_LEAK_CHECK")) {
48 GMemVTable mem_vtable;
49diff --git a/runtime/Makefile.am b/runtime/Makefile.am
50index e3a8a21e9e2..587b9f4aa79 100644
51--- a/runtime/Makefile.am
52+++ b/runtime/Makefile.am
53@@ -1,6 +1,3 @@
54-# hack to prevent 'check' from depending on 'all'
55-AUTOMAKE_OPTIONS = cygnus
56-
57 tmpinst = _tmpinst
58
59 noinst_SCRIPTS = mono-wrapper monodis-wrapper semdel-wrapper