Changeset View
Changeset View
Standalone View
Standalone View
lang/ghc/bsd.ghc.mk
# $FreeBSD$ | # $FreeBSD$ | ||||
# | # | ||||
# bsd.ghc.mk -- Common code for various versions of GHC ports. | # bsd.ghc.mk -- Common code for various versions of GHC ports. | ||||
# | # | ||||
# Maintained by: haskell@FreeBSD.org | # Maintained by: haskell@FreeBSD.org | ||||
# | # | ||||
ONLY_FOR_ARCHS= aarch64 amd64 armv6 armv7 i386 | ONLY_FOR_ARCHS= aarch64 amd64 armv6 armv7 i386 | ||||
tcberner: ^ why not add powerpc64 here? instead having that confusing line in lang/ghc/Makefile | |||||
Done Inline ActionsIt's only for ghc-8.6.x mikael: It's only for ghc-8.6.x | |||||
Not Done Inline Actions^ this seems to breaks it: you cannot include bsd.port[.pre].mk twice tcberner: ^ this seems to breaks it:
```
you cannot include bsd.port[.pre].mk twice
``` | |||||
GHC_VERSION_MAJOR= ${GHC_VERSION:S/./ /g:[1]} | |||||
GHC_VERSION_MINOR= ${GHC_VERSION:S/./ /g:[2]} | |||||
# .if ${GHC_VERSION_MAJOR} >= 8 && ${GHC_VERSION_MINOR} >= 6 && ${OSVERSION} >= 1200086 | |||||
# ONLY_FOR_ARCHS+= powerpc64 | |||||
# .endif | |||||
DATADIR= ${PREFIX}/share/ghc-${GHC_VERSION} | DATADIR= ${PREFIX}/share/ghc-${GHC_VERSION} | ||||
EXAMPLESDIR= ${PREFIX}/share/examples/ghc-${GHC_VERSION} | EXAMPLESDIR= ${PREFIX}/share/examples/ghc-${GHC_VERSION} | ||||
USES= autoreconf gmake iconv:translit localbase:ldflags ncurses perl5 tar:xz | USES= autoreconf gmake iconv:translit localbase:ldflags ncurses perl5 tar:xz | ||||
Not Done Inline ActionsWhy do we need that? arrowd: Why do we need that? | |||||
Done Inline ActionsI need a recent compiler, I probably just need compiler:c11 (or put use_gcc in the ppc64 'if block') mikael: I need a recent compiler, I probably just need compiler:c11 (or put use_gcc in the ppc64 'if… | |||||
USE_LOCALE= en_US.UTF-8 | USE_LOCALE= en_US.UTF-8 | ||||
USE_PERL5= build | USE_PERL5= build | ||||
NO_CCACHE= ccache: error: Failed to create directory /nonexistent/.ccache/tmp: Permission denied | NO_CCACHE= ccache: error: Failed to create directory /nonexistent/.ccache/tmp: Permission denied | ||||
# The configure process accepts,filters and canonicalises | # The configure process accepts,filters and canonicalises | ||||
# the CONFIGURE_TARGET variable. You can read the files | # the CONFIGURE_TARGET variable. You can read the files | ||||
# ${WRKSRC}/configure and ${WRKSRC}/config.sub. | # ${WRKSRC}/configure and ${WRKSRC}/config.sub. | ||||
# This is better fixed in files/build.mk.in | # This is better fixed in files/build.mk.in | ||||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | |||||
LOCALBASE?= /usr/local | LOCALBASE?= /usr/local | ||||
PLIST?= ${.CURDIR}/../../lang/ghc/pkg-plist | PLIST?= ${.CURDIR}/../../lang/ghc/pkg-plist | ||||
GHC_ARCH= ${ARCH:S/amd64/x86_64/:C/armv.*/arm/} | GHC_ARCH= ${ARCH:S/amd64/x86_64/:C/armv.*/arm/} | ||||
.include <bsd.port.options.mk> | .include <bsd.port.options.mk> | ||||
.if empty(PORT_OPTIONS:MBOOT) | .if empty(PORT_OPTIONS:MBOOT) | ||||
. if ${ARCH} == armv6 || ${ARCH} == armv7 | . if ${ARCH} == armv6 || ${ARCH} == armv7 | ||||
tcbernerUnsubmitted Not Done Inline ActionsFor a future revision, couldnt we do something like _BOOT_GHC_VESRSION_amd64= 8.6.4 _BOOT_GHC_VESRSION_i386=8.6.4 [...] _BOOT_GHC_VERSION_${ARCH}?=8.4.3 BOOT_GHC_VERSION=${_BOOT_GHC_VERSION_${ARCH}} tcberner: For a future revision, couldnt we do something like
```
_BOOT_GHC_VESRSION_amd64= 8.6.4… | |||||
BOOT_GHC_VERSION= 8.4.2 | BOOT_GHC_VERSION= 8.4.2 | ||||
. elif ${ARCH} == powerpc64 | |||||
BOOT_GHC_VERSION= 8.6.3 | |||||
. else | . else | ||||
BOOT_GHC_VERSION= 8.4.3 | BOOT_GHC_VERSION= 8.4.3 | ||||
. endif | . endif | ||||
# When GHC being compiled and GHC used for bootstrapping support different | # When GHC being compiled and GHC used for bootstrapping support different | ||||
# LLVM versions, we have to pull in both. Luckily, this is relatively rare. | # LLVM versions, we have to pull in both. Luckily, this is relatively rare. | ||||
. if ${ARCH} == aarch64 || ${ARCH} == armv6 || ${ARCH} == armv7 | . if ${ARCH} == aarch64 || ${ARCH} == armv6 || ${ARCH} == armv7 | ||||
# LLVM version that bootstrap compiler uses | # LLVM version that bootstrap compiler uses | ||||
Show All 23 Lines | |||||
IGNORE= lang/ghc on ARM requires at least __FreeBSD_version 1200064 | IGNORE= lang/ghc on ARM requires at least __FreeBSD_version 1200064 | ||||
. endif | . endif | ||||
. ifdef QEMU_EMULATING | . ifdef QEMU_EMULATING | ||||
IGNORE= qemu-user-static isn't able to build lang/ghc, but it builds fine on a real hardware | IGNORE= qemu-user-static isn't able to build lang/ghc, but it builds fine on a real hardware | ||||
. endif | . endif | ||||
.endif | .endif | ||||
.if ${ARCH} == powerpc64 | |||||
USE_GCC= yes | |||||
CONFIGURE_ENV+= STRIP=${LOCALBASE}/bin/strip | |||||
.endif | |||||
CONFIGURE_ENV+= CC=${CC} LD=${LD} | CONFIGURE_ENV+= CC=${CC} LD=${LD} | ||||
DOCSDIR= ${PREFIX}/share/doc/${DISTNAME} | DOCSDIR= ${PREFIX}/share/doc/${DISTNAME} | ||||
GHC_LIBDIR= ${STAGEDIR}${PREFIX}/lib/ghc-${GHC_VERSION} | GHC_LIBDIR= ${STAGEDIR}${PREFIX}/lib/ghc-${GHC_VERSION} | ||||
GHC_LIBDIR_REL= lib/ghc-${GHC_VERSION} | GHC_LIBDIR_REL= lib/ghc-${GHC_VERSION} | ||||
PLIST_SUB+= GHC_VERSION=${GHC_VERSION} GHC_LIBDIR=${GHC_LIBDIR_REL} | PLIST_SUB+= GHC_VERSION=${GHC_VERSION} GHC_LIBDIR=${GHC_LIBDIR_REL} | ||||
Show All 26 Lines | |||||
SLAVES_PREFIX= ${WRKDIR}/slaves_prefix | SLAVES_PREFIX= ${WRKDIR}/slaves_prefix | ||||
SLAVES_WRKDIRPREFIX= ${WRKDIR}/slaves_wrkdirprefix | SLAVES_WRKDIRPREFIX= ${WRKDIR}/slaves_wrkdirprefix | ||||
MAKE_ENV+= PATH=${SLAVES_PREFIX}/bin:${PATH} | MAKE_ENV+= PATH=${SLAVES_PREFIX}/bin:${PATH} | ||||
CONFIGURE_ENV+= PATH=${SLAVES_PREFIX}/bin:${PATH} | CONFIGURE_ENV+= PATH=${SLAVES_PREFIX}/bin:${PATH} | ||||
post-extract: | post-extract: | ||||
# don't use the "wrap" trick on arches that use post-ino64 bootstrap binaries (arm*) | # Use the "wrap" trick on arches that have to use pre-ino64 bootstrap binaries | ||||
.if empty(PORT_OPTIONS:MBOOT) && ${OPSYS} == FreeBSD && ${OSVERSION} >= 1200031 && \ | .if empty(PORT_OPTIONS:MBOOT) && ${OPSYS} == FreeBSD && ${OSVERSION} >= 1200031 && \ | ||||
${ARCH} != aarch64 && ${ARCH} != armv6 && ${ARCH} != armv7 | ${ARCH} == amd64 && ${ARCH} == i386 | ||||
Done Inline ActionsI wonder if this should not be changed to positive tests with the architectures that actually need this instead of excluding the ones that do not. mat: I wonder if this should not be changed to positive tests with the architectures that actually… | |||||
@${REINPLACE_CMD} -e 's|@SettingsCCompilerLinkFlags@|& -Wl,--wrap=readdir_r,--wrap=stat,--wrap=lstat,--wrap=fstat,--wrap=mknod|' ${BOOT_DIR}/settings.in | @${REINPLACE_CMD} -e 's|@SettingsCCompilerLinkFlags@|& -Wl,--wrap=readdir_r,--wrap=stat,--wrap=lstat,--wrap=fstat,--wrap=mknod|' ${BOOT_DIR}/settings.in | ||||
.endif | .endif | ||||
# %%PORTDOCS%%%%DOCSDIR%%/html/libraries/doc-index-V.html | # %%PORTDOCS%%%%DOCSDIR%%/html/libraries/doc-index-V.html | ||||
post-install-script: | post-install-script: | ||||
${FIND} -ds ${GHC_LIBDIR} -type f -print | ${SED} -E \ | ${FIND} -ds ${GHC_LIBDIR} -type f -print | ${SED} -E \ | ||||
-e 's,^${STAGEDIR}${PREFIX}/?,,' \ | -e 's,^${STAGEDIR}${PREFIX}/?,,' \ | ||||
-e '/^${GHC_LIBDIR:C/\//\\\//g}\/package.conf.d\/package\.cache/s|^|@comment |g' \ | -e '/^${GHC_LIBDIR:C/\//\\\//g}\/package.conf.d\/package\.cache/s|^|@comment |g' \ | ||||
Show All 39 Lines | |||||
pre-configure: apply-slist | pre-configure: apply-slist | ||||
# Copy the subbed build.mk to the proper position | # Copy the subbed build.mk to the proper position | ||||
${CP} ${WRKDIR}/build.mk ${WRKSRC}/mk/build.mk | ${CP} ${WRKDIR}/build.mk ${WRKSRC}/mk/build.mk | ||||
@${MKDIR} ${TMPDIR} | @${MKDIR} ${TMPDIR} | ||||
.if empty(PORT_OPTIONS:MBOOT) && ${OPSYS} == FreeBSD && \ | .if empty(PORT_OPTIONS:MBOOT) && ${OPSYS} == FreeBSD && \ | ||||
${OSVERSION} >= 1200031 && \ | ${OSVERSION} >= 1200031 && \ | ||||
${ARCH} != aarch64 && ${ARCH} != armv6 && ${ARCH} != armv7 | ${ARCH} == amd64 && ${ARCH} == i386 | ||||
${CC} ${CFLAGS} -c -o ${BOOT_DIR}/wrap.o ${PATCHDIR}/wrap.c | ${CC} ${CFLAGS} -c -o ${BOOT_DIR}/wrap.o ${PATCHDIR}/wrap.c | ||||
Done Inline ActionsSame here. mat: Same here. | |||||
for x in ${BOOT_DIR}/rts/dist/build/libCffi*.a; do \ | for x in ${BOOT_DIR}/rts/dist/build/libCffi*.a; do \ | ||||
${AR} q $$x ${BOOT_DIR}/wrap.o; ${RANLIB} $$x; \ | ${AR} q $$x ${BOOT_DIR}/wrap.o; ${RANLIB} $$x; \ | ||||
done | done | ||||
rm ${BOOT_DIR}/wrap.o | rm ${BOOT_DIR}/wrap.o | ||||
.endif # Do not merge, prev condition need to grow OSVER check. | .endif # Do not merge, prev condition need to grow OSVER check. | ||||
.if empty(PORT_OPTIONS:MBOOT) | .if empty(PORT_OPTIONS:MBOOT) | ||||
@(cd ${BOOT_DIR} && ${CONFIGURE_ENV} ${CONFIGURE_CMD} ${CONFIGURE_ARGS_BOOT}) | @(cd ${BOOT_DIR} && ${CONFIGURE_ENV} ${CONFIGURE_CMD} ${CONFIGURE_ARGS_BOOT}) | ||||
@(cd ${BOOT_DIR} && PACKAGES='' ${MAKE_CMD} install) | @(cd ${BOOT_DIR} && PACKAGES='' ${MAKE_CMD} install) | ||||
▲ Show 20 Lines • Show All 89 Lines • Show Last 20 Lines |
^ why not add powerpc64 here? instead having that confusing line in lang/ghc/Makefile