Starting with Debian's HPPA port of ghc (Glasgow Haskell Compiler), I keyworded dev-lang/ghc-6.4.1-r2 with ~hppa, added a few tests for hppa to disable certain unsupported features on the hppa architecture, and then successfully completed a build of dev-lang/ghc-6.4.1-r2 on hppa. I then used the instructions from Duncan Coutts in bug 88362, comment #20 to produce a binary package of my build for distfiles to be used as dev-lang/ghc-bin-6.4.1, which is needed to bootstrap your own native build of ghc. I can make my ghc-bin-6.4.1 binpkg for hppa available, or here are the steps you would take to reproduce my efforts for yourself: 1. Download http://ftp.debian.org/debian/pool/main/g/ghc6/ghc6_6.4.1-1_hppa.deb, which is the Debian hppa binary package of ghc for hppa. 2. Use alien to convert this archive to a tgz file. Then repack it as a .tbz2 file for the ghc-bin ebuild. 3. Move the .tbz2 file to /usr/portage/distfiles/ghc-bin-6.4.1-hppa.tbz2. 4. Emerge dev-libs/gmp if you do not already have it, as ghc and ghc-bin both need this dependency in order to run. 5. Use the attached ghc-bin-6.4.1 ebuild file to emerge ghc-bin for ~hppa. You may need to use ebuild to recompute the digests for this, as needed. 6. Once this is done, use the attached ghc-6.4.1-r2.ebuild, cabal-1.1.3-r1.ebuild, and haskell-cabal.eclass to emerge dev-lang/ghc-6.4.1-r2 and dev-haskell/cabal-1.1.3-r1 for hppa. 7. Now you should have a working build of ghc in /usr. ghc-bin is no longer necessary at this point; you can unmerge it if you like. ghc-bin is needed in case future revisions of ghc come out (e.g. 6.4.2), as you need a way to compile a new version of ghc using an existing ghc binary build. If you have previously successfully emerged ghc, then you do not need ghc-bin to bootstrap a new release of ghc. The existing ghc that you have emerged will work. I will also attach a few sample Haskell programs to try out. Compiling and running them is relatively straightforward: $ ghc -o Hello Hello.hs $ ./Hello $ ghc -o Factorial Factorial.hs $ ./Factorial 123 If you have any questions, please do not hesitate to get in touch with me. I look forward to working with you to add ghc support to hppa.
Created attachment 81631 [details] ghc-bin-6.4.1 ebuild keyworded for ~hppa
Created attachment 81632 [details] ghc-6.4.1-r2 ebuild keyworded for ~hppa
Created attachment 81633 [details] cabal-1.1.3-r1 ebuild keyworded for ~hppa
Created attachment 81634 [details] haskell-cabal eclass modified to support ~hppa
hamal ~ # emerge --info Portage 2.0.53 (default-linux/hppa/2005.0, gcc-3.3.6, glibc-2.3.4.20040808-r1, 2.6.15.1-pa4-livecd32 parisc) ================================================================= System uname: 2.6.15.1-pa4-livecd32 parisc PA7200 (PCX-T') Gentoo Base System version 1.6.14 dev-lang/python: 2.4.2 sys-apps/sandbox: 1.2.17 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1 sys-devel/binutils: 2.16.1 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="hppa" AUTOCLEAN="yes" CBUILD="hppa1.1-unknown-linux-gnu" CFLAGS="-Os -pipe -march=1.1 -mschedule=7200" CHOST="hppa1.1-unknown-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-Os -pipe -march=1.1 -mschedule=7200" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks sandbox sfperms strict" GENTOO_MIRRORS="http://gentoo-distfiles.mirrors.tds.net" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="hppa berkdb bitmap-fonts bzip2 crypt cups expat foomaticdb fortran gdbm gmp gpm imlib ipv6 libwww ncurses nls pam perl pic python readline spell ssl tcpd truetype-fonts type1-fonts udev xml2 zlib userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY hamal ~ #
Created attachment 81635 [details] "hello world" example program to test
Created attachment 81636 [details] example factorial program to test compile this with: $ ghc -o Factorial Factorial.hs run it like this: $ ./Factorial 123 123! = 12146304367025329675766243241881295855454217088483382315328918161829235892362167668831156960612640202170735835221294047782591091570411651472186029519906261646730733907419814952960000000000000000000000000000
(Just removing myself from the CC since I'm already included in haskell@gentoo.org) Just to note that if anyone from the hppa herd wants to talk to us about this one then come find us in #gentoo-haskell.
(In reply to comment #0) > 1. Download > http://ftp.debian.org/debian/pool/main/g/ghc6/ghc6_6.4.1-1_hppa.deb, which is > the Debian hppa binary package of ghc for hppa. Make that http://ftp.debian.org/debian/pool/main/g/ghc6/ghc6_6.4.1-2_hppa.deb
Rej: thanks so much for all your work in bootstrapping ghc for hppa and getting it into portage. Closing this bug.
Marked ~hppa: dev-lang/ghc-bin-6.4.1 dev-lang/ghc-6.4.1-r2 dev-haskell/cabal-1.1.3-r1 dev-haskell/haddock-0.7 ... and closing this bug.