mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
gnu: nhc98: Build with the current tool chain.
* 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.
This commit is contained in:
parent
72dd5c8766
commit
4fa516474b
3 changed files with 45 additions and 32 deletions
|
@ -1544,6 +1544,7 @@ dist_patch_DATA = \
|
||||||
%D%/packages/patches/nettle-3.5-check-_pkcs1_sec_decrypt-msg-len.patch \
|
%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-pt1.patch \
|
||||||
%D%/packages/patches/nettle-3.5-CVE-2021-3580-pt2.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/nix-dont-build-html-doc.diff \
|
||||||
%D%/packages/patches/nfs4-acl-tools-0.3.7-fixpaths.patch \
|
%D%/packages/patches/nfs4-acl-tools-0.3.7-fixpaths.patch \
|
||||||
%D%/packages/patches/ngircd-handle-zombies.patch \
|
%D%/packages/patches/ngircd-handle-zombies.patch \
|
||||||
|
|
|
@ -123,14 +123,14 @@ (define-public nhc98
|
||||||
version ".tar.gz"))
|
version ".tar.gz"))
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"0fkgxgsd2iqxvwcgnad1702kradwlbcal6rxdrgb22vd6dnc3i8l"))))
|
"0fkgxgsd2iqxvwcgnad1702kradwlbcal6rxdrgb22vd6dnc3i8l"))
|
||||||
|
(patches (search-patches "nhc98-c-update.patch"))))
|
||||||
(build-system gnu-build-system)
|
(build-system gnu-build-system)
|
||||||
(supported-systems '("i686-linux" "x86_64-linux"))
|
(supported-systems '("i686-linux" "x86_64-linux"))
|
||||||
(arguments
|
(arguments
|
||||||
(list
|
(list
|
||||||
#:tests? #false ;there is no test target
|
#:tests? #false ;there is no test target
|
||||||
#:system "i686-linux"
|
#:system "i686-linux"
|
||||||
#:implicit-inputs? #false
|
|
||||||
#:parallel-build? #false ;not supported
|
#:parallel-build? #false ;not supported
|
||||||
#:strip-binaries? #false ;doesn't work
|
#:strip-binaries? #false ;doesn't work
|
||||||
#:make-flags '(list "all-gcc")
|
#:make-flags '(list "all-gcc")
|
||||||
|
@ -170,36 +170,6 @@ (define-public nhc98
|
||||||
"--ccoption="
|
"--ccoption="
|
||||||
"--ldoption="
|
"--ldoption="
|
||||||
"--install"))))))
|
"--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")
|
(home-page "https://www.haskell.org/nhc98")
|
||||||
(synopsis "Nearly a Haskell Compiler")
|
(synopsis "Nearly a Haskell Compiler")
|
||||||
(description
|
(description
|
||||||
|
|
42
gnu/packages/patches/nhc98-c-update.patch
Normal file
42
gnu/packages/patches/nhc98-c-update.patch
Normal file
|
@ -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 */
|
Loading…
Reference in a new issue