summaryrefslogtreecommitdiff
path: root/lang/ghc7
diff options
context:
space:
mode:
authorobache <obache@pkgsrc.org>2014-02-01 13:06:19 +0000
committerobache <obache@pkgsrc.org>2014-02-01 13:06:19 +0000
commit9baacfec1b4a5815268e5299eef88ae0dd56fa33 (patch)
tree31bd52736638228c74d45d2efce041576ab66f9e /lang/ghc7
parent10951a7585c5f827d696938b41df443553197723 (diff)
downloadpkgsrc-9baacfec1b4a5815268e5299eef88ae0dd56fa33.tar.gz
define and use DISTNAME to match its naming.
Diffstat (limited to 'lang/ghc7')
-rw-r--r--lang/ghc7/DEINSTALL4
-rw-r--r--lang/ghc7/Makefile33
-rw-r--r--lang/ghc7/bootstrap.mk42
3 files changed, 40 insertions, 39 deletions
diff --git a/lang/ghc7/DEINSTALL b/lang/ghc7/DEINSTALL
index 14c866d2006..dae09d89ea0 100644
--- a/lang/ghc7/DEINSTALL
+++ b/lang/ghc7/DEINSTALL
@@ -1,9 +1,9 @@
#!/bin/sh
#
-DISTNAME="@DISTNAME@"
+GHC_VERSION="@GHC_VERSION@"
case ${STAGE} in
DEINSTALL)
- ${RM} -f ${PKG_PREFIX}/lib/${DISTNAME}/package.conf.d/package.cache
+ ${RM} -f ${PKG_PREFIX}/lib/${PKGBASE}-${GHC_VERSION}/package.conf.d/package.cache
;;
esac
diff --git a/lang/ghc7/Makefile b/lang/ghc7/Makefile
index 361c272d645..3e5d84841c1 100644
--- a/lang/ghc7/Makefile
+++ b/lang/ghc7/Makefile
@@ -1,12 +1,14 @@
-# $NetBSD: Makefile,v 1.6 2014/01/31 09:04:36 obache Exp $
+# $NetBSD: Makefile,v 1.7 2014/02/01 13:06:19 obache Exp $
# -----------------------------------------------------------------------------
# Package metadata
#
-DISTNAME= ghc-${VERSION}
-VERSION= 7.6.3
+DISTNAME= ghc-7.6.3-src
+PKGNAME= ${DISTNAME:S/-src$//}
PKGREVISION= 1
CATEGORIES= lang
-MASTER_SITES= http://www.haskell.org/ghc/dist/${VERSION}/
+MASTER_SITES= http://www.haskell.org/ghc/dist/${PKGVERSION_NOREV}/
+EXTRACT_SUFX= .tar.bz2
+
MAINTAINER= pho@cielonegro.org
HOMEPAGE= http://www.haskell.org/ghc/
COMMENT= Compiler for the functional language Haskell
@@ -30,22 +32,23 @@ ONLY_FOR_PLATFORM= \
# -----------------------------------------------------------------------------
# Distfiles
#
-DISTFILES= ${DISTNAME}-src.tar.bz2
+DISTFILES= ${DEFAULT_DISTFILES}
#.if make(distinfo)
-#DISTFILES+= ${DISTNAME}-boot-i386-unknown-freebsd.tar.xz
-#DISTFILES+= ${DISTNAME}-boot-i386-unknown-netbsd.tar.xz
-#DISTFILES+= ${DISTNAME}-boot-powerpc-apple-darwin.tar.xz
-#DISTFILES+= ${DISTNAME}-boot-x86_64-unknown-linux.tar.xz
-#DISTFILES+= ${DISTNAME}-boot-x86_64-unknown-netbsd.tar.xz
-#DISTFILES+= ${DISTNAME}-boot-i386-unknown-solaris2.tar.gz
-#DISTFILES+= ${DISTNAME}-boot-x86_64-unknown-solaris2.tar.xz
+#DISTFILES+= ${PKGNAME_NOREV}-boot-i386-unknown-freebsd.tar.xz
+#DISTFILES+= ${PKGNAME_NOREV}-boot-i386-unknown-netbsd.tar.xz
+#DISTFILES+= ${PKGNAME_NOREV}-boot-powerpc-apple-darwin.tar.xz
+#DISTFILES+= ${PKGNAME_NOREV}-boot-x86_64-unknown-linux.tar.xz
+#DISTFILES+= ${PKGNAME_NOREV}-boot-x86_64-unknown-netbsd.tar.xz
+#DISTFILES+= ${PKGNAME_NOREV}-boot-i386-unknown-solaris2.tar.gz
+#DISTFILES+= ${PKGNAME_NOREV}-boot-x86_64-unknown-solaris2.tar.xz
#.else
#DISTFILES+= ${BOOT_ARCHIVE}
#.endif
+WRKSRC= ${WRKDIR}/${PKGNAME_NOREV}
# We don't want to extract all of the DISTFILEs.
-EXTRACT_ONLY= ${DISTNAME}-src.tar.bz2
+EXTRACT_ONLY= ${DEFAULT_DISTFILES}
# -----------------------------------------------------------------------------
@@ -133,11 +136,11 @@ do-configure:
#
# Substitutions for INSTALL and DEINSTALL that handles package.cache.
-FILES_SUBST+= DISTNAME=${DISTNAME}
+FILES_SUBST+= GHC_VERSION=${PKGVERSION_NOREV}
# We don't want package.cache to be in the PLIST.
post-install:
- ${RM} -f ${DESTDIR:Q}${PREFIX:Q}/lib/${DISTNAME}/package.conf.d/package.cache
+ ${RM} -f ${DESTDIR:Q}${PREFIX:Q}/lib/${PKGNAME_NOREV}/package.conf.d/package.cache
# -----------------------------------------------------------------------------
diff --git a/lang/ghc7/bootstrap.mk b/lang/ghc7/bootstrap.mk
index 7c5c4ab3bc6..2cf16c105eb 100644
--- a/lang/ghc7/bootstrap.mk
+++ b/lang/ghc7/bootstrap.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bootstrap.mk,v 1.3 2014/01/30 07:57:35 obache Exp $
+# $NetBSD: bootstrap.mk,v 1.4 2014/02/01 13:06:19 obache Exp $
# -----------------------------------------------------------------------------
# Select a bindist of bootstrapping compiler based on a per-platform
# basis.
@@ -12,29 +12,29 @@
#
.include "../../mk/bsd.prefs.mk"
.if ${MACHINE_ARCH} == "i386" && ${OPSYS} == "FreeBSD"
-BOOT_ARCHIVE= ${DISTNAME}-boot-i386-unknown-freebsd.tar.xz
+BOOT_ARCHIVE= ${PKGNAME_NOREV}-boot-i386-unknown-freebsd.tar.xz
.elif ${MACHINE_ARCH} == "i386" && ${OPSYS} == "NetBSD"
-BOOT_ARCHIVE= ${DISTNAME}-boot-i386-unknown-netbsd.tar.xz
+BOOT_ARCHIVE= ${PKGNAME_NOREV}-boot-i386-unknown-netbsd.tar.xz
.elif ${MACHINE_ARCH} == "powerpc" && ${OPSYS} == "Darwin"
-BOOT_ARCHIVE= ${DISTNAME}-boot-powerpc-apple-darwin.tar.xz
+BOOT_ARCHIVE= ${PKGNAME_NOREV}-boot-powerpc-apple-darwin.tar.xz
# Existence of libelf makes LeadingUnderscore being "NO", which is
# incorrect for this platform. See ${WRKSRC}/aclocal.m4
# (FP_LEADING_UNDERSCORE)
CONFLICTS+= libelf-[0-9]*
.elif ${MACHINE_ARCH} == "x86_64" && ${OPSYS} == "Linux"
-BOOT_ARCHIVE= ${DISTNAME}-boot-x86_64-unknown-linux.tar.xz
+BOOT_ARCHIVE= ${PKGNAME_NOREV}-boot-x86_64-unknown-linux.tar.xz
.elif ${MACHINE_ARCH} == "x86_64" && ${OPSYS} == "NetBSD"
-BOOT_ARCHIVE= ${DISTNAME}-boot-x86_64-unknown-netbsd.tar.xz
+BOOT_ARCHIVE= ${PKGNAME_NOREV}-boot-x86_64-unknown-netbsd.tar.xz
.elif !empty(MACHINE_PLATFORM:MSunOS-5.11-i386)
-BOOT_ARCHIVE= ${DISTNAME}-boot-i386-unknown-solaris2.tar.gz
+BOOT_ARCHIVE= ${PKGNAME_NOREV}-boot-i386-unknown-solaris2.tar.gz
.elif !empty(MACHINE_PLATFORM:MSunOS-5.11-x86_64)
-BOOT_ARCHIVE= ${DISTNAME}-boot-x86_64-unknown-solaris2.tar.xz
+BOOT_ARCHIVE= ${PKGNAME_NOREV}-boot-x86_64-unknown-solaris2.tar.xz
.else
PKG_FAIL_REASON+= "internal error: unsupported platform"
@@ -53,20 +53,18 @@ BOOT_TARBALL= ${BOOT_ARCHIVE:C/\.xz$//:C/\.gz$//}
USE_TOOLS+= gmake xzcat xz
pre-configure:
-.if !exists(${DISTDIR:Q}/${DIST_SUBDIR:Q}/${BOOT_ARCHIVE})
- @${FAIL_MSG} "Put your trusted bootstrap archive as ${DISTDIR}/${DIST_SUBDIR}/${BOOT_ARCHIVE}"
-.else
+ @${TEST} -f ${DISTDIR:Q}/${DIST_SUBDIR:Q}/${BOOT_ARCHIVE} || \
+ ${FAIL_MSG} "Put your trusted bootstrap archive as ${DISTDIR}/${DIST_SUBDIR}/${BOOT_ARCHIVE}"
@${PHASE_MSG} "Extracting bootstrapping compiler for ${PKGNAME}"
${RUN} ${MKDIR} ${WRKDIR:Q}/build-extract
${RUN} cd ${WRKDIR:Q}/build-extract && \
${EXTRACT_CMD_DEFAULT} ${DISTDIR:Q}/${DIST_SUBDIR:Q}/${BOOT_ARCHIVE}
@${PHASE_MSG} "Preparing bootstrapping compiler for ${PKGNAME}"
- ${RUN} cd ${WRKDIR:Q}/build-extract/${DISTNAME}-boot && \
+ ${RUN} cd ${WRKDIR:Q}/build-extract/${PKGNAME_NOREV}-boot && \
${SH} ./configure \
--prefix=${TOOLS_DIR:Q} && \
${MAKE_PROGRAM} install
-.endif
# -----------------------------------------------------------------------------
@@ -80,15 +78,15 @@ pre-configure:
#
.PHONY: bootstrap
-#BUILDLINK_PASSTHRU_DIRS= ${PREFIX}/lib/${DISTNAME}
+#BUILDLINK_PASSTHRU_DIRS= ${PREFIX}/lib/${PKGNAME_NOREV}
-.if exists(${WRKDIR}/${DISTNAME}/mk/config.mk)
+.if exists(${WRKDIR}/${PKGNAME_NOREV}/mk/config.mk)
bootstrap:
@${ERROR_MSG} "You have already configured the package in a way\
that building bootstrapping compiler is impossible."
@${FAIL_MSG} "Please run \"${MAKE} clean patch\" first."
-.elif !exists(${WRKDIR}/${DISTNAME}/rts/ghc.mk.orig)
+.elif !exists(${WRKDIR}/${PKGNAME_NOREV}/rts/ghc.mk.orig)
bootstrap:
@${FAIL_MSG} "Please run \"${MAKE} patch\" first."
@@ -102,14 +100,14 @@ ${WRKDIR}/lndir:
${CC:Q} lndir.c -o ${.TARGET}
${WRKDIR}/stamp-lndir-boot: ${WRKDIR}/lndir
- @${PHASE_MSG} "Duplicating the source tree for bootstrapping ${DISTNAME}"
+ @${PHASE_MSG} "Duplicating the source tree for bootstrapping ${PKGNAME_NOREV}"
${MKDIR} ${WRKDIR:Q}/build-boot
cd ${WRKDIR:Q}/build-boot && \
- ${WRKDIR}/lndir -silent ../${DISTNAME:Q}
+ ${WRKDIR}/lndir -silent ../${PKGNAME_NOREV:Q}
${TOUCH} ${.TARGET}
${WRKDIR}/stamp-configure-boot: ${WRKDIR}/stamp-lndir-boot
- @${PHASE_MSG} "Configuring bootstrapping compiler ${DISTNAME}"
+ @${PHASE_MSG} "Configuring bootstrapping compiler ${PKGNAME_NOREV}"
${MKDIR} ${WRKDIR:Q}/build-boot
cd ${WRKDIR:Q}/build-boot && \
${PKGSRC_SETENV} PATH=${PATH} \
@@ -127,17 +125,17 @@ ${WRKDIR}/stamp-configure-boot: ${WRKDIR}/stamp-lndir-boot
${TOUCH} ${.TARGET}
${WRKDIR}/stamp-build-boot: ${WRKDIR}/stamp-configure-boot
- @${PHASE_MSG} "Building bootstrapping compiler ${DISTNAME}"
+ @${PHASE_MSG} "Building bootstrapping compiler ${PKGNAME_NOREV}"
${RUN} cd ${WRKDIR:Q}/build-boot && ${BUILD_MAKE_CMD}
${TOUCH} ${.TARGET}
${WRKDIR}/${BOOT_TARBALL}: ${WRKDIR}/stamp-build-boot
- @${PHASE_MSG} "Creating binary distribution of bootstrapping ${DISTNAME}"
+ @${PHASE_MSG} "Creating binary distribution of bootstrapping ${PKGNAME_NOREV}"
${RUN} cd ${WRKDIR:Q}/build-boot && ${BUILD_MAKE_CMD} binary-dist
${MV} -f ${WRKDIR:Q}/build-boot/${BOOT_TARBALL} ${.TARGET}
# This can take up half an hour. Memory usage is also very high, about 680 MiB.
${WRKDIR}/${BOOT_ARCHIVE}: ${WRKDIR}/${BOOT_TARBALL}
- @${PHASE_MSG} "Compressing binary distribution of bootstrapping ${DISTNAME}"
+ @${PHASE_MSG} "Compressing binary distribution of bootstrapping ${PKGNAME_NOREV}"
${XZ} --verbose -9 --extreme ${WRKDIR:Q}/${BOOT_TARBALL}
.endif