]> gitweb @ CieloNegro.org - pkgsrc-ghc.git/blob - Makefile
Merge branch 'ghc-7.4.1'
[pkgsrc-ghc.git] / Makefile
1 # $NetBSD: Makefile,v 1.42 2008/07/07 14:58:00 kristerw Exp $
2
3 DISTNAME=       ghc-${VERSION}
4 VERSION=        7.4.1
5 CATEGORIES=     lang
6 MASTER_SITES=   http://www.haskell.org/ghc/dist/${VERSION}/
7 MAINTAINER=     kristerw@NetBSD.org
8 HOMEPAGE=       http://www.haskell.org/ghc/
9 COMMENT=        Compiler for the functional language Haskell
10 LICENSE=        modified-bsd
11
12 DISTFILES=      ${DISTNAME}-src.tar.bz2
13 DISTFILES+=     ${DISTNAME}-boot-i386-unknown-freebsd8.0.tar.bz2
14 DISTFILES+=     ${DISTNAME}-boot-i386-unknown-netbsdelf6.99.1.tar.bz2
15 DISTFILES+=     ${DISTNAME}-boot-powerpc-apple-darwin9.8.0.tar.bz2
16 DISTFILES+=     ${DISTNAME}-boot-x86_64-unknown-linux-gnu.tar.bz2
17
18 .for i in ${DISTFILES:M*-boot-*}
19 SITES.${i}=     http://static.cielonegro.org/archive/
20 .endfor
21
22 PKG_DESTDIR_SUPPORT=    user-destdir
23
24 # Unregisterised HC packages are platform-dependent C sources. Yes,
25 # they are C sources but are totally non-portable. We have to create
26 # more HC packages to support more platforms. Note that those packages
27 # are built with integer-simple, not integer-gmp, to reduce some
28 # complexity by not depending on the GMP. The resulting registerised
29 # GHC uses integer-gmp so this won't be a problem.
30 #
31 # If you want to build HC packages yourself, follow instructions in
32 # the ./TODO file.
33 ONLY_FOR_PLATFORM= \
34         Darwin-*-powerpc \
35         FreeBSD-*-i386 \
36         Linux-*-x86_64 \
37         NetBSD-*-i386
38
39 # We must provide the real path to gcc to the ./configure script,
40 # because GHC has a runtime dependency on it. Aren't there any ways
41 # better than this?
42 .include "../../mk/bsd.prefs.mk"
43 .include "../../mk/compiler.mk"
44 .if empty(CCPATH)
45 WARNINGS+= "This package depends on pkgsrc's undocumented variable \
46 CCPATH but it disappeared somehow."
47 WARNINGS+= "Using hard-coded /usr/bin/gcc as the C compiler..."
48 CONFIGURE_ARGS+= --with-gcc=/usr/bin/gcc
49 .else
50 CONFIGURE_ARGS+= --with-gcc=${CCPATH}
51 .endif
52
53 USE_TOOLS+=     autoconf date gmake gtar perl perl:run
54 CONFIGURE_ENV+= PerlCmd=${PERL5:Q}
55
56 # We don't want to extract all of the DISTFILEs.
57 EXTRACT_ONLY=   ${DISTNAME}-src.tar.bz2
58
59 CONFIGURE_ARGS += \
60         --build=${PLATFORM} \
61         --host=${PLATFORM} \
62         --target=${PLATFORM} \
63         --prefix=${PREFIX} \
64         --mandir=${PREFIX}/${PKGMANDIR} \
65         --with-gmp-includes=${PREFIX}/include \
66         --with-gmp-libraries=${PREFIX}/lib \
67         --with-iconv-includes=${PREFIX}/include \
68         --with-iconv-libraries=${PREFIX}/lib
69
70 # Define ${PLATFORM} and the target "pre-configure".
71 .include "../../wip/ghc/stage0.mk"
72
73 do-configure:
74         ${RUN} cd ${WRKSRC} && \
75                 ${SETENV} ${CONFIGURE_ENV} ./configure ${CONFIGURE_ARGS}
76 # We need to tell the libraries/terminfo/configure that our ncurses is
77 # in a non-standard path. Without that, the resulting GHC tries to
78 # link programs by executing ld(1) without passing it -L${PREFIX}/lib.
79         ${RUN} ${ECHO} "libraries/terminfo_CONFIGURE_OPTS += \
80                 --configure-option=--with-curses-includes=${PREFIX}/include \
81                 --configure-option=--with-curses-libraries=${PREFIX}/lib" >> ${WRKSRC}/mk/build.mk
82 # The ghc compiler does normally split the generated asm files into small
83 # parts before sending them to gcc, to enable the linker to eliminate
84 # unused parts.  This does however not play nice with the pkgsrc
85 # framework, and the result is that the build takes more than 5 times
86 # as long than when the files are not split.  See
87 #    http://mail-index.netbsd.org/tech-pkg/2006/07/30/0005.html
88 # for a description of the problem.
89 # Disable file splitting until pkgsrc gets improved.
90         ${RUN} ${ECHO} "SplitObjs = NO" >> ${WRKSRC}/mk/build.mk
91 # If we don't explicitly disable HsColour, PLIST gets changed
92 # depending on whether we have installed it or not.
93         ${RUN} ${ECHO} "HSCOLOUR_SRCS = NO" >> ${WRKSRC}/mk/build.mk
94
95 # Substitutions for INSTALL and DEINSTALL.
96 FILES_SUBST+=   DISTNAME=${DISTNAME}
97
98 # There is an unused script which don't pass the portability test.
99 CHECK_PORTABILITY_SKIP+=        distrib/prep-bin-dist-mingw
100
101 # GHC currently *requires* ${PREFIX}/lib to be in
102 # "/etc/ld-elf.so.conf". See
103 # http://hackage.haskell.org/trac/ghc/ticket/2933
104 CHECK_SHLIBS_SUPPORTED= no
105
106 # I guess pdcurses works well but not tested.
107 USE_NCURSES=    yes
108 .include "../../devel/ncurses/buildlink3.mk"
109
110 BUILD_DEPENDS+= docbook-xsl-[0-9]*:../../textproc/docbook-xsl
111 BUILDLINK_DEPMETHOD.libxslt = build
112 .include "../../converters/libiconv/buildlink3.mk"
113 .include "../../devel/gmp/buildlink3.mk"
114 .include "../../textproc/libxslt/buildlink3.mk"
115 .include "../../mk/pthread.buildlink3.mk"
116 .include "../../mk/bsd.pkg.mk"