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 02/21] gnu: Add pnet-git.
Date: Mon, 16 Dec 2024 19:26:25 +0200	[thread overview]
Message-ID: <cc87b692472570311e155b361d01975fb1bae193.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 (pnet-git): New variable.
* gnu/packages/patches/pnet-fix-line-number-info.patch: New patch.
* gnu/packages/patches/pnet-fix-off-by-one.patch: New patch.
* gnu/packages/patches/pnet-newer-libgc-fix.patch: New patch.
* gnu/packages/patches/pnet-newer-texinfo-fix.patch: New patch.
* gnu/local.mk (dist_patch_DATA): Register new patches.

Change-Id: I751e97088e2b848078889b2033ebb4356d3cfe4b
---
 gnu/local.mk                                  |  4 +
 gnu/packages/dotnet.scm                       | 99 +++++++++++++++++++
 .../patches/pnet-fix-line-number-info.patch   | 13 +++
 .../patches/pnet-fix-off-by-one.patch         | 13 +++
 .../patches/pnet-newer-libgc-fix.patch        | 45 +++++++++
 .../patches/pnet-newer-texinfo-fix.patch      | 13 +++
 6 files changed, 187 insertions(+)
 create mode 100644 gnu/packages/patches/pnet-fix-line-number-info.patch
 create mode 100644 gnu/packages/patches/pnet-fix-off-by-one.patch
 create mode 100644 gnu/packages/patches/pnet-newer-libgc-fix.patch
 create mode 100644 gnu/packages/patches/pnet-newer-texinfo-fix.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 94331c6064b..8fc98c8fd22 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1929,6 +1929,10 @@ dist_patch_DATA =						\
   %D%/packages/patches/plasma-framework-fix-KF5PlasmaMacros.cmake.patch \
   %D%/packages/patches/plasp-fix-normalization.patch \
   %D%/packages/patches/plasp-include-iostream.patch \
+  %D%/packages/patches/pnet-fix-line-number-info.patch		\
+  %D%/packages/patches/pnet-fix-off-by-one.patch		\
+  %D%/packages/patches/pnet-newer-libgc-fix.patch		\
+  %D%/packages/patches/pnet-newer-texinfo-fix.patch		\
   %D%/packages/patches/pocketfft-cpp-prefer-preprocessor-if.patch			\
   %D%/packages/patches/pokerth-boost.patch			\
   %D%/packages/patches/ppsspp-disable-upgrade-and-gold.patch		\
diff --git a/gnu/packages/dotnet.scm b/gnu/packages/dotnet.scm
index e085b364e29..cd8886c8398 100644
--- a/gnu/packages/dotnet.scm
+++ b/gnu/packages/dotnet.scm
@@ -60,3 +60,102 @@ (define-public treecc
 of compilers and other language-based tools.  It manages the generation of
 code to handle abstract syntax trees and operations upon the trees.")
     (license license:gpl2+)))
+
+;; several improvements occurred past the 0.8.0 release that make it easier to
+;; bootstrap mono
+(define-public pnet-git
+  (let ((commit "3baf94734d8dc3fdabba68a8891e67a43ed6c4bd")
+        (version "0.8.0")
+        (revision "0"))
+    (package
+      (name "pnet-git")
+      (version (git-version version revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://git.savannah.gnu.org/git/dotgnu-pnet/pnet.git")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "0vznvrgz8l0mpib1rz5v3clr7cn570vyp80f7f1jvzivnc1imzn6"))
+                (modules '((guix build utils)))
+                (snippet
+                 #~(begin
+                     (for-each delete-file-recursively '("libffi" "libgc"))
+                     (for-each delete-file (filter file-exists?
+                                                   '("compile"
+                                                     "configure"
+                                                     "config.guess"
+                                                     "config.sub"
+                                                     "depcomp"
+                                                     "install-sh"
+                                                     "ltconfig"
+                                                     "ltcf-c.sh"
+                                                     "ltmain.sh")))
+                     (for-each delete-file (find-files "." "Makefile(\\.in)?$"))
+                     (for-each delete-file (find-files "." "_grammar\\.(c|h)$"))
+                     (for-each delete-file (find-files "." "_scanner\\.(c|h)$"))
+                     ;; Fix to not require bundled dependencies
+                     (substitute* "configure.in"
+                       (("GCLIBS='.*libgc.a'") "GCLIBS='-lgc'")
+                       ;; AC_SEARCH_LIBJIT checks hardcoded header locations
+                       (("search_libjit=true")
+                        (string-append "search_libjit=false\n"
+                                       "JIT_LIBS=-ljit")))
+                     (substitute* "Makefile.am"
+                       (("OPT_SUBDIRS \\+= lib.*") ""))
+                     (substitute* "support/hb_gc.c"
+                       (("#include .*/libgc/include/gc.h.")
+                        "#include <gc.h>")
+                       (("#include .*/libgc/include/gc_typed.h.")
+                        "#include <gc/gc_typed.h>"))
+                     (substitute* (list "codegen/Makefile.am"
+                                        "cscc/bf/Makefile.am"
+                                        "cscc/csharp/Makefile.am"
+                                        "cscc/c/Makefile.am"
+                                        "cscc/java/Makefile.am")
+                       ;; Generated files aren't prerequisites
+                       (("TREECC_OUTPUT =.*") ""))
+                     (substitute* "cscc/csharp/cs_grammar.y"
+                       (("YYLEX") "yylex()"))
+                     (substitute* "cscc/common/cc_main.h"
+                       (("CCPreProc CCPreProcessorStream;" all)
+                        (string-append "extern " all)))
+                     (substitute* "csdoc/scanner.c"
+                       (("int\ttoken;" all)
+                        (string-append "extern " all)))
+                     (substitute* "doc/cvmdoc.py"
+                       (("python1.5") "python"))))
+                (patches
+                 (search-patches "pnet-newer-libgc-fix.patch"
+                                 "pnet-newer-texinfo-fix.patch"
+                                 "pnet-fix-line-number-info.patch"
+                                 "pnet-fix-off-by-one.patch"))))
+      (build-system gnu-build-system)
+      (native-inputs
+       (list autoconf
+             automake
+             bison
+             flex
+             libtool
+             libatomic-ops
+             python         ; for cvmdoc.py
+             texinfo
+             treecc))
+      (inputs
+       (list libgc libjit))
+      (arguments
+       (list #:configure-flags #~(list "--with-jit")
+             #:make-flags #~(list "CFLAGS+=-Wno-pointer-to-int-cast")))
+      (native-search-paths
+       (list (search-path-specification
+              (variable "CSCC_LIB_PATH")
+              (files (list "lib/cscc/lib")))))
+      (home-page "http://www.gnu.org/software/dotgnu/html2.0/pnet.html")
+      (synopsis "Compiler for the C# programming language")
+      (description
+       "The goal of this project is to build a suite of free software tools
+to build and execute .NET applications, including a C# compiler,
+assembler, disassembler, and runtime engine.")
+      (license license:gpl2+))))
diff --git a/gnu/packages/patches/pnet-fix-line-number-info.patch b/gnu/packages/patches/pnet-fix-line-number-info.patch
new file mode 100644
index 00000000000..9e5af849413
--- /dev/null
+++ b/gnu/packages/patches/pnet-fix-line-number-info.patch
@@ -0,0 +1,13 @@
+diff --git a/codegen/cg_coerce.c b/codegen/cg_coerce.c
+index 92d2f59a..c90ad5e2 100644
+--- a/codegen/cg_coerce.c
++++ b/codegen/cg_coerce.c
+@@ -1203,6 +1203,8 @@ int ILCoerce(ILGenInfo *info, ILNode *node, ILNode **parent,
+ 					!= ILMachineType_Void)
+ 	{
+ 		*parent = ILNode_CastSimple_create(node, constType);
++                yysetfilename(*parent, yygetfilename(node));
++		yysetlinenum(*parent, yygetlinenum(node));
+ 		return 1;
+ 	}
+ 	else if(indirect && GetIndirectConvertRules(info,fromType,toType,0, 
diff --git a/gnu/packages/patches/pnet-fix-off-by-one.patch b/gnu/packages/patches/pnet-fix-off-by-one.patch
new file mode 100644
index 00000000000..858d2266976
--- /dev/null
+++ b/gnu/packages/patches/pnet-fix-off-by-one.patch
@@ -0,0 +1,13 @@
+diff --git a/codegen/cg_genattr.c b/codegen/cg_genattr.c
+index 535852da..c3acc0dc 100644
+--- a/codegen/cg_genattr.c
++++ b/codegen/cg_genattr.c
+@@ -1532,7 +1532,7 @@ static int MarshalAsAttribute(ILGenInfo *info,
+ 			else
+ 			{
+ 				sizeParamIndex = attributeInfo->namedArgs[currentNamedArg].evalValue.un.i4Value;
+-				if(sizeParamIndex <= 0)
++				if(sizeParamIndex < 0)
+ 				{
+ 					CGErrorForNode(info, attributeInfo->namedArgs[currentNamedArg].node,
+ 						_("The size parameter index must be >= 0"));
diff --git a/gnu/packages/patches/pnet-newer-libgc-fix.patch b/gnu/packages/patches/pnet-newer-libgc-fix.patch
new file mode 100644
index 00000000000..1084b5a5bec
--- /dev/null
+++ b/gnu/packages/patches/pnet-newer-libgc-fix.patch
@@ -0,0 +1,45 @@
+diff --git a/support/hb_gc.c b/support/hb_gc.c
+index a5addb2d..41126963 100644
+--- a/support/hb_gc.c
++++ b/support/hb_gc.c
+@@ -104,12 +104,6 @@ static volatile int _FinalizersRunningSynchronously = 0;
+ 	#define GC_TRACE(a, b)
+ #endif
+ 
+-/*
+- * This is a internal global variable with the number of reclaimed bytes
+- * after a garbage collection.
+- */
+-extern GC_signed_word GC_bytes_found;
+-
+ /*
+  *	Main entry point for the finalizer thread.
+  */
+@@ -432,6 +426,7 @@ int ILGCFullCollection(int timeout)
+ {
+ 	int lastFinalizingCount;
+ 	int hasThreads;
++       struct GC_prof_stats_s stats;
+ 
+ 	hasThreads = _ILHasThreads();
+ 
+@@ -462,7 +457,8 @@ int ILGCFullCollection(int timeout)
+ 			GC_TRACE("Last finalizingCount = %i\n", lastFinalizingCount);
+ 
+ 			GC_gcollect();
+-			bytesCollected = GC_bytes_found;
++                       GC_get_prof_stats(&stats, sizeof(stats));
++			bytesCollected = stats.bytes_reclaimed_since_gc;
+ 
+ 			GC_TRACE("GC: bytes collected =  %i\n", bytesCollected);
+ 
+@@ -516,7 +512,8 @@ int ILGCFullCollection(int timeout)
+ 			GC_TRACE("Last finalizingCount = %i\n", lastFinalizingCount);
+ 
+ 			GC_gcollect();
+-			bytesCollected = GC_bytes_found;
++                       GC_get_prof_stats(&stats, sizeof(stats));
++			bytesCollected = stats.bytes_reclaimed_since_gc;
+ 
+ 			GC_TRACE("GC: bytes collected =  %i\n", bytesCollected);
+ 
diff --git a/gnu/packages/patches/pnet-newer-texinfo-fix.patch b/gnu/packages/patches/pnet-newer-texinfo-fix.patch
new file mode 100644
index 00000000000..b57052eeeaa
--- /dev/null
+++ b/gnu/packages/patches/pnet-newer-texinfo-fix.patch
@@ -0,0 +1,13 @@
+diff --git a/doc/pnettools.texi b/doc/pnettools.texi
+index 916d90bb..cdbe05cf 100644
+--- a/doc/pnettools.texi
++++ b/doc/pnettools.texi
+@@ -59,7 +59,7 @@ Copyright @copyright{} 2001, 2002, 2003 Southern Storm Software, Pty Ltd
+ @center @titlefont{Portable.NET Development Tools}
+ 
+ @vskip 0pt plus 1fill
+-@center{Copyright @copyright{} 2001, 2002, 2003 Southern Storm Software, Pty Ltd}
++@center Copyright @copyright{} 2001, 2002, 2003 Southern Storm Software, Pty Ltd
+ @end titlepage
+ 
+ @c -----------------------------------------------------------------------
-- 
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   ` Efraim Flashner [this message]
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   ` [bug#74609] [PATCH 05/21] gnu: Add mono-1.9.1 Efraim Flashner
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=cc87b692472570311e155b361d01975fb1bae193.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.