Subject: [bug#57625] [PATCH v3 4/4] gnu: Add pnetlib.

From: Adam Faiz <[email-masked]>
Date: Tue, 27 Jun 2023 07:38:05 +0800

>From 32aaac1e57b195273020a3babd54d1ecf42c3d69 Mon Sep 17 00:00:00 2001
Message-Id: <3[email-masked]>
In-Reply-To: <9[email-masked]>
References: <9[email-masked]>
From: AwesomeAdam54321 <[email-masked]>
Date: Mon, 26 Jun 2023 20:20:12 +0800
Subject: [PATCH v3 4/4] gnu: Add pnetlib.

* gnu/packages/dotgnu.scm (pnetlib): New variable.
---
 gnu/packages/dotgnu.scm | 51 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/gnu/packages/dotgnu.scm b/gnu/packages/dotgnu.scm
index 283168c5c0..e4a42035e3 100644
--- a/gnu/packages/dotgnu.scm
+++ b/gnu/packages/dotgnu.scm
@@ -144,3 +144,54 @@ (define-public pnet
 to build and execute .NET applications, including a C# compiler,
 assembler, disassembler, and runtime engine.")
     (license license:gpl2+)))
+
+(define-public pnetlib
+  (package
+    (name "pnetlib")
+    (version "0.8.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "mirror://savannah/dotgnu-pnet/pnetlib-"
+                    version ".tar.gz"))
+              (sha256
+               (base32
+                "1adr5nyrx6ip3rlcilr5kyahw11bpzj1ijb5zdjpn2lvn218ksms"))
+              (modules '((guix build utils)))
+              (snippet
+               #~(begin
+                   (for-each delete-file '("configure"
+                                           "config.guess"
+                                           "config.sub"
+                                           "install-sh"
+                                           "ltmain.sh"))
+                   (for-each delete-file (find-files "." "Makefile\\.in"))
+                   (substitute* "tests/runtime/Makefile.am"
+                     (("TESTS_ENVIRONMENT.*")
+                      (string-append
+                       "LOG_COMPILER = $(SHELL)\n"
+                       "AM_LOG_FLAGS = $(top_builddir)/tools/run_test.sh"
+                       " $(top_builddir)")))
+                   (substitute* "tools/run_test.sh.in"
+                     (("en_US") "en_US.utf8"))
+                   (substitute* "tools/wrapper.sh.in"
+                     (("exec .LN_S clrwrap ..1." all)
+                      (string-append
+                       "echo '#!@SHELL@' >> $1\n"
+                       "echo exec $CLRWRAP"
+                       " $(dirname $(dirname $1))"
+                       "/lib/cscc/lib/$(basename $1).exe '$*' >> $1\n"
+                       "chmod +x $1")))))))
+    (build-system gnu-build-system)
+    (arguments
+     (list #:tests? #f)) ; 4 tests fail
+    (native-inputs
+     (list autoconf automake libtool treecc))
+    (inputs
+     (list pnet))
+    (home-page "http://www.gnu.org/software/dotgnu/html2.0/pnet.html")
+    (synopsis "Libraries for the C# programming language")
+    (description
+     "DotGNU Portable.NET Library contains an implementation of the C# library,
+for use with .NET-capable runtime engines and applications.")
+    (license license:gpl2+)))
-- 
2.40.1