contrib/ghc/Pkgfile

65 lines
2.0 KiB
Plaintext
Raw Normal View History

2014-01-24 14:29:01 +01:00
# Description: Glasgow Haskell compiler.
# URL: http://www.haskell.org/haskellwiki/Glasgow_Haskell_Compiler
# Maintainer: Danny Rawlins, crux at romster dot me
2014-01-24 14:29:01 +01:00
# Packager: Moritz Wilhelmy, moritz plus crux at wzff dot de
# Depends on: docbook-xsl libedit libffi libgmp readline
2014-01-24 14:29:01 +01:00
name=ghc
2018-03-07 22:48:07 +01:00
version=8.2.2
2014-01-24 14:29:01 +01:00
release=1
2018-03-07 22:48:07 +01:00
_bootstrapsum=789fee2f21daa1a4d0bdef282d4e5aa9683405085a61fb968e65dc95f64e9e03
2017-10-15 07:16:13 +02:00
#curl -s http://downloads.haskell.org/~ghc/$version/SHA256SUMS | grep ./ghc-$version-x86_64-centos67-linux.tar.xz | cut -d' ' -f1
2016-09-25 16:10:56 +02:00
source=(https://downloads.haskell.org/~ghc/$version/$name-$version-src.tar.xz)
2014-01-24 14:29:01 +01:00
build() {
# if ghc is not previously installed bootstrap it
if [ ! -e /usr/bin/ghc ]; then
# download binary bootstrap file if it does not exist
2016-09-25 16:10:56 +02:00
if [ ! -f "$PKGMK_SOURCE_DIR/$name-$version-x86_64-centos67-linux.tar.xz" ]; then
2014-01-24 14:29:01 +01:00
2016-09-25 16:10:56 +02:00
wget http://downloads.haskell.org/~ghc/$version/$name-$version-x86_64-centos67-linux.tar.xz \
--output-document="$PKGMK_SOURCE_DIR/$name-$version-x86_64-centos67-linux.tar.xz"
2017-10-15 07:16:13 +02:00
if [ $_bootstrapsum != $(sha256sum "$PKGMK_SOURCE_DIR/$name-$version-x86_64-centos67-linux.tar.xz" | cut -d' ' -f1) ]; then
echo "Error Bootstrap file $PKGMK_SOURCE_DIR/$name-$version-x86_64-centos67-linux.tar.xz failed sha256sum"
exit 1
fi
2014-01-24 14:29:01 +01:00
fi
install -d tmp
cd tmp
2016-09-25 16:10:56 +02:00
bsdtar -xf "$PKGMK_SOURCE_DIR/$name-$version-x86_64-centos67-linux.tar.xz"
2014-01-24 14:29:01 +01:00
mv $name-$version ../$name-$version-binary
cd -
rmdir tmp
cd $name-$version-binary
2016-09-25 16:10:56 +02:00
# hack for gmp and ncurses for bootstrap binary ghc
2014-01-24 14:29:01 +01:00
ln -s /usr/lib/libgmp.so.10 libgmp.so.3
2016-09-25 16:10:56 +02:00
ln -s /lib/libncurses.so.6 libtinfo.so.5
2014-01-24 14:29:01 +01:00
export LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH"
./configure --prefix=$SRC/binary
make install
cd $SRC
export PATH="$SRC/binary/bin:$PATH"
fi
cd $name-$version
2016-09-25 16:10:56 +02:00
./configure \
--prefix=/usr \
--docdir=/usr/share/doc/ghc \
--with-system-libffi \
--with-ffi-includes=$(pkg-config --variable=includedir libffi)
2014-01-24 14:29:01 +01:00
make
make -j1 DESTDIR=$PKG install
2016-09-25 16:10:56 +02:00
2014-01-24 14:29:01 +01:00
rm -r $PKG/usr/share/doc
}