tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Import wig/ghc as lang/ghc7 (Re: Removing packages without DESTDIR support)



Hi,

On Fri, 25 Oct 2013 16:30:42 +0900, Jonathan Perkin 
<jperkin%joyent.com@localhost> wrote:

FWIW we are using wip/ghc in our official builds now, with a few diffs:

  
https://github.com/joyent/pkgsrc-wip/compare/master...joyent#diff-6fd4e83bc04fcaecd4db8649edc3a8e9L3

It would be great for *BSD folks to bring their bootstraps up to date
so we can merge this.

I've modified as followings and created bootstrap binary packages for
NetBSD-6.1.2-i386 and NetBSD-6.1.2-x86_64.

I know it is less platform support than lang/ghc
(and less bootstrap support than current wip/ghc),
so I would like to imported as lang/ghc7 tomorrow
with commented out currently unsupported platform parts.

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc-wip/wip/ghc/Makefile,v
retrieving revision 1.35
diff -u -r1.35 Makefile
--- Makefile    23 Feb 2013 12:24:06 -0000      1.35
+++ Makefile    11 Dec 2013 12:52:24 -0000
@@ -3,7 +3,7 @@
 # Package metadata
 #
 DISTNAME=      ghc-${VERSION}
-VERSION=       7.6.2
+VERSION=       7.6.3
 CATEGORIES=    lang
 MASTER_SITES=  http://www.haskell.org/ghc/dist/${VERSION}/
 MAINTAINER=    pho%cielonero.org@localhost
@@ -22,18 +22,25 @@
        FreeBSD-*-i386 \
        Linux-*-x86_64 \
        NetBSD-*-i386 \
-       NetBSD-*-x86_64
+       NetBSD-*-x86_64 \
+       SunOS-5.11-*


 # -----------------------------------------------------------------------------
 # Distfiles
 #
 DISTFILES=     ${DISTNAME}-src.tar.bz2
+.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
+.else
+DISTFILES+=    ${BOOT_ARCHIVE}
+.endif

 .for i in ${DISTFILES:M*-boot-*}
 SITES.${i}=    http://static.cielonegro.org/archive/
@@ -50,25 +57,23 @@
 GNU_CONFIGURE=                 yes
 USE_GNU_CONFIGURE_HOST=        no

-# We must provide the real path to gcc to the ./configure script,
-# because GHC has a runtime dependency on it. Aren't there any ways
-# better than this?
-.include "../../mk/compiler.mk"
-.if empty(CCPATH)
-CCPATH=        /usr/bin/gcc
-WARNINGS+="This package depends on pkgsrc's undocumented variable\
-CCPATH but it disappeared somehow."
-WARNINGS+="Using hard-coded ${CCPATH:Q} as the C compiler..."
-.endif
-
 CONFIGURE_ARGS+= \
-       --with-gcc=${CCPATH:Q} \
-       --with-gmp-includes=${PREFIX:Q}/include \
-       --with-gmp-libraries=${PREFIX:Q}/lib \
-       --with-iconv-includes=${PREFIX:Q}/include \
-       --with-iconv-libraries=${PREFIX:Q}/lib
+       --with-gcc=${CC:Q} \
+       --with-gmp-includes=${BUILDLINK_PREFIX.gmp:Q}/include \
+       --with-gmp-libraries=${BUILDLINK_PREFIX.gmp:Q}/lib \
+       --with-iconv-includes=${BUILDLINK_PREFIX.iconv:Q}/include \
+       --with-iconv-libraries=${BUILDLINK_PREFIX.iconv:Q}/lib

 CONFIGURE_ENV+= \
+       CONF_CC_OPTS_STAGE0=${CFLAGS:Q} \
+       CONF_GCC_LINKER_OPTS_STAGE0=${LDFLAGS:Q} \
+       CONF_LD_LINKER_OPTS_STAGE0=${LDFLAGS:Q} \
+       CONF_CC_OPTS_STAGE1=${CFLAGS:Q} \
+       CONF_GCC_LINKER_OPTS_STAGE1=${LDFLAGS:Q} \
+       CONF_LD_LINKER_OPTS_STAGE1=${LDFLAGS:Q} \
+       CONF_CC_OPTS_STAGE2=${CFLAGS:Q} \
+       CONF_GCC_LINKER_OPTS_STAGE2=${LDFLAGS:Q} \
+       CONF_LD_LINKER_OPTS_STAGE2=${LDFLAGS:Q} \
        PerlCmd=${PERL5:Q}


@@ -99,8 +104,8 @@
 # in a non-standard path. Without that, the resulting GHC tries to
 # link programs by executing ld(1) without passing it -L${PREFIX:Q}/lib.
        ${RUN} ${ECHO} "libraries/terminfo_CONFIGURE_OPTS += \
-               --configure-option=--with-curses-includes=${PREFIX:Q}/include \
-               --configure-option=--with-curses-libraries=${PREFIX:Q}/lib" >> 
${WRKSRC:Q}/mk/build.mk
+               
--configure-option=--with-curses-includes=${BUILDLINK_PREFIX.ncurses:Q}/include 
\
+               
--configure-option=--with-curses-libraries=${BUILDLINK_PREFIX.ncurses:Q}/lib" 
>> ${WRKSRC:Q}/mk/build.mk

 # The ghc compiler does normally split the generated asm files into small
 # parts before sending them to gcc, to enable the linker to eliminate
@@ -151,7 +156,7 @@
 .else
 GENERATE_PLIST+= \
        cd ${DESTDIR:Q}${PREFIX:Q} && \
-               ${FIND} * \( -type f -or -type l \) | ${SORT} -d;
+               ${FIND} * \( -type f -o -type l \) | ${SORT} -d;
 .endif


@@ -165,7 +170,7 @@
 # GHC currently *requires* ${PREFIX}/lib to be in
 # "/etc/ld-elf.so.conf". See
 # http://hackage.haskell.org/trac/ghc/ticket/2933
-CHECK_SHLIBS_SUPPORTED=        no
+#CHECK_SHLIBS_SUPPORTED=       no


 # -----------------------------------------------------------------------------
@@ -175,14 +180,11 @@
 # I guess pdcurses works well but not tested.
 USE_NCURSES=   yes

-BUILDLINK_DEPMETHOD.docbook-xsl=       build
-BUILDLINK_DEPMETHOD.libxslt=           build
-BUILDLINK_DEPMETHOD.xz=                build
-.include "../../archivers/xz/buildlink3.mk"
+BUILD_DEPENDS+=        libxslt-[0-9]*:../../textproc/libxslt
+BUILD_DEPENDS+=        docbook-xsl-[0-9]*:../../textproc/docbook-xsl
+
 .include "../../converters/libiconv/buildlink3.mk"
 .include "../../devel/gmp/buildlink3.mk"
 .include "../../devel/ncurses/buildlink3.mk"
-.include "../../textproc/libxslt/buildlink3.mk"
-.include "../../textproc/docbook-xsl/buildlink3.mk"
 .include "../../mk/pthread.buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
Index: bootstrap.mk
===================================================================
RCS file: /cvsroot/pkgsrc-wip/wip/ghc/bootstrap.mk,v
retrieving revision 1.3
diff -u -r1.3 bootstrap.mk
--- bootstrap.mk        23 Feb 2013 12:24:07 -0000      1.3
+++ bootstrap.mk        11 Dec 2013 12:52:24 -0000
@@ -30,6 +30,12 @@
 .elif ${MACHINE_ARCH} == "x86_64" && ${OPSYS} == "NetBSD"
 BOOT_ARCHIVE=  ${DISTNAME}-boot-x86_64-unknown-netbsd.tar.xz

+.elif !empty(MACHINE_PLATFORM:MSunOS-5.11-i386)
+BOOT_ARCHIVE=  ${DISTNAME}-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
+
 .else
 PKG_FAIL_REASON+=      "internal error: unsupported platform"
 .endif
@@ -43,7 +49,7 @@
 # Install a bootstrapping compiler directly into TOOLS_DIR so that
 # ./configure can find it.
 #
-USE_TOOLS+=    gmake xzcat
+USE_TOOLS+=    gmake xzcat xz

 pre-configure:
        @${PHASE_MSG} "Extracting bootstrapping compiler for ${PKGNAME}"
@@ -54,8 +60,7 @@
        @${PHASE_MSG} "Preparing bootstrapping compiler for ${PKGNAME}"
        ${RUN} cd ${WRKDIR:Q}/build-extract/${DISTNAME}-boot && \
                ${SH} ./configure \
-                       --prefix=${TOOLS_DIR:Q} \
-                       --with-gcc=${CCPATH:Q} && \
+                       --prefix=${TOOLS_DIR:Q} && \
                ${MAKE_PROGRAM} install


@@ -70,6 +75,8 @@
 #
 .PHONY: bootstrap

+#BUILDLINK_PASSTHRU_DIRS=      ${PREFIX}/lib/ghc-7.6.3
+
 .if exists(${WRKDIR}/${DISTNAME}/mk/config.mk)
 bootstrap:
        @${ERROR_MSG} "You have already configured the package in a way\
@@ -87,7 +94,7 @@
 ${WRKDIR}/lndir:
        @${PHASE_MSG} "Building lndir(1) to duplicate the source tree."
        cd ${WRKSRC:Q}/utils/lndir && \
-               ${CCPATH:Q} lndir.c -o ${.TARGET}
+               ${CC:Q} lndir.c -o ${.TARGET}

 ${WRKDIR}/stamp-lndir-boot: ${WRKDIR}/lndir
        @${PHASE_MSG} "Duplicating the source tree for bootstrapping 
${DISTNAME}"
@@ -100,8 +107,18 @@
        @${PHASE_MSG} "Configuring bootstrapping compiler ${DISTNAME}"
        ${MKDIR} ${WRKDIR:Q}/build-boot
        cd ${WRKDIR:Q}/build-boot && \
-               ${SH} ./configure --with-gcc=${CCPATH:Q} && \
-               ${LN} -f ${FILESDIR:Q}/bootstrap.build.mk mk/build.mk
+               ${PKGSRC_SETENV} PATH=${PATH} \
+               CONF_CC_OPTS_STAGE0=${CFLAGS:Q} \
+               CONF_GCC_LINKER_OPTS_STAGE0="-L${PREFIX}/lib 
${COMPILER_RPATH_FLAG}${PREFIX}/lib" \
+               CONF_LD_LINKER_OPTS_STAGE0="-L${PREFIX}/lib 
${LINKER_RPATH_FLAG}${PREFIX}/lib" \
+               CONF_CC_OPTS_STAGE1=${CFLAGS:Q} \
+               CONF_GCC_LINKER_OPTS_STAGE1="-L${PREFIX}/lib 
${COMPILER_RPATH_FLAG}${PREFIX}/lib" \
+               CONF_LD_LINKER_OPTS_STAGE1="-L${PREFIX}/lib 
${LINKER_RPATH_FLAG}${PREFIX}/lib" \
+               CONF_CC_OPTS_STAGE2=${CFLAGS:Q} \
+               CONF_GCC_LINKER_OPTS_STAGE2="-L${PREFIX}/lib 
${COMPILER_RPATH_FLAG}${PREFIX}/lib" \
+               CONF_LD_LINKER_OPTS_STAGE2="-L${PREFIX}/lib 
${LINKER_RPATH_FLAG}${PREFIX}/lib" \
+               ${SH} ./configure && \
+               ${SED} -e "s,@PREFIX@,${BUILDLINK_PREFIX.ncurses:Q},g" 
/${FILESDIR:Q}/bootstrap.build.mk > mk/build.mk
        ${TOUCH} ${.TARGET}

 ${WRKDIR}/stamp-build-boot: ${WRKDIR}/stamp-configure-boot
@@ -117,5 +134,5 @@
 # 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}"
-       ${PREFIX:Q}/bin/xz --verbose -9 --extreme ${WRKDIR:Q}/${BOOT_TARBALL}
+       ${XZ} --verbose -9 --extreme ${WRKDIR:Q}/${BOOT_TARBALL}
 .endif
Index: buildlink3.mk
===================================================================
RCS file: /cvsroot/pkgsrc-wip/wip/ghc/buildlink3.mk,v
retrieving revision 1.13
diff -u -r1.13 buildlink3.mk
--- buildlink3.mk       23 Feb 2013 12:24:07 -0000      1.13
+++ buildlink3.mk       11 Dec 2013 12:52:24 -0000
@@ -5,7 +5,7 @@
 .if !defined(GHC_BUILDLINK3_MK)
 GHC_BUILDLINK3_MK:=

-BUILDLINK_API_DEPENDS.ghc+=    ghc>=7.6.2
+BUILDLINK_API_DEPENDS.ghc+=    ghc>=7.6.3
 BUILDLINK_PKGSRCDIR.ghc?=      ../../wip/ghc

 .include "../../converters/libiconv/buildlink3.mk"
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc-wip/wip/ghc/distinfo,v
retrieving revision 1.18
diff -u -r1.18 distinfo
--- distinfo    23 Feb 2013 12:24:07 -0000      1.18
+++ distinfo    11 Dec 2013 12:52:24 -0000
@@ -1,27 +1,19 @@
 $NetBSD$

-SHA1 (ghc-7.6.2-boot-i386-unknown-freebsd.tar.xz) = 
b7a286b89ffd39dde789776fd925efb452e75233
-RMD160 (ghc-7.6.2-boot-i386-unknown-freebsd.tar.xz) = 
707ad61207e8caad6d06a65fbe87447798d153f6
-Size (ghc-7.6.2-boot-i386-unknown-freebsd.tar.xz) = 27926040 bytes
-SHA1 (ghc-7.6.2-boot-i386-unknown-netbsd.tar.xz) = 
0786ea45e68a9aecc46799c893aa666eb02f5878
-RMD160 (ghc-7.6.2-boot-i386-unknown-netbsd.tar.xz) = 
57db9cc16ff78c7e410d653b74d885bf2c69e13d
-Size (ghc-7.6.2-boot-i386-unknown-netbsd.tar.xz) = 28261476 bytes
-SHA1 (ghc-7.6.2-boot-powerpc-apple-darwin.tar.xz) = 
90a4e64842426dd956650e8ef2e17e9ef0b9a69b
-RMD160 (ghc-7.6.2-boot-powerpc-apple-darwin.tar.xz) = 
fb1b85b25195846f260b4f8082908e80bc7a6d0f
-Size (ghc-7.6.2-boot-powerpc-apple-darwin.tar.xz) = 33635664 bytes
-SHA1 (ghc-7.6.2-boot-x86_64-unknown-linux.tar.xz) = 
3cb91c05cd1c0f12e3420d466636e110934a11ac
-RMD160 (ghc-7.6.2-boot-x86_64-unknown-linux.tar.xz) = 
4a57fcbe2c7b99371f61e3a8f4bfdc4e9aae4339
-Size (ghc-7.6.2-boot-x86_64-unknown-linux.tar.xz) = 28837552 bytes
-SHA1 (ghc-7.6.2-boot-x86_64-unknown-netbsd.tar.xz) = 
3d3e29ea427c9b26760fb232b77772bc63dd8938
-RMD160 (ghc-7.6.2-boot-x86_64-unknown-netbsd.tar.xz) = 
b1325b7ae4d39362073c24a226b6bd86d124569e
-Size (ghc-7.6.2-boot-x86_64-unknown-netbsd.tar.xz) = 28778048 bytes
-SHA1 (ghc-7.6.2-src.tar.bz2) = 17329b0f1a401f3402cce13ba5e4cf8fbfa41a1d
-RMD160 (ghc-7.6.2-src.tar.bz2) = 3aa6cc4daaba1f14f28a7720d6d39cf1d9f982f2
-Size (ghc-7.6.2-src.tar.bz2) = 110778081 bytes
+SHA1 (ghc-7.6.3-boot-i386-unknown-netbsd.tar.xz) = 
9fc2f538da69ede96f0754e0cf5d376280c5f2ee
+RMD160 (ghc-7.6.3-boot-i386-unknown-netbsd.tar.xz) = 
4f188f1b7ba992cc1a1436aac68d11ef78f7714c
+Size (ghc-7.6.3-boot-i386-unknown-netbsd.tar.xz) = 28258276 bytes
+SHA1 (ghc-7.6.3-boot-x86_64-unknown-netbsd.tar.xz) = 
0d6da7f192a25d154f46554777909f19002a48a3
+RMD160 (ghc-7.6.3-boot-x86_64-unknown-netbsd.tar.xz) = 
9995bf052e5737074692a107d5210663759d796c
+Size (ghc-7.6.3-boot-x86_64-unknown-netbsd.tar.xz) = 28766012 bytes
+SHA1 (ghc-7.6.3-src.tar.bz2) = 8938e1ef08b37a4caa071fa169e79a3001d065ff
+RMD160 (ghc-7.6.3-src.tar.bz2) = 82a673ed38b7cf9a59afeb01057625fc761a822b
+Size (ghc-7.6.3-src.tar.bz2) = 110763823 bytes
 SHA1 (patch-Makefile) = a6692a4a90b8003a8719c51d82d15f5af0ba1907
 SHA1 (patch-ghc.mk) = c4210aaa3e2b4a319b0b70da375ac89fddde5cb7
 SHA1 (patch-libraries_integer-gmp_configure.ac) = 
bc5ce3a6c39d681c413eb08b66e7287e39406fe0
 SHA1 (patch-libraries_integer-simple_GHC_Integer.hs) = 
f079285bc489c194959b9bee2aa5c977ec77ae1e
 SHA1 (patch-libraries_integer-simple_GHC_Integer_Type.hs) = 
b3140e169726f78f6d3b4edcd4cc119b6f767bfa
+SHA1 (patch-rts_Linker.c) = e38e3035ffdf7a46bf681e7220704ba617f3f627
 SHA1 (patch-rts_StgCRun.c) = dcbc883cb4826aeccac0be09647b7889c7809271
 SHA1 (patch-rts_ghc.mk) = 4dd33c5ac593736a9fa0fdbdd65df90549fac771
Index: files/bootstrap.build.mk
===================================================================
RCS file: /cvsroot/pkgsrc-wip/wip/ghc/files/bootstrap.build.mk,v
retrieving revision 1.1
diff -u -r1.1 bootstrap.build.mk
--- files/bootstrap.build.mk    23 Feb 2013 12:24:07 -0000      1.1
+++ files/bootstrap.build.mk    11 Dec 2013 12:52:24 -0000
@@ -29,3 +29,7 @@

 # We'd like to distinguish bootstrapping bindists from normal ones.
 BIN_DIST_NAME      = ghc-$(ProjectVersion)-boot
+
+libraries/terminfo_CONFIGURE_OPTS += \
+         --configure-option=--with-curses-includes=@PREFIX@/include \
+         --configure-option=--with-curses-libraries=@PREFIX@/lib
Index: patches/patch-rts_Linker.c
===================================================================
RCS file: patches/patch-rts_Linker.c
diff -N patches/patch-rts_Linker.c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-rts_Linker.c  11 Dec 2013 12:52:24 -0000
@@ -0,0 +1,26 @@
+$NetBSD$
+
+Support 64-bit x86 SunOS.
+
+--- rts/Linker.c.orig  2013-04-18 21:22:46.000000000 +0000
++++ rts/Linker.c
+@@ -75,7 +75,8 @@
+     (   defined(linux_HOST_OS)     || defined(freebsd_HOST_OS) || \
+         defined(dragonfly_HOST_OS) || defined(netbsd_HOST_OS ) || \
+         defined(openbsd_HOST_OS  ) || defined(darwin_HOST_OS ) || \
+-        defined(kfreebsdgnu_HOST_OS) || defined(gnu_HOST_OS)))
++        defined(kfreebsdgnu_HOST_OS) || defined(gnu_HOST_OS) || \
++      defined(solari2_HOST_OS)))
+ /* Don't use mmap on powerpc_HOST_ARCH as mmap doesn't support
+  * reallocating but we need to allocate jump islands just after each
+  * object images. Otherwise relative branches to jump islands can fail
+@@ -4014,6 +4015,9 @@ ocResolve_PEi386 ( ObjectCode* oc )
+ #  define ELF_TARGET_386    /* Used inside <elf.h> */
+ #elif defined(x86_64_HOST_ARCH)
+ #  define ELF_TARGET_X64_64
++#  if defined(solaris2_HOST_OS)
++#    define ELF_TARGET_AMD64
++#  endif
+ #  define ELF_64BIT
+ #endif
+

--
OBATA Akio / obache%NetBSD.org@localhost


Home | Main Index | Thread Index | Old Index