[BACK]Return to Makefile CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / lang / ghc7

Annotation of pkgsrc/lang/ghc7/Makefile, Revision 1.45

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

CVSweb <webmaster@jp.NetBSD.org>