From: "Ludovic Courtès" <ludo@gnu.org>
To: 53964@debbugs.gnu.org
Cc: "Ludovic Courtès" <ludo@gnu.org>
Subject: [bug#53964] [PATCH 1/4] gnu: nhc98: Build with the current tool chain.
Date: Sat, 12 Feb 2022 22:45:29 +0100 [thread overview]
Message-ID: <20220212214532.23087-1-ludo@gnu.org> (raw)
In-Reply-To: <20220212214307.22962-1-ludo@gnu.org>
* gnu/packages/patches/nhc98-c-update.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/haskell.scm (nhc98)[source]: Use it.
[arguments]: Remove #:implicit-inputs?.
[native-inputs]: Remove.
---
gnu/local.mk | 1 +
gnu/packages/haskell.scm | 34 ++----------------
gnu/packages/patches/nhc98-c-update.patch | 42 +++++++++++++++++++++++
3 files changed, 45 insertions(+), 32 deletions(-)
create mode 100644 gnu/packages/patches/nhc98-c-update.patch
diff --git a/gnu/local.mk b/gnu/local.mk
index a706409516..950b040c64 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1546,6 +1546,7 @@ dist_patch_DATA = \
%D%/packages/patches/nettle-3.5-check-_pkcs1_sec_decrypt-msg-len.patch \
%D%/packages/patches/nettle-3.5-CVE-2021-3580-pt1.patch \
%D%/packages/patches/nettle-3.5-CVE-2021-3580-pt2.patch \
+ %D%/packages/patches/nhc98-c-update.patch \
%D%/packages/patches/nix-dont-build-html-doc.diff \
%D%/packages/patches/nfs4-acl-tools-0.3.7-fixpaths.patch \
%D%/packages/patches/ngircd-handle-zombies.patch \
diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index 647b078dfd..c3706fca6c 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -123,14 +123,14 @@ (define-public nhc98
version ".tar.gz"))
(sha256
(base32
- "0fkgxgsd2iqxvwcgnad1702kradwlbcal6rxdrgb22vd6dnc3i8l"))))
+ "0fkgxgsd2iqxvwcgnad1702kradwlbcal6rxdrgb22vd6dnc3i8l"))
+ (patches (search-patches "nhc98-c-update.patch"))))
(build-system gnu-build-system)
(supported-systems '("i686-linux" "x86_64-linux"))
(arguments
(list
#:tests? #false ;there is no test target
#:system "i686-linux"
- #:implicit-inputs? #false
#:parallel-build? #false ;not supported
#:strip-binaries? #false ;doesn't work
#:make-flags '(list "all-gcc")
@@ -170,36 +170,6 @@ (define-public nhc98
"--ccoption="
"--ldoption="
"--install"))))))
- (native-inputs
- `(("findutils" ,findutils)
- ("tar" ,tar)
- ("bzip2" ,bzip2)
- ("gzip" ,gzip)
- ("xz" ,xz)
- ("diffutils" ,diffutils)
- ("file" ,file)
- ("gawk" ,gawk)
-
- ("make" ,gnu-make)
- ("sed" ,sed)
- ("grep" ,grep)
- ("coreutils" ,coreutils)
- ("bash" ,bash-minimal)
-
- ("libc" ,glibc-2.2.5)
- ("gcc-wrapper"
- ,(module-ref (resolve-interface
- '(gnu packages commencement))
- 'gcc-2.95-wrapper))
- ("gcc"
- ,(module-ref (resolve-interface
- '(gnu packages commencement))
- 'gcc-mesboot0))
- ("binutils"
- ,(module-ref (resolve-interface
- '(gnu packages commencement))
- 'binutils-mesboot))
- ("kernel-headers" ,linux-libre-headers)))
(home-page "https://www.haskell.org/nhc98")
(synopsis "Nearly a Haskell Compiler")
(description
diff --git a/gnu/packages/patches/nhc98-c-update.patch b/gnu/packages/patches/nhc98-c-update.patch
new file mode 100644
index 0000000000..06e6928d14
--- /dev/null
+++ b/gnu/packages/patches/nhc98-c-update.patch
@@ -0,0 +1,42 @@
+This patch provides an update so that nhc98 can be built and works with
+a modern C compiler (GCC 11) and libc (glibc 2.33).
+
+diff --git a/Makefile.inc b/Makefile.inc
+index 4fbd47a..5bce5c9 100644
+--- a/Makefile.inc
++++ b/Makefile.inc
+@@ -1,6 +1,10 @@
+ ### Configurable variables:
+
+-OPT = -O3
++# We want C89 semantics plus C++-style comments and things like the
++# 'setjmp_buf' and 'u_short' types. More importantly, build with '-O1'
++# only to avoid modern optimizations that break the code.
++OPT = -O1 -std=gnu89 -D_GNU_SOURCE=1
++
+ #ARCH = -m32
+ ARCH =
+
+diff --git a/script/nhc98heap.c b/script/nhc98heap.c
+index 534010e..a30d5cd 100644
+--- a/script/nhc98heap.c
++++ b/script/nhc98heap.c
+@@ -1,5 +1,6 @@
+ #include <stdlib.h>
+ #include <stdio.h>
++#include <ctype.h>
+ main(int argc, char **argv)
+ {
+ int prefix = 1;
+diff --git a/src/runtime/Kernel/collector.c b/src/runtime/Kernel/collector.c
+index b95a273..1f879c5 100644
+--- a/src/runtime/Kernel/collector.c
++++ b/src/runtime/Kernel/collector.c
+@@ -2,6 +2,7 @@
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <string.h>
++#include <unistd.h>
+ #include "node.h"
+ /*#include "newmacros.h" -- already included in node.h */
+ /*#include "runtime.h" -- already included in node.h */
--
2.34.0
next prev parent reply other threads:[~2022-02-12 21:46 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-12 21:43 [bug#53964] [PATCH 0/4] Build nhc98 and ghc@4 with regular dependencies Ludovic Courtès
2022-02-12 21:45 ` Ludovic Courtès [this message]
2022-02-12 21:45 ` [bug#53964] [PATCH 2/4] gnu: gcc: Add 2.95 Ludovic Courtès
2022-02-12 22:35 ` Maxime Devos
2022-02-12 22:37 ` Maxime Devos
2022-02-14 9:23 ` Ludovic Courtès
2022-02-12 22:40 ` Maxime Devos
2022-02-14 9:25 ` Ludovic Courtès
2022-02-12 22:43 ` Maxime Devos
2022-02-12 22:45 ` Maxime Devos
2022-02-14 9:26 ` Ludovic Courtès
2022-02-12 22:47 ` Maxime Devos
2022-02-14 9:33 ` Ludovic Courtès
2022-02-14 11:22 ` [bug#53964] [PATCH 0/4] Build nhc98 and ghc@4 with regular dependencies Ludovic Courtès
2022-02-12 21:45 ` [bug#53964] [PATCH 3/4] gnu: ghc@4: Build without referring to packages in commencement.scm Ludovic Courtès
2022-02-12 22:49 ` Maxime Devos
2022-02-14 9:35 ` Ludovic Courtès
2022-02-12 22:52 ` Maxime Devos
2022-02-14 9:36 ` Ludovic Courtès
2022-02-12 21:45 ` [bug#53964] [PATCH 4/4] gnu: Remove glibc@2.2.5 and gcc-2.95-wrapper Ludovic Courtès
2022-02-12 22:14 ` [bug#53964] [PATCH 0/4] Build nhc98 and ghc@4 with regular dependencies Ricardo Wurmus
2022-02-14 14:58 ` bug#53964: " Ludovic Courtès
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=20220212214532.23087-1-ludo@gnu.org \
--to=ludo@gnu.org \
--cc=53964@debbugs.gnu.org \
/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.