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.
2020-06-01 17:45:48 +02:00
# URL: https://www.haskell.org/haskellwiki/Glasgow_Haskell_Compiler
# Maintainer: Danny Rawlins, crux at romster dot me
# Depends on: docbook-xsl libedit libffi libgmp readline
2014-01-24 14:29:01 +01:00
name=ghc
2021-03-02 15:55:17 +01:00
version=8.10.4
_bversion=8.10.4
2014-01-24 14:29:01 +01:00
release=1
2021-03-02 15:55:17 +01:00
_bootstrapsum=fb8a91f0cf06594172aff46c2f6f7486179e1c3760855c79fbdd3012598cc2cd
2019-05-09 15:08:11 +02:00
#curl -s http://downloads.haskell.org/~ghc/$version/SHA256SUMS | grep ./ghc-$version-x86_64-centos7-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
2018-08-22 16:58:05 +02:00
if [ ! -e '/usr/bin/ghc' ]; then
2014-01-24 14:29:01 +01:00
# download binary bootstrap file if it does not exist
2019-05-09 15:08:11 +02:00
if [ ! -f "$PKGMK_SOURCE_DIR/$name-$_bversion-x86_64-centos7-linux.tar.xz" ]; then
2014-01-24 14:29:01 +01:00
2019-05-09 15:08:11 +02:00
wget "http://downloads.haskell.org/~ghc/$_bversion/$name-$_bversion-x86_64-centos7-linux.tar.xz" \
--output-document="$PKGMK_SOURCE_DIR/$name-$_bversion-x86_64-centos7-linux.tar.xz"
2017-10-15 07:16:13 +02:00
2014-01-24 14:29:01 +01:00
fi
2019-05-09 15:08:11 +02:00
if [ $_bootstrapsum != $(sha256sum "$PKGMK_SOURCE_DIR/$name-$_bversion-x86_64-centos7-linux.tar.xz" | cut -d' ' -f1) ]; then
echo "Error Bootstrap file $PKGMK_SOURCE_DIR/$name-$_bversion-x86_64-centos7-linux.tar.xz failed sha256sum"
2018-08-22 16:58:05 +02:00
exit $E_GENERAL
fi
2016-09-25 16:10:56 +02:00
2018-08-22 16:58:05 +02:00
mkdir tmp
cd tmp
2019-05-09 15:08:11 +02:00
bsdtar -xf "$PKGMK_SOURCE_DIR/$name-$_bversion-x86_64-centos7-linux.tar.xz"
2018-08-22 16:58:05 +02:00
mv $name-$_bversion ../$name-$_bversion-binary
2014-01-24 14:29:01 +01:00
cd -
rmdir tmp
2018-08-22 16:58:05 +02:00
cd $name-$_bversion-binary
2014-01-24 14:29:01 +01:00
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
}