]> gitweb @ CieloNegro.org - pkgsrc-ghc.git/blob - Makefile
Added missing files
[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=                6.12.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                                 ${DISTNAME}-boot-i386-unknown-netbsd.tar.bz2 \
14                                 ${DISTNAME}-boot-i386-unknown-freebsd.tar.bz2
15
16 SITES.${DISTNAME}-src.tar.bz2                                           = http://www.haskell.org/ghc/dist/${VERSION}/
17 SITES.${DISTNAME}-boot-i386-unknown-netbsd.tar.bz2      = http://static.cielonegro.org/archive/
18 SITES.${DISTNAME}-boot-i386-unknown-freebsd.tar.bz2     = http://static.cielonegro.org/archive/
19
20 PKG_DESTDIR_SUPPORT=    user-destdir
21
22 .include "../../mk/bsd.prefs.mk"
23
24 # Unregisterised HC packages are architecture dependent. We have to
25 # create more HC packages to support more architectures.
26 ONLY_FOR_PLATFORM= NetBSD-*-i386 FreeBSD-*-i386
27 # Note: Darwin-*-powerpc is temporarily disabled for now. It shall come back in the near future. Thanks for your patience.
28
29 USE_TOOLS+=     gmake bsdtar perl:run
30 CONFIGURE_ENV+=         PerlCmd=${PERL5:Q}
31
32 # We don't want to extract all of the DISTFILEs.
33 EXTRACT_ONLY=   ${DISTNAME}-src.tar.bz2
34
35 CONFIGURE_ARGS += \
36         --prefix=${PREFIX} \
37         --mandir=${PREFIX}/${PKGMANDIR} \
38         --with-gmp-includes=${PREFIX}/include \
39         --with-gmp-libraries=${PREFIX}/lib \
40         --with-iconv-includes=${PREFIX}/include \
41         --with-iconv-libraries=${PREFIX}/lib
42
43 # Build an unregisterised bootstrap compiler and install it directly
44 # into the .buildlink directory. But we can't use "make install"
45 # because we don't build it in a standard way (./configure && make).
46 #
47 # To install it, we just copy ghc and ghc-pkg from
48 # "work/bootstrap/ghc-${VERSION}/inplace/bin" to
49 # "${BUILDLINK_DIR}/bin". Note that in-place ghc isn't usable before
50 # running "ghc-pkg recache".
51
52 .if ${MACHINE_ARCH} == "i386" && ${OPSYS} == "NetBSD"
53 BOOTSTRAP_TARBALL  = ${DISTNAME}-boot-i386-unknown-netbsd.tar.bz2
54 BOOTSTRAP_BUILD_MK = ${PKGDIR}/files/bootstrap-bsd.mk
55
56 .elif ${MACHINE_ARCH} == "i386" && ${OPSYS} == "FreeBSD"
57 BOOTSTRAP_TARBALL = ${DISTNAME}-boot-i386-unknown-freebsd.tar.bz2
58 BOOTSTRAP_BUILD_MK = ${PKGDIR}/files/bootstrap-bsd.mk
59
60 #.elif ${MACHINE_ARCH} == "powerpc" && ${OPSYS} == "Darwin"
61 #BOOTSTRAP_TARBALL = ${DISTNAME}-boot-powerpc-apple-darwin.tar.bz2
62 #BOOTSTRAP_BUILD_MK = ${PKGDIR}/files/bootstrap.mk
63
64 .else
65 PKG_FAIL_REASON+=       "internal error: unsupported platform"
66 .endif
67
68 pre-configure:
69         ${RUN} cd ${WRKDIR} && \
70                 ${ECHO} "====> Preparing bootstrap compiler" && \
71                 ${MKDIR} bootstrap && \
72                 ${CP} -r ${DISTNAME} bootstrap && \
73                 cd bootstrap/${DISTNAME} && \
74                 ${LN} -sf ${PWD_CMD} utils/ghc-pwd/ghc-pwd && \
75                 ${ECHO} "====> Configuring for bootstrap compiler" && \
76                 ${ENV} ${CONFIGURE_ENV} ./configure --enable-hc-boot ${CONFIGURE_ARGS} && \
77                 ${ECHO} "====> Extracting bootstrap HC archive" && \
78                 (cd .. && bsdtar jxfm ${DISTDIR}/${BOOTSTRAP_TARBALL}) && \
79                 ${SH} mkfiles && \
80                 ${ECHO} "====> Building bootstrap compiler" && \
81                 ${SED} -e "s#\\[\\[PREFIX\\]\\]#${PREFIX}#g" ${BOOTSTRAP_BUILD_MK} > mk/build.mk && \
82                 for c in libraries/*/configure; do \
83                         (cd `${DIRNAME} $$c` && ${ENV} ${CONFIGURE_ENV} ${SH} configure ${CONFIGURE_ARGS}); \
84                 done && \
85                 for i in inplace/lib/package.conf.d/*.conf */*/package-data.mk */*/*/package-data.mk; do \
86                         ${SED} -e "s#\\[\\[GHC_SOURCE_PATH\\]\\]#`${PWD_CMD}`#g" $$i > $$i.tmp; \
87                         ${MV} -f $$i.tmp $$i; \
88                 done && \
89                 ${TOUCH} -r inplace/lib/package.conf.d */*/package-data.mk */*/*/package-data.mk && \
90                 ${GMAKE} bootstrapping-files && \
91                 ${GMAKE} all_ghc_stage2 && \
92                 ${GMAKE} inplace/bin/ghc-pkg && \
93                 ${GMAKE} inplace/lib/unlit && \
94                 inplace/bin/ghc-pkg recache && \
95                 ${CP} inplace/bin/ghc-stage2 ${BUILDLINK_DIR}/bin/ghc && \
96                 ${CP} inplace/bin/ghc-pkg ${BUILDLINK_DIR}/bin/ghc-pkg
97
98 # We need to tell the libraries/integer-gmp/configure that libgmp is
99 # in a non-standard path. Without that, the resulting GHC tries to
100 # link programs by executing ld(1) without passing it -L${PREFIX}/lib.
101 do-configure:
102         ${RUN} cd ${WRKSRC} && \
103                 ${ENV} ${CONFIGURE_ENV} ./configure ${CONFIGURE_ARGS}
104         ${RUN} ${ECHO} "libraries/integer-gmp_CONFIGURE_OPTS += \
105                 --configure-option=--with-gmp-includes=${PREFIX}/include \
106                 --configure-option=--with-gmp-libraries=${PREFIX}/lib" > ${WRKSRC}/mk/build.mk
107         ${RUN} ${ECHO} "libraries/terminfo_CONFIGURE_OPTS += \
108                 --configure-option=--with-curses-includes=${PREFIX}/include \
109                 --configure-option=--with-curses-libraries=${PREFIX}/lib" >> ${WRKSRC}/mk/build.mk
110
111 # The ghc compiler does normally split the generated C files into small
112 # parts before sending them to gcc, to enable the linker to eliminate
113 # unused parts.  This does however not play nice with the pkgsrc
114 # framework, and the result is that the build takes more than 5 times
115 # as long than when the files are not split.  See
116 #    http://mail-index.netbsd.org/tech-pkg/2006/07/30/0005.html
117 # for a description of the problem.
118 # Disable file splitting until pkgsrc gets improved.
119 pre-build:
120         ${RUN} ${ECHO} "SplitObjs = NO" >> ${WRKSRC}/mk/build.mk
121
122 # Some unused scripts don't pass the portability test.
123 CHECK_PORTABILITY_SKIP+=        distrib/prep-bin-dist-mingw
124
125 # GHC currently *requires* ${PREFIX}/lib to be in
126 # "/etc/ld-elf.so.conf". See
127 # http://hackage.haskell.org/trac/ghc/ticket/2933
128 CHECK_SHLIBS_SUPPORTED=         no
129
130 BUILDLINK_DEPMETHOD.libxslt = build
131 .include "../../converters/libiconv/buildlink3.mk"
132 .include "../../devel/gmp/buildlink3.mk"
133 .include "../../textproc/libxslt/buildlink3.mk"
134 .include "../../mk/termcap.buildlink3.mk"
135 .include "../../mk/pthread.buildlink3.mk"
136 .include "../../mk/bsd.pkg.mk"