all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Efraim Flashner <efraim@flashner.co.il>
To: 74609@debbugs.gnu.org
Cc: aaron.covrig.us@ieee.org, ludo@gnu.org,
	unmush <unmush@hashbang.sh>,
	richard@freakingpenguin.com, unmush@proton.me, janneke@gnu.org
Subject: [bug#74609] [PATCH 05/21] gnu: Add mono-1.9.1.
Date: Mon, 16 Dec 2024 19:26:28 +0200	[thread overview]
Message-ID: <c4249b1c34c50dcf9c7a963c9a28261b2a8a53b7.1734369314.git.efraim@flashner.co.il> (raw)
In-Reply-To: <cover.1734369314.git.efraim@flashner.co.il>

From: unmush <unmush@hashbang.sh>

* 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.

Change-Id: I19c16041fa4419a7c31ca510da6f33a03785f584
---
 gnu/local.mk                                  |  2 +
 gnu/packages/dotnet.scm                       | 60 +++++++++++++++++++
 ...-1.9.1-add-MONO_CREATE_IMAGE_VERSION.patch | 14 +++++
 gnu/packages/patches/mono-1.9.1-fixes.patch   | 59 ++++++++++++++++++
 4 files changed, 135 insertions(+)
 create mode 100644 gnu/packages/patches/mono-1.9.1-add-MONO_CREATE_IMAGE_VERSION.patch
 create mode 100644 gnu/packages/patches/mono-1.9.1-fixes.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index bd2d3e61df4..38e98386d20 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1819,6 +1819,8 @@ dist_patch_DATA =						\
   %D%/packages/patches/module-init-tools-moduledir.patch	\
   %D%/packages/patches/monero-use-system-miniupnpc.patch			\
   %D%/packages/patches/mono-1.2.6-bootstrap.patch		\
+  %D%/packages/patches/mono-1.9.1-add-MONO_CREATE_IMAGE_VERSION.patch		\
+  %D%/packages/patches/mono-1.9.1-fixes.patch			\
   %D%/packages/patches/mosaicatcher-unbundle-htslib.patch	\
   %D%/packages/patches/mrrescue-support-love-11.patch		\
   %D%/packages/patches/mtools-mformat-uninitialized.patch	\
diff --git a/gnu/packages/dotnet.scm b/gnu/packages/dotnet.scm
index 2f93d4bbd00..3a3bcb3c940 100644
--- a/gnu/packages/dotnet.scm
+++ b/gnu/packages/dotnet.scm
@@ -361,3 +361,63 @@ (define-public mono-1.2.6
               license:lgpl2.0+ ;; note: ./mcs/LICENSE.LGPL specifies no version
               ;; mcs/jay
               license:bsd-4))))
+
+(define-public mono-1.9.1
+  (package
+    (inherit mono-1.2.6)
+    (version "1.9.1")
+    (name "mono")
+    (source (origin
+              (method git-fetch)
+              (uri
+               (git-reference
+                (url "https://gitlab.winehq.org/mono/mono.git")
+                (commit (string-append "mono-" "1.9.1.1"))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0s1n3zdhc2alk9smxfdl1kjz7lz2p19gs0ks4hgr864jlmf13bws"))
+              (modules '((guix build utils)
+                         (ice-9 string-fun)))
+              (snippet prepare-mono-source)
+              (patches
+               (search-patches
+                "mono-1.9.1-fixes.patch"
+                "mono-1.9.1-add-MONO_CREATE_IMAGE_VERSION.patch"))))
+    (native-inputs
+     (modify-inputs (package-native-inputs mono-1.2.6)
+       (delete "pnet-git")
+       (delete "pnetlib-git")
+       (prepend mono-1.2.6)
+       (append which)
+       ;; needed for tests
+       (append perl)))
+    (arguments
+     (substitute-keyword-arguments (package-arguments mono-1.2.6)
+       ((#:make-flags _ #f)
+        #~(list "CC=gcc" "V=1"))
+       ((#:phases phases #~%standard-phases)
+        #~(modify-phases #$phases
+            (add-before 'configure 'set-cflags
+              (lambda _
+                ;; apparently can't be set via make flags in this version
+                (let ((original (getenv "CFLAGS")))
+                  (setenv "CFLAGS" (string-append (or original "")
+                                                  (if original " " "")
+                                                  "-DARG_MAX=500")))))
+            (add-before 'configure 'set-create-image-version
+              (lambda _
+                ;; pnet produces v2.x assemblies.  Mono does this weird thing
+                ;; where it always produces assemblies of the same version as
+                ;; the runtime that is running it, which is based on the
+                ;; version of the assembly that it loaded, which is based on
+                ;; what it decided for the previous compiler... on and on all
+                ;; the way back to pnet.  This breaks that chain, because
+                ;; otherwise it ends up compiling the initial mcs against .NET
+                ;; 2.0 libraries and then running with .NET 1.0 libraries.
+                (setenv "MONO_CREATE_IMAGE_VERSION" "v1.1.4322")))
+            (add-after 'unpack 'patch-test-driver-shebang
+              (lambda _
+                (patch-shebang "mono/tests/test-driver")))))
+       ((#:tests? _ #f) #f)
+       ((#: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 @@
+diff --git a/mono/metadata/reflection.c b/mono/metadata/reflection.c
+index ce053b0ef49..7c51f20c4cf 100644
+--- a/mono/metadata/reflection.c
++++ b/mono/metadata/reflection.c
+@@ -4336,6 +4336,9 @@ create_dynamic_mono_image (MonoDynamicAssembly *assembly, char *assembly_name, c
+ 
+ 	const char *version = mono_get_runtime_info ()->runtime_version;
+ 
++        char *env_ver = getenv("MONO_CREATE_IMAGE_VERSION");
++        if (env_ver) version = env_ver;
++
+ #if HAVE_BOEHM_GC
+ 	image = GC_MALLOC (sizeof (MonoDynamicImage));
+ #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 @@
+diff --git a/data/mono.pc.in b/data/mono.pc.in
+index 6da0960db2d..d43bb187218 100644
+--- a/data/mono.pc.in
++++ b/data/mono.pc.in
+@@ -7,6 +7,6 @@ sysconfdir=@sysconfdir@
+ Name: Mono
+ Description: Mono Runtime
+ Version: @VERSION@
+-Requires: glib-2.0 gthread-2.0
++Requires: glib-2.0 gthread-2.0 bdw-gc
+ Libs: -L${libdir} @export_ldflags@ -lmono @libmono_ldflags@
+ Cflags: -I${includedir} @libmono_cflags@
+diff --git a/mono-uninstalled.pc.in b/mono-uninstalled.pc.in
+index 7fa3f12dc91..2a0734362fd 100644
+--- a/mono-uninstalled.pc.in
++++ b/mono-uninstalled.pc.in
+@@ -1,6 +1,6 @@
+ Name: Mono
+ Description: Mono Runtime
+ Version: @VERSION@
+-Requires: glib-2.0 gthread-2.0
++Requires: glib-2.0 gthread-2.0 bdw-gc
+ Libs: -L@mono_build_root@/mono/mini/.libs @export_ldflags@ -lmono @libmono_ldflags@
+ Cflags: -I@abs_top_srcdir@ -I@abs_top_srcdir@/mono @libmono_cflags@
+diff --git a/mono/metadata/Makefile.am b/mono/metadata/Makefile.am
+index 2e480190c8c..90d0f619959 100644
+--- a/mono/metadata/Makefile.am
++++ b/mono/metadata/Makefile.am
+@@ -157,7 +157,6 @@ libmonoruntimeinclude_HEADERS = \
+ 	object.h	\
+ 	exception.h	\
+ 	profiler.h	\
+-	appdomain.h	\
+ 	mono-config.h	\
+ 	debug-helpers.h	\
+ 	mempool.h
+diff --git a/mono/mini/driver.c b/mono/mini/driver.c
+index ffa4b5e5e69..85a954960eb 100644
+--- a/mono/mini/driver.c
++++ b/mono/mini/driver.c
+@@ -1033,6 +1033,7 @@ mono_main (int argc, char* argv[])
+ #endif
+ 	if (!g_thread_supported ())
+ 		g_thread_init (NULL);
++        GC_allow_register_threads();
+ 
+ 	if (mono_running_on_valgrind () && getenv ("MONO_VALGRIND_LEAK_CHECK")) {
+ 		GMemVTable mem_vtable;
+diff --git a/runtime/Makefile.am b/runtime/Makefile.am
+index e3a8a21e9e2..587b9f4aa79 100644
+--- a/runtime/Makefile.am
++++ b/runtime/Makefile.am
+@@ -1,6 +1,3 @@
+-# hack to prevent 'check' from depending on 'all'
+-AUTOMAKE_OPTIONS = cygnus
+-
+ tmpinst = _tmpinst
+ 
+ noinst_SCRIPTS = mono-wrapper monodis-wrapper semdel-wrapper
-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted





  parent reply	other threads:[~2024-12-16 17:31 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-29 15:05 [bug#74609] [PATCH] Adding a fully-bootstrapped mono unmush via Guix-patches via
2024-12-05  6:21 ` Aaron Covrig via Guix-patches via
2024-12-05 22:07 ` Richard Sent
2024-12-13  7:47 ` Ludovic Courtès
2024-12-13 12:13   ` Janneke Nieuwenhuizen
2024-12-13 21:22 ` Ludovic Courtès
2024-12-16 17:26 ` [bug#74609] [PATCH 00/21] mono bootstrap Efraim Flashner
2024-12-16 17:26   ` [bug#74609] [PATCH 01/21] gnu: Add treecc Efraim Flashner
2024-12-16 17:26   ` [bug#74609] [PATCH 02/21] gnu: Add pnet-git Efraim Flashner
2024-12-16 17:26   ` [bug#74609] [PATCH 03/21] gnu: Add pnetlib-git Efraim Flashner
2024-12-16 17:26   ` [bug#74609] [PATCH 04/21] gnu: Add mono-1.2.6 Efraim Flashner
2024-12-16 17:26   ` Efraim Flashner [this message]
2024-12-16 17:26   ` [bug#74609] [PATCH 06/21] gnu: Add mono-2.4.2 Efraim Flashner
2024-12-16 17:26   ` [bug#74609] [PATCH 07/21] gnu: Add mono-2.6.4 Efraim Flashner
2024-12-16 17:26   ` [bug#74609] [PATCH 08/21] gnu: Add mono-2.11.4 Efraim Flashner
2024-12-16 17:26   ` [bug#74609] [PATCH 09/21] gnu: Add mono-3.0 Efraim Flashner
2024-12-16 17:26   ` [bug#74609] [PATCH 10/21] gnu: Add mono-3.12.1 Efraim Flashner
2024-12-16 17:26   ` [bug#74609] [PATCH 11/21] gnu: Add mono-4.9.0 Efraim Flashner
2024-12-16 17:26   ` [bug#74609] [PATCH 12/21] gnu: Add mono-5.0.1 Efraim Flashner
2024-12-16 17:26   ` [bug#74609] [PATCH 13/21] gnu: Add mono-5.1.0 Efraim Flashner
2024-12-16 17:26   ` [bug#74609] [PATCH 14/21] gnu: Add mono-5.2.0 Efraim Flashner
2024-12-16 17:26   ` [bug#74609] [PATCH 15/21] gnu: Add mono-5.4.0 Efraim Flashner
2024-12-16 17:26   ` [bug#74609] [PATCH 16/21] gnu: Add mono-pre-5.8.0 Efraim Flashner
2024-12-16 17:26   ` [bug#74609] [PATCH 17/21] gnu: Add mono-5.8.0 Efraim Flashner
2024-12-16 17:26   ` [bug#74609] [PATCH 18/21] gnu: Add mono-pre-5.10.0 Efraim Flashner
2024-12-16 17:26   ` [bug#74609] [PATCH 19/21] gnu: Add mono-5.10.0 Efraim Flashner
2024-12-16 17:26   ` [bug#74609] [PATCH 20/21] gnu: Add libgdiplus Efraim Flashner
2024-12-16 17:26   ` [bug#74609] [PATCH 21/21] gnu: Add mono-6.12.0 Efraim Flashner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c4249b1c34c50dcf9c7a963c9a28261b2a8a53b7.1734369314.git.efraim@flashner.co.il \
    --to=efraim@flashner.co.il \
    --cc=74609@debbugs.gnu.org \
    --cc=aaron.covrig.us@ieee.org \
    --cc=janneke@gnu.org \
    --cc=ludo@gnu.org \
    --cc=richard@freakingpenguin.com \
    --cc=unmush@hashbang.sh \
    --cc=unmush@proton.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.