summaryrefslogtreecommitdiff
path: root/ghc/Pkgfile
blob: 7ed82db22b7aeb604ed877182bfd527c60ed78aa (plain)
    1 # Description: Glasgow Haskell compiler.
    2 # URL: http://www.haskell.org/haskellwiki/Glasgow_Haskell_Compiler
    3 # Maintainer: Danny Rawlins, crux at romster dot me
    4 # Packager: Moritz Wilhelmy, moritz plus crux at wzff dot de
    5 # Depends on: docbook-xsl libedit libffi libgmp readline
    6 
    7 name=ghc
    8 version=8.0.1
    9 release=1
   10 source=(https://downloads.haskell.org/~ghc/$version/$name-$version-src.tar.xz)
   11 
   12 build() {
   13 	# if ghc is not previously installed bootstrap it
   14 	if [ ! -e /usr/bin/ghc ]; then
   15 
   16 		# download binary bootstrap file if it does not exist
   17 		if [ ! -f "$PKGMK_SOURCE_DIR/$name-$version-x86_64-centos67-linux.tar.xz" ]; then
   18 
   19 			wget http://downloads.haskell.org/~ghc/$version/$name-$version-x86_64-centos67-linux.tar.xz \
   20 				--output-document="$PKGMK_SOURCE_DIR/$name-$version-x86_64-centos67-linux.tar.xz"
   21 		fi
   22 
   23 		install -d tmp
   24 		cd tmp
   25 
   26 		bsdtar -xf "$PKGMK_SOURCE_DIR/$name-$version-x86_64-centos67-linux.tar.xz"
   27 		mv $name-$version ../$name-$version-binary
   28 		cd -
   29 		rmdir tmp
   30 
   31 		cd $name-$version-binary
   32 
   33 		# hack for gmp and ncurses for bootstrap binary ghc
   34 		ln -s /usr/lib/libgmp.so.10 libgmp.so.3
   35 		ln -s /lib/libncurses.so.6 libtinfo.so.5
   36 		export LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH"
   37 
   38 		./configure --prefix=$SRC/binary
   39 		make install
   40 		cd $SRC
   41 
   42 		export PATH="$SRC/binary/bin:$PATH"
   43 	fi
   44 
   45 	cd $name-$version
   46 
   47         ./configure \
   48                 --prefix=/usr \
   49                 --docdir=/usr/share/doc/ghc \
   50                 --with-system-libffi \
   51                 --with-ffi-includes=$(pkg-config --variable=includedir libffi)
   52 
   53 	make
   54 	make -j1 DESTDIR=$PKG install
   55 
   56 	rm -r $PKG/usr/share/doc
   57 }

Generated by cgit