Mon Mar 30 19:36:04 2020 UTC ()
Allow more memory for GHC to waste. Allow dropping extra compat
libraries in FILESDIR.


(joerg)
diff -r1.43 -r1.44 pkgsrc/lang/ghc7/Makefile
diff -r1.6 -r1.7 pkgsrc/lang/ghc80/Makefile
diff -r1.8 -r1.9 pkgsrc/lang/ghc84/Makefile

cvs diff -r1.43 -r1.44 pkgsrc/lang/ghc7/Makefile (switch to unified diff)

--- pkgsrc/lang/ghc7/Makefile 2020/03/27 04:13:57 1.43
+++ pkgsrc/lang/ghc7/Makefile 2020/03/30 19:36:03 1.44
@@ -1,204 +1,204 @@ @@ -1,204 +1,204 @@
1# $NetBSD: Makefile,v 1.43 2020/03/27 04:13:57 riastradh Exp $ 1# $NetBSD: Makefile,v 1.44 2020/03/30 19:36:03 joerg Exp $
2# ----------------------------------------------------------------------------- 2# -----------------------------------------------------------------------------
3# Package metadata 3# Package metadata
4# 4#
5DISTNAME= ghc-7.10.3-src 5DISTNAME= ghc-7.10.3-src
6PKGREVISION= 3 6PKGREVISION= 3
7PKGNAME= ${DISTNAME:S/-src$//} 7PKGNAME= ${DISTNAME:S/-src$//}
8CATEGORIES= lang 8CATEGORIES= lang
9MASTER_SITES= https://downloads.haskell.org/~ghc/${PKGVERSION_NOREV}/ 9MASTER_SITES= https://downloads.haskell.org/~ghc/${PKGVERSION_NOREV}/
10EXTRACT_SUFX= .tar.xz 10EXTRACT_SUFX= .tar.xz
11 11
12MAINTAINER= pho@cielonegro.org 12MAINTAINER= pho@cielonegro.org
13HOMEPAGE= https://www.haskell.org/ghc/ 13HOMEPAGE= https://www.haskell.org/ghc/
14COMMENT= Compiler for the functional language Haskell - 7.10 Release Series 14COMMENT= Compiler for the functional language Haskell - 7.10 Release Series
15LICENSE= modified-bsd 15LICENSE= modified-bsd
16 16
17# TODO: We should be using the alternatives framework. 17# TODO: We should be using the alternatives framework.
18CONFLICTS+= ghc-[0-9]* 18CONFLICTS+= ghc-[0-9]*
19 19
20# GHC requires GHC to build itself. Formerly we could work around this 20# GHC requires GHC to build itself. Formerly we could work around this
21# bootstrapping problem by creating a special archive containing C 21# bootstrapping problem by creating a special archive containing C
22# sources compiled from Haskell sources, but that's no longer 22# sources compiled from Haskell sources, but that's no longer
23# possible. So we have to prepare stripped-down binaries sufficient to 23# possible. So we have to prepare stripped-down binaries sufficient to
24# bootstrap compilers for each platforms. If you want to build them 24# bootstrap compilers for each platforms. If you want to build them
25# yourself, follow instructions in BOOTSTRAP.txt and ./bootstrap.mk 25# yourself, follow instructions in BOOTSTRAP.txt and ./bootstrap.mk
26BROKEN_EXCEPT_ON_PLATFORM+= \ 26BROKEN_EXCEPT_ON_PLATFORM+= \
27 Darwin-*-powerpc \ 27 Darwin-*-powerpc \
28 FreeBSD-*-i386 \ 28 FreeBSD-*-i386 \
29 NetBSD-*-x86_64 \ 29 NetBSD-*-x86_64 \
30 SunOS-*-i386 \ 30 SunOS-*-i386 \
31 SunOS-*-x86_64 31 SunOS-*-x86_64
32 32
33 33
34# ----------------------------------------------------------------------------- 34# -----------------------------------------------------------------------------
35# Distfiles 35# Distfiles
36# 36#
37DISTFILES= ${DEFAULT_DISTFILES} 37DISTFILES= ${DEFAULT_DISTFILES}
38WRKSRC= ${WRKDIR}/${PKGNAME_NOREV} 38WRKSRC= ${WRKDIR}/${PKGNAME_NOREV}
39 39
40# We don't want to extract all of the DISTFILEs. 40# We don't want to extract all of the DISTFILEs.
41EXTRACT_ONLY= ${DEFAULT_DISTFILES} 41EXTRACT_ONLY= ${DEFAULT_DISTFILES}
42 42
43 43
44# ----------------------------------------------------------------------------- 44# -----------------------------------------------------------------------------
45# Tools 45# Tools
46# 46#
47# The runtime dependency on perl is due to the evil splitter 47# The runtime dependency on perl is due to the evil splitter
48# (lib/${PKGNAME_NOREV}/ghc-split). 48# (lib/${PKGNAME_NOREV}/ghc-split).
49USE_TOOLS+= autoconf gmake gzip perl:run 49USE_TOOLS+= autoconf gmake gzip perl:run
50GNU_CONFIGURE= yes 50GNU_CONFIGURE= yes
51USE_GNU_CONFIGURE_HOST= no 51USE_GNU_CONFIGURE_HOST= no
52USE_LIBTOOL= yes 52USE_LIBTOOL= yes
53 53
54CONFIGURE_ARGS.common= \ 54CONFIGURE_ARGS.common= \
55 --with-gcc=${CC:Q} \ 55 --with-gcc=${CC:Q} \
56 --with-ld=${LD:Q} \ 56 --with-ld=${LD:Q} \
57 --with-curses-includes=${BUILDLINK_PREFIX.curses:Q}/${BUILDLINK_INCDIRS.curses:Q} \ 57 --with-curses-includes=${BUILDLINK_PREFIX.curses:Q}/${BUILDLINK_INCDIRS.curses:Q} \
58 --with-curses-libraries=${BUILDLINK_PREFIX.curses:Q}/${BUILDLINK_LIBDIRS.curses:Q} \ 58 --with-curses-libraries=${BUILDLINK_PREFIX.curses:Q}/${BUILDLINK_LIBDIRS.curses:Q} \
59 --with-gmp-includes=${BUILDLINK_PREFIX.gmp:Q}/${BUILDLINK_INCDIRS.gmp:Q} \ 59 --with-gmp-includes=${BUILDLINK_PREFIX.gmp:Q}/${BUILDLINK_INCDIRS.gmp:Q} \
60 --with-gmp-libraries=${BUILDLINK_PREFIX.gmp:Q}/${BUILDLINK_LIBDIRS.gmp:Q} \ 60 --with-gmp-libraries=${BUILDLINK_PREFIX.gmp:Q}/${BUILDLINK_LIBDIRS.gmp:Q} \
61 --with-iconv-includes=${BUILDLINK_PREFIX.iconv:Q}/${BUILDLINK_INCDIRS.iconv:Q} \ 61 --with-iconv-includes=${BUILDLINK_PREFIX.iconv:Q}/${BUILDLINK_INCDIRS.iconv:Q} \
62 --with-iconv-libraries=${BUILDLINK_PREFIX.iconv:Q}/${BUILDLINK_LIBDIRS.iconv:Q} \ 62 --with-iconv-libraries=${BUILDLINK_PREFIX.iconv:Q}/${BUILDLINK_LIBDIRS.iconv:Q} \
63 --with-system-libffi \ 63 --with-system-libffi \
64 --with-ffi-includes=${BUILDLINK_PREFIX.libffi:Q}/${BUILDLINK_INCDIRS.libffi:Q} \ 64 --with-ffi-includes=${BUILDLINK_PREFIX.libffi:Q}/${BUILDLINK_INCDIRS.libffi:Q} \
65 --with-ffi-libraries=${BUILDLINK_PREFIX.libffi:Q}/${BUILDLINK_LIBDIRS.libffi:Q} 65 --with-ffi-libraries=${BUILDLINK_PREFIX.libffi:Q}/${BUILDLINK_LIBDIRS.libffi:Q}
66 66
67CONFIGURE_ARGS+= ${CONFIGURE_ARGS.common} 67CONFIGURE_ARGS+= ${CONFIGURE_ARGS.common}
68 68
69CONFIGURE_ENV+= \ 69CONFIGURE_ENV+= \
70 ac_cv_path_fp_prog_ar=${AR:Q} \ 70 ac_cv_path_fp_prog_ar=${AR:Q} \
71 ac_cv_path_READELF=readelf \ 71 ac_cv_path_READELF=readelf \
72 PerlCmd=${PERL5:Q} 72 PerlCmd=${PERL5:Q}
73 73
74# LDFLAGS is currently not honored by "./configure". Since LDFLAGS 74# LDFLAGS is currently not honored by "./configure". Since LDFLAGS
75# contains rpath flags it's very important to force GHC to honor 75# contains rpath flags it's very important to force GHC to honor
76# it. Otherwise neither GHC itself nor executables it produces will 76# it. Otherwise neither GHC itself nor executables it produces will
77# have any rpaths so users will have to put "${PREFIX}/lib" into their 77# have any rpaths so users will have to put "${PREFIX}/lib" into their
78# "/etc/ld-elf.so.conf". See 78# "/etc/ld-elf.so.conf". See
79# http://hackage.haskell.org/trac/ghc/ticket/2933 79# http://hackage.haskell.org/trac/ghc/ticket/2933
80.for stage in 0 1 2 80.for stage in 0 1 2
81CONFIGURE_ENV+= \ 81CONFIGURE_ENV+= \
82 CONF_GCC_LINKER_OPTS_STAGE${stage}=${LDFLAGS:Q} 82 CONF_GCC_LINKER_OPTS_STAGE${stage}=${LDFLAGS:Q}
83# Note that CONF_LD_LINKER_OPTS_STAGE{0,1,2} are only used for 83# Note that CONF_LD_LINKER_OPTS_STAGE{0,1,2} are only used for
84# creating static GHCi libraries (HS*.o). Setting them to ${LDFLAGS} 84# creating static GHCi libraries (HS*.o). Setting them to ${LDFLAGS}
85# does more harm than good because our ${LDFLAGS} contains -Wl,* 85# does more harm than good because our ${LDFLAGS} contains -Wl,*
86# flags. It's true that ../../mk/wrapper/cmd-sink-ld transforms them 86# flags. It's true that ../../mk/wrapper/cmd-sink-ld transforms them
87# but those flags will also be baked into the compiler (see 87# but those flags will also be baked into the compiler (see
88# ${WRKSRC}/compiler/ghc.mk) so they cause problems when used outside 88# ${WRKSRC}/compiler/ghc.mk) so they cause problems when used outside
89# the buildlink. 89# the buildlink.
90.endfor 90.endfor
91 91
92# The runtime system of GHC (rts) tends to conflict with PaX MPROTECT 92# The runtime system of GHC (rts) tends to conflict with PaX MPROTECT
93# because it needs to generate various kinds of code at run time. The 93# because it needs to generate various kinds of code at run time. The
94# RTS linker, whose job is to load *static* objects at run time, 94# RTS linker, whose job is to load *static* objects at run time,
95# doesn't play nice with ASLR either. This means most executables 95# doesn't play nice with ASLR either. This means most executables
96# produced by GHC need them to be disabled. Perhaps we should patch 96# produced by GHC need them to be disabled. Perhaps we should patch
97# rts/sm/Storage.c so that it uses ffi_closure_alloc(3) on every 97# rts/sm/Storage.c so that it uses ffi_closure_alloc(3) on every
98# platform, not just Linux, and also drop support for static library 98# platform, not just Linux, and also drop support for static library
99# loading and switch to dynamic libraries entirely. 99# loading and switch to dynamic libraries entirely.
100.for f in ghc ghc-pkg haddock hpc hsc2hs runghc 100.for f in ghc ghc-pkg haddock hpc hsc2hs runghc
101NOT_PAX_MPROTECT_SAFE+= lib/${PKGNAME_NOREV}/bin/${f} 101NOT_PAX_MPROTECT_SAFE+= lib/${PKGNAME_NOREV}/bin/${f}
102NOT_PAX_ASLR_SAFE+= lib/${PKGNAME_NOREV}/bin/${f} 102NOT_PAX_ASLR_SAFE+= lib/${PKGNAME_NOREV}/bin/${f}
103.endfor 103.endfor
104 104
105 105
106# ----------------------------------------------------------------------------- 106# -----------------------------------------------------------------------------
107# Build hooks 107# Build hooks
108# 108#
109 109
110# We patch configure.ac in some directories. 110# We patch configure.ac in some directories.
111post-patch: 111post-patch:
112 @${PHASE_MSG} "Regenerating configuration scripts for ${PKGNAME}" 112 @${PHASE_MSG} "Regenerating configuration scripts for ${PKGNAME}"
113 ${RUN} cd ${WRKSRC:Q}/libraries/base && autoconf 113 ${RUN} cd ${WRKSRC:Q}/libraries/base && autoconf
114 ${RUN} cd ${WRKSRC:Q}/libraries/integer-gmp && autoconf 114 ${RUN} cd ${WRKSRC:Q}/libraries/integer-gmp && autoconf
115 115
116# Define the target "pre-configure" and non-standard "bootstrap". 116# Define the target "pre-configure" and non-standard "bootstrap".
117.include "../../lang/ghc7/bootstrap.mk" 117.include "../../lang/ghc7/bootstrap.mk"
118 118
119# Our pre-configure phase installs a bindist of bootstrapping compiler 119# Our pre-configure phase installs a bindist of bootstrapping compiler
120# directly into TOOLS_DIR so that ./configure can find it. 120# directly into TOOLS_DIR so that ./configure can find it.
121 121
122# Here we generate mk/build.mk dynamically. 122# Here we generate mk/build.mk dynamically.
123post-configure: 123post-configure:
124 ${RUN} ${RM} -f ${WRKSRC:Q}/mk/build.mk 124 ${RUN} ${RM} -f ${WRKSRC:Q}/mk/build.mk
125 125
126# If there is HsColour in the PATH, GHC's build system tries to use it 126# If there is HsColour in the PATH, GHC's build system tries to use it
127# without even checking if it really works. That's not what we 127# without even checking if it really works. That's not what we
128# appreciate. 128# appreciate.
129 ${RUN} ${ECHO} "HSCOLOUR_SRCS = NO" >> ${WRKSRC:Q}/mk/build.mk 129 ${RUN} ${ECHO} "HSCOLOUR_SRCS = NO" >> ${WRKSRC:Q}/mk/build.mk
130 130
131# Don't even think of PDF. 131# Don't even think of PDF.
132 ${RUN} ${ECHO} "BUILD_DOCBOOK_PS = NO" >> ${WRKSRC:Q}/mk/build.mk 132 ${RUN} ${ECHO} "BUILD_DOCBOOK_PS = NO" >> ${WRKSRC:Q}/mk/build.mk
133 ${RUN} ${ECHO} "BUILD_DOCBOOK_PDF = NO" >> ${WRKSRC:Q}/mk/build.mk 133 ${RUN} ${ECHO} "BUILD_DOCBOOK_PDF = NO" >> ${WRKSRC:Q}/mk/build.mk
134 134
135 135
136# ----------------------------------------------------------------------------- 136# -----------------------------------------------------------------------------
137# Installation/removal hooks 137# Installation/removal hooks
138# 138#
139 139
140# Substitutions for INSTALL and DEINSTALL that handles package.cache. 140# Substitutions for INSTALL and DEINSTALL that handles package.cache.
141FILES_SUBST+= GHC_VERSION=${PKGVERSION_NOREV} 141FILES_SUBST+= GHC_VERSION=${PKGVERSION_NOREV}
142 142
143# We don't want package.cache to be in the PLIST. 143# We don't want package.cache to be in the PLIST.
144post-install: 144post-install:
145 ${RM} -f ${DESTDIR:Q}${PREFIX:Q}/lib/${PKGNAME_NOREV}/package.conf.d/package.cache 145 ${RM} -f ${DESTDIR:Q}${PREFIX:Q}/lib/${PKGNAME_NOREV}/package.conf.d/package.cache
146 146
147 147
148# ----------------------------------------------------------------------------- 148# -----------------------------------------------------------------------------
149# PLIST 149# PLIST
150# 150#
151# We can't use static PLIST because the package installs files with a 151# We can't use static PLIST because the package installs files with a
152# hashed name. And "PLIST_TYPE = dynamic" appears to be broken atm 152# hashed name. And "PLIST_TYPE = dynamic" appears to be broken atm
153# [2019-12-27; pho]. 153# [2019-12-27; pho].
154GENERATE_PLIST+= \ 154GENERATE_PLIST+= \
155 cd ${DESTDIR:Q}${PREFIX:Q} && \ 155 cd ${DESTDIR:Q}${PREFIX:Q} && \
156 ${FIND} * \( -type f -o -type l \) | ${SORT}; 156 ${FIND} * \( -type f -o -type l \) | ${SORT};
157 157
158 158
159# ----------------------------------------------------------------------------- 159# -----------------------------------------------------------------------------
160# Sanity checks 160# Sanity checks
161# 161#
162 162
163# There is an unused script which don't pass the portability test. 163# There is an unused script which don't pass the portability test.
164CHECK_PORTABILITY_SKIP+= distrib/prep-bin-dist-mingw 164CHECK_PORTABILITY_SKIP+= distrib/prep-bin-dist-mingw
165 165
166# Dynamically linked Haskell executables and libraries have rpaths to 166# Dynamically linked Haskell executables and libraries have rpaths to
167# dependent Haskell libraries, but the problem is that they are 167# dependent Haskell libraries, but the problem is that they are
168# specified with $ORIGIN, which isn't currently supported by 168# specified with $ORIGIN, which isn't currently supported by
169# ../../mk/check/check-shlibs-elf.awk. 169# ../../mk/check/check-shlibs-elf.awk.
170CHECK_SHLIBS_SKIP+= */libHS*-ghc${PKGVERSION_NOREV}.* 170CHECK_SHLIBS_SKIP+= */libHS*-ghc${PKGVERSION_NOREV}.*
171.for f in ghc ghc-pkg haddock hpc hsc2hs runghc 171.for f in ghc ghc-pkg haddock hpc hsc2hs runghc
172CHECK_SHLIBS_SKIP+= lib/${PKGNAME_NOREV}/bin/${f} 172CHECK_SHLIBS_SKIP+= lib/${PKGNAME_NOREV}/bin/${f}
173.endfor 173.endfor
174 174
175# ghc57207_0.s: failed to add inputs for merge: Resource temporarily unavailable 175# ghc57207_0.s: failed to add inputs for merge: Resource temporarily unavailable
176CTF_FILES_SKIP+= */libHS*-ghc${PKGVERSION_NOREV}.* 176CTF_FILES_SKIP+= */libHS*-ghc${PKGVERSION_NOREV}.*
177 177
178# ld: fatal: relocation error ... relocation requires reference symbol 178# ld: fatal: relocation error ... relocation requires reference symbol
179STRIP_FILES_SKIP+= lib/${PKGNAME_NOREV}/libHSrts.a 179STRIP_FILES_SKIP+= lib/${PKGNAME_NOREV}/libHSrts.a
180 180
181 181
182# ----------------------------------------------------------------------------- 182# -----------------------------------------------------------------------------
183# Dependencies 183# Dependencies
184# 184#
185BUILD_DEPENDS+= libxslt-[0-9]*:../../textproc/libxslt 185BUILD_DEPENDS+= libxslt-[0-9]*:../../textproc/libxslt
186BUILD_DEPENDS+= docbook-xsl-[0-9]*:../../textproc/docbook-xsl 186BUILD_DEPENDS+= docbook-xsl-[0-9]*:../../textproc/docbook-xsl
187 187
188# NetBSD 9.x have libcurses with a newer major version than the 188# NetBSD 9.x have libcurses with a newer major version than the
189# bootstrap kit is linked against. For now, work around this with 189# bootstrap kit is linked against. For now, work around this with
190# compat80. 190# compat80.
191.if ${OPSYS} == "NetBSD" && empty(OS_VERSION:M[0-8].*) 191.if ${OPSYS} == "NetBSD" && empty(OS_VERSION:M[0-8].*)
192BUILD_DEPENDS+= compat80-[0-9]*:../../emulators/compat80 192BUILD_DEPENDS+= compat80-[0-9]*:../../emulators/compat80
193# In a sandboxed build environment, we have to reach over to the 193# In a sandboxed build environment, we have to reach over to the
194# installed libraries themselves, since the symlinks compat80 adds 194# installed libraries themselves, since the symlinks compat80 adds
195# to the /usr tree can't be applied. 195# to the /usr tree can't be applied.
196ALL_ENV+= LD_LIBRARY_PATH=${PREFIX:Q}/emul/netbsd/usr/lib 196ALL_ENV+= LD_LIBRARY_PATH=${PREFIX:Q}/emul/netbsd/usr/lib:${FILESDIR}
197.endif 197.endif
198 198
199.include "../../converters/libiconv/buildlink3.mk" 199.include "../../converters/libiconv/buildlink3.mk"
200.include "../../devel/libffi/buildlink3.mk" 200.include "../../devel/libffi/buildlink3.mk"
201.include "../../devel/gmp/buildlink3.mk" 201.include "../../devel/gmp/buildlink3.mk"
202.include "../../mk/curses.buildlink3.mk" 202.include "../../mk/curses.buildlink3.mk"
203.include "../../mk/pthread.buildlink3.mk" 203.include "../../mk/pthread.buildlink3.mk"
204.include "../../mk/bsd.pkg.mk" 204.include "../../mk/bsd.pkg.mk"

cvs diff -r1.6 -r1.7 pkgsrc/lang/ghc80/Makefile (switch to unified diff)

--- pkgsrc/lang/ghc80/Makefile 2020/03/27 04:13:57 1.6
+++ pkgsrc/lang/ghc80/Makefile 2020/03/30 19:36:03 1.7
@@ -1,202 +1,204 @@ @@ -1,202 +1,204 @@
1# $NetBSD: Makefile,v 1.6 2020/03/27 04:13:57 riastradh Exp $ 1# $NetBSD: Makefile,v 1.7 2020/03/30 19:36:03 joerg Exp $
2# ----------------------------------------------------------------------------- 2# -----------------------------------------------------------------------------
3# Package metadata 3# Package metadata
4# 4#
5DISTNAME= ghc-8.0.2-src 5DISTNAME= ghc-8.0.2-src
6PKGNAME= ${DISTNAME:S/-src$//} 6PKGNAME= ${DISTNAME:S/-src$//}
7PKGREVISION= 1 7PKGREVISION= 1
8CATEGORIES= lang 8CATEGORIES= lang
9MASTER_SITES= https://downloads.haskell.org/~ghc/${PKGVERSION_NOREV}/ 9MASTER_SITES= https://downloads.haskell.org/~ghc/${PKGVERSION_NOREV}/
10EXTRACT_SUFX= .tar.xz 10EXTRACT_SUFX= .tar.xz
11 11
12MAINTAINER= pho@cielonegro.org 12MAINTAINER= pho@cielonegro.org
13HOMEPAGE= https://www.haskell.org/ghc/ 13HOMEPAGE= https://www.haskell.org/ghc/
14COMMENT= Compiler for the functional language Haskell - 8.0 Release Series 14COMMENT= Compiler for the functional language Haskell - 8.0 Release Series
15LICENSE= modified-bsd 15LICENSE= modified-bsd
16 16
 17UNLIMIT_RESOURCES= datasize virtualsize
 18
17# TODO: We should be using the alternatives framework. 19# TODO: We should be using the alternatives framework.
18CONFLICTS+= ghc-[0-9]* 20CONFLICTS+= ghc-[0-9]*
19 21
20# GHC requires GHC to build itself. Formerly we could work around this 22# GHC requires GHC to build itself. Formerly we could work around this
21# bootstrapping problem by creating a special archive containing C 23# bootstrapping problem by creating a special archive containing C
22# sources compiled from Haskell sources, but that's no longer 24# sources compiled from Haskell sources, but that's no longer
23# possible. So we have to prepare stripped-down binaries sufficient to 25# possible. So we have to prepare stripped-down binaries sufficient to
24# bootstrap compilers for each platforms. If you want to build them 26# bootstrap compilers for each platforms. If you want to build them
25# yourself, follow instructions in BOOTSTRAP.txt and ./bootstrap.mk 27# yourself, follow instructions in BOOTSTRAP.txt and ./bootstrap.mk
26#BROKEN_EXCEPT_ON_PLATFORM+= Darwin-*-powerpc # Not available yet 28#BROKEN_EXCEPT_ON_PLATFORM+= Darwin-*-powerpc # Not available yet
27BROKEN_EXCEPT_ON_PLATFORM+= FreeBSD-*-i386 29BROKEN_EXCEPT_ON_PLATFORM+= FreeBSD-*-i386
28BROKEN_EXCEPT_ON_PLATFORM+= FreeBSD-*-x86_64 30BROKEN_EXCEPT_ON_PLATFORM+= FreeBSD-*-x86_64
29BROKEN_EXCEPT_ON_PLATFORM+= NetBSD-*-x86_64 31BROKEN_EXCEPT_ON_PLATFORM+= NetBSD-*-x86_64
30BROKEN_EXCEPT_ON_PLATFORM+= SunOS-*-x86_64 32BROKEN_EXCEPT_ON_PLATFORM+= SunOS-*-x86_64
31 33
32 34
33# ----------------------------------------------------------------------------- 35# -----------------------------------------------------------------------------
34# Distfiles 36# Distfiles
35# 37#
36DISTFILES= ${DEFAULT_DISTFILES} 38DISTFILES= ${DEFAULT_DISTFILES}
37WRKSRC= ${WRKDIR}/${PKGNAME_NOREV} 39WRKSRC= ${WRKDIR}/${PKGNAME_NOREV}
38 40
39# We don't want to extract all of the DISTFILEs. 41# We don't want to extract all of the DISTFILEs.
40EXTRACT_ONLY= ${DEFAULT_DISTFILES} 42EXTRACT_ONLY= ${DEFAULT_DISTFILES}
41 43
42 44
43# ----------------------------------------------------------------------------- 45# -----------------------------------------------------------------------------
44# Tools 46# Tools
45# 47#
46# The runtime dependency on perl is due to the evil splitter 48# The runtime dependency on perl is due to the evil splitter
47# (lib/${PKGNAME_NOREV}/ghc-split). 49# (lib/${PKGNAME_NOREV}/ghc-split).
48USE_TOOLS+= autoconf gmake gzip perl:run 50USE_TOOLS+= autoconf gmake gzip perl:run
49GNU_CONFIGURE= yes 51GNU_CONFIGURE= yes
50USE_GNU_CONFIGURE_HOST= no 52USE_GNU_CONFIGURE_HOST= no
51USE_LIBTOOL= yes 53USE_LIBTOOL= yes
52 54
53CONFIGURE_ARGS.common= \ 55CONFIGURE_ARGS.common= \
54 --with-gcc=${CC:Q} \ 56 --with-gcc=${CC:Q} \
55 --with-ld=${LD:Q} \ 57 --with-ld=${LD:Q} \
56 --with-curses-libraries=${BUILDLINK_PREFIX.curses:Q}/${BUILDLINK_LIBDIRS.curses:Q} \ 58 --with-curses-libraries=${BUILDLINK_PREFIX.curses:Q}/${BUILDLINK_LIBDIRS.curses:Q} \
57 --with-gmp-includes=${BUILDLINK_PREFIX.gmp:Q}/${BUILDLINK_INCDIRS.gmp:Q} \ 59 --with-gmp-includes=${BUILDLINK_PREFIX.gmp:Q}/${BUILDLINK_INCDIRS.gmp:Q} \
58 --with-gmp-libraries=${BUILDLINK_PREFIX.gmp:Q}/${BUILDLINK_LIBDIRS.gmp:Q} \ 60 --with-gmp-libraries=${BUILDLINK_PREFIX.gmp:Q}/${BUILDLINK_LIBDIRS.gmp:Q} \
59 --with-iconv-includes=${BUILDLINK_PREFIX.iconv:Q}/${BUILDLINK_INCDIRS.iconv:Q} \ 61 --with-iconv-includes=${BUILDLINK_PREFIX.iconv:Q}/${BUILDLINK_INCDIRS.iconv:Q} \
60 --with-iconv-libraries=${BUILDLINK_PREFIX.iconv:Q}/${BUILDLINK_LIBDIRS.iconv:Q} \ 62 --with-iconv-libraries=${BUILDLINK_PREFIX.iconv:Q}/${BUILDLINK_LIBDIRS.iconv:Q} \
61 --with-system-libffi \ 63 --with-system-libffi \
62 --with-ffi-includes=${BUILDLINK_PREFIX.libffi:Q}/${BUILDLINK_INCDIRS.libffi:Q} \ 64 --with-ffi-includes=${BUILDLINK_PREFIX.libffi:Q}/${BUILDLINK_INCDIRS.libffi:Q} \
63 --with-ffi-libraries=${BUILDLINK_PREFIX.libffi:Q}/${BUILDLINK_LIBDIRS.libffi:Q} 65 --with-ffi-libraries=${BUILDLINK_PREFIX.libffi:Q}/${BUILDLINK_LIBDIRS.libffi:Q}
64 66
65CONFIGURE_ARGS+= ${CONFIGURE_ARGS.common} 67CONFIGURE_ARGS+= ${CONFIGURE_ARGS.common}
66 68
67CONFIGURE_ENV+= \ 69CONFIGURE_ENV+= \
68 ac_cv_path_fp_prog_ar=${AR:Q} \ 70 ac_cv_path_fp_prog_ar=${AR:Q} \
69 PerlCmd=${PERL5:Q} 71 PerlCmd=${PERL5:Q}
70 72
71# LDFLAGS is currently not honored by "./configure". Since LDFLAGS 73# LDFLAGS is currently not honored by "./configure". Since LDFLAGS
72# contains rpath flags it's very important to force GHC to honor 74# contains rpath flags it's very important to force GHC to honor
73# it. Otherwise neither GHC itself nor executables it produces will 75# it. Otherwise neither GHC itself nor executables it produces will
74# have any rpaths so users will have to put "${PREFIX}/lib" into their 76# have any rpaths so users will have to put "${PREFIX}/lib" into their
75# "/etc/ld-elf.so.conf". See 77# "/etc/ld-elf.so.conf". See
76# http://hackage.haskell.org/trac/ghc/ticket/2933 78# http://hackage.haskell.org/trac/ghc/ticket/2933
77.for stage in 0 1 2 79.for stage in 0 1 2
78CONFIGURE_ENV+= \ 80CONFIGURE_ENV+= \
79 CONF_GCC_LINKER_OPTS_STAGE${stage}=${LDFLAGS:Q} 81 CONF_GCC_LINKER_OPTS_STAGE${stage}=${LDFLAGS:Q}
80# Note that CONF_LD_LINKER_OPTS_STAGE{0,1,2} are only used for 82# Note that CONF_LD_LINKER_OPTS_STAGE{0,1,2} are only used for
81# creating static GHCi libraries (HS*.o). Setting them to ${LDFLAGS} 83# creating static GHCi libraries (HS*.o). Setting them to ${LDFLAGS}
82# does more harm than good because our ${LDFLAGS} contains -Wl,* 84# does more harm than good because our ${LDFLAGS} contains -Wl,*
83# flags. It's true that ../../mk/wrapper/cmd-sink-ld transforms them 85# flags. It's true that ../../mk/wrapper/cmd-sink-ld transforms them
84# but those flags will also be baked into the compiler (see 86# but those flags will also be baked into the compiler (see
85# ${WRKSRC}/compiler/ghc.mk) so they cause problems when used outside 87# ${WRKSRC}/compiler/ghc.mk) so they cause problems when used outside
86# the buildlink. 88# the buildlink.
87.endfor 89.endfor
88 90
89# The runtime system of GHC (rts) tends to conflict with PaX MPROTECT 91# The runtime system of GHC (rts) tends to conflict with PaX MPROTECT
90# because it needs to generate various kinds of code at run time. The 92# because it needs to generate various kinds of code at run time. The
91# RTS linker, whose job is to load *static* objects at run time, 93# RTS linker, whose job is to load *static* objects at run time,
92# doesn't play nice with ASLR either. This means most executables 94# doesn't play nice with ASLR either. This means most executables
93# produced by GHC need them to be disabled. Perhaps we should patch 95# produced by GHC need them to be disabled. Perhaps we should patch
94# rts/sm/Storage.c so that it uses ffi_closure_alloc(3) on every 96# rts/sm/Storage.c so that it uses ffi_closure_alloc(3) on every
95# platform, not just Linux, and also drop support for static library 97# platform, not just Linux, and also drop support for static library
96# loading and switch to dynamic libraries entirely. 98# loading and switch to dynamic libraries entirely.
97.for f in ghc ghc-iserv ghc-iserv-dyn ghc-iserv-prof ghc-pkg haddock hpc hsc2hs runghc 99.for f in ghc ghc-iserv ghc-iserv-dyn ghc-iserv-prof ghc-pkg haddock hpc hsc2hs runghc
98NOT_PAX_MPROTECT_SAFE+= lib/${PKGNAME_NOREV}/bin/${f} 100NOT_PAX_MPROTECT_SAFE+= lib/${PKGNAME_NOREV}/bin/${f}
99NOT_PAX_ASLR_SAFE+= lib/${PKGNAME_NOREV}/bin/${f} 101NOT_PAX_ASLR_SAFE+= lib/${PKGNAME_NOREV}/bin/${f}
100.endfor 102.endfor
101 103
102 104
103# ----------------------------------------------------------------------------- 105# -----------------------------------------------------------------------------
104# Build hooks 106# Build hooks
105# 107#
106 108
107# We patch configure.ac in some directories. 109# We patch configure.ac in some directories.
108post-patch: 110post-patch:
109 @${PHASE_MSG} "Regenerating configuration scripts for ${PKGNAME}" 111 @${PHASE_MSG} "Regenerating configuration scripts for ${PKGNAME}"
110 ${RUN} cd ${WRKSRC:Q} && autoconf 112 ${RUN} cd ${WRKSRC:Q} && autoconf
111 ${RUN} cd ${WRKSRC:Q}/libraries/base && autoconf 113 ${RUN} cd ${WRKSRC:Q}/libraries/base && autoconf
112 ${RUN} cd ${WRKSRC:Q}/libraries/integer-gmp && autoconf 114 ${RUN} cd ${WRKSRC:Q}/libraries/integer-gmp && autoconf
113 115
114# Define the target "pre-configure" and non-standard "bootstrap". 116# Define the target "pre-configure" and non-standard "bootstrap".
115.include "../../lang/ghc80/bootstrap.mk" 117.include "../../lang/ghc80/bootstrap.mk"
116 118
117# Our pre-configure phase installs a bindist of bootstrapping compiler 119# Our pre-configure phase installs a bindist of bootstrapping compiler
118# directly into TOOLS_DIR so that ./configure can find it. 120# directly into TOOLS_DIR so that ./configure can find it.
119 121
120# Here we generate mk/build.mk dynamically. 122# Here we generate mk/build.mk dynamically.
121post-configure: 123post-configure:
122 ${RUN} ${RM} -f ${WRKSRC:Q}/mk/build.mk 124 ${RUN} ${RM} -f ${WRKSRC:Q}/mk/build.mk
123 125
124# If there is HsColour in the PATH, GHC's build system tries to use it 126# If there is HsColour in the PATH, GHC's build system tries to use it
125# without even checking if it really works. That's not what we 127# without even checking if it really works. That's not what we
126# appreciate. 128# appreciate.
127 ${RUN} ${ECHO} "HSCOLOUR_SRCS = NO" >> ${WRKSRC:Q}/mk/build.mk 129 ${RUN} ${ECHO} "HSCOLOUR_SRCS = NO" >> ${WRKSRC:Q}/mk/build.mk
128 130
129# Don't even think of PDF. 131# Don't even think of PDF.
130 ${RUN} ${ECHO} "BUILD_SPHINX_PDF = NO" >> ${WRKSRC:Q}/mk/build.mk 132 ${RUN} ${ECHO} "BUILD_SPHINX_PDF = NO" >> ${WRKSRC:Q}/mk/build.mk
131 133
132 134
133# ----------------------------------------------------------------------------- 135# -----------------------------------------------------------------------------
134# Installation/removal hooks 136# Installation/removal hooks
135# 137#
136 138
137# Substitutions for INSTALL and DEINSTALL that handles package.cache. 139# Substitutions for INSTALL and DEINSTALL that handles package.cache.
138FILES_SUBST+= GHC_VERSION=${PKGVERSION_NOREV} 140FILES_SUBST+= GHC_VERSION=${PKGVERSION_NOREV}
139 141
140# We don't want package.cache to be in the PLIST. 142# We don't want package.cache to be in the PLIST.
141post-install: 143post-install:
142 ${RM} -f ${DESTDIR:Q}${PREFIX:Q}/lib/${PKGNAME_NOREV}/package.conf.d/package.cache 144 ${RM} -f ${DESTDIR:Q}${PREFIX:Q}/lib/${PKGNAME_NOREV}/package.conf.d/package.cache
143 145
144 146
145# ----------------------------------------------------------------------------- 147# -----------------------------------------------------------------------------
146# PLIST 148# PLIST
147# 149#
148# We can't use static PLIST because the package installs files with a 150# We can't use static PLIST because the package installs files with a
149# hashed name. And "PLIST_TYPE = dynamic" appears to be broken atm 151# hashed name. And "PLIST_TYPE = dynamic" appears to be broken atm
150# [2019-12-27; pho]. 152# [2019-12-27; pho].
151GENERATE_PLIST+= \ 153GENERATE_PLIST+= \
152 cd ${DESTDIR:Q}${PREFIX:Q} && \ 154 cd ${DESTDIR:Q}${PREFIX:Q} && \
153 ${FIND} * \( -type f -o -type l \) | ${SORT}; 155 ${FIND} * \( -type f -o -type l \) | ${SORT};
154 156
155 157
156# ----------------------------------------------------------------------------- 158# -----------------------------------------------------------------------------
157# Sanity checks 159# Sanity checks
158# 160#
159 161
160# There is an unused script which don't pass the portability test. 162# There is an unused script which don't pass the portability test.
161CHECK_PORTABILITY_SKIP+= distrib/prep-bin-dist-mingw 163CHECK_PORTABILITY_SKIP+= distrib/prep-bin-dist-mingw
162 164
163# Dynamically linked Haskell executables and libraries have rpaths to 165# Dynamically linked Haskell executables and libraries have rpaths to
164# dependent Haskell libraries, but the problem is that they are 166# dependent Haskell libraries, but the problem is that they are
165# specified with $ORIGIN, which isn't currently supported by 167# specified with $ORIGIN, which isn't currently supported by
166# ../../mk/check/check-shlibs-elf.awk. 168# ../../mk/check/check-shlibs-elf.awk.
167CHECK_SHLIBS_SKIP+= */libHS*-ghc${PKGVERSION_NOREV}.* 169CHECK_SHLIBS_SKIP+= */libHS*-ghc${PKGVERSION_NOREV}.*
168.for f in ghc ghc-iserv-dyn ghc-pkg haddock hpc hsc2hs runghc 170.for f in ghc ghc-iserv-dyn ghc-pkg haddock hpc hsc2hs runghc
169CHECK_SHLIBS_SKIP+= lib/${PKGNAME_NOREV}/bin/${f} 171CHECK_SHLIBS_SKIP+= lib/${PKGNAME_NOREV}/bin/${f}
170.endfor 172.endfor
171 173
172# ghc57207_0.s: failed to add inputs for merge: Resource temporarily unavailable 174# ghc57207_0.s: failed to add inputs for merge: Resource temporarily unavailable
173CTF_FILES_SKIP+= */libHS*-ghc${PKGVERSION_NOREV}.* 175CTF_FILES_SKIP+= */libHS*-ghc${PKGVERSION_NOREV}.*
174 176
175# ld: fatal: relocation error ... relocation requires reference symbol 177# ld: fatal: relocation error ... relocation requires reference symbol
176STRIP_FILES_SKIP+= lib/${PKGNAME_NOREV}/libHSrts.a 178STRIP_FILES_SKIP+= lib/${PKGNAME_NOREV}/libHSrts.a
177 179
178 180
179# ----------------------------------------------------------------------------- 181# -----------------------------------------------------------------------------
180# Dependencies 182# Dependencies
181# 183#
182BUILDLINK_DEPMETHOD.python:= build 184BUILDLINK_DEPMETHOD.python:= build
183.include "../../lang/python/pyversion.mk" 185.include "../../lang/python/pyversion.mk"
184BUILD_DEPENDS+= ${PYPKGPREFIX}-sphinx-[0-9]*:../../textproc/py-sphinx 186BUILD_DEPENDS+= ${PYPKGPREFIX}-sphinx-[0-9]*:../../textproc/py-sphinx
185 187
186# NetBSD 9.x have libcurses with a newer major version than the 188# NetBSD 9.x have libcurses with a newer major version than the
187# bootstrap kit is linked against. For now, work around this with 189# bootstrap kit is linked against. For now, work around this with
188# compat80. 190# compat80.
189.if ${OPSYS} == "NetBSD" && empty(OS_VERSION:M[0-8].*) 191.if ${OPSYS} == "NetBSD" && empty(OS_VERSION:M[0-8].*)
190BUILD_DEPENDS+= compat80-[0-9]*:../../emulators/compat80 192BUILD_DEPENDS+= compat80-[0-9]*:../../emulators/compat80
191# In a sandboxed build environment, we have to reach over to the 193# In a sandboxed build environment, we have to reach over to the
192# installed libraries themselves, since the symlinks compat80 adds 194# installed libraries themselves, since the symlinks compat80 adds
193# to the /usr tree can't be applied. 195# to the /usr tree can't be applied.
194ALL_ENV+= LD_LIBRARY_PATH=${PREFIX:Q}/emul/netbsd/usr/lib 196ALL_ENV+= LD_LIBRARY_PATH=${PREFIX:Q}/emul/netbsd/usr/lib:${FILESDIR}
195.endif 197.endif
196 198
197.include "../../converters/libiconv/buildlink3.mk" 199.include "../../converters/libiconv/buildlink3.mk"
198.include "../../devel/libffi/buildlink3.mk" 200.include "../../devel/libffi/buildlink3.mk"
199.include "../../devel/gmp/buildlink3.mk" 201.include "../../devel/gmp/buildlink3.mk"
200.include "../../mk/curses.buildlink3.mk" 202.include "../../mk/curses.buildlink3.mk"
201.include "../../mk/pthread.buildlink3.mk" 203.include "../../mk/pthread.buildlink3.mk"
202.include "../../mk/bsd.pkg.mk" 204.include "../../mk/bsd.pkg.mk"

cvs diff -r1.8 -r1.9 pkgsrc/lang/ghc84/Makefile (switch to unified diff)

--- pkgsrc/lang/ghc84/Makefile 2020/03/27 04:13:57 1.8
+++ pkgsrc/lang/ghc84/Makefile 2020/03/30 19:36:03 1.9
@@ -1,220 +1,222 @@ @@ -1,220 +1,222 @@
1# $NetBSD: Makefile,v 1.8 2020/03/27 04:13:57 riastradh Exp $ 1# $NetBSD: Makefile,v 1.9 2020/03/30 19:36:03 joerg Exp $
2# ----------------------------------------------------------------------------- 2# -----------------------------------------------------------------------------
3# Package metadata 3# Package metadata
4# 4#
5DISTNAME= ghc-8.4.4-src 5DISTNAME= ghc-8.4.4-src
6PKGNAME= ${DISTNAME:S/-src$//} 6PKGNAME= ${DISTNAME:S/-src$//}
7PKGREVISION= 1 7PKGREVISION= 1
8CATEGORIES= lang 8CATEGORIES= lang
9MASTER_SITES= https://downloads.haskell.org/~ghc/${PKGVERSION_NOREV}/ 9MASTER_SITES= https://downloads.haskell.org/~ghc/${PKGVERSION_NOREV}/
10EXTRACT_SUFX= .tar.xz 10EXTRACT_SUFX= .tar.xz
11 11
12MAINTAINER= pho@cielonegro.org 12MAINTAINER= pho@cielonegro.org
13HOMEPAGE= https://www.haskell.org/ghc/ 13HOMEPAGE= https://www.haskell.org/ghc/
14COMMENT= Compiler for the functional language Haskell - 8.4 Release Series 14COMMENT= Compiler for the functional language Haskell - 8.4 Release Series
15LICENSE= modified-bsd 15LICENSE= modified-bsd
16 16
 17UNLIMIT_RESOURCES= datasize virtualsize
 18
17# TODO: We should be using the alternatives framework. 19# TODO: We should be using the alternatives framework.
18CONFLICTS+= ghc-[0-9]* 20CONFLICTS+= ghc-[0-9]*
19 21
20# GHC requires GHC to build itself. We have to prepare stripped-down 22# GHC requires GHC to build itself. We have to prepare stripped-down
21# binaries sufficient to bootstrap compilers for each platforms. If 23# binaries sufficient to bootstrap compilers for each platforms. If
22# you want to build them yourself, follow instructions in 24# you want to build them yourself, follow instructions in
23# BOOTSTRAP.txt and ./bootstrap.mk 25# BOOTSTRAP.txt and ./bootstrap.mk
24#BROKEN_EXCEPT_ON_PLATFORM+= Darwin-*-powerpc # Not available yet 26#BROKEN_EXCEPT_ON_PLATFORM+= Darwin-*-powerpc # Not available yet
25BROKEN_EXCEPT_ON_PLATFORM+= Darwin-*-x86_64 27BROKEN_EXCEPT_ON_PLATFORM+= Darwin-*-x86_64
26BROKEN_EXCEPT_ON_PLATFORM+= FreeBSD-*-i386 28BROKEN_EXCEPT_ON_PLATFORM+= FreeBSD-*-i386
27BROKEN_EXCEPT_ON_PLATFORM+= FreeBSD-*-x86_64 29BROKEN_EXCEPT_ON_PLATFORM+= FreeBSD-*-x86_64
28BROKEN_EXCEPT_ON_PLATFORM+= NetBSD-*-x86_64 30BROKEN_EXCEPT_ON_PLATFORM+= NetBSD-*-x86_64
29#BROKEN_EXCEPT_ON_PLATFORM+= SunOS-*-i386 # Not available yet 31#BROKEN_EXCEPT_ON_PLATFORM+= SunOS-*-i386 # Not available yet
30BROKEN_EXCEPT_ON_PLATFORM+= SunOS-*-x86_64 # Not available yet 32BROKEN_EXCEPT_ON_PLATFORM+= SunOS-*-x86_64 # Not available yet
31 33
32 34
33# ----------------------------------------------------------------------------- 35# -----------------------------------------------------------------------------
34# Distfiles 36# Distfiles
35# 37#
36DISTFILES= ${DEFAULT_DISTFILES} 38DISTFILES= ${DEFAULT_DISTFILES}
37WRKSRC= ${WRKDIR}/${PKGNAME_NOREV} 39WRKSRC= ${WRKDIR}/${PKGNAME_NOREV}
38 40
39# We don't want to extract all of the DISTFILEs. 41# We don't want to extract all of the DISTFILEs.
40EXTRACT_ONLY= ${DEFAULT_DISTFILES} 42EXTRACT_ONLY= ${DEFAULT_DISTFILES}
41 43
42 44
43# ----------------------------------------------------------------------------- 45# -----------------------------------------------------------------------------
44# Tools 46# Tools
45# 47#
46# The runtime dependency on perl is due to the evil splitter 48# The runtime dependency on perl is due to the evil splitter
47# (lib/${PKGNAME_NOREV}/ghc-split). 49# (lib/${PKGNAME_NOREV}/ghc-split).
48USE_TOOLS+= autoconf gmake perl:run 50USE_TOOLS+= autoconf gmake perl:run
49GNU_CONFIGURE= yes 51GNU_CONFIGURE= yes
50USE_GNU_CONFIGURE_HOST= no 52USE_GNU_CONFIGURE_HOST= no
51USE_LIBTOOL= yes 53USE_LIBTOOL= yes
52 54
53CONFIGURE_ARGS.common= \ 55CONFIGURE_ARGS.common= \
54 --with-curses-libraries=${BUILDLINK_PREFIX.curses}/${BUILDLINK_LIBDIRS.curses:Q} \ 56 --with-curses-libraries=${BUILDLINK_PREFIX.curses}/${BUILDLINK_LIBDIRS.curses:Q} \
55 --with-gmp-includes=${BUILDLINK_PREFIX.gmp}/${BUILDLINK_INCDIRS.gmp:Q} \ 57 --with-gmp-includes=${BUILDLINK_PREFIX.gmp}/${BUILDLINK_INCDIRS.gmp:Q} \
56 --with-gmp-libraries=${BUILDLINK_PREFIX.gmp}/${BUILDLINK_LIBDIRS.gmp:Q} \ 58 --with-gmp-libraries=${BUILDLINK_PREFIX.gmp}/${BUILDLINK_LIBDIRS.gmp:Q} \
57 --with-iconv-includes=${BUILDLINK_PREFIX.iconv}/${BUILDLINK_INCDIRS.iconv:Q} \ 59 --with-iconv-includes=${BUILDLINK_PREFIX.iconv}/${BUILDLINK_INCDIRS.iconv:Q} \
58 --with-iconv-libraries=${BUILDLINK_PREFIX.iconv}/${BUILDLINK_LIBDIRS.iconv:Q} \ 60 --with-iconv-libraries=${BUILDLINK_PREFIX.iconv}/${BUILDLINK_LIBDIRS.iconv:Q} \
59 --with-system-libffi \ 61 --with-system-libffi \
60 --with-ffi-includes=${BUILDLINK_PREFIX.libffi}/${BUILDLINK_INCDIRS.libffi:Q} \ 62 --with-ffi-includes=${BUILDLINK_PREFIX.libffi}/${BUILDLINK_INCDIRS.libffi:Q} \
61 --with-ffi-libraries=${BUILDLINK_PREFIX.libffi}/${BUILDLINK_LIBDIRS.libffi:Q} 63 --with-ffi-libraries=${BUILDLINK_PREFIX.libffi}/${BUILDLINK_LIBDIRS.libffi:Q}
62 64
63CONFIGURE_ARGS+= ${CONFIGURE_ARGS.common} 65CONFIGURE_ARGS+= ${CONFIGURE_ARGS.common}
64 66
65# We must pass non-wrapper tools to ./configure because they will be 67# We must pass non-wrapper tools to ./configure because they will be
66# embedded in the compiler (actually ${WRKSRC}/settings). 68# embedded in the compiler (actually ${WRKSRC}/settings).
67CONFIGURE_ENV+= \ 69CONFIGURE_ENV+= \
68 ac_cv_prog_fp_prog_ar=${AR:Q} \ 70 ac_cv_prog_fp_prog_ar=${AR:Q} \
69 ac_cv_prog_LIBTOOL=libtool \ 71 ac_cv_prog_LIBTOOL=libtool \
70 PerlCmd=${PERL5:Q} \ 72 PerlCmd=${PERL5:Q} \
71 CC=${CC:Q} \ 73 CC=${CC:Q} \
72 LD=${LD:Q} 74 LD=${LD:Q}
73 75
74# LDFLAGS is currently not honored by "./configure". Since LDFLAGS 76# LDFLAGS is currently not honored by "./configure". Since LDFLAGS
75# contains rpath flags it's very important to force GHC to honor 77# contains rpath flags it's very important to force GHC to honor
76# it. Otherwise neither GHC itself nor executables it produces will 78# it. Otherwise neither GHC itself nor executables it produces will
77# have any rpaths so users will have to put "${PREFIX}/lib" into their 79# have any rpaths so users will have to put "${PREFIX}/lib" into their
78# "/etc/ld-elf.so.conf". See 80# "/etc/ld-elf.so.conf". See
79# http://hackage.haskell.org/trac/ghc/ticket/2933 81# http://hackage.haskell.org/trac/ghc/ticket/2933
80.for stage in 0 1 2 82.for stage in 0 1 2
81CONFIGURE_ENV+= \ 83CONFIGURE_ENV+= \
82 CONF_GCC_LINKER_OPTS_STAGE${stage}=${LDFLAGS:M*:Q} 84 CONF_GCC_LINKER_OPTS_STAGE${stage}=${LDFLAGS:M*:Q}
83# Note that CONF_LD_LINKER_OPTS_STAGE{0,1,2} are only used for 85# Note that CONF_LD_LINKER_OPTS_STAGE{0,1,2} are only used for
84# creating static GHCi libraries (HS*.o). Setting them to ${LDFLAGS} 86# creating static GHCi libraries (HS*.o). Setting them to ${LDFLAGS}
85# does more harm than good because our ${LDFLAGS} contains -Wl,* 87# does more harm than good because our ${LDFLAGS} contains -Wl,*
86# flags. It's true that ../../mk/wrapper/cmd-sink-ld transforms them 88# flags. It's true that ../../mk/wrapper/cmd-sink-ld transforms them
87# but those flags will also be baked into the compiler (see 89# but those flags will also be baked into the compiler (see
88# ${WRKSRC}/compiler/ghc.mk) so they cause problems when used outside 90# ${WRKSRC}/compiler/ghc.mk) so they cause problems when used outside
89# the buildlink. 91# the buildlink.
90.endfor 92.endfor
91 93
92# The runtime system of GHC (rts) tends to conflict with PaX MPROTECT 94# The runtime system of GHC (rts) tends to conflict with PaX MPROTECT
93# because it needs to generate various kinds of code at run time. The 95# because it needs to generate various kinds of code at run time. The
94# RTS linker, whose job is to load *static* objects at run time, 96# RTS linker, whose job is to load *static* objects at run time,
95# doesn't play nice with ASLR either. This means most executables 97# doesn't play nice with ASLR either. This means most executables
96# produced by GHC need them to be disabled. Perhaps we should patch 98# produced by GHC need them to be disabled. Perhaps we should patch
97# rts/sm/Storage.c so that it uses ffi_closure_alloc(3) on every 99# rts/sm/Storage.c so that it uses ffi_closure_alloc(3) on every
98# platform, not just Linux, and also drop support for static library 100# platform, not just Linux, and also drop support for static library
99# loading and switch to dynamic libraries entirely. 101# loading and switch to dynamic libraries entirely.
100.for f in ghc ghc-iserv ghc-iserv-dyn ghc-iserv-prof ghc-pkg haddock hpc hsc2hs runghc 102.for f in ghc ghc-iserv ghc-iserv-dyn ghc-iserv-prof ghc-pkg haddock hpc hsc2hs runghc
101NOT_PAX_MPROTECT_SAFE+= lib/${PKGNAME_NOREV}/bin/${f} 103NOT_PAX_MPROTECT_SAFE+= lib/${PKGNAME_NOREV}/bin/${f}
102NOT_PAX_ASLR_SAFE+= lib/${PKGNAME_NOREV}/bin/${f} 104NOT_PAX_ASLR_SAFE+= lib/${PKGNAME_NOREV}/bin/${f}
103.endfor 105.endfor
104 106
105 107
106# ----------------------------------------------------------------------------- 108# -----------------------------------------------------------------------------
107# Build hooks 109# Build hooks
108# 110#
109 111
110# We patch configure.ac in some directories. 112# We patch configure.ac in some directories.
111post-patch: 113post-patch:
112 @${PHASE_MSG} "Regenerating configuration scripts for ${PKGNAME}" 114 @${PHASE_MSG} "Regenerating configuration scripts for ${PKGNAME}"
113 ${RUN} cd ${WRKSRC} && autoconf 115 ${RUN} cd ${WRKSRC} && autoconf
114 116
115# Define the target "pre-configure" and non-standard "bootstrap". 117# Define the target "pre-configure" and non-standard "bootstrap".
116.include "../../lang/ghc84/bootstrap.mk" 118.include "../../lang/ghc84/bootstrap.mk"
117 119
118# Our pre-configure phase installs a bindist of bootstrapping compiler 120# Our pre-configure phase installs a bindist of bootstrapping compiler
119# directly into TOOLS_DIR so that ./configure can find it. 121# directly into TOOLS_DIR so that ./configure can find it.
120 122
121# The version restriction on Sphinx in ${WRKSRC}/configure.ac is too 123# The version restriction on Sphinx in ${WRKSRC}/configure.ac is too
122# loose, and building docs/users_guide rarely succeeds. We don't know 124# loose, and building docs/users_guide rarely succeeds. We don't know
123# which version is actually required for it. 125# which version is actually required for it.
124.include "../../mk/bsd.prefs.mk" 126.include "../../mk/bsd.prefs.mk"
125BUILD_SPHINX_HTML?= no 127BUILD_SPHINX_HTML?= no
126 128
127# Here we generate mk/build.mk dynamically. 129# Here we generate mk/build.mk dynamically.
128post-configure: 130post-configure:
129 ${RUN} ${RM} -f ${WRKSRC}/mk/build.mk 131 ${RUN} ${RM} -f ${WRKSRC}/mk/build.mk
130 132
131# If there is HsColour in the PATH, GHC's build system tries to use it 133# If there is HsColour in the PATH, GHC's build system tries to use it
132# without even checking if it really works. That's not what we 134# without even checking if it really works. That's not what we
133# appreciate. 135# appreciate.
134 ${RUN} ${ECHO} "HSCOLOUR_SRCS = NO" >> ${WRKSRC}/mk/build.mk 136 ${RUN} ${ECHO} "HSCOLOUR_SRCS = NO" >> ${WRKSRC}/mk/build.mk
135 137
136.if ${BUILD_SPHINX_HTML} == "no" 138.if ${BUILD_SPHINX_HTML} == "no"
137 ${RUN} ${ECHO} "BUILD_SPHINX_HTML = NO" >> ${WRKSRC}/mk/build.mk 139 ${RUN} ${ECHO} "BUILD_SPHINX_HTML = NO" >> ${WRKSRC}/mk/build.mk
138.endif 140.endif
139 141
140# Don't even think of PDF. 142# Don't even think of PDF.
141 ${RUN} ${ECHO} "BUILD_SPHINX_PDF = NO" >> ${WRKSRC}/mk/build.mk 143 ${RUN} ${ECHO} "BUILD_SPHINX_PDF = NO" >> ${WRKSRC}/mk/build.mk
142 144
143# https://gitlab.haskell.org/ghc/ghc/issues/13542 145# https://gitlab.haskell.org/ghc/ghc/issues/13542
144.if ${OPSYS} == "SunOS" 146.if ${OPSYS} == "SunOS"
145 ${RUN} ${ECHO} "SplitSections = YES" >> ${WRKSRC}/mk/build.mk 147 ${RUN} ${ECHO} "SplitSections = YES" >> ${WRKSRC}/mk/build.mk
146.endif 148.endif
147 149
148 150
149# ----------------------------------------------------------------------------- 151# -----------------------------------------------------------------------------
150# Installation/removal hooks 152# Installation/removal hooks
151# 153#
152 154
153# Substitutions for INSTALL and DEINSTALL that handles package.cache. 155# Substitutions for INSTALL and DEINSTALL that handles package.cache.
154FILES_SUBST+= GHC_VERSION=${PKGVERSION_NOREV} 156FILES_SUBST+= GHC_VERSION=${PKGVERSION_NOREV}
155 157
156# We don't want package.cache to be in the PLIST. 158# We don't want package.cache to be in the PLIST.
157post-install: 159post-install:
158 ${RM} -f ${DESTDIR}${PREFIX}/lib/${PKGNAME_NOREV}/package.conf.d/package.cache 160 ${RM} -f ${DESTDIR}${PREFIX}/lib/${PKGNAME_NOREV}/package.conf.d/package.cache
159 161
160 162
161# ----------------------------------------------------------------------------- 163# -----------------------------------------------------------------------------
162# PLIST 164# PLIST
163# 165#
164# We can't use static PLIST because the package installs files with a 166# We can't use static PLIST because the package installs files with a
165# hashed name. And "PLIST_TYPE = dynamic" appears to be broken atm 167# hashed name. And "PLIST_TYPE = dynamic" appears to be broken atm
166# [2019-12-27; pho]. 168# [2019-12-27; pho].
167GENERATE_PLIST+= \ 169GENERATE_PLIST+= \
168 cd ${DESTDIR}${PREFIX} && \ 170 cd ${DESTDIR}${PREFIX} && \
169 ${FIND} * \( -type f -o -type l \) | ${SORT}; 171 ${FIND} * \( -type f -o -type l \) | ${SORT};
170 172
171 173
172# ----------------------------------------------------------------------------- 174# -----------------------------------------------------------------------------
173# Sanity checks 175# Sanity checks
174# 176#
175 177
176# There is an unused script which don't pass the portability test. 178# There is an unused script which don't pass the portability test.
177CHECK_PORTABILITY_SKIP+= distrib/prep-bin-dist-mingw 179CHECK_PORTABILITY_SKIP+= distrib/prep-bin-dist-mingw
178 180
179# Dynamically linked Haskell executables and libraries have rpaths to 181# Dynamically linked Haskell executables and libraries have rpaths to
180# dependent Haskell libraries, but the problem is that they are 182# dependent Haskell libraries, but the problem is that they are
181# specified with $ORIGIN, which isn't currently supported by 183# specified with $ORIGIN, which isn't currently supported by
182# ../../mk/check/check-shlibs-elf.awk. 184# ../../mk/check/check-shlibs-elf.awk.
183CHECK_SHLIBS_SKIP+= */libHS*-ghc${PKGVERSION_NOREV}.* 185CHECK_SHLIBS_SKIP+= */libHS*-ghc${PKGVERSION_NOREV}.*
184.for f in ghc ghc-iserv-dyn ghc-pkg haddock hpc hsc2hs runghc 186.for f in ghc ghc-iserv-dyn ghc-pkg haddock hpc hsc2hs runghc
185CHECK_SHLIBS_SKIP+= lib/${PKGNAME_NOREV}/bin/${f} 187CHECK_SHLIBS_SKIP+= lib/${PKGNAME_NOREV}/bin/${f}
186.endfor 188.endfor
187 189
188# ghc57207_0.s: failed to add inputs for merge: Resource temporarily unavailable 190# ghc57207_0.s: failed to add inputs for merge: Resource temporarily unavailable
189CTF_FILES_SKIP+= */libHS*-ghc${PKGVERSION_NOREV}.* 191CTF_FILES_SKIP+= */libHS*-ghc${PKGVERSION_NOREV}.*
190 192
191# ld: fatal: relocation error ... relocation requires reference symbol 193# ld: fatal: relocation error ... relocation requires reference symbol
192STRIP_FILES_SKIP+= lib/${PKGNAME_NOREV}/libHSrts.a 194STRIP_FILES_SKIP+= lib/${PKGNAME_NOREV}/libHSrts.a
193 195
194 196
195# ----------------------------------------------------------------------------- 197# -----------------------------------------------------------------------------
196# Dependencies 198# Dependencies
197# 199#
198.if ${BUILD_SPHINX_HTML} != "no" 200.if ${BUILD_SPHINX_HTML} != "no"
199BUILDLINK_DEPMETHOD.python:= build 201BUILDLINK_DEPMETHOD.python:= build
200.include "../../lang/python/pyversion.mk" 202.include "../../lang/python/pyversion.mk"
201BUILD_DEPENDS+= ${PYPKGPREFIX}-sphinx-[0-9]*:../../textproc/py-sphinx 203BUILD_DEPENDS+= ${PYPKGPREFIX}-sphinx-[0-9]*:../../textproc/py-sphinx
202.endif 204.endif
203 205
204# NetBSD 9.x have libcurses with a newer major version than the 206# NetBSD 9.x have libcurses with a newer major version than the
205# bootstrap kit is linked against. For now, work around this with 207# bootstrap kit is linked against. For now, work around this with
206# compat80. 208# compat80.
207.if ${OPSYS} == "NetBSD" && empty(OS_VERSION:M[0-8].*) 209.if ${OPSYS} == "NetBSD" && empty(OS_VERSION:M[0-8].*)
208BUILD_DEPENDS+= compat80-[0-9]*:../../emulators/compat80 210BUILD_DEPENDS+= compat80-[0-9]*:../../emulators/compat80
209# In a sandboxed build environment, we have to reach over to the 211# In a sandboxed build environment, we have to reach over to the
210# installed libraries themselves, since the symlinks compat80 adds 212# installed libraries themselves, since the symlinks compat80 adds
211# to the /usr tree can't be applied. 213# to the /usr tree can't be applied.
212ALL_ENV+= LD_LIBRARY_PATH=${PREFIX}/emul/netbsd/usr/lib 214ALL_ENV+= LD_LIBRARY_PATH=${PREFIX:Q}/emul/netbsd/usr/lib:${FILESDIR}
213.endif 215.endif
214 216
215.include "../../converters/libiconv/buildlink3.mk" 217.include "../../converters/libiconv/buildlink3.mk"
216.include "../../devel/libffi/buildlink3.mk" 218.include "../../devel/libffi/buildlink3.mk"
217.include "../../devel/gmp/buildlink3.mk" 219.include "../../devel/gmp/buildlink3.mk"
218.include "../../mk/curses.buildlink3.mk" 220.include "../../mk/curses.buildlink3.mk"
219.include "../../mk/pthread.buildlink3.mk" 221.include "../../mk/pthread.buildlink3.mk"
220.include "../../mk/bsd.pkg.mk" 222.include "../../mk/bsd.pkg.mk"